Skip to content

Commit 407b038

Browse files
committed
Use Properties instead of Overriden methods
1 parent 791c52d commit 407b038

File tree

2 files changed

+1
-26
lines changed

2 files changed

+1
-26
lines changed

src/main/java/io/github/cadiboo/examplemod/ModEventSubscriber.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public static void onRegisterBlocks(final RegistryEvent.Register<Block> event) {
6161
// This block has the IRON material, meaning it needs at least a stone pickaxe to break it. It is very similar to the Iron Block
6262
setup(new Block(Block.Properties.create(Material.IRON, MaterialColor.IRON).hardnessAndResistance(5.0F, 6.0F).sound(SoundType.METAL)), "example_block"),
6363
// This block has the MISCELLANEOUS material. It is very similar to the Redstone Torch
64-
setup(new MiniModelBlock(Block.Properties.create(Material.MISCELLANEOUS).hardnessAndResistance(1.5F).lightValue(13)), "mini_model"),
64+
setup(new MiniModelBlock(Block.Properties.create(Material.MISCELLANEOUS).hardnessAndResistance(1.5F).lightValue(13).doesNotBlockMovement()), "mini_model"),
6565
// This block has the ROCK material, meaning it needs at least a wooden pickaxe to break it. It is very similar to the Furnace
6666
setup(new HeatCollectorBlock(Block.Properties.create(Material.ROCK).hardnessAndResistance(3.5F).lightValue(13)), "heat_collector"),
6767
setup(new ElectricFurnaceBlock(Block.Properties.create(Material.ROCK).hardnessAndResistance(3.5F)), "electric_furnace"),

src/main/java/io/github/cadiboo/examplemod/block/MiniModelBlock.java

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,12 @@
1111
import net.minecraft.util.Hand;
1212
import net.minecraft.util.math.BlockPos;
1313
import net.minecraft.util.math.BlockRayTraceResult;
14-
import net.minecraft.util.math.shapes.ISelectionContext;
15-
import net.minecraft.util.math.shapes.VoxelShape;
16-
import net.minecraft.util.math.shapes.VoxelShapes;
1714
import net.minecraft.world.IBlockReader;
1815
import net.minecraft.world.World;
1916
import net.minecraftforge.api.distmarker.Dist;
2017
import net.minecraftforge.api.distmarker.OnlyIn;
2118
import net.minecraftforge.fml.DistExecutor;
2219

23-
import javax.annotation.Nonnull;
2420
import javax.annotation.Nullable;
2521

2622
/**
@@ -44,27 +40,6 @@ public TileEntity createTileEntity(final BlockState state, final IBlockReader wo
4440
return ModTileEntityTypes.MINI_MODEL.create();
4541
}
4642

47-
/**
48-
* @deprecated Call via {@link BlockState#isSolid()} whenever possible.
49-
* Implementing/overriding is fine.
50-
*/
51-
@Override
52-
public boolean isSolid(final BlockState state) {
53-
// This prevents xraying through the world and allows light to go through this block.
54-
return false;
55-
}
56-
57-
/**
58-
* @deprecated Call via {@link BlockState#getCollisionShape(IBlockReader, BlockPos, ISelectionContext)} whenever possible.
59-
* Implementing/overriding is fine.
60-
*/
61-
@Override
62-
@Nonnull
63-
public VoxelShape getCollisionShape(final BlockState state, final IBlockReader reader, final BlockPos pos, final ISelectionContext context) {
64-
// Allow entities to walk through the model
65-
return VoxelShapes.empty();
66-
}
67-
6843
/**
6944
* @deprecated Call via {@link BlockState#onBlockActivated(World, PlayerEntity, Hand, BlockRayTraceResult)} whenever possible.
7045
* Implementing/overriding is fine.

0 commit comments

Comments
 (0)