Fix ProtocolLib compatibility

This commit is contained in:
Minecrell 2014-09-01 15:36:00 -05:00 committed by Zach Brown
parent 72142b3f8d
commit 85eb25863a
2 changed files with 54 additions and 0 deletions

View File

@ -0,0 +1,25 @@
From 40dad27b03d2c402a7c3ca130ad8df3b86aa5cc9 Mon Sep 17 00:00:00 2001
From: Zach Brown <Zbob750@live.com>
Date: Mon, 1 Sep 2014 15:33:27 -0500
Subject: [PATCH] Allow ProtocolLib to be enabled
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
index c7ad532..b3002e8 100644
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
@@ -133,11 +133,6 @@ public final class SimplePluginManager implements PluginManager {
description = loader.getPluginDescription(file);
String name = description.getName();
// Spigot Start
- if ( name.equalsIgnoreCase( "ProtocolLib" ) )
- {
- server.getLogger().log( Level.WARNING, "Skipping loading of ProtocolLib as it does not work with Spigot 1.8 builds!" );
- continue;
- }
if ( name.equalsIgnoreCase( "Orebfuscator" ) )
{
server.getLogger().log( Level.WARNING, "Skipping loading of Orebfuscator as it does not work with Spigot 1.8 builds!" );
--
1.9.1

View File

@ -0,0 +1,29 @@
From 2bed385eff3e829e3d2d9de35b5093d6f0853512 Mon Sep 17 00:00:00 2001
From: Minecrell <dev@minecrell.net>
Date: Mon, 1 Sep 2014 15:33:57 -0500
Subject: [PATCH] Fix for ProtocolLib compatibility
diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java
index 6d579e3..98b0979 100644
--- a/src/main/java/net/minecraft/server/NetworkManager.java
+++ b/src/main/java/net/minecraft/server/NetworkManager.java
@@ -250,7 +250,14 @@ public class NetworkManager extends SimpleChannelInboundHandler {
// Spigot start - protocol patch
public void enableCompression() {
- m.pipeline().addBefore( "decoder", "decompress", new SpigotDecompressor() );
+ // PaperSpigot start - Fix ProtocolLib compatibility
+ if ( m.pipeline().get("protocol_lib_decoder") != null ) {
+ m.pipeline().addBefore( "protocol_lib_decoder", "decompress", new SpigotDecompressor() );
+ } else {
+ m.pipeline().addBefore( "decoder", "decompress", new SpigotDecompressor() );
+ }
+ // PaperSpigot end
+
m.pipeline().addBefore( "encoder", "compress", new SpigotCompressor() );
}
// Spigot end
--
1.9.1