From 8b2f0affe4be2333e617a7db66feef61359cd590 Mon Sep 17 00:00:00 2001 From: bconlon Date: Mon, 28 Dec 2020 17:15:16 -0800 Subject: [PATCH] floating blocks drop as item past height limit. --- .../entities/block/EntityFloatingBlock.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/main/java/com/gildedgames/the_aether/entities/block/EntityFloatingBlock.java b/src/main/java/com/gildedgames/the_aether/entities/block/EntityFloatingBlock.java index d2199d8..bf4c264 100644 --- a/src/main/java/com/gildedgames/the_aether/entities/block/EntityFloatingBlock.java +++ b/src/main/java/com/gildedgames/the_aether/entities/block/EntityFloatingBlock.java @@ -10,6 +10,8 @@ import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityFallingBlock; import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.MathHelper; import net.minecraft.world.World; @@ -84,6 +86,11 @@ public class EntityFloatingBlock extends Entity implements IEntityAdditionalSpaw if (this.ticksExisted > 200) { + if (!this.worldObj.isRemote) + { + this.entityDropItem(new ItemStack(Item.getItemFromBlock(this.getBlock())),0.0F); + } + this.setDead(); } else @@ -101,6 +108,15 @@ public class EntityFloatingBlock extends Entity implements IEntityAdditionalSpaw this.posY = j; this.posZ = k + 0.5D; } + + if (this.posY > this.worldObj.getHeight()) + { + if (!this.worldObj.isRemote) + { + this.setDead(); + this.entityDropItem(new ItemStack(Item.getItemFromBlock(this.getBlock())),0.0F); + } + } } }