This commit is contained in:
creeper123123321 2019-05-29 14:57:17 -03:00
parent 7d225cfa4e
commit 6aaa206bb9
No known key found for this signature in database
GPG Key ID: 0AC57D54786721D1
2 changed files with 1 additions and 39 deletions

View File

@ -3,7 +3,7 @@ import org.apache.tools.ant.filters.ReplaceTokens
plugins { plugins {
id("java") id("java")
id("net.minecrell.licenser") version "0.4.1" id("net.minecrell.licenser") version "0.4.1"
id("fabric-loom") version "0.2.3-SNAPSHOT" id("fabric-loom") version "0.2.4-SNAPSHOT"
id("com.palantir.git-version") version "0.12.0-rc2" id("com.palantir.git-version") version "0.12.0-rc2"
} }

View File

@ -44,44 +44,6 @@ public class ClientSideReference extends Protocol {
@Override @Override
protected void registerPackets() { protected void registerPackets() {
// Plugin Message
registerOutgoing(State.PLAY, 0x18, 0x18, new PacketRemapper() {
@Override
public void registerMap() {
handler(new PacketHandler() {
@Override
public void handle(PacketWrapper wrapper) throws Exception {
String channel = wrapper.passthrough(Type.STRING);
try {
new Identifier(channel);
} catch (InvalidIdentifierException ex) {
Via.getPlatform().getLogger().warning("Ignoring invalid custom payload identifier: " + ex.getMessage());
wrapper.set(Type.STRING, 0, "viafabric:invalid");
return;
}
if (channel.equals("minecraft:register") || channel.equals("minecraft:unregister")) {
String[] channels = new String(wrapper.read(Type.REMAINING_BYTES), StandardCharsets.UTF_8).split("\0");
List<String> filteredChannels = new LinkedList<>();
for (String c : channels) {
try {
new Identifier(c);
} catch (InvalidIdentifierException ex) {
Via.getPlatform().getLogger().warning("Ignoring invalid custom payload identifier in " + channel + ": " + ex.getMessage());
continue;
}
filteredChannels.add(c);
}
wrapper.write(Type.REMAINING_BYTES, Joiner.on('\0').join(filteredChannels).getBytes(StandardCharsets.UTF_8));
}
}
});
}
});
} }
@Override @Override