Skip to content

Commit

Permalink
Harden altar item dropping
Browse files Browse the repository at this point in the history
  • Loading branch information
ACGaming committed Jan 30, 2025
1 parent ead9f74 commit 1391198
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/main/java/mod/emt/harkenscythe/block/HSBlockAltar.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,6 @@ public boolean hasTileEntity(IBlockState state)
return true;
}

@Override
public void breakBlock(World world, BlockPos pos, IBlockState state)
{
TileEntity te = world.getTileEntity(pos);
if (te instanceof HSTileEntityAltar)
{
HSTileEntityAltar altar = (HSTileEntityAltar) te;
altar.dropItem();
}
super.breakBlock(world, pos, state);
}

@Override
public abstract TileEntity createNewTileEntity(World world, int meta);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,13 @@ public NBTTagCompound writeToNBT(NBTTagCompound compound)
return compound;
}

@Override
public void invalidate()
{
super.invalidate();
dropItem();
}

public void dropItem()
{
if (!world.isRemote && !getInputStack().isEmpty())
Expand Down

0 comments on commit 1391198

Please sign in to comment.