25w19a
This commit is contained in:
1 parent
6bed85ef8c
commit
a1e4496cff
14 files changed
+38
-38
No files matched your search
@@ -604,7 +604,7 @@ public class CarpetEventServer
|
||||
return handler.call(() ->
|
||||
Arrays.asList(
|
||||
new EntityValue(player),
|
||||
new BlockValue(null, player.serverLevel(), blockpos),
|
||||
new BlockValue(null, player.level(), blockpos),
|
||||
StringValue.of(facing.getName())
|
||||
), player::createCommandSourceStack);
|
||||
}
|
||||
@@ -624,7 +624,7 @@ public class CarpetEventServer
|
||||
new EntityValue(player),
|
||||
ValueConversions.of(itemstack, player.level().registryAccess()),
|
||||
StringValue.of(enumhand == InteractionHand.MAIN_HAND ? "mainhand" : "offhand"),
|
||||
new BlockValue(null, player.serverLevel(), blockpos),
|
||||
new BlockValue(null, player.level(), blockpos),
|
||||
StringValue.of(enumfacing.getName()),
|
||||
ListValue.of(
|
||||
new NumericValue(vec3d.x),
|
||||
@@ -648,7 +648,7 @@ public class CarpetEventServer
|
||||
return Arrays.asList(
|
||||
new EntityValue(player),
|
||||
StringValue.of(enumhand == InteractionHand.MAIN_HAND ? "mainhand" : "offhand"),
|
||||
new BlockValue(null, player.serverLevel(), blockpos),
|
||||
new BlockValue(null, player.level(), blockpos),
|
||||
StringValue.of(enumfacing.getName()),
|
||||
ListValue.of(
|
||||
new NumericValue(vec3d.x),
|
||||
@@ -669,7 +669,7 @@ public class CarpetEventServer
|
||||
new EntityValue(player),
|
||||
ValueConversions.of(itemstack, player.level().registryAccess()),
|
||||
StringValue.of(enumhand == InteractionHand.MAIN_HAND ? "mainhand" : "offhand"),
|
||||
new BlockValue(null, player.serverLevel(), pos)
|
||||
new BlockValue(null, player.level(), pos)
|
||||
), player::createCommandSourceStack);
|
||||
}
|
||||
};
|
||||
@@ -682,7 +682,7 @@ public class CarpetEventServer
|
||||
new EntityValue(player),
|
||||
ValueConversions.of(itemstack, player.level().registryAccess()),
|
||||
StringValue.of(enumhand == InteractionHand.MAIN_HAND ? "mainhand" : "offhand"),
|
||||
new BlockValue(null, player.serverLevel(), pos)
|
||||
new BlockValue(null, player.level(), pos)
|
||||
), player::createCommandSourceStack);
|
||||
return false;
|
||||
}
|
||||
@@ -693,7 +693,7 @@ public class CarpetEventServer
|
||||
public boolean onBlockBroken(ServerPlayer player, BlockPos pos, BlockState previousBS)
|
||||
{
|
||||
return handler.call(
|
||||
() -> Arrays.asList(new EntityValue(player), new BlockValue(previousBS, player.serverLevel(), pos)),
|
||||
() -> Arrays.asList(new EntityValue(player), new BlockValue(previousBS, player.level(), pos)),
|
||||
player::createCommandSourceStack
|
||||
);
|
||||
}
|
||||
@@ -1336,7 +1336,7 @@ public class CarpetEventServer
|
||||
valArgs.add(EntityValue.of(player));
|
||||
for (Object o : args)
|
||||
{
|
||||
valArgs.add(ValueConversions.guess(player.serverLevel(), o));
|
||||
valArgs.add(ValueConversions.guess(player.level(), o));
|
||||
}
|
||||
return valArgs;
|
||||
}, player::createCommandSourceStack
|
||||
|
||||
@@ -777,7 +777,7 @@ public class ShapeDispatcher
|
||||
}
|
||||
|
||||
Vec3 v = relativiseRender(p.level(), this.pos, 0);
|
||||
p.serverLevel().sendParticles(p, particle, true, true, v.x, v.y, v.z, 1, 0.0, 0.0, 0.0, 0.0);
|
||||
p.level().sendParticles(p, particle, true, true, v.x, v.y, v.z, 1, 0.0, 0.0, 0.0, 0.0);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1072,7 +1072,7 @@ public class ShapeDispatcher
|
||||
ParticleOptions locparticledata = new DustParticleOptions(ARGB.colorFromFloat(1.0f, fr, fg, fb), 1);
|
||||
for (Vec3 v : getAlterPoint(p))
|
||||
{
|
||||
p.serverLevel().sendParticles(p, locparticledata, true, true,
|
||||
p.level().sendParticles(p, locparticledata, true, true,
|
||||
v.x, v.y, v.z, 1,
|
||||
0.0, 0.0, 0.0, 0.0);
|
||||
}
|
||||
@@ -1282,7 +1282,7 @@ public class ShapeDispatcher
|
||||
{
|
||||
int partno = Math.min(1000, 20 * subdivisions);
|
||||
RandomSource rand = p.level().getRandom();
|
||||
ServerLevel world = p.serverLevel();
|
||||
ServerLevel world = p.level();
|
||||
ParticleOptions particle = replacementParticle(world.registryAccess());
|
||||
|
||||
Vec3 ccenter = relativiseRender(world, center, 0);
|
||||
@@ -1379,7 +1379,7 @@ public class ShapeDispatcher
|
||||
{
|
||||
int partno = (int) Math.min(1000, Math.sqrt(20 * subdivisions * (1 + height)));
|
||||
RandomSource rand = p.level().getRandom();
|
||||
ServerLevel world = p.serverLevel();
|
||||
ServerLevel world = p.level();
|
||||
ParticleOptions particle = replacementParticle(world.registryAccess());
|
||||
|
||||
Vec3 ccenter = relativiseRender(world, center, 0);
|
||||
@@ -2185,7 +2185,7 @@ public class ShapeDispatcher
|
||||
int parts = 0;
|
||||
for (ServerPlayer player : playerList)
|
||||
{
|
||||
ServerLevel world = player.serverLevel();
|
||||
ServerLevel world = player.level();
|
||||
world.sendParticles(player, particle, true, true,
|
||||
(towards.x) / 2 + from.x, (towards.y) / 2 + from.y, (towards.z) / 2 + from.z, particles / 3,
|
||||
towards.x / 6, towards.y / 6, towards.z / 6, 0.0);
|
||||
@@ -2202,7 +2202,7 @@ public class ShapeDispatcher
|
||||
int dev = 2 * divider;
|
||||
for (ServerPlayer player : playerList)
|
||||
{
|
||||
ServerLevel world = player.serverLevel();
|
||||
ServerLevel world = player.level();
|
||||
world.sendParticles(player, particle, true, true,
|
||||
(towards.x) / center + from.x, (towards.y) / center + from.y, (towards.z) / center + from.z, particles / divider,
|
||||
towards.x / dev, towards.y / dev, towards.z / dev, 0.0);
|
||||
@@ -2234,7 +2234,7 @@ public class ShapeDispatcher
|
||||
Vec3 at = from.add(towards.scale(rand.nextDouble()));
|
||||
for (ServerPlayer player : players)
|
||||
{
|
||||
player.serverLevel().sendParticles(player, particle, true, true,
|
||||
player.level().sendParticles(player, particle, true, true,
|
||||
at.x, at.y, at.z, 1,
|
||||
0.0, 0.0, 0.0, 0.0);
|
||||
pcount++;
|
||||
@@ -2255,7 +2255,7 @@ public class ShapeDispatcher
|
||||
{
|
||||
for (ServerPlayer player : players)
|
||||
{
|
||||
player.serverLevel().sendParticles(player, particle, true, true,
|
||||
player.level().sendParticles(player, particle, true, true,
|
||||
delta.x + from.x, delta.y + from.y, delta.z + from.z, 1,
|
||||
0.0, 0.0, 0.0, 0.0);
|
||||
pcount++;
|
||||
|
||||
@@ -70,12 +70,12 @@ public class SnoopyCommandSource extends CommandSourceStack
|
||||
{
|
||||
super(player.commandSource(), player.position(), player.getRotationVector(),
|
||||
player.level() instanceof final ServerLevel serverLevel ? serverLevel : null,
|
||||
player.server.getProfilePermissions(player.getGameProfile()), player.getName().getString(), player.getDisplayName(),
|
||||
player.getServer().getProfilePermissions(player.getGameProfile()), player.getName().getString(), player.getDisplayName(),
|
||||
player.level().getServer(), player);
|
||||
this.output = player.commandSource();
|
||||
this.position = player.position();
|
||||
this.world = player.level() instanceof final ServerLevel serverLevel ? serverLevel : null;
|
||||
this.level = player.server.getProfilePermissions(player.getGameProfile());
|
||||
this.level = player.getServer().getProfilePermissions(player.getGameProfile());
|
||||
this.simpleName = player.getName().getString();
|
||||
this.name = player.getDisplayName();
|
||||
this.server = player.level().getServer();
|
||||
@@ -86,7 +86,7 @@ public class SnoopyCommandSource extends CommandSourceStack
|
||||
this.error = error;
|
||||
this.chatOutput = output;
|
||||
this.signingContext = CommandSigningContext.ANONYMOUS;
|
||||
this.taskChainer = TaskChainer.immediate(player.server);
|
||||
this.taskChainer = TaskChainer.immediate(player.getServer());
|
||||
}
|
||||
|
||||
private SnoopyCommandSource(CommandSource output, Vec3 pos, Vec2 rot, ServerLevel world, int level, String simpleName, Component name, MinecraftServer server, @Nullable Entity entity, CommandResultCallback consumer, EntityAnchorArgument.Anchor entityAnchor, CommandSigningContext context, TaskChainer chainer,
|
||||
|
||||
@@ -714,7 +714,7 @@ public class EntityValue extends Value
|
||||
{
|
||||
return Value.NULL;
|
||||
}
|
||||
return new BlockValue(null, sp.serverLevel(), pos);
|
||||
return new BlockValue(null, sp.level(), pos);
|
||||
}
|
||||
return Value.NULL;
|
||||
});
|
||||
|
||||
@@ -200,7 +200,7 @@ public class ScreenValue extends Value
|
||||
this.screenHandler = null;
|
||||
return false;
|
||||
}
|
||||
int runPermissionLevel = Vanilla.MinecraftServer_getRunPermissionLevel(player.server);
|
||||
int runPermissionLevel = Vanilla.MinecraftServer_getRunPermissionLevel(player.getServer());
|
||||
CommandSourceStack source = player.createCommandSourceStack().withPermission(runPermissionLevel);
|
||||
CarpetScriptHost executingHost = appHost.retrieveForExecution(source, player);
|
||||
try
|
||||
|
||||
Reference in new issue
Block a user