added ability set unmountable entities

This commit is contained in:
gnembon committed 2020-02-10 01:52:08 -04:00
1 parent 229a82da90
commit ee4a073a57
4 files changed
+37

No files matched your search

@@ -228,6 +228,7 @@ public class EntityValue extends Value
put("is_ridden", (e, a) -> new NumericValue(e.hasPassengers()));
put("passengers", (e, a) -> ListValue.wrap(e.getPassengerList().stream().map(EntityValue::new).collect(Collectors.toList())));
put("mount", (e, a) -> (e.getVehicle()!=null)?new EntityValue(e.getVehicle()):Value.NULL);
put("unmountable", (e, a) -> new NumericValue(((EntityInterface)e).isPermanentVehicle()));
put("tags", (e, a) -> ListValue.wrap(e.getScoreboardTags().stream().map(StringValue::new).collect(Collectors.toList())));
put("has_tag", (e, a) -> new NumericValue(e.getScoreboardTags().contains(a.getString())));
put("yaw", (e, a)-> new NumericValue(e.yaw));
@@ -661,6 +662,11 @@ public class EntityValue extends Value
//...
}
});
put("unmountable", (e, v) ->{
if (v == null)
v = Value.TRUE;
((EntityInterface)e).setPermanentVehicle(v.getBoolean());
});
put("drop_passengers", (e, v) -> e.removeAllPassengers());
put("mount_passengers", (e, v) -> {
if (v==null)