mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-21 04:32:23 +00:00
Fixed the Gaia Guardian breaking blocks on the client side. Closes #1141
This commit is contained in:
1 parent
9094320d29
commit
bdfa816290
1 file changed
+13
-11
@@ -390,18 +390,20 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi
|
||||
if(!worldObj.isRemote && worldObj.difficultySetting == EnumDifficulty.PEACEFUL)
|
||||
setDead();
|
||||
|
||||
int posXInt = MathHelper.floor_double(posX);
|
||||
int posYInt = MathHelper.floor_double(posY);
|
||||
int posZInt = MathHelper.floor_double(posZ);
|
||||
Block block = worldObj.getBlock(posXInt, posYInt, posZInt);
|
||||
if(block.getBlockHardness(worldObj, posXInt, posYInt, posZInt) >= 0) {
|
||||
List<ItemStack> items = block.getDrops(worldObj, posXInt, posYInt, posZInt, 0, 0);
|
||||
for(ItemStack stack : items) {
|
||||
if(ConfigHandler.blockBreakParticles)
|
||||
worldObj.playAuxSFX(2001, posXInt, posYInt, posZInt, Block.getIdFromBlock(block) + (worldObj.getBlockMetadata(posXInt, posYInt, posZInt) << 12));
|
||||
worldObj.spawnEntityInWorld(new EntityItem(worldObj, posXInt + 0.5, posYInt + 0.5, posZInt + 0.5, stack));
|
||||
if(!worldObj.isRemote) {
|
||||
int posXInt = MathHelper.floor_double(posX);
|
||||
int posYInt = MathHelper.floor_double(posY);
|
||||
int posZInt = MathHelper.floor_double(posZ);
|
||||
Block block = worldObj.getBlock(posXInt, posYInt, posZInt);
|
||||
if(block.getBlockHardness(worldObj, posXInt, posYInt, posZInt) >= 0) {
|
||||
List<ItemStack> items = block.getDrops(worldObj, posXInt, posYInt, posZInt, 0, 0);
|
||||
for(ItemStack stack : items) {
|
||||
if(ConfigHandler.blockBreakParticles)
|
||||
worldObj.playAuxSFX(2001, posXInt, posYInt, posZInt, Block.getIdFromBlock(block) + (worldObj.getBlockMetadata(posXInt, posYInt, posZInt) << 12));
|
||||
worldObj.spawnEntityInWorld(new EntityItem(worldObj, posXInt + 0.5, posYInt + 0.5, posZInt + 0.5, stack));
|
||||
}
|
||||
worldObj.setBlockToAir(posXInt, posYInt, posZInt);
|
||||
}
|
||||
worldObj.setBlockToAir(posXInt, posYInt, posZInt);
|
||||
}
|
||||
|
||||
ChunkCoordinates source = getSource();
|
||||
|
||||
Reference in new issue
Block a user