File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
src/main/java/com/mengcraft/playersql Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change 11package com .mengcraft .playersql ;
22
33import com .comphenix .protocol .utility .StreamSerializer ;
4+ import com .google .common .base .Preconditions ;
45import com .mengcraft .playersql .internal .IPacketDataSerializer ;
56import io .netty .buffer .PooledByteBufAllocator ;
67import io .netty .buffer .Unpooled ;
@@ -52,6 +53,9 @@ public static ItemStack deserialize(String input) {
5253 ItemStack output ;
5354 try (IPacketDataSerializer serializer = PACKET_DATA_SERIALIZER_FACTORY .create (Unpooled .wrappedBuffer (Base64 .getDecoder ().decode (input )))) {
5455 output = serializer .readItemStack ();
56+ } catch (io .netty .handler .codec .EncoderException e ) {// upgrade from below 2.9?
57+ Preconditions .checkState (Bukkit .getPluginManager ().isPluginEnabled ("ProtocolLib" ), "protocollib not found" );
58+ output = StreamSerializer .getDefault ().deserializeItemStack (input );
5559 }
5660 return output ;
5761 }
You can’t perform that action at this time.
0 commit comments