This commit is contained in:
gnembon committed 2025-02-13 22:38:20 +01:00
1 parent 4079ef1419
commit 9be8d5c77b
7 files changed
+30 -26

No files matched your search

@@ -530,15 +530,16 @@ public class EntityValue extends Value
put("spawn_point", (e, a) -> {
if (e instanceof ServerPlayer spe)
{
if (spe.getRespawnPosition() == null)
if (spe.getRespawnConfig() == null)
{
return Value.FALSE;
}
ServerPlayer.RespawnConfig spec = spe.getRespawnConfig();
return ListValue.of(
ValueConversions.of(spe.getRespawnPosition()),
ValueConversions.of(spe.getRespawnDimension()),
new NumericValue(spe.getRespawnAngle()),
BooleanValue.of(spe.isRespawnForced())
ValueConversions.of(spec.pos()),
ValueConversions.of(spec.dimension()),
new NumericValue(spec.angle()),
BooleanValue.of(spec.forced())
);
}
return Value.NULL;
@@ -1366,7 +1367,7 @@ public class EntityValue extends Value
}
if (a == null)
{
spe.setRespawnPosition(null, null, 0, false, false);
spe.setRespawnPosition(null, false);
}
else if (a instanceof ListValue lv)
{
@@ -1389,7 +1390,7 @@ public class EntityValue extends Value
}
}
}
spe.setRespawnPosition(world, pos, angle, forced, false);
spe.setRespawnPosition(new ServerPlayer.RespawnConfig(world, pos, angle, forced), false);
}
else if (a instanceof BlockValue bv)
{
@@ -1397,11 +1398,11 @@ public class EntityValue extends Value
{
throw new InternalExpressionException("block for spawn modification should be localised in the world");
}
spe.setRespawnPosition(bv.getWorld().dimension(), bv.getPos(), e.getYRot(), true, false); // yaw
spe.setRespawnPosition(new ServerPlayer.RespawnConfig(bv.getWorld().dimension(), bv.getPos(), e.getYRot(), true), false); // yaw
}
else if (a.isNull())
{
spe.setRespawnPosition(null, null, 0, false, false);
spe.setRespawnPosition(null, false);
}
else
{