move mojang api server patches up

This commit is contained in:
Jake 2021-11-23 17:16:01 -08:00 committed by MiniDigger | Martin
parent e481692afd
commit d9c1c30c58
2 changed files with 14 additions and 14 deletions

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Async command map building
diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java
index 780f46c8fdbaafaca6babfa34ebd97f420d0d612..07c4d909324c8aad3a8c5d27811e2c28fe7a91f3 100644
index cc2337ee8a00fab8919a61324899113370bc5018..b28dc3f176221a6d6efb35af11b54777299b9242 100644
--- a/src/main/java/net/minecraft/commands/Commands.java
+++ b/src/main/java/net/minecraft/commands/Commands.java
@@ -29,6 +29,7 @@ import net.minecraft.network.chat.MutableComponent;
@@ -30,6 +30,7 @@ import net.minecraft.network.chat.MutableComponent;
import net.minecraft.network.chat.TextComponent;
import net.minecraft.network.chat.TranslatableComponent;
import net.minecraft.network.protocol.game.ClientboundCommandsPacket;
@ -16,7 +16,7 @@ index 780f46c8fdbaafaca6babfa34ebd97f420d0d612..07c4d909324c8aad3a8c5d27811e2c28
import net.minecraft.server.commands.AdvancementCommands;
import net.minecraft.server.commands.AttributeCommand;
import net.minecraft.server.commands.BanIpCommands;
@@ -335,6 +336,14 @@ public class Commands {
@@ -344,6 +345,14 @@ public class Commands {
if ( org.spigotmc.SpigotConfig.tabComplete < 0 ) return; // Spigot
// CraftBukkit start
// Register Vanilla commands into builtRoot as before
@ -31,7 +31,7 @@ index 780f46c8fdbaafaca6babfa34ebd97f420d0d612..07c4d909324c8aad3a8c5d27811e2c28
Map<CommandNode<CommandSourceStack>, CommandNode<SharedSuggestionProvider>> map = Maps.newIdentityHashMap(); // Use identity to prevent aliasing issues
RootCommandNode vanillaRoot = new RootCommandNode();
@@ -352,7 +361,14 @@ public class Commands {
@@ -361,7 +370,14 @@ public class Commands {
for (CommandNode node : rootcommandnode.getChildren()) {
bukkit.add(node.getName());
}

View File

@ -10,7 +10,7 @@ Adds CommandRegisteredEvent
- Allows manipulating the CommandNode to add more children/metadata for the client
diff --git a/build.gradle.kts b/build.gradle.kts
index 24465fa59dd9eeff82ad620731fadcb19910aa4e..053e65679dd44f3d1c669ef560f07554af09086b 100644
index 7fc074f63d1c3b3cf09bb5f95fd7bc5c0968a5de..44f5a30a16f3d5604cd99bb39c8d744bb607d923 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -16,6 +16,7 @@ repositories {
@ -22,10 +22,10 @@ index 24465fa59dd9eeff82ad620731fadcb19910aa4e..053e65679dd44f3d1c669ef560f07554
implementation("org.jline:jline-terminal-jansi:3.21.0")
implementation("net.minecrell:terminalconsoleappender:1.3.0")
diff --git a/src/main/java/net/minecraft/commands/CommandSourceStack.java b/src/main/java/net/minecraft/commands/CommandSourceStack.java
index 880fc9fea286384d002518137972935fdf1d2d72..a59d14e61fcbca7861a5593d0717b81262ccbdc5 100644
index 9f79c949d18c1ff3bdb49780fcecfc75366a8ff6..530a09fa3c9155459c6a4519e3412408ae658145 100644
--- a/src/main/java/net/minecraft/commands/CommandSourceStack.java
+++ b/src/main/java/net/minecraft/commands/CommandSourceStack.java
@@ -37,7 +37,7 @@ import net.minecraft.world.phys.Vec2;
@@ -38,7 +38,7 @@ import net.minecraft.world.phys.Vec2;
import net.minecraft.world.phys.Vec3;
import com.mojang.brigadier.tree.CommandNode; // CraftBukkit
@ -34,7 +34,7 @@ index 880fc9fea286384d002518137972935fdf1d2d72..a59d14e61fcbca7861a5593d0717b812
public static final SimpleCommandExceptionType ERROR_NOT_PLAYER = new SimpleCommandExceptionType(new TranslatableComponent("permissions.requires.player"));
public static final SimpleCommandExceptionType ERROR_NOT_ENTITY = new SimpleCommandExceptionType(new TranslatableComponent("permissions.requires.entity"));
@@ -153,6 +153,25 @@ public class CommandSourceStack implements SharedSuggestionProvider {
@@ -155,6 +155,25 @@ public class CommandSourceStack implements SharedSuggestionProvider {
return this.textName;
}
@ -61,10 +61,10 @@ index 880fc9fea286384d002518137972935fdf1d2d72..a59d14e61fcbca7861a5593d0717b812
public boolean hasPermission(int level) {
// CraftBukkit start
diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java
index 07c4d909324c8aad3a8c5d27811e2c28fe7a91f3..96a33f63024c1f72ab018e15904505832430002c 100644
index b28dc3f176221a6d6efb35af11b54777299b9242..6624045921ef64046b375ec787cadda1e8c8435b 100644
--- a/src/main/java/net/minecraft/commands/Commands.java
+++ b/src/main/java/net/minecraft/commands/Commands.java
@@ -362,6 +362,7 @@ public class Commands {
@@ -371,6 +371,7 @@ public class Commands {
bukkit.add(node.getName());
}
// Paper start - Async command map building
@ -72,7 +72,7 @@ index 07c4d909324c8aad3a8c5d27811e2c28fe7a91f3..96a33f63024c1f72ab018e1590450583
MinecraftServer.getServer().execute(() -> {
runSync(player, bukkit, rootcommandnode);
});
@@ -369,6 +370,7 @@ public class Commands {
@@ -378,6 +379,7 @@ public class Commands {
private void runSync(ServerPlayer player, Collection<String> bukkit, RootCommandNode<SharedSuggestionProvider> rootcommandnode) {
// Paper end - Async command map building
@ -81,10 +81,10 @@ index 07c4d909324c8aad3a8c5d27811e2c28fe7a91f3..96a33f63024c1f72ab018e1590450583
event.getPlayer().getServer().getPluginManager().callEvent(event);
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 9fc196ada8dc3b9b9a8f3f35ac6b07c949ce2339..3071053aa9c6a9abc2af50b3c370a408cddbac85 100644
index 2d2b1a293a1359ffa6d33635856406a909c452ce..be5f7b5e8537aa3bf4088fa8c2e9d6cce17c64ac 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -759,8 +759,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -747,8 +747,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
ParseResults<CommandSourceStack> parseresults = this.server.getCommands().getDispatcher().parse(stringreader, this.player.createCommandSourceStack());
this.server.getCommands().getDispatcher().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> {
@ -99,7 +99,7 @@ index 9fc196ada8dc3b9b9a8f3f35ac6b07c949ce2339..3071053aa9c6a9abc2af50b3c370a408
});
});
}
@@ -769,7 +773,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -757,7 +761,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
builder = builder.createOffset(builder.getInput().lastIndexOf(' ') + 1);
completions.forEach(builder::suggest);