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

@@ -1623,6 +1623,8 @@ public class CarpetExpression
* <p>Eye height of the entity.</p>
* <h3><code>query(e,'age')</code></h3>
* <p>Age, in ticks, of the entity, i.e. how long it existed.</p>
* <h3><code>query(e,'despawn_timer')</code></h3>
* <p>For living entities - the number of ticks they fall outside of immediate player presence.</p>
* <h3><code>query(e,'item')</code></h3>
* <p>The item triple (name, count, nbt) if its an item entity, <code>null</code> otherwise</p>
* <h3><code>query(e,'count')</code></h3>
@@ -1718,8 +1720,10 @@ public class CarpetExpression
* <h3><code>modify(e, 'accelerate', x, y, z), modify(e, 'accelerate', l(x, y, z) )</code></h3>
* <p>Adds a vector to the motion vector. Most realistic way to apply a force to an entity.</p>
* <h3><code>modify(e, 'custom_name'), modify(e, 'custom_name', name )</code></h3>
* <h3><code>modify(e,'pickup_delay')</code></h3>
* <h3><code>modify(e, 'pickup_delay')</code></h3>
* <p>Sets a custom pickup delay if the entity argument is an item entity</p>
* <h3><code>modify(e, 'despawn_timer')</code></h3>
* <p>Sets a custom despawn timer value.</p>
* <h3><code>modify(e, 'dismount')</code></h3>
* <p>Dismounts riding entity.</p>
* <h3><code>modify(e, 'mount', other)</code></h3>
@@ -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)