From d433c8a30c161e31145beaf6712a48f4a9252f58 Mon Sep 17 00:00:00 2001 From: Sollace Date: Fri, 1 Feb 2019 11:37:47 +0200 Subject: [PATCH] Items dropped by clouds will now float in place --- .../java/com/minelittlepony/unicopia/Predicates.java | 2 +- .../minelittlepony/unicopia/entity/EntityCloud.java | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/minelittlepony/unicopia/Predicates.java b/src/main/java/com/minelittlepony/unicopia/Predicates.java index 95ebcc02..bc4bf4f1 100644 --- a/src/main/java/com/minelittlepony/unicopia/Predicates.java +++ b/src/main/java/com/minelittlepony/unicopia/Predicates.java @@ -17,7 +17,7 @@ public final class Predicates { }; public static final Predicate ITEMS = entity -> { - return entity instanceof EntityItem && entity.isEntityAlive(); + return entity instanceof EntityItem && entity.isEntityAlive() && entity.ticksExisted > 1; }; public static final Predicate ITEM_INTERACT_WITH_CLOUDS = item -> { diff --git a/src/main/java/com/minelittlepony/unicopia/entity/EntityCloud.java b/src/main/java/com/minelittlepony/unicopia/entity/EntityCloud.java index d569383c..2d860edb 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/EntityCloud.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/EntityCloud.java @@ -570,6 +570,17 @@ public class EntityCloud extends EntityFlying implements IAnimals { } } + @Override + public EntityItem entityDropItem(ItemStack stack, float offsetY) { + EntityItem item = super.entityDropItem(stack, offsetY); + + PlayerSpeciesList.instance().getEntity(item).setPlayerSpecies(Race.PEGASUS); + item.setNoGravity(true); + item.motionY = 0; + + return item; + } + @Override public void readEntityFromNBT(NBTTagCompound tag) { super.readEntityFromNBT(tag);