Refactored the Explosive Charges to have a proper base class.
This commit is contained in:
parent
cac20388f8
commit
0a0742d8eb
6 changed files with 118 additions and 102 deletions
|
@ -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();
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue