Update to Minecraft 1.21

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2024-06-14 01:05:00 +10:00
parent 7c6204e1a9
commit eed041d629
255 changed files with 3585 additions and 3261 deletions

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/commands/CommandDispatcher.java
+++ b/net/minecraft/commands/CommandDispatcher.java
@@ -136,6 +136,14 @@
@@ -135,6 +135,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();
@@ -148,6 +156,7 @@
@@ -147,6 +155,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);
@@ -249,6 +258,11 @@
@@ -247,6 +256,11 @@
CommandPublish.register(this.dispatcher);
}
@@ -35,7 +35,7 @@
this.dispatcher.setConsumer(ExecutionCommandSource.resultConsumer());
}
@@ -259,18 +273,65 @@
@@ -257,18 +271,65 @@
return new ParseResults(commandcontextbuilder1, parseresults.getReader(), parseresults.getExceptions());
}
@@ -103,7 +103,7 @@
try {
if (contextchain != null) {
@@ -304,7 +365,7 @@
@@ -302,7 +363,7 @@
}
@Nullable
@@ -112,7 +112,7 @@
try {
validateParseResults(parseresults);
return (ContextChain) ContextChain.tryFlatten(parseresults.getContext().build(s)).orElseThrow(() -> {
@@ -315,7 +376,7 @@
@@ -313,7 +374,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) {
@@ -365,7 +426,7 @@
@@ -363,7 +424,7 @@
executioncontext1.close();
} finally {
@@ -130,7 +130,7 @@
}
} else {
consumer.accept(executioncontext);
@@ -374,11 +435,36 @@
@@ -372,11 +433,36 @@
}
public void sendCommands(EntityPlayer entityplayer) {
@@ -168,7 +168,7 @@
entityplayer.connection.send(new PacketPlayOutCommands(rootcommandnode));
}
@@ -389,7 +475,7 @@
@@ -387,7 +473,7 @@
CommandNode<CommandListenerWrapper> commandnode2 = (CommandNode) iterator.next();
if (commandnode2.canUse(commandlistenerwrapper)) {
@@ -177,7 +177,7 @@
argumentbuilder.requires((icompletionprovider) -> {
return true;
@@ -412,7 +498,7 @@
@@ -410,7 +496,7 @@
argumentbuilder.redirect((CommandNode) map.get(argumentbuilder.getRedirect()));
}
@@ -186,7 +186,7 @@
map.put(commandnode2, commandnode3);
commandnode1.addChild(commandnode3);
@@ -473,7 +559,7 @@
@@ -471,7 +557,7 @@
}
private <T> HolderLookup.b.a<T> createLookup(final HolderLookup.b<T> holderlookup_b) {