@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/commands/CommandDispatcher.java
|
||||
+++ b/net/minecraft/commands/CommandDispatcher.java
|
||||
@@ -119,6 +119,14 @@
|
||||
@@ -120,6 +120,14 @@
|
||||
import net.minecraft.util.profiling.jfr.JvmProfiler;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
public class CommandDispatcher {
|
||||
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
@@ -130,6 +138,7 @@
|
||||
@@ -131,6 +139,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);
|
||||
@@ -218,6 +227,11 @@
|
||||
@@ -220,6 +229,11 @@
|
||||
CommandPublish.register(this.dispatcher);
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
this.dispatcher.setConsumer((commandcontext, flag, i) -> {
|
||||
((CommandListenerWrapper) commandcontext.getSource()).onCommandComplete(commandcontext, flag, i);
|
||||
});
|
||||
@@ -230,12 +244,59 @@
|
||||
@@ -232,12 +246,59 @@
|
||||
return new ParseResults(commandcontextbuilder1, parseresults.getReader(), parseresults.getExceptions());
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
CommandListenerWrapper commandlistenerwrapper = (CommandListenerWrapper) parseresults.getContext().getSource();
|
||||
|
||||
commandlistenerwrapper.getServer().getProfiler().push(() -> {
|
||||
@@ -260,7 +321,7 @@
|
||||
@@ -262,7 +323,7 @@
|
||||
if (commandsyntaxexception.getInput() != null && commandsyntaxexception.getCursor() >= 0) {
|
||||
int j = Math.min(commandsyntaxexception.getInput().length(), commandsyntaxexception.getCursor());
|
||||
IChatMutableComponent ichatmutablecomponent = IChatBaseComponent.empty().withStyle(EnumChatFormat.GRAY).withStyle((chatmodifier) -> {
|
||||
@@ -105,7 +105,7 @@
|
||||
});
|
||||
|
||||
if (j > 10) {
|
||||
@@ -310,11 +371,36 @@
|
||||
@@ -312,11 +373,36 @@
|
||||
}
|
||||
|
||||
public void sendCommands(EntityPlayer entityplayer) {
|
||||
@@ -143,7 +143,7 @@
|
||||
entityplayer.connection.send(new PacketPlayOutCommands(rootcommandnode));
|
||||
}
|
||||
|
||||
@@ -325,7 +411,7 @@
|
||||
@@ -327,7 +413,7 @@
|
||||
CommandNode<CommandListenerWrapper> commandnode2 = (CommandNode) iterator.next();
|
||||
|
||||
if (commandnode2.canUse(commandlistenerwrapper)) {
|
||||
@@ -152,7 +152,7 @@
|
||||
|
||||
argumentbuilder.requires((icompletionprovider) -> {
|
||||
return true;
|
||||
@@ -348,7 +434,7 @@
|
||||
@@ -350,7 +436,7 @@
|
||||
argumentbuilder.redirect((CommandNode) map.get(argumentbuilder.getRedirect()));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/commands/CommandListenerWrapper.java
|
||||
+++ b/net/minecraft/commands/CommandListenerWrapper.java
|
||||
@@ -40,6 +40,8 @@
|
||||
@@ -42,6 +42,8 @@
|
||||
import net.minecraft.world.phys.Vec2F;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
@@ -9,15 +9,15 @@
|
||||
public class CommandListenerWrapper implements ICompletionProvider {
|
||||
|
||||
public static final SimpleCommandExceptionType ERROR_NOT_PLAYER = new SimpleCommandExceptionType(IChatBaseComponent.translatable("permissions.requires.player"));
|
||||
@@ -60,6 +62,7 @@
|
||||
private final Vec2F rotation;
|
||||
@@ -63,6 +65,7 @@
|
||||
private final CommandSigningContext signingContext;
|
||||
private final TaskChainer chatMessageChainer;
|
||||
private final IntConsumer returnValueConsumer;
|
||||
+ public volatile CommandNode currentCommand; // CraftBukkit
|
||||
|
||||
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, (commandcontext, flag, j) -> {
|
||||
@@ -170,9 +173,23 @@
|
||||
@@ -179,9 +182,23 @@
|
||||
|
||||
@Override
|
||||
public boolean hasPermission(int i) {
|
||||
@@ -41,7 +41,7 @@
|
||||
public Vec3D getPosition() {
|
||||
return this.worldPosition;
|
||||
}
|
||||
@@ -298,7 +315,7 @@
|
||||
@@ -318,7 +335,7 @@
|
||||
while (iterator.hasNext()) {
|
||||
EntityPlayer entityplayer = (EntityPlayer) iterator.next();
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
entityplayer.sendSystemMessage(ichatmutablecomponent);
|
||||
}
|
||||
}
|
||||
@@ -371,4 +388,10 @@
|
||||
@@ -391,4 +408,10 @@
|
||||
public FeatureFlagSet enabledFeatures() {
|
||||
return this.level.enabledFeatures();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user