Fix Teleposer and Soul Forge dropping items on break
This commit is contained in:
parent
c5dec61351
commit
70f9b9f101
|
@ -1,5 +1,6 @@
|
||||||
package WayofTime.bloodmagic.block;
|
package WayofTime.bloodmagic.block;
|
||||||
|
|
||||||
|
import WayofTime.bloodmagic.tile.TileAltar;
|
||||||
import net.minecraft.block.BlockContainer;
|
import net.minecraft.block.BlockContainer;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
|
@ -64,14 +65,13 @@ public class BlockSoulForge extends BlockContainer
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void breakBlock(World worldIn, BlockPos pos, IBlockState state)
|
public void breakBlock(World world, BlockPos blockPos, IBlockState blockState)
|
||||||
{
|
{
|
||||||
if (worldIn.getTileEntity(pos) != null && worldIn.getTileEntity(pos) instanceof TileTeleposer)
|
TileSoulForge tileSoulForge = (TileSoulForge) world.getTileEntity(blockPos);
|
||||||
{
|
if (tileSoulForge != null)
|
||||||
InventoryHelper.dropInventoryItems(worldIn, pos, (TileTeleposer) worldIn.getTileEntity(pos));
|
tileSoulForge.dropItems();
|
||||||
}
|
|
||||||
|
|
||||||
super.breakBlock(worldIn, pos, state);
|
super.breakBlock(world, blockPos, blockState);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -52,14 +52,13 @@ public class BlockTeleposer extends BlockContainer
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void breakBlock(World worldIn, BlockPos pos, IBlockState state)
|
public void breakBlock(World world, BlockPos blockPos, IBlockState blockState)
|
||||||
{
|
{
|
||||||
if (worldIn.getTileEntity(pos) != null && worldIn.getTileEntity(pos) instanceof TileTeleposer)
|
TileTeleposer tileTeleposer = (TileTeleposer) world.getTileEntity(blockPos);
|
||||||
{
|
if (tileTeleposer != null)
|
||||||
InventoryHelper.dropInventoryItems(worldIn, pos, (TileTeleposer) worldIn.getTileEntity(pos));
|
tileTeleposer.dropItems();
|
||||||
}
|
|
||||||
|
|
||||||
super.breakBlock(worldIn, pos, state);
|
super.breakBlock(world, blockPos, blockState);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue