Update to Minecraft 1.21.2

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2024-10-23 02:15:00 +11:00
parent 2c4beb962b
commit d3a23f42c3
522 changed files with 8501 additions and 6477 deletions

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/commands/CommandDispatcher.java
+++ b/net/minecraft/commands/CommandDispatcher.java
@@ -135,6 +135,14 @@
@@ -139,6 +139,14 @@
import net.minecraft.world.level.GameRules;
import org.slf4j.Logger;
@@ -15,7 +15,7 @@
public class CommandDispatcher {
private static final ThreadLocal<ExecutionContext<CommandListenerWrapper>> CURRENT_EXECUTION_CONTEXT = new ThreadLocal();
@@ -147,6 +155,7 @@
@@ -151,6 +159,7 @@
private final com.mojang.brigadier.CommandDispatcher<CommandListenerWrapper> dispatcher = new com.mojang.brigadier.CommandDispatcher();
public CommandDispatcher(CommandDispatcher.ServerType commanddispatcher_servertype, CommandBuildContext commandbuildcontext) {
@@ -23,7 +23,7 @@
CommandAdvancement.register(this.dispatcher);
CommandAttribute.register(this.dispatcher, commandbuildcontext);
CommandExecute.register(this.dispatcher, commandbuildcontext);
@@ -247,6 +256,11 @@
@@ -252,6 +261,11 @@
CommandPublish.register(this.dispatcher);
}
@@ -35,7 +35,7 @@
this.dispatcher.setConsumer(ExecutionCommandSource.resultConsumer());
}
@@ -257,18 +271,65 @@
@@ -262,18 +276,65 @@
return new ParseResults(commandcontextbuilder1, parseresults.getReader(), parseresults.getExceptions());
}
@@ -95,7 +95,7 @@
+ public void performCommand(ParseResults<CommandListenerWrapper> parseresults, String s, String label) { // CraftBukkit
CommandListenerWrapper commandlistenerwrapper = (CommandListenerWrapper) parseresults.getContext().getSource();
commandlistenerwrapper.getServer().getProfiler().push(() -> {
Profiler.get().push(() -> {
return "/" + s;
});
- ContextChain<CommandListenerWrapper> contextchain = finishParsing(parseresults, s, commandlistenerwrapper);
@@ -103,7 +103,7 @@
try {
if (contextchain != null) {
@@ -302,7 +363,7 @@
@@ -307,7 +368,7 @@
}
@Nullable
@@ -112,7 +112,7 @@
try {
validateParseResults(parseresults);
return (ContextChain) ContextChain.tryFlatten(parseresults.getContext().build(s)).orElseThrow(() -> {
@@ -313,7 +374,7 @@
@@ -318,7 +379,7 @@
if (commandsyntaxexception.getInput() != null && commandsyntaxexception.getCursor() >= 0) {
int i = Math.min(commandsyntaxexception.getInput().length(), commandsyntaxexception.getCursor());
IChatMutableComponent ichatmutablecomponent = IChatBaseComponent.empty().withStyle(EnumChatFormat.GRAY).withStyle((chatmodifier) -> {
@@ -121,7 +121,7 @@
});
if (i > 10) {
@@ -363,7 +424,7 @@
@@ -368,7 +429,7 @@
executioncontext1.close();
} finally {
@@ -130,7 +130,7 @@
}
} else {
consumer.accept(executioncontext);
@@ -372,11 +433,36 @@
@@ -377,11 +438,36 @@
}
public void sendCommands(EntityPlayer entityplayer) {
@@ -168,7 +168,7 @@
entityplayer.connection.send(new PacketPlayOutCommands(rootcommandnode));
}
@@ -387,7 +473,7 @@
@@ -392,7 +478,7 @@
CommandNode<CommandListenerWrapper> commandnode2 = (CommandNode) iterator.next();
if (commandnode2.canUse(commandlistenerwrapper)) {
@@ -177,7 +177,7 @@
argumentbuilder.requires((icompletionprovider) -> {
return true;
@@ -410,7 +496,7 @@
@@ -415,7 +501,7 @@
argumentbuilder.redirect((CommandNode) map.get(argumentbuilder.getRedirect()));
}
@@ -186,7 +186,7 @@
map.put(commandnode2, commandnode3);
commandnode1.addChild(commandnode3);
@@ -471,7 +557,7 @@
@@ -481,7 +567,7 @@
}
private <T> HolderLookup.b.a<T> createLookup(final HolderLookup.b<T> holderlookup_b) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/commands/CommandListenerWrapper.java
+++ b/net/minecraft/commands/CommandListenerWrapper.java
@@ -44,6 +44,8 @@
@@ -46,6 +46,8 @@
import net.minecraft.world.phys.Vec2F;
import net.minecraft.world.phys.Vec3D;
@@ -9,7 +9,7 @@
public class CommandListenerWrapper implements ExecutionCommandSource<CommandListenerWrapper>, ICompletionProvider {
public static final SimpleCommandExceptionType ERROR_NOT_PLAYER = new SimpleCommandExceptionType(IChatBaseComponent.translatable("permissions.requires.player"));
@@ -63,6 +65,7 @@
@@ -65,6 +67,7 @@
private final Vec2F rotation;
private final CommandSigningContext signingContext;
private final TaskChainer chatMessageChainer;
@@ -17,7 +17,7 @@
public CommandListenerWrapper(ICommandListener icommandlistener, Vec3D vec3d, Vec2F vec2f, WorldServer worldserver, int i, String s, IChatBaseComponent ichatbasecomponent, MinecraftServer minecraftserver, @Nullable Entity entity) {
this(icommandlistener, vec3d, vec2f, worldserver, i, s, ichatbasecomponent, minecraftserver, entity, false, CommandResultCallback.EMPTY, ArgumentAnchor.Anchor.FEET, CommandSigningContext.ANONYMOUS, TaskChainer.immediate(minecraftserver));
@@ -169,9 +172,23 @@
@@ -171,9 +174,23 @@
@Override
public boolean hasPermission(int i) {
@@ -41,16 +41,16 @@
public Vec3D getPosition() {
return this.worldPosition;
}
@@ -300,7 +317,7 @@
@@ -302,7 +319,7 @@
while (iterator.hasNext()) {
EntityPlayer entityplayer = (EntityPlayer) iterator.next();
- if (entityplayer != this.source && this.server.getPlayerList().isOp(entityplayer.getGameProfile())) {
+ if (entityplayer != this.source && entityplayer.getBukkitEntity().hasPermission("minecraft.admin.command_feedback")) { // CraftBukkit
- if (entityplayer.commandSource() != this.source && this.server.getPlayerList().isOp(entityplayer.getGameProfile())) {
+ if (entityplayer.commandSource() != this.source && entityplayer.getBukkitEntity().hasPermission("minecraft.admin.command_feedback")) { // CraftBukkit
entityplayer.sendSystemMessage(ichatmutablecomponent);
}
}
@@ -393,4 +410,10 @@
@@ -400,4 +417,10 @@
public boolean isSilent() {
return this.silent;
}