Fix #1833
This commit is contained in:
parent
cc51e9b016
commit
ab15533351
2 changed files with 9 additions and 12 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue