Items dropped by clouds will now float in place

This commit is contained in:
Sollace 2019-02-01 11:37:47 +02:00
parent 292b09d6e5
commit d433c8a30c
2 changed files with 12 additions and 1 deletions

View file

@ -17,7 +17,7 @@ public final class Predicates {
}; };
public static final Predicate<Entity> ITEMS = entity -> { public static final Predicate<Entity> ITEMS = entity -> {
return entity instanceof EntityItem && entity.isEntityAlive(); return entity instanceof EntityItem && entity.isEntityAlive() && entity.ticksExisted > 1;
}; };
public static final Predicate<EntityItem> ITEM_INTERACT_WITH_CLOUDS = item -> { public static final Predicate<EntityItem> ITEM_INTERACT_WITH_CLOUDS = item -> {

View file

@ -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 @Override
public void readEntityFromNBT(NBTTagCompound tag) { public void readEntityFromNBT(NBTTagCompound tag) {
super.readEntityFromNBT(tag); super.readEntityFromNBT(tag);