Merge branch 'master' into 1.15

This commit is contained in:
gnembon committed 2019-11-12 00:58:30 -04:00
commit 831fc06e0a
2 files changed
+14 -1

No files matched your search

@@ -225,6 +225,7 @@ public class EntityValue extends Value
put("width", (e, a) -> new NumericValue(e.getDimensions(EntityPose.STANDING).width));
put("eye_height", (e, a) -> new NumericValue(e.getEyeHeight(EntityPose.STANDING)));
put("age", (e, a) -> new NumericValue(e.age));
put("despawn_timer", (e, a) -> e instanceof LivingEntity?new NumericValue(((LivingEntity) e).getDespawnCounter()):Value.NULL);
put("item", (e, a) -> (e instanceof ItemEntity)?ListValue.fromItemStack(((ItemEntity) e).getStack()):Value.NULL);
put("count", (e, a) -> (e instanceof ItemEntity)?new NumericValue(((ItemEntity) e).getStack().getCount()):Value.NULL);
put("pickup_delay", (e, a) -> (e instanceof ItemEntity)?new NumericValue(((ItemEntityInterface) e).getPickupDelay()):Value.NULL);
@@ -732,6 +733,14 @@ public class EntityValue extends Value
}
});
put("despawn_timer", (e, v) ->
{
if (e instanceof LivingEntity)
{
((LivingEntity) e).setDespawnCounter((int)NumericValue.asNumber(v).getLong());
}
});
put("ai", (e, v) ->
{
if (e instanceof MobEntity)