diff --git a/src/main/java/com/thebrokenrail/energonrelics/block/DefensiveLaserBlock.java b/src/main/java/com/thebrokenrail/energonrelics/block/DefensiveLaserBlock.java index a2772bc..18d760c 100644 --- a/src/main/java/com/thebrokenrail/energonrelics/block/DefensiveLaserBlock.java +++ b/src/main/java/com/thebrokenrail/energonrelics/block/DefensiveLaserBlock.java @@ -9,6 +9,7 @@ import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; +import net.minecraft.block.ShapeContext; import net.minecraft.block.entity.BlockEntity; import net.minecraft.block.entity.BlockEntityType; import net.minecraft.client.render.block.entity.BlockEntityRenderDispatcher; @@ -18,15 +19,18 @@ import net.minecraft.state.StateManager; import net.minecraft.state.property.BooleanProperty; import net.minecraft.state.property.Properties; import net.minecraft.util.math.BlockPos; +import net.minecraft.util.shape.VoxelShape; +import net.minecraft.util.shape.VoxelShapes; import net.minecraft.world.BlockView; import java.util.function.Function; +@SuppressWarnings("deprecation") public class DefensiveLaserBlock extends EnergyProviderBlock { public static final BooleanProperty POWERED = Properties.POWERED; public DefensiveLaserBlock() { - super(FabricBlockSettings.copy(Blocks.OBSIDIAN).sounds(BlockSoundGroup.GLASS).nonOpaque().allowsSpawning((state, world, pos, type) -> false).solidBlock((state, world, pos) -> false).suffocates((state, world, pos) -> false).lightLevel(state -> state.get(POWERED) ? 7 : 0)); + super(FabricBlockSettings.copy(Blocks.OBSIDIAN).sounds(BlockSoundGroup.GLASS).nonOpaque().allowsSpawning((state, world, pos, type) -> false).solidBlock((state, world, pos) -> false).suffocates((state, world, pos) -> false).lightLevel(state -> state.get(POWERED) ? 7 : 0).blockVision((state, world, pos) -> false)); setDefaultState(getDefaultState().with(POWERED, false)); } @@ -36,7 +40,6 @@ public class DefensiveLaserBlock extends EnergyProviderBlock { } @Override - @SuppressWarnings("deprecation") @Environment(EnvType.CLIENT) public float getAmbientOcclusionLightLevel(BlockState state, BlockView world, BlockPos pos) { return 1f; @@ -47,6 +50,11 @@ public class DefensiveLaserBlock extends EnergyProviderBlock { return true; } + @Override + public VoxelShape getVisualShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { + return VoxelShapes.empty(); + } + @Override protected Function, BlockEntity> getFactory() { return DefensiveLaserBlockEntity::new; diff --git a/src/main/java/com/thebrokenrail/energonrelics/block/LightningRodBlock.java b/src/main/java/com/thebrokenrail/energonrelics/block/LightningRodBlock.java index 6979a61..191d1f9 100644 --- a/src/main/java/com/thebrokenrail/energonrelics/block/LightningRodBlock.java +++ b/src/main/java/com/thebrokenrail/energonrelics/block/LightningRodBlock.java @@ -18,13 +18,13 @@ import net.minecraft.world.BlockView; import java.util.function.Function; +@SuppressWarnings("deprecation") public class LightningRodBlock extends EnergyProviderBlock { public LightningRodBlock() { - super(FabricBlockSettings.of(Material.STONE, MaterialColor.BLUE_TERRACOTTA).nonOpaque().allowsSpawning((state, world, pos, type) -> false).solidBlock((state, world, pos) -> false).suffocates((state, world, pos) -> false).emissiveLighting((state, world, pos) -> true).lightLevel(10).requiresTool().strength(1.5f, 6.0f)); + super(FabricBlockSettings.of(Material.STONE, MaterialColor.BLUE_TERRACOTTA).nonOpaque().allowsSpawning((state, world, pos, type) -> false).solidBlock((state, world, pos) -> false).suffocates((state, world, pos) -> false).emissiveLighting((state, world, pos) -> true).lightLevel(10).requiresTool().strength(1.5f, 6.0f).blockVision((state, world, pos) -> false)); } @Override - @SuppressWarnings("deprecation") @Environment(EnvType.CLIENT) public float getAmbientOcclusionLightLevel(BlockState state, BlockView world, BlockPos pos) { return 1f; @@ -35,6 +35,11 @@ public class LightningRodBlock extends EnergyProviderBlock { return true; } + @Override + public VoxelShape getVisualShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { + return VoxelShapes.empty(); + } + @Override protected Function, BlockEntity> getFactory() { return LightningRodBlockEntity::new; @@ -42,7 +47,6 @@ public class LightningRodBlock extends EnergyProviderBlock { private static final VoxelShape SHAPE = VoxelShapes.union(createCuboidShape(3d, 0d, 3d, 13d, 2d, 13d), createCuboidShape(7.5d, 2d, 7.5d, 8.5d, 26d, 8.5d)); - @SuppressWarnings("deprecation") @Override public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { return SHAPE; diff --git a/src/main/java/com/thebrokenrail/energonrelics/block/ThermalGlassBlock.java b/src/main/java/com/thebrokenrail/energonrelics/block/ThermalGlassBlock.java index 0c51385..57b1f7b 100644 --- a/src/main/java/com/thebrokenrail/energonrelics/block/ThermalGlassBlock.java +++ b/src/main/java/com/thebrokenrail/energonrelics/block/ThermalGlassBlock.java @@ -7,17 +7,20 @@ import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.minecraft.block.BlockState; import net.minecraft.block.Material; import net.minecraft.block.MaterialColor; +import net.minecraft.block.ShapeContext; import net.minecraft.sound.BlockSoundGroup; import net.minecraft.util.math.BlockPos; +import net.minecraft.util.shape.VoxelShape; +import net.minecraft.util.shape.VoxelShapes; import net.minecraft.world.BlockView; +@SuppressWarnings("deprecation") public class ThermalGlassBlock extends SimpleBlock { public ThermalGlassBlock() { - super(FabricBlockSettings.of(Material.STONE, MaterialColor.YELLOW_TERRACOTTA).sounds(BlockSoundGroup.GLASS).requiresTool().strength(1.5f, 6.0f).nonOpaque().allowsSpawning((state, world, pos, type) -> false).solidBlock((state, world, pos) -> false).suffocates((state, world, pos) -> false)); + super(FabricBlockSettings.of(Material.STONE, MaterialColor.YELLOW_TERRACOTTA).sounds(BlockSoundGroup.GLASS).requiresTool().strength(1.5f, 6.0f).nonOpaque().allowsSpawning((state, world, pos, type) -> false).solidBlock((state, world, pos) -> false).suffocates((state, world, pos) -> false).blockVision((state, world, pos) -> false)); } @Override - @SuppressWarnings("deprecation") @Environment(EnvType.CLIENT) public float getAmbientOcclusionLightLevel(BlockState state, BlockView world, BlockPos pos) { return 1f; @@ -27,4 +30,9 @@ public class ThermalGlassBlock extends SimpleBlock { public boolean isTranslucent(BlockState state, BlockView world, BlockPos pos) { return true; } + + @Override + public VoxelShape getVisualShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { + return VoxelShapes.empty(); + } } diff --git a/src/main/java/com/thebrokenrail/energonrelics/block/forcefield/ForcefieldBlock.java b/src/main/java/com/thebrokenrail/energonrelics/block/forcefield/ForcefieldBlock.java index cb6b06a..a892f4d 100644 --- a/src/main/java/com/thebrokenrail/energonrelics/block/forcefield/ForcefieldBlock.java +++ b/src/main/java/com/thebrokenrail/energonrelics/block/forcefield/ForcefieldBlock.java @@ -10,6 +10,7 @@ import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; +import net.minecraft.block.ShapeContext; import net.minecraft.block.entity.BlockEntity; import net.minecraft.block.piston.PistonBehavior; import net.minecraft.sound.BlockSoundGroup; @@ -20,6 +21,8 @@ import net.minecraft.util.BlockMirror; import net.minecraft.util.BlockRotation; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; +import net.minecraft.util.shape.VoxelShape; +import net.minecraft.util.shape.VoxelShapes; import net.minecraft.world.BlockView; import net.minecraft.world.WorldAccess; @@ -28,7 +31,7 @@ public class ForcefieldBlock extends SimpleBlock { public static final DirectionProperty FACING = Properties.FACING; public ForcefieldBlock() { - super(FabricBlockSettings.copy(Blocks.BARRIER).dropsNothing().lightLevel(state -> 4).emissiveLighting((state, world, pos) -> true).nonOpaque().sounds(BlockSoundGroup.GLASS).allowsSpawning((state, world, pos, type) -> false).solidBlock((state, world, pos) -> false).suffocates((state, world, pos) -> false)); + super(FabricBlockSettings.copy(Blocks.BARRIER).dropsNothing().lightLevel(state -> 4).emissiveLighting((state, world, pos) -> true).nonOpaque().sounds(BlockSoundGroup.GLASS).allowsSpawning((state, world, pos, type) -> false).solidBlock((state, world, pos) -> false).suffocates((state, world, pos) -> false).blockVision((state, world, pos) -> false)); setDefaultState(getDefaultState().with(FACING, Direction.NORTH)); } @@ -58,6 +61,11 @@ public class ForcefieldBlock extends SimpleBlock { return true; } + @Override + public VoxelShape getVisualShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { + return VoxelShapes.empty(); + } + @Override protected boolean registerItem() { return false;