Refactored the Explosive Charges to have a proper base class.

This commit is contained in:
WayofTime 2021-01-23 14:52:46 -05:00
parent cac20388f8
commit 0a0742d8eb
6 changed files with 118 additions and 102 deletions

View file

@ -18,6 +18,7 @@ import net.minecraft.world.IBlockReader;
import net.minecraft.world.IWorld;
import net.minecraft.world.IWorldReader;
import net.minecraft.world.World;
import wayoftime.bloodmagic.tile.TileExplosiveCharge;
import wayoftime.bloodmagic.tile.TileShapedExplosive;
public class BlockShapedExplosive extends Block
@ -110,7 +111,7 @@ public class BlockShapedExplosive extends Block
@Override
public void onBlockHarvested(World world, BlockPos blockPos, BlockState blockState, PlayerEntity player)
{
TileShapedExplosive tile = (TileShapedExplosive) world.getTileEntity(blockPos);
TileExplosiveCharge tile = (TileExplosiveCharge) world.getTileEntity(blockPos);
if (tile != null && !world.isRemote)
tile.dropSelf();

View file

@ -14,7 +14,7 @@ import net.minecraft.util.SoundEvents;
import net.minecraft.world.World;
import wayoftime.bloodmagic.anointment.AnointmentHolder;
import wayoftime.bloodmagic.entity.projectile.EntityShapedCharge;
import wayoftime.bloodmagic.tile.TileShapedExplosive;
import wayoftime.bloodmagic.tile.TileExplosiveCharge;
public class ItemBlockShapedCharge extends BlockItem
{
@ -60,9 +60,9 @@ public class ItemBlockShapedCharge extends BlockItem
if (holder != null)
{
TileEntity tile = context.getWorld().getTileEntity(context.getPos());
if (tile instanceof TileShapedExplosive)
if (tile instanceof TileExplosiveCharge)
{
((TileShapedExplosive) tile).setAnointmentHolder(holder);
((TileExplosiveCharge) tile).setAnointmentHolder(holder);
}
}