Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-12-24 15:20:35 +01:00
Forge is confirmed working
Dieser Commit ist enthalten in:
Ursprung
11a86e9bb9
Commit
fba3bfb0be
@ -1,6 +1,7 @@
|
|||||||
package com.velocitypowered.proxy.command;
|
package com.velocitypowered.proxy.command;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
|
import com.google.common.base.Splitter;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import com.velocitypowered.api.command.Command;
|
import com.velocitypowered.api.command.Command;
|
||||||
@ -157,6 +158,7 @@ public class VelocityCommandManager implements CommandManager {
|
|||||||
|
|
||||||
private static class RegularCommandWrapper implements RawCommand {
|
private static class RegularCommandWrapper implements RawCommand {
|
||||||
|
|
||||||
|
private static final Splitter ARGS_SPLITTER = Splitter.on(' ').omitEmptyStrings();
|
||||||
private final Command delegate;
|
private final Command delegate;
|
||||||
|
|
||||||
private RegularCommandWrapper(Command delegate) {
|
private RegularCommandWrapper(Command delegate) {
|
||||||
@ -165,17 +167,19 @@ public class VelocityCommandManager implements CommandManager {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(CommandSource source, String commandLine) {
|
public void execute(CommandSource source, String commandLine) {
|
||||||
delegate.execute(source, commandLine.split(" ", -1));
|
delegate.execute(source, ARGS_SPLITTER.splitToList(commandLine).toArray(new String[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> suggest(CommandSource source, String currentLine) {
|
public List<String> suggest(CommandSource source, String currentLine) {
|
||||||
return delegate.suggest(source, currentLine.split(" ", -1));
|
return delegate.suggest(source, ARGS_SPLITTER.splitToList(currentLine)
|
||||||
|
.toArray(new String[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasPermission(CommandSource source, String commandLine) {
|
public boolean hasPermission(CommandSource source, String commandLine) {
|
||||||
return delegate.hasPermission(source, commandLine.split(" ", -1));
|
return delegate.hasPermission(source, ARGS_SPLITTER.splitToList(commandLine)
|
||||||
|
.toArray(new String[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
static RawCommand wrap(Command command) {
|
static RawCommand wrap(Command command) {
|
||||||
|
@ -167,7 +167,7 @@ public class TransitionSessionHandler implements MinecraftSessionHandler {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
serverConn.getPlayer().getMinecraftConnection().write(packet);
|
serverConn.getPlayer().getMinecraftConnection().write(packet.retain());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ public class InitialConnectSessionHandler implements MinecraftSessionHandler {
|
|||||||
} else if (PluginMessageUtil.isUnregister(packet)) {
|
} else if (PluginMessageUtil.isUnregister(packet)) {
|
||||||
player.getKnownChannels().removeAll(PluginMessageUtil.getChannels(packet));
|
player.getKnownChannels().removeAll(PluginMessageUtil.getChannels(packet));
|
||||||
}
|
}
|
||||||
serverConn.ensureConnected().write(packet);
|
serverConn.ensureConnected().write(packet.retain());
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren