mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-10 17:52:02 -07:00
@@ -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) {
|
||||
|
Reference in New Issue
Block a user