From ab15533351ee191e695af25bd0a60cf483d80394 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Sun, 15 Sep 2019 13:30:05 +0100 Subject: [PATCH] Fix #1833 --- .../techreborn/blocks/lighting/BlockLamp.java | 17 +++++++---------- src/main/java/techreborn/init/TRContent.java | 4 ++-- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/src/main/java/techreborn/blocks/lighting/BlockLamp.java b/src/main/java/techreborn/blocks/lighting/BlockLamp.java index 7661a4075..bd561f2ba 100644 --- a/src/main/java/techreborn/blocks/lighting/BlockLamp.java +++ b/src/main/java/techreborn/blocks/lighting/BlockLamp.java @@ -24,11 +24,8 @@ package techreborn.blocks.lighting; -import net.minecraft.block.Block; -import net.minecraft.block.BlockRenderLayer; -import net.minecraft.block.BlockRenderType; -import net.minecraft.block.BlockState; -import net.minecraft.block.Material; +import net.fabricmc.fabric.api.block.FabricBlockSettings; +import net.minecraft.block.*; import net.minecraft.block.entity.BlockEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemPlacementContext; @@ -59,14 +56,13 @@ public class BlockLamp extends BaseBlockEntityProvider { protected final VoxelShape[] shape; private int cost; - private int brightness; + private static int brightness = 15; - public BlockLamp(int brightness, int cost, double depth, double width) { - super(Block.Settings.of(Material.REDSTONE_LAMP).strength(2f, 2f)); - this.setDefaultState(this.stateFactory.getDefaultState().with(FACING, Direction.NORTH).with(ACTIVE, false)); + public BlockLamp(int cost, double depth, double width) { + super(FabricBlockSettings.of(Material.REDSTONE_LAMP).strength(2f, 2f).lightLevel(brightness).build()); this.shape = GenCuboidShapes(depth, width); this.cost = cost; - this.brightness = brightness; + this.setDefaultState(this.stateFactory.getDefaultState().with(FACING, Direction.NORTH).with(ACTIVE, false)); BlockWrenchEventHandler.wrenableBlocks.add(this); } @@ -135,6 +131,7 @@ public class BlockLamp extends BaseBlockEntityProvider { return state.get(ACTIVE) ? brightness : 0; } + @Override public BlockRenderLayer getRenderLayer() { return BlockRenderLayer.CUTOUT; diff --git a/src/main/java/techreborn/init/TRContent.java b/src/main/java/techreborn/init/TRContent.java index c86773047..be0caef4b 100644 --- a/src/main/java/techreborn/init/TRContent.java +++ b/src/main/java/techreborn/init/TRContent.java @@ -444,8 +444,8 @@ public class TRContent { ALARM(new BlockAlarm()), CHUNK_LOADER(new GenericMachineBlock(EGui.CHUNK_LOADER, ChunkLoaderBlockEntity::new)), - LAMP_INCANDESCENT(new BlockLamp(14, 4, 10, 8)), - LAMP_LED(new BlockLamp(15, 1, 1, 12)), + LAMP_INCANDESCENT(new BlockLamp(4, 10, 8)), + LAMP_LED(new BlockLamp(1, 1, 12)), PLAYER_DETECTOR(new BlockPlayerDetector()); public final String name;