Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New fixtures (optional) #23

Open
wants to merge 11 commits into
base: ver/1.20.1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
with:
arguments: "build publishMods"
- name: Store artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: gradle-build-output
path: ./**/libs/*.jar
7 changes: 4 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# 1.20.1-alpha.22
# 1.20.1-alpha.23

* Fix overriding existing methods in dynamiclightsprovider interface
* Fix standing on LED panels
* Let lights tilt further down, thanks dumaan089
* Add extra texturing to lights, thanks dumaan089
* Add moving head wash, thanks dumaan089
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ Pull Requests are welcome and will be reviewed by Rushmead.

* Rushmead
* bright_spark
* FreneticScribbler
* FreneticScribbler
* Dumaan089
Empty file added Task
Empty file.
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// 1.20.2 2024-07-30T19:12:09.649396 Item Models: theatrical
// 1.20.2 2025-02-10T21:36:36.4650464 Item Models: theatrical
b61dea162dac1064778fccd83e00b34aeea3d2b7 assets/theatrical/models/item/artnet_interface.json
b8f0135bf11be0f31f5d16d76a8c50f28900ee04 assets/theatrical/models/item/basic_lighting_desk.json
545f9e738bfe2c1e7b2236f46042b2504b81373b assets/theatrical/models/item/configuration_card.json
0dc3e30a7627a40ada8a4b8e20249c809067a337 assets/theatrical/models/item/led_fresnel.json
81307d2abd44e288e5e8c9b7824de5a0e895e0be assets/theatrical/models/item/led_panel.json
e6b312509e9a1cfcd5730624d5cbd9f04781d7f7 assets/theatrical/models/item/moving_light.json
60c8fe683be5154fc1d18d5e88c969e422e289c2 assets/theatrical/models/item/moving_wash.json
0d5befeac428b5d0be735b72f8ca31d904c081d8 assets/theatrical/models/item/pipe.json
4c0820713db76bd2b2dfb712bff51e382da41ac2 assets/theatrical/models/item/redstone_interface.json
da8f48c84e1fb2dc911004bad231caadbbcd9701 assets/theatrical/models/item/tank_trap.json
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// 1.20.2 2024-08-10T16:17:08.6930462 Languages: en_us
831d4167f7c689fed8b25d9623c152450500fc8f assets/theatrical/lang/en_us.json
// 1.20.2 2025-02-10T21:36:36.4700505 Languages: en_us
cb8eaff73b76198108bddce14ea2b0b4b381ffbb assets/theatrical/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"block.theatrical.led_fresnel": "LED Fresnel",
"block.theatrical.led_panel": "LED Panel",
"block.theatrical.moving_light": "Moving Light",
"block.theatrical.moving_wash": "Moving Wash",
"block.theatrical.pipe": "Rigging Pipe",
"block.theatrical.redstone_interface": "Redstone Interface",
"block.theatrical.tank_trap": "Tank Trap",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"parent": "theatrical:block/moving_wash/moving_wash_whole"
}
66 changes: 66 additions & 0 deletions common/src/main/java/dev/imabad/theatrical/TheatricalClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,41 @@
import dev.imabad.theatrical.blockentities.control.BasicLightingDeskBlockEntity;
import dev.imabad.theatrical.blockentities.light.BaseLightBlockEntity;
import dev.imabad.theatrical.blockentities.light.FresnelBlockEntity;
import dev.imabad.theatrical.blockentities.light.RGBbarBlockEntity;
import dev.imabad.theatrical.blockentities.light.LEDfountainBlockEntity;
import dev.imabad.theatrical.blockentities.light.LEDPanel2BlockEntity;
import dev.imabad.theatrical.blockentities.light.ParLedBlockEntity;
import dev.imabad.theatrical.blockentities.light.BigPanelBlockEntity;
import dev.imabad.theatrical.blockentities.light.BigPanel2BlockEntity;
import dev.imabad.theatrical.blocks.light.MovingLightBlock;
import dev.imabad.theatrical.blocks.light.MovingWashBlock;
import dev.imabad.theatrical.client.LazyRenderers;
import dev.imabad.theatrical.client.blockentities.BasicLightingConsoleRenderer;
import dev.imabad.theatrical.client.blockentities.FresnelRenderer;
import dev.imabad.theatrical.client.blockentities.LEDfountainRenderer;
import dev.imabad.theatrical.client.blockentities.BigPanelRenderer;
import dev.imabad.theatrical.client.blockentities.BigPanel2Renderer;
import dev.imabad.theatrical.client.blockentities.LEDPanelRenderer;
import dev.imabad.theatrical.client.blockentities.LEDPanel2Renderer;
import dev.imabad.theatrical.client.blockentities.MovingLightRenderer;
import dev.imabad.theatrical.client.blockentities.MovingScanRenderer;
import dev.imabad.theatrical.client.blockentities.MovingWashRenderer;
import dev.imabad.theatrical.client.blockentities.RGBbarRenderer;
import dev.imabad.theatrical.client.blockentities.ParLedRenderer;
import dev.imabad.theatrical.client.blockentities.MovingVL2CRenderer;
import dev.imabad.theatrical.client.blockentities.MovingVL6Renderer;
import dev.imabad.theatrical.client.blockentities.MovingBeamRenderer;
import dev.imabad.theatrical.client.dmx.ArtNetManager;
import dev.imabad.theatrical.client.dmx.ArtNetToNetworkClientData;
import dev.imabad.theatrical.client.dmx.TheatricalArtNetClient;
import dev.imabad.theatrical.client.gui.screen.BasicLightingDeskScreen;
import dev.imabad.theatrical.client.gui.screen.FresnelScreen;
import dev.imabad.theatrical.client.gui.screen.LEDfountainScreen;
import dev.imabad.theatrical.client.gui.screen.BigPanelScreen;
import dev.imabad.theatrical.client.gui.screen.ParLedScreen;
import dev.imabad.theatrical.client.gui.screen.BigPanel2Screen;
import dev.imabad.theatrical.client.gui.screen.RGBbarScreen;
import dev.imabad.theatrical.client.gui.screen.LEDPanel2Screen;
import dev.imabad.theatrical.client.gui.screen.GenericDMXConfigurationScreen;
import dev.imabad.theatrical.config.TheatricalConfig;
import dev.imabad.theatrical.config.UniverseConfig;
Expand Down Expand Up @@ -57,8 +81,19 @@ public class TheatricalClient {
private static ArtNetManager artNetManager;
public static void init() {
BlockEntityRendererRegistry.register(BlockEntities.MOVING_LIGHT.get(), MovingLightRenderer::new);
BlockEntityRendererRegistry.register(BlockEntities.MOVING_WASH.get(), MovingWashRenderer::new);
BlockEntityRendererRegistry.register(BlockEntities.MOVING_SCAN.get(), MovingScanRenderer::new);
BlockEntityRendererRegistry.register(BlockEntities.MOVING_VL2C.get(), MovingVL2CRenderer::new);
BlockEntityRendererRegistry.register(BlockEntities.MOVING_VL6.get(), MovingVL6Renderer::new);
BlockEntityRendererRegistry.register(BlockEntities.MOVING_BEAM.get(), MovingBeamRenderer::new);
BlockEntityRendererRegistry.register(BlockEntities.LED_FRESNEL.get(), FresnelRenderer::new);
BlockEntityRendererRegistry.register(BlockEntities.LED_FOUNTAIN.get(), LEDfountainRenderer::new);
BlockEntityRendererRegistry.register(BlockEntities.PAR_LED.get(), ParLedRenderer::new);
BlockEntityRendererRegistry.register(BlockEntities.BIG_PANEL.get(), BigPanelRenderer::new);
BlockEntityRendererRegistry.register(BlockEntities.BIG_PANEL2.get(), BigPanel2Renderer::new);
BlockEntityRendererRegistry.register(BlockEntities.RGB_BAR.get(), RGBbarRenderer::new);
BlockEntityRendererRegistry.register(BlockEntities.LED_PANEL.get(), LEDPanelRenderer::new);
BlockEntityRendererRegistry.register(BlockEntities.LED_PANEL_2.get(), LEDPanel2Renderer::new);
BlockEntityRendererRegistry.register(BlockEntities.BASIC_LIGHTING_DESK.get(), BasicLightingConsoleRenderer::new);
// BlockEntityRendererRegistry.register(BlockEntities.CABLE.get(), CableRenderer::new);
artNetManager = new ArtNetManager();
Expand Down Expand Up @@ -220,11 +255,42 @@ public static void handleOpenScreen(OpenScreen openScreen){
Minecraft.getInstance().setScreen(new FresnelScreen(fresnelBlockEntity));
}
}
case LED_PANEL_2 -> {
if(Minecraft.getInstance().level.getBlockEntity(openScreen.getPos()) instanceof LEDPanel2BlockEntity LEDPanel2BlockEntity) {
Minecraft.getInstance().setScreen(new LEDPanel2Screen(LEDPanel2BlockEntity));
}
}
case LED_FOUNTAIN -> {
if(Minecraft.getInstance().level.getBlockEntity(openScreen.getPos()) instanceof LEDfountainBlockEntity LEDfountainBlockEntity) {
Minecraft.getInstance().setScreen(new LEDfountainScreen(LEDfountainBlockEntity));
}
}
case RGB_BAR -> {
if(Minecraft.getInstance().level.getBlockEntity(openScreen.getPos()) instanceof RGBbarBlockEntity RGBbarBlockEntity) {
Minecraft.getInstance().setScreen(new RGBbarScreen(RGBbarBlockEntity));
}
}
case BASIC_LIGHTING_DESK -> {
if(Minecraft.getInstance().level.getBlockEntity(openScreen.getPos()) instanceof BasicLightingDeskBlockEntity bse) {
Minecraft.getInstance().setScreen(new BasicLightingDeskScreen(bse));
}
}
case BIG_PANEL -> {
if(Minecraft.getInstance().level.getBlockEntity(openScreen.getPos()) instanceof BigPanelBlockEntity BigPanelBlockEntity) {
Minecraft.getInstance().setScreen(new BigPanelScreen(BigPanelBlockEntity));
}
}
case BIG_PANEL2 -> {
if(Minecraft.getInstance().level.getBlockEntity(openScreen.getPos()) instanceof BigPanel2BlockEntity BigPanel2BlockEntity) {
Minecraft.getInstance().setScreen(new BigPanel2Screen(BigPanel2BlockEntity));
}
}
case PAR_LED -> {
if(Minecraft.getInstance().level.getBlockEntity(openScreen.getPos()) instanceof ParLedBlockEntity ParLedBlockEntity) {
Minecraft.getInstance().setScreen(new ParLedScreen(ParLedBlockEntity));
}
}
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ public enum TheatricalScreen {

GENERIC_DMX,
BASIC_LIGHTING_DESK,
FRESNEL

FRESNEL,
RGB_BAR,
LED_FOUNTAIN,
LED_PANEL_2,
BIG_PANEL,
BIG_PANEL2,
PAR_LED,
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,19 @@
import dev.imabad.theatrical.blockentities.interfaces.ArtNetInterfaceBlockEntity;
import dev.imabad.theatrical.blockentities.interfaces.RedstoneInterfaceBlockEntity;
import dev.imabad.theatrical.blockentities.light.FresnelBlockEntity;
import dev.imabad.theatrical.blockentities.light.LEDPanel2BlockEntity;
import dev.imabad.theatrical.blockentities.light.RGBbarBlockEntity;
import dev.imabad.theatrical.blockentities.light.LEDPanelBlockEntity;
import dev.imabad.theatrical.blockentities.light.ParLedBlockEntity;
import dev.imabad.theatrical.blockentities.light.BigPanelBlockEntity;
import dev.imabad.theatrical.blockentities.light.BigPanel2BlockEntity;
import dev.imabad.theatrical.blockentities.light.MovingLightBlockEntity;
import dev.imabad.theatrical.blockentities.light.MovingWashBlockEntity;
import dev.imabad.theatrical.blockentities.light.MovingVL2CBlockEntity;
import dev.imabad.theatrical.blockentities.light.MovingVL6BlockEntity;
import dev.imabad.theatrical.blockentities.light.MovingBeamBlockEntity;
import dev.imabad.theatrical.blockentities.light.MovingScanBlockEntity;
import dev.imabad.theatrical.blockentities.light.LEDfountainBlockEntity;
import dev.imabad.theatrical.blocks.Blocks;
import net.minecraft.core.registries.Registries;
import net.minecraft.world.level.block.entity.BlockEntityType;
Expand All @@ -19,7 +30,22 @@ public class BlockEntities {
public static final RegistrySupplier<BlockEntityType<ArtNetInterfaceBlockEntity>> ART_NET_INTERFACE = BLOCK_ENTITIES.register("artnet_interface", () -> BlockEntityType.Builder.of(ArtNetInterfaceBlockEntity::new, Blocks.ART_NET_INTERFACE.get()).build(null));
public static final RegistrySupplier<BlockEntityType<FresnelBlockEntity>> LED_FRESNEL = BLOCK_ENTITIES.register("led_fresnel", () -> BlockEntityType.Builder.of(FresnelBlockEntity::new, Blocks.LED_FRESNEL.get()).build(null));



public static final RegistrySupplier<BlockEntityType<RedstoneInterfaceBlockEntity>> REDSTONE_INTERFACE = BLOCK_ENTITIES.register("redstone_interface", () -> BlockEntityType.Builder.of(RedstoneInterfaceBlockEntity::new, Blocks.REDSTONE_INTERFACE.get()).build(null));
public static final RegistrySupplier<BlockEntityType<LEDPanelBlockEntity>> LED_PANEL = BLOCK_ENTITIES.register("led_panel", () -> BlockEntityType.Builder.of(LEDPanelBlockEntity::new, Blocks.LED_PANEL.get()).build(null));
public static final RegistrySupplier<BlockEntityType<BasicLightingDeskBlockEntity>> BASIC_LIGHTING_DESK = BLOCK_ENTITIES.register("basic_lighting_desk", () -> BlockEntityType.Builder.of(BasicLightingDeskBlockEntity::new, Blocks.BASIC_LIGHTING_DESK.get()).build(null));
public static final RegistrySupplier<BlockEntityType<MovingWashBlockEntity>> MOVING_WASH = BLOCK_ENTITIES.register("moving_wash", () -> BlockEntityType.Builder.of(MovingWashBlockEntity::new, Blocks.MOVING_WASH_BLOCK.get()).build(null));
public static final RegistrySupplier<BlockEntityType<MovingVL2CBlockEntity>> MOVING_VL2C = BLOCK_ENTITIES.register("moving_vl2c", () -> BlockEntityType.Builder.of(MovingVL2CBlockEntity::new, Blocks.MOVING_VL2C_BLOCK.get()).build(null));
public static final RegistrySupplier<BlockEntityType<MovingVL6BlockEntity>> MOVING_VL6 = BLOCK_ENTITIES.register("moving_vl6", () -> BlockEntityType.Builder.of(MovingVL6BlockEntity::new, Blocks.MOVING_VL6_BLOCK.get()).build(null));
public static final RegistrySupplier<BlockEntityType<MovingBeamBlockEntity>> MOVING_BEAM = BLOCK_ENTITIES.register("moving_beam", () -> BlockEntityType.Builder.of(MovingBeamBlockEntity::new, Blocks.MOVING_BEAM_BLOCK.get()).build(null));
public static final RegistrySupplier<BlockEntityType<MovingScanBlockEntity>> MOVING_SCAN = BLOCK_ENTITIES.register("moving_scan", () -> BlockEntityType.Builder.of(MovingScanBlockEntity::new, Blocks.MOVING_SCAN_BLOCK.get()).build(null));
public static final RegistrySupplier<BlockEntityType<RGBbarBlockEntity>> RGB_BAR = BLOCK_ENTITIES.register("rgb_bar", () -> BlockEntityType.Builder.of(RGBbarBlockEntity::new, Blocks.RGB_BAR.get()).build(null));
public static final RegistrySupplier<BlockEntityType<LEDfountainBlockEntity>> LED_FOUNTAIN = BLOCK_ENTITIES.register("led_fountain", () -> BlockEntityType.Builder.of(LEDfountainBlockEntity::new, Blocks.LED_FOUNTAIN.get()).build(null));
public static final RegistrySupplier<BlockEntityType<LEDPanel2BlockEntity>> LED_PANEL_2 = BLOCK_ENTITIES.register("led_panel_2", () -> BlockEntityType.Builder.of(LEDPanel2BlockEntity::new, Blocks.LED_PANEL_2.get()).build(null));
public static final RegistrySupplier<BlockEntityType<BigPanelBlockEntity>> BIG_PANEL = BLOCK_ENTITIES.register("big_panel", () -> BlockEntityType.Builder.of(BigPanelBlockEntity::new, Blocks.BIG_PANEL.get()).build(null));
public static final RegistrySupplier<BlockEntityType<BigPanel2BlockEntity>> BIG_PANEL2 = BLOCK_ENTITIES.register("big_panel2", () -> BlockEntityType.Builder.of(BigPanel2BlockEntity::new, Blocks.BIG_PANEL2.get()).build(null));
public static final RegistrySupplier<BlockEntityType<ParLedBlockEntity>> PAR_LED = BLOCK_ENTITIES.register("par_led", () -> BlockEntityType.Builder.of(ParLedBlockEntity::new, Blocks.PAR_LED.get()).build(null));


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
package dev.imabad.theatrical.blockentities.light;

import dev.imabad.theatrical.api.Fixture;
import dev.imabad.theatrical.blockentities.BlockEntities;
import dev.imabad.theatrical.fixtures.Fixtures;
import net.minecraft.core.BlockPos;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;

import java.util.Arrays;

public class BigPanel2BlockEntity extends BaseDMXConsumerLightBlockEntity {

public BigPanel2BlockEntity(BlockPos pos, BlockState state) {
super(BlockEntities.BIG_PANEL2.get(), pos, state);
setChannelCount(4);
}
@Override
public Fixture getFixture() {
return Fixtures.BIG_PANEL2.get();
}

@Override
public int getFocus() {
return 1;
}

@Override
public void consume(byte[] dmxValues) {
int start = this.getChannelStart() > 0 ? this.getChannelStart() - 1 : 0;
byte[] ourValues = Arrays.copyOfRange(dmxValues, start,
start+ this.getChannelCount());
if(ourValues.length < 4){
return;
}
if(this.storePrev()){
level.sendBlockUpdated(getBlockPos(), getBlockState(), getBlockState(), Block.UPDATE_CLIENTS);
}
intensity = convertByteToInt(ourValues[0]);
red = convertByteToInt(ourValues[1]);
green = convertByteToInt(ourValues[2]);
blue = convertByteToInt(ourValues[3]);
level.sendBlockUpdated(getBlockPos(), getBlockState(), getBlockState(), Block.UPDATE_CLIENTS);
setChanged();
}

@Override
public int getDeviceTypeId() {
return 0x02;
}

@Override
public String getModelName() {
return "Big Panel 2";
}

@Override
public ResourceLocation getFixtureId() {
return Fixtures.BIG_PANEL2.getId();
}

@Override
public int getActivePersonality() {
return 0;
}

public int convertByteToInt(byte val) {
return Byte.toUnsignedInt(val);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
package dev.imabad.theatrical.blockentities.light;

import dev.imabad.theatrical.api.Fixture;
import dev.imabad.theatrical.blockentities.BlockEntities;
import dev.imabad.theatrical.fixtures.Fixtures;
import net.minecraft.core.BlockPos;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;

import java.util.Arrays;

public class BigPanelBlockEntity extends BaseDMXConsumerLightBlockEntity {

public BigPanelBlockEntity(BlockPos pos, BlockState state) {
super(BlockEntities.BIG_PANEL.get(), pos, state);
setChannelCount(4);
}
@Override
public Fixture getFixture() {
return Fixtures.BIG_PANEL.get();
}

@Override
public int getFocus() {
return 1;
}

@Override
public void consume(byte[] dmxValues) {
int start = this.getChannelStart() > 0 ? this.getChannelStart() - 1 : 0;
byte[] ourValues = Arrays.copyOfRange(dmxValues, start,
start+ this.getChannelCount());
if(ourValues.length < 4){
return;
}
if(this.storePrev()){
level.sendBlockUpdated(getBlockPos(), getBlockState(), getBlockState(), Block.UPDATE_CLIENTS);
}
intensity = convertByteToInt(ourValues[0]);
red = convertByteToInt(ourValues[1]);
green = convertByteToInt(ourValues[2]);
blue = convertByteToInt(ourValues[3]);
level.sendBlockUpdated(getBlockPos(), getBlockState(), getBlockState(), Block.UPDATE_CLIENTS);
setChanged();
}

@Override
public int getDeviceTypeId() {
return 0x02;
}

@Override
public String getModelName() {
return "Big Panel";
}

@Override
public ResourceLocation getFixtureId() {
return Fixtures.BIG_PANEL.getId();
}

@Override
public int getActivePersonality() {
return 0;
}

public int convertByteToInt(byte val) {
return Byte.toUnsignedInt(val);
}

}
Loading