13
0
geforkt von Mirrors/Velocity

Forge is confirmed working

Dieser Commit ist enthalten in:
Andrew Steinborn 2019-07-03 22:45:25 -04:00
Ursprung 11a86e9bb9
Commit fba3bfb0be
3 geänderte Dateien mit 9 neuen und 5 gelöschten Zeilen

Datei anzeigen

@ -1,6 +1,7 @@
package com.velocitypowered.proxy.command;
import com.google.common.base.Preconditions;
import com.google.common.base.Splitter;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.velocitypowered.api.command.Command;
@ -157,6 +158,7 @@ public class VelocityCommandManager implements CommandManager {
private static class RegularCommandWrapper implements RawCommand {
private static final Splitter ARGS_SPLITTER = Splitter.on(' ').omitEmptyStrings();
private final Command delegate;
private RegularCommandWrapper(Command delegate) {
@ -165,17 +167,19 @@ public class VelocityCommandManager implements CommandManager {
@Override
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
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
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) {

Datei anzeigen

@ -167,7 +167,7 @@ public class TransitionSessionHandler implements MinecraftSessionHandler {
return true;
}
serverConn.getPlayer().getMinecraftConnection().write(packet);
serverConn.getPlayer().getMinecraftConnection().write(packet.retain());
return true;
}

Datei anzeigen

@ -26,7 +26,7 @@ public class InitialConnectSessionHandler implements MinecraftSessionHandler {
} else if (PluginMessageUtil.isUnregister(packet)) {
player.getKnownChannels().removeAll(PluginMessageUtil.getChannels(packet));
}
serverConn.ensureConnected().write(packet);
serverConn.ensureConnected().write(packet.retain());
}
return true;
}