This commit is contained in:
gnembon committed 2021-05-05 01:50:04 -03:00
1 parent e4ebeda1d0
commit 5ac22aa000
8 files changed
+24 -24

No files matched your search

@@ -142,7 +142,7 @@ public class Entities {
ServerWorld serverWorld = cc.s.getWorld();
Entity entity_1 = EntityType.loadEntityWithPassengers(tag, serverWorld, (entity_1x) -> {
entity_1x.refreshPositionAndAngles(vec3d.x, vec3d.y, vec3d.z, entity_1x.method_36454(), entity_1x.method_36455());
entity_1x.refreshPositionAndAngles(vec3d.x, vec3d.y, vec3d.z, entity_1x.getYaw(), entity_1x.getPitch());
return !serverWorld.tryLoadEntity(entity_1x) ? null : entity_1x;
});
if (entity_1 == null) {
@@ -429,7 +429,7 @@ public class EntityValue extends Value
put("uuid",(e, a) -> new StringValue(e.getUuidAsString()));
put("id",(e, a) -> new NumericValue(e.getId()));
put("pos", (e, a) -> ListValue.of(new NumericValue(e.getX()), new NumericValue(e.getY()), new NumericValue(e.getZ())));
put("location", (e, a) -> ListValue.of(new NumericValue(e.getX()), new NumericValue(e.getY()), new NumericValue(e.getZ()), new NumericValue(e.method_36454()), new NumericValue(e.method_36455())));
put("location", (e, a) -> ListValue.of(new NumericValue(e.getX()), new NumericValue(e.getY()), new NumericValue(e.getZ()), new NumericValue(e.getYaw()), new NumericValue(e.getPitch())));
put("x", (e, a) -> new NumericValue(e.getX()));
put("y", (e, a) -> new NumericValue(e.getY()));
put("z", (e, a) -> new NumericValue(e.getZ()));
@@ -467,7 +467,7 @@ public class EntityValue extends Value
return new NumericValue(e.getType().isIn(tag));
});
put("yaw", (e, a)-> new NumericValue(e.method_36454()));
put("yaw", (e, a)-> new NumericValue(e.getYaw()));
put("head_yaw", (e, a)-> {
if (e instanceof LivingEntity)
{
@@ -483,7 +483,7 @@ public class EntityValue extends Value
return Value.NULL;
});
put("pitch", (e, a)-> new NumericValue(e.method_36455()));
put("pitch", (e, a)-> new NumericValue(e.getPitch()));
put("look", (e, a) -> {
Vec3d look = e.getRotationVector();
return ListValue.of(new NumericValue(look.x),new NumericValue(look.y),new NumericValue(look.z));
@@ -1010,25 +1010,25 @@ public class EntityValue extends Value
NumericValue.asNumber(coords.get(0)).getDouble(),
NumericValue.asNumber(coords.get(1)).getDouble(),
NumericValue.asNumber(coords.get(2)).getDouble(),
e.method_36454(),
e.method_36455()
e.getYaw(),
e.getPitch()
);
});
put("x", (e, v) ->
{
updatePosition(e, NumericValue.asNumber(v).getDouble(), e.getY(), e.getZ(), e.method_36454(), e.method_36455());
updatePosition(e, NumericValue.asNumber(v).getDouble(), e.getY(), e.getZ(), e.getYaw(), e.getPitch());
});
put("y", (e, v) ->
{
updatePosition(e, e.getX(), NumericValue.asNumber(v).getDouble(), e.getZ(), e.method_36454(), e.method_36455());
updatePosition(e, e.getX(), NumericValue.asNumber(v).getDouble(), e.getZ(), e.getYaw(), e.getPitch());
});
put("z", (e, v) ->
{
updatePosition(e, e.getX(), e.getY(), NumericValue.asNumber(v).getDouble(), e.method_36454(), e.method_36455());
updatePosition(e, e.getX(), e.getY(), NumericValue.asNumber(v).getDouble(), e.getYaw(), e.getPitch());
});
put("yaw", (e, v) ->
{
updatePosition(e, e.getX(), e.getY(), e.getZ(), ((float)NumericValue.asNumber(v).getDouble()) % 360, e.method_36455());
updatePosition(e, e.getX(), e.getY(), e.getZ(), ((float)NumericValue.asNumber(v).getDouble()) % 360, e.getPitch());
});
put("head_yaw", (e, v) ->
{
@@ -1047,7 +1047,7 @@ public class EntityValue extends Value
put("pitch", (e, v) ->
{
updatePosition(e, e.getX(), e.getY(), e.getZ(), e.method_36454(), MathHelper.clamp((float)NumericValue.asNumber(v).getDouble(), -90, 90));
updatePosition(e, e.getX(), e.getY(), e.getZ(), e.getYaw(), MathHelper.clamp((float)NumericValue.asNumber(v).getDouble(), -90, 90));
});
//"look"
@@ -1065,8 +1065,8 @@ public class EntityValue extends Value
e.getX() + NumericValue.asNumber(coords.get(0)).getDouble(),
e.getY() + NumericValue.asNumber(coords.get(1)).getDouble(),
e.getZ() + NumericValue.asNumber(coords.get(2)).getDouble(),
e.method_36454(),
e.method_36455()
e.getYaw(),
e.getPitch()
);
});
@@ -1290,7 +1290,7 @@ public class EntityValue extends Value
BlockValue bv= (BlockValue)a;
if (bv.getPos()==null || bv.getWorld() == null)
throw new InternalExpressionException("block for spawn modification should be localised in the world");
spe.setSpawnPoint(bv.getWorld().getRegistryKey(), bv.getPos(), e.method_36454(), true, false); // yaw
spe.setSpawnPoint(bv.getWorld().getRegistryKey(), bv.getPos(), e.getYaw(), true, false); // yaw
}
else if (a.isNull())
{