diff --git a/src/generated/resources/assets/techarium/blockstates/electrochromatic_glass.json b/src/generated/resources/assets/techarium/blockstates/electrochromatic_glass.json new file mode 100644 index 00000000..b14bbfad --- /dev/null +++ b/src/generated/resources/assets/techarium/blockstates/electrochromatic_glass.json @@ -0,0 +1,10 @@ +{ + "variants": { + "powered=false": { + "model": "techarium:block/electrochromatic_glass_off" + }, + "powered=true": { + "model": "techarium:block/electrochromatic_glass_on" + } + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/techarium/lang/en_us.json b/src/generated/resources/assets/techarium/lang/en_us.json index e1efa582..c7f93340 100644 --- a/src/generated/resources/assets/techarium/lang/en_us.json +++ b/src/generated/resources/assets/techarium/lang/en_us.json @@ -1,6 +1,7 @@ { "block.techarium.aluminium_block": "Block of Aluminum", "block.techarium.aluminium_factoryblock": "Aluminium Factory Block", + "block.techarium.aluminium_ladder": "Aluminium Ladder", "block.techarium.aluminium_ore": "Aluminium Ore", "block.techarium.aluminium_plate_block": "Block of Aluminum Plates", "block.techarium.arboretum": "Arboretum", @@ -13,6 +14,7 @@ "block.techarium.copper_ore": "Copper Ore", "block.techarium.copper_plate_block": "Block of Copper Plates", "block.techarium.depot": "Depot", + "block.techarium.electrochromatic_glass": "Electrochromatic Glass", "block.techarium.encased_aluminium_block": "Encased Aluminium Block", "block.techarium.encased_copper_block": "Encased Copper Block", "block.techarium.encased_lead_block": "Encased Lead Block", diff --git a/src/generated/resources/assets/techarium/models/block/electrochromatic_glass_off.json b/src/generated/resources/assets/techarium/models/block/electrochromatic_glass_off.json new file mode 100644 index 00000000..5ffd92e8 --- /dev/null +++ b/src/generated/resources/assets/techarium/models/block/electrochromatic_glass_off.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "techarium:block/electrochromatic_glass_off" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/techarium/models/block/electrochromatic_glass_on.json b/src/generated/resources/assets/techarium/models/block/electrochromatic_glass_on.json new file mode 100644 index 00000000..49bbb5eb --- /dev/null +++ b/src/generated/resources/assets/techarium/models/block/electrochromatic_glass_on.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "techarium:block/electrochromatic_glass_on" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/techarium/models/item/electrochromatic_glass.json b/src/generated/resources/assets/techarium/models/item/electrochromatic_glass.json new file mode 100644 index 00000000..af1cbdd1 --- /dev/null +++ b/src/generated/resources/assets/techarium/models/item/electrochromatic_glass.json @@ -0,0 +1,3 @@ +{ + "parent": "techarium:block/electrochromatic_glass_off" +} \ No newline at end of file diff --git a/src/generated/resources/data/techarium/loot_tables/blocks/aluminium_ladder.json b/src/generated/resources/data/techarium/loot_tables/blocks/aluminium_ladder.json new file mode 100644 index 00000000..452c2465 --- /dev/null +++ b/src/generated/resources/data/techarium/loot_tables/blocks/aluminium_ladder.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "techarium:aluminium_ladder" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/techarium/loot_tables/blocks/electrochromatic_glass.json b/src/generated/resources/data/techarium/loot_tables/blocks/electrochromatic_glass.json new file mode 100644 index 00000000..71525841 --- /dev/null +++ b/src/generated/resources/data/techarium/loot_tables/blocks/electrochromatic_glass.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "techarium:electrochromatic_glass" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/java/software/bernie/techarium/Techarium.java b/src/main/java/software/bernie/techarium/Techarium.java index eecfae49..e613f626 100644 --- a/src/main/java/software/bernie/techarium/Techarium.java +++ b/src/main/java/software/bernie/techarium/Techarium.java @@ -93,5 +93,6 @@ public void onClientSetup(FMLClientSetupEvent event) { ScreenManager.register(EXCHANGE_STATION_CONTAINER.get(), ExchangeStationScreen::new); RenderTypeLookup.setRenderLayer(BlockRegistry.ALUMINIUM_LADDER.get(), RenderType.cutout()); + RenderTypeLookup.setRenderLayer(BlockRegistry.ELECTROCHROMATIC_GLASS.get(), RenderType.cutout()); } } diff --git a/src/main/java/software/bernie/techarium/block/electrochromicglass/ElectroChromicGlassBlock.java b/src/main/java/software/bernie/techarium/block/electrochromicglass/ElectroChromicGlassBlock.java new file mode 100644 index 00000000..ee162682 --- /dev/null +++ b/src/main/java/software/bernie/techarium/block/electrochromicglass/ElectroChromicGlassBlock.java @@ -0,0 +1,214 @@ +package software.bernie.techarium.block.electrochromicglass; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import javax.annotation.Nullable; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.material.PushReaction; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.item.BlockItemUseContext; +import net.minecraft.state.BooleanProperty; +import net.minecraft.state.IntegerProperty; +import net.minecraft.state.StateContainer.Builder; +import net.minecraft.state.properties.BlockStateProperties; +import net.minecraft.util.Direction; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.shapes.VoxelShape; +import net.minecraft.util.math.shapes.VoxelShapes; +import net.minecraft.world.IBlockReader; +import net.minecraft.world.World; +import net.minecraft.world.server.ServerWorld; +import net.minecraftforge.fml.network.NetworkDirection; +import software.bernie.techarium.config.TechariumConfig; +import software.bernie.techarium.network.NetworkConnection; +import software.bernie.techarium.network.block.ElectroChromicGlassPacket; + +public class ElectroChromicGlassBlock extends Block { + + public static final int RADIUS = TechariumConfig.SERVER_CONFIG.electroChromicGlassRadius.get(); + public static final BooleanProperty POWERED = BlockStateProperties.POWERED; + public static final IntegerProperty POWER = IntegerProperty.create("power", 0, RADIUS); + + public ElectroChromicGlassBlock(Properties p_i48373_1_) { + super(p_i48373_1_); + this.registerDefaultState(this.defaultBlockState().setValue(POWERED, Boolean.valueOf(false)).setValue(POWER, 0)); + + } + + @Nullable + public BlockState getStateForPlacement(BlockItemUseContext useContext) { + BlockState state = super.getStateForPlacement(useContext); + World world = useContext.getLevel(); + BlockPos pos = useContext.getClickedPos(); + + for (Direction dir : Direction.values()) { + BlockState offsetState = world.getBlockState(pos.relative(dir)); + if (offsetState.getBlock() == this) { + if (offsetState.getValue(POWERED) && offsetState.getValue(POWER) > 0) { + int power = offsetState.getValue(POWER) - 1; + + sendSignal(world, pos, state, power, true, false); + return state.setValue(POWERED, Boolean.valueOf(true)).setValue(POWER, power); + } + } + } + + return state; + } + + @Override + protected void createBlockStateDefinition(Builder builder) { + builder.add(POWERED, POWER); + super.createBlockStateDefinition(builder); + } + + public void neighborChanged(BlockState blockState, World world, BlockPos pos, Block block, BlockPos pos2, boolean bool) { + if (!world.isClientSide) { + if (world.hasNeighborSignal(pos) && block.isSignalSource(world.getBlockState(pos2))) { + sendSignal(world, pos, blockState, RADIUS, !blockState.getValue(POWERED), true); + } + } + } + + public void sendSignal(World world, BlockPos pos, BlockState state, int power, boolean powered, boolean shouldUpdate) { + if (state.getBlock() != this) + return; + + if (shouldUpdate) + world.setBlock(pos, state.setValue(POWERED, powered).setValue(POWER, power), 18); + + if (power <= 0) + return; + + if (world.getBlockState(pos.relative(Direction.EAST)).getBlock() == this) + updateDirection(world, pos, power, powered, Direction.EAST); + + if (world.getBlockState(pos.relative(Direction.WEST)).getBlock() == this) + updateDirection(world, pos, power, powered, Direction.WEST); + + if (world.getBlockState(pos.relative(Direction.SOUTH)).getBlock() == this) + updateDirection(world, pos, power, powered, Direction.SOUTH); + + if (world.getBlockState(pos.relative(Direction.NORTH)).getBlock() == this) + updateDirection(world, pos, power, powered, Direction.NORTH); + + if (world.getBlockState(pos.relative(Direction.UP)).getBlock() == this) + updateDirection(world, pos, power, powered, Direction.UP); + + if (world.getBlockState(pos.relative(Direction.DOWN)).getBlock() == this) + updateDirection(world, pos, power, powered, Direction.DOWN); + } + + private void updateDirection(World world, BlockPos pos, int power, boolean powered, Direction dir) { + BlockPos posOffset = pos.relative(dir); + BlockState state = world.getBlockState(posOffset); + + if (state.getBlock() != this) + return; + + if (state.getValue(POWERED) != powered) + sendSignal(world, posOffset, state, power-1, powered, true); + + else if (state.getValue(POWER) < power - 1) + sendSignal(world, posOffset, state, power-1, powered, true); + } + + @Override + public void onRemove(BlockState state, World world, BlockPos pos, BlockState newState, + boolean bool) { + if (!world.isClientSide()) { + if (newState.getBlock() != this) { + if (state.getValue(POWERED) && state.getValue(POWER) == RADIUS) + sendSignal(world, pos, state, RADIUS, false, false); + else sendDestroySignal(new ArrayList(), world, state, pos, pos); + } + } + + super.onRemove(state, world, pos, newState, bool); + } + + @Override + public void tick(BlockState state, ServerWorld world, BlockPos pos, Random rand) { + if (!world.isClientSide()) { + if (state.getValue(POWER) == RADIUS) { + sendSignal(world, pos, state, RADIUS, true, true); + } + + else if (!state.getValue(POWERED)) { + for (PlayerEntity player : world.players()) { + ElectroChromicGlassPacket packet = new ElectroChromicGlassPacket(pos); + NetworkConnection.INSTANCE.sendTo(packet, ((ServerPlayerEntity) player).connection.getConnection(), NetworkDirection.PLAY_TO_CLIENT); + } + } + } + super.tick(state, world, pos, rand); + } + + @Override + public PushReaction getPistonPushReaction(BlockState p_149656_1_) { + return PushReaction.BLOCK; + } + + private void sendDestroySignal(List posDone, World world, BlockState state, BlockPos pos, BlockPos start) { + if (state.getBlock() != this) + return; + if (!state.getValue(POWERED)) + return; + + if (state.getValue(POWER) == RADIUS) { + if (!pos.equals(start)) + world.setBlock(pos, state.setValue(POWER, RADIUS), 18); + + world.getBlockTicks().scheduleTick(pos, this, 4); + return; + } + + if (world.getBlockState(pos.relative(Direction.EAST)).getBlock() == this) + updateDestroySignal(posDone, world, pos, start, Direction.EAST); + + if (world.getBlockState(pos.relative(Direction.WEST)).getBlock() == this) + updateDestroySignal(posDone, world, pos, start, Direction.WEST); + + if (world.getBlockState(pos.relative(Direction.SOUTH)).getBlock() == this) + updateDestroySignal(posDone, world, pos, start, Direction.SOUTH); + + if (world.getBlockState(pos.relative(Direction.NORTH)).getBlock() == this) + updateDestroySignal(posDone, world, pos, start, Direction.NORTH); + + if (world.getBlockState(pos.relative(Direction.UP)).getBlock() == this) + updateDestroySignal(posDone, world, pos, start, Direction.UP); + + if (world.getBlockState(pos.relative(Direction.DOWN)).getBlock() == this) + updateDestroySignal(posDone, world, pos, start, Direction.DOWN); + + if (!pos.equals(start)) { + world.setBlock(pos, state.setValue(POWERED, false), 8); + world.getBlockTicks().scheduleTick(pos, this, 4); + } + } + + private void updateDestroySignal(List posDone, World world, BlockPos pos, BlockPos start, Direction dir) { + BlockPos posOffset = pos.relative(dir); + BlockState state = world.getBlockState(posOffset); + + if (posDone.contains(posOffset)) { + return; + } + + posDone.add(posOffset); + if (state.getBlock() != this) + return; + sendDestroySignal(posDone, world, state, posOffset, start); + } + + @Override + public VoxelShape getOcclusionShape(BlockState state, IBlockReader world, BlockPos pos) { + if (state.getValue(POWERED)) return VoxelShapes.block(); + return VoxelShapes.empty(); + } +} diff --git a/src/main/java/software/bernie/techarium/config/TechariumConfig.java b/src/main/java/software/bernie/techarium/config/TechariumConfig.java index 8adb5b88..fb9546c5 100644 --- a/src/main/java/software/bernie/techarium/config/TechariumConfig.java +++ b/src/main/java/software/bernie/techarium/config/TechariumConfig.java @@ -26,6 +26,7 @@ private static void generateServerConfig() { public static class TechariumServerConfig { public final ForgeConfigSpec.ConfigValue numHammerForDepotRecipe; + public final ForgeConfigSpec.ConfigValue electroChromicGlassRadius; private TechariumServerConfig() { SERVER.push("General"); @@ -34,6 +35,10 @@ private TechariumServerConfig() { .comment("The amount of times you need to hammer before the hammering recipe is complete. Hammering 5 times takes 1 second") .defineInRange("numHammerings", 5, 1, Integer.MAX_VALUE); + electroChromicGlassRadius = SERVER + .comment("The max propagation radius for the ElectroChromic Block") + .defineInRange("radius", 15, 1, 128); + SERVER.pop(); SERVER_SPEC = SERVER.build(); } diff --git a/src/main/java/software/bernie/techarium/datagen/TechariumBlockStateProvider.java b/src/main/java/software/bernie/techarium/datagen/TechariumBlockStateProvider.java index f1e76b12..5aa652f8 100644 --- a/src/main/java/software/bernie/techarium/datagen/TechariumBlockStateProvider.java +++ b/src/main/java/software/bernie/techarium/datagen/TechariumBlockStateProvider.java @@ -4,9 +4,12 @@ import net.minecraft.data.DataGenerator; import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.util.Direction; -import net.minecraftforge.client.model.generators.*; +import net.minecraftforge.client.model.generators.ModelFile; +import net.minecraftforge.client.model.generators.ModelProvider; +import net.minecraftforge.client.model.generators.VariantBlockStateBuilder; import net.minecraftforge.common.data.ExistingFileHelper; import software.bernie.techarium.Techarium; +import software.bernie.techarium.block.electrochromicglass.ElectroChromicGlassBlock; import software.bernie.techarium.block.voltaicpile.VoltaicPileBlock; import software.bernie.techarium.datagen.base.TechariumBlockStateProviderBase; import software.bernie.techarium.registry.BlockRegistry; @@ -76,6 +79,8 @@ public void registerBlock() { blockProvider.getExistingFile(Techarium.rl("block/tech_button_off"))); simpleBlockItem(BlockRegistry.TECH_LEVER.get(), blockProvider.getExistingFile(Techarium.rl("block/tech_lever_off"))); + + simpleBooleanBlock(BlockRegistry.ELECTROCHROMATIC_GLASS.get(), ElectroChromicGlassBlock.POWERED); } private void registerVoltaicPile() { diff --git a/src/main/java/software/bernie/techarium/datagen/TechariumLangProvider.java b/src/main/java/software/bernie/techarium/datagen/TechariumLangProvider.java index aaea9665..379541b6 100644 --- a/src/main/java/software/bernie/techarium/datagen/TechariumLangProvider.java +++ b/src/main/java/software/bernie/techarium/datagen/TechariumLangProvider.java @@ -98,6 +98,7 @@ protected void addBlocks() { addBlock(BlockRegistry.TECH_LEVER, "Lever"); addBlock(BlockRegistry.ALUMINIUM_LADDER, "Aluminium Ladder"); + addBlock(BlockRegistry.ELECTROCHROMATIC_GLASS, "Electrochromatic Glass"); } private void addTranslationComponents() { diff --git a/src/main/java/software/bernie/techarium/datagen/TechariumLootTableProvider.java b/src/main/java/software/bernie/techarium/datagen/TechariumLootTableProvider.java index e59515d4..3360ffc6 100644 --- a/src/main/java/software/bernie/techarium/datagen/TechariumLootTableProvider.java +++ b/src/main/java/software/bernie/techarium/datagen/TechariumLootTableProvider.java @@ -84,6 +84,7 @@ protected void addTables() { dropSelf(BlockRegistry.TECH_BUTTON); dropSelf(BlockRegistry.TECH_LEVER); dropSelf(BlockRegistry.ALUMINIUM_LADDER); + dropSelf(BlockRegistry.ELECTROCHROMATIC_GLASS); voltaicPileLootTable(); } diff --git a/src/main/java/software/bernie/techarium/datagen/base/TechariumBlockStateProviderBase.java b/src/main/java/software/bernie/techarium/datagen/base/TechariumBlockStateProviderBase.java index 3bbf5ab9..63324bf3 100644 --- a/src/main/java/software/bernie/techarium/datagen/base/TechariumBlockStateProviderBase.java +++ b/src/main/java/software/bernie/techarium/datagen/base/TechariumBlockStateProviderBase.java @@ -2,9 +2,12 @@ import net.minecraft.block.Block; import net.minecraft.data.DataGenerator; +import net.minecraft.state.Property; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.model.generators.BlockStateProvider; +import net.minecraftforge.client.model.generators.ConfiguredModel; import net.minecraftforge.client.model.generators.ModelFile; +import net.minecraftforge.client.model.generators.ModelProvider; import net.minecraftforge.common.data.ExistingFileHelper; import software.bernie.techarium.Techarium; import software.bernie.techarium.block.BlockRegistryObjectGroup; @@ -103,4 +106,20 @@ public void existingBlockNoItem(Block block, ResourceLocation existingModel) { ModelFile model = new ModelFile.ExistingModelFile(existingModel, helper); this.simpleBlock(block, model); } + + public void simpleBooleanBlock(Block block, Property prop) { + ModelFile modelOff = models().cubeAll(name(block) + "_off", blockTexture(block, "_off")); + ModelFile modelOn = models().cubeAll(name(block) + "_on", blockTexture(block, "_on")); + + getVariantBuilder(block) + .partialState().with(prop, false).addModels(new ConfiguredModel(modelOff)) + .partialState().with(prop, true).addModels(new ConfiguredModel(modelOn)); + + this.simpleBlockItem(block, modelOff); + } + + public ResourceLocation blockTexture(Block block, String end) { + ResourceLocation name = block.getRegistryName(); + return new ResourceLocation(name.getNamespace(), ModelProvider.BLOCK_FOLDER + "/" + name.getPath() + end); + } } diff --git a/src/main/java/software/bernie/techarium/network/NetworkConnection.java b/src/main/java/software/bernie/techarium/network/NetworkConnection.java index 79194bce..c30f0868 100644 --- a/src/main/java/software/bernie/techarium/network/NetworkConnection.java +++ b/src/main/java/software/bernie/techarium/network/NetworkConnection.java @@ -4,7 +4,12 @@ import net.minecraftforge.fml.network.NetworkRegistry; import net.minecraftforge.fml.network.simple.SimpleChannel; import software.bernie.techarium.Techarium; -import software.bernie.techarium.network.container.*; +import software.bernie.techarium.network.block.ElectroChromicGlassPacket; +import software.bernie.techarium.network.container.ChangedMainConfigContainerPacket; +import software.bernie.techarium.network.container.ChangedRedstoneControlTypeContainerPacket; +import software.bernie.techarium.network.container.EnergyBarClickContainerPacket; +import software.bernie.techarium.network.container.FluidTankClickContainerPacket; +import software.bernie.techarium.network.container.RecipeWidgetClickContainerPacket; import software.bernie.techarium.network.tile.UpdateCoilTypePacket; public class NetworkConnection { @@ -24,6 +29,7 @@ public static void registerMessages() { registerMessage(new ChangedMainConfigContainerPacket()); registerMessage(new RecipeWidgetClickContainerPacket()); registerMessage(new UpdateCoilTypePacket()); + registerMessage(new ElectroChromicGlassPacket()); } public static > void registerMessage(MSG dummyPacket) { INSTANCE.registerMessage(getAndUpdateIndex(), diff --git a/src/main/java/software/bernie/techarium/network/block/ElectroChromicGlassPacket.java b/src/main/java/software/bernie/techarium/network/block/ElectroChromicGlassPacket.java new file mode 100644 index 00000000..4e065714 --- /dev/null +++ b/src/main/java/software/bernie/techarium/network/block/ElectroChromicGlassPacket.java @@ -0,0 +1,46 @@ +package software.bernie.techarium.network.block; + +import net.minecraft.block.BlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.world.ClientWorld; +import net.minecraft.network.PacketBuffer; +import net.minecraft.util.math.BlockPos; +import net.minecraftforge.fml.network.NetworkEvent.Context; +import software.bernie.techarium.block.electrochromicglass.ElectroChromicGlassBlock; +import software.bernie.techarium.network.ServerToClientPacket; + +public class ElectroChromicGlassPacket extends ServerToClientPacket { + + private BlockPos pos; + + public ElectroChromicGlassPacket() {} + + public ElectroChromicGlassPacket(BlockPos pos) { + this.pos = pos; + } + + @Override + public void write(PacketBuffer writeInto) { + writeInto.writeBlockPos(pos); + } + + @Override + public ElectroChromicGlassPacket create(PacketBuffer readFrom) { + pos = readFrom.readBlockPos(); + return new ElectroChromicGlassPacket(pos); + } + + @Override + public void doAction(Context context) { + context.enqueueWork(() -> { + Minecraft mc = Minecraft.getInstance(); + ClientWorld level = mc.level; + BlockState state = level.getBlockState(pos); + if (state.getBlock() instanceof ElectroChromicGlassBlock) + level.setBlock(pos, state.setValue(ElectroChromicGlassBlock.POWERED, false), 8); + }); + + context.setPacketHandled(true); + } + +} \ No newline at end of file diff --git a/src/main/java/software/bernie/techarium/registry/BlockRegistry.java b/src/main/java/software/bernie/techarium/registry/BlockRegistry.java index fa0e29a2..acc010e1 100644 --- a/src/main/java/software/bernie/techarium/registry/BlockRegistry.java +++ b/src/main/java/software/bernie/techarium/registry/BlockRegistry.java @@ -8,6 +8,8 @@ import net.minecraft.block.AbstractBlock; import net.minecraft.block.Block; import net.minecraft.block.Blocks; +import net.minecraft.block.SoundType; +import net.minecraft.block.material.Material; import net.minecraft.item.BlockItem; import net.minecraft.item.Item; import net.minecraft.tileentity.TileEntityType; @@ -28,6 +30,7 @@ import software.bernie.techarium.block.botarium.BotariumTop; import software.bernie.techarium.block.coils.MagneticCoilBlock; import software.bernie.techarium.block.depot.DepotBlock; +import software.bernie.techarium.block.electrochromicglass.ElectroChromicGlassBlock; import software.bernie.techarium.block.exchangestation.ExchangeStationBlock; import software.bernie.techarium.block.gravmagnet.GravMagnetBlock; import software.bernie.techarium.block.ladder.TechariumLadderBlock; @@ -154,6 +157,9 @@ public class BlockRegistry { public static final RegistryObject ALUMINIUM_LADDER = registerBlock("aluminium_ladder", () -> new TechariumLadderBlock(AbstractBlock.Properties.copy(Blocks.LADDER), 0.3f)); + + public static final RegistryObject ELECTROCHROMATIC_GLASS = registerBlock("electrochromatic_glass", + () -> new ElectroChromicGlassBlock(AbstractBlock.Properties.of(Material.GLASS).strength(0.3F).sound(SoundType.GLASS))); private static RegistryObject registerBlock(String name, Supplier block) { RegistryObject reg = BLOCKS.register(name, block); diff --git a/src/main/resources/assets/techarium/textures/block/electrochromatic_glass_off.png b/src/main/resources/assets/techarium/textures/block/electrochromatic_glass_off.png new file mode 100644 index 00000000..543d772b Binary files /dev/null and b/src/main/resources/assets/techarium/textures/block/electrochromatic_glass_off.png differ diff --git a/src/main/resources/assets/techarium/textures/block/electrochromatic_glass_on.png b/src/main/resources/assets/techarium/textures/block/electrochromatic_glass_on.png new file mode 100644 index 00000000..a34341d3 Binary files /dev/null and b/src/main/resources/assets/techarium/textures/block/electrochromatic_glass_on.png differ