1.20.2-pre1

This commit is contained in:
gnembon committed 2023-09-05 22:15:44 +02:00
1 parent ffbd1338b0
commit 5a77da26d4
12 files changed
+49 -54

No files matched your search

+1 -1
View File
@@ -230,7 +230,7 @@ public class Vanilla
public static String ServerPlayer_getLanguage(ServerPlayer player)
{
return ((ServerPlayerInterface) player).getLanguage();
return player.clientInformation().language();
}
public static GoalSelector Mob_getAI(Mob mob, boolean target)
@@ -41,6 +41,8 @@ public class SnoopyCommandSource extends CommandSourceStack
private final List<Component> chatOutput;
private final CommandSigningContext signingContext;
private final TaskChainer taskChainer;
public SnoopyCommandSource(CommandSourceStack original, Component[] error, List<Component> chatOutput)
{
super(CommandSource.NULL, original.getPosition(), original.getRotation(), original.getLevel(), Vanilla.MinecraftServer_getRunPermissionLevel(original.getServer()),
@@ -62,6 +64,7 @@ public class SnoopyCommandSource extends CommandSourceStack
this.error = error;
this.chatOutput = chatOutput;
this.signingContext = original.getSigningContext();
this.taskChainer = TaskChainer.immediate(original.getServer());
}
public SnoopyCommandSource(ServerPlayer player, Component[] error, List<Component> output)
@@ -85,15 +88,16 @@ public class SnoopyCommandSource extends CommandSourceStack
this.error = error;
this.chatOutput = output;
this.signingContext = CommandSigningContext.ANONYMOUS;
this.taskChainer = TaskChainer.immediate(player.server);
}
private SnoopyCommandSource(CommandSource output, Vec3 pos, Vec2 rot, ServerLevel world, int level, String simpleName, Component name, MinecraftServer server, @Nullable Entity entity, ResultConsumer<CommandSourceStack> consumer, EntityAnchorArgument.Anchor entityAnchor, CommandSigningContext context,
private SnoopyCommandSource(CommandSource output, Vec3 pos, Vec2 rot, ServerLevel world, int level, String simpleName, Component name, MinecraftServer server, @Nullable Entity entity, ResultConsumer<CommandSourceStack> consumer, EntityAnchorArgument.Anchor entityAnchor, CommandSigningContext context, TaskChainer chainer,
Component[] error, List<Component> chatOutput
)
{
super(output, pos, rot, world, level,
simpleName, name, server, entity, false,
consumer, entityAnchor, context, TaskChainer.immediate(server), i -> {});
consumer, entityAnchor, context, chainer, i -> {});
this.output = output;
this.position = pos;
this.rotation = rot;
@@ -108,30 +112,31 @@ public class SnoopyCommandSource extends CommandSourceStack
this.error = error;
this.chatOutput = chatOutput;
this.signingContext = context;
this.taskChainer = chainer;
}
@Override
public CommandSourceStack withEntity(Entity entity)
{
return new SnoopyCommandSource(output, position, rotation, world, level, entity.getName().getString(), entity.getDisplayName(), server, entity, resultConsumer, entityAnchor, signingContext, error, chatOutput);
return new SnoopyCommandSource(output, position, rotation, world, level, entity.getName().getString(), entity.getDisplayName(), server, entity, resultConsumer, entityAnchor, signingContext, taskChainer, error, chatOutput);
}
@Override
public CommandSourceStack withPosition(Vec3 position)
{
return new SnoopyCommandSource(output, position, rotation, world, level, simpleName, name, server, entity, resultConsumer, entityAnchor, signingContext, error, chatOutput);
return new SnoopyCommandSource(output, position, rotation, world, level, simpleName, name, server, entity, resultConsumer, entityAnchor, signingContext, taskChainer, error, chatOutput);
}
@Override
public CommandSourceStack withRotation(Vec2 rotation)
{
return new SnoopyCommandSource(output, position, rotation, world, level, simpleName, name, server, entity, resultConsumer, entityAnchor, signingContext, error, chatOutput);
return new SnoopyCommandSource(output, position, rotation, world, level, simpleName, name, server, entity, resultConsumer, entityAnchor, signingContext, taskChainer, error, chatOutput);
}
@Override
public CommandSourceStack withCallback(ResultConsumer<CommandSourceStack> consumer)
{
return new SnoopyCommandSource(output, position, rotation, world, level, simpleName, name, server, entity, consumer, entityAnchor, signingContext, error, chatOutput);
return new SnoopyCommandSource(output, position, rotation, world, level, simpleName, name, server, entity, consumer, entityAnchor, signingContext, taskChainer, error, chatOutput);
}
@Override
@@ -160,13 +165,13 @@ public class SnoopyCommandSource extends CommandSourceStack
@Override
public CommandSourceStack withAnchor(EntityAnchorArgument.Anchor anchor)
{
return new SnoopyCommandSource(output, position, rotation, world, level, simpleName, name, server, entity, resultConsumer, anchor, signingContext, error, chatOutput);
return new SnoopyCommandSource(output, position, rotation, world, level, simpleName, name, server, entity, resultConsumer, anchor, signingContext, taskChainer, error, chatOutput);
}
@Override
public CommandSourceStack withSigningContext(CommandSigningContext commandSigningContext)
public CommandSourceStack withSigningContext(CommandSigningContext commandSigningContext, TaskChainer taskChainer)
{
return new SnoopyCommandSource(output, position, rotation, world, level, simpleName, name, server, entity, resultConsumer, entityAnchor, commandSigningContext, error, chatOutput);
return new SnoopyCommandSource(output, position, rotation, world, level, simpleName, name, server, entity, resultConsumer, entityAnchor, commandSigningContext, taskChainer, error, chatOutput);
}
@Override
@@ -174,7 +179,7 @@ public class SnoopyCommandSource extends CommandSourceStack
{
double d = DimensionType.getTeleportationScale(this.world.dimensionType(), world.dimensionType());
Vec3 position = new Vec3(this.position.x * d, this.position.y, this.position.z * d);
return new SnoopyCommandSource(output, position, rotation, world, level, simpleName, name, server, entity, resultConsumer, entityAnchor, signingContext, error, chatOutput);
return new SnoopyCommandSource(output, position, rotation, world, level, simpleName, name, server, entity, resultConsumer, entityAnchor, signingContext, taskChainer, error, chatOutput);
}
@Override