Skip to content

Commit e92abda

Browse files
committed
Try to fix forge compatibility
Addresses #825
1 parent 3f7b7f4 commit e92abda

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/main/java/com/comphenix/protocol/injector/netty/ProtocolInjector.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,9 +297,7 @@ public PacketEvent onPacketSending(Injector injector, Object packet, NetworkMark
297297
PacketContainer container = new PacketContainer(PacketRegistry.getPacketType(clazz), packet);
298298
return packetQueued(container, injector.getPlayer(), marker);
299299
} catch (LinkageError e) {
300-
// So far this has been seen when the jar is shared
301-
System.err.println("[ProtocolLib] Encountered a LinkageError. Make sure you\'re not using this jar for multiple server instances!");
302-
System.err.println("[ProtocolLib] If you\'re getting this error for other reasons, please report it!");
300+
System.err.println("[ProtocolLib] Encountered a LinkageError (likely a misbehaving wrapper), please report this!");
303301
e.printStackTrace();
304302
}
305303
}

src/main/java/com/comphenix/protocol/reflect/cloning/BukkitCloner.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ private static void fromWrapper(Supplier<Class<?>> getClass, Function<Object, Cl
4747
if (nmsClass != null) {
4848
CLONERS.put(nmsClass, nmsObject -> fromHandle.apply(nmsObject).deepClone().getHandle());
4949
}
50-
} catch (RuntimeException ignored) { }
50+
} catch (Throwable ignored) { }
5151
}
5252

5353
@SuppressWarnings({"unchecked", "rawtypes"})
@@ -57,7 +57,7 @@ private static void fromConverter(Supplier<Class<?>> getClass, EquivalentConvert
5757
if (nmsClass != null) {
5858
CLONERS.put(nmsClass, nmsObject -> converter.getGeneric(converter.getSpecific(nmsObject)));
5959
}
60-
} catch (RuntimeException ignored) { }
60+
} catch (Throwable ignored) { }
6161
}
6262

6363
private static void fromManual(Supplier<Class<?>> getClass, Function<Object, Object> cloner) {
@@ -66,7 +66,7 @@ private static void fromManual(Supplier<Class<?>> getClass, Function<Object, Obj
6666
if (nmsClass != null) {
6767
CLONERS.put(nmsClass, cloner);
6868
}
69-
} catch (RuntimeException ignored) { }
69+
} catch (Throwable ignored) { }
7070
}
7171

7272
static {

0 commit comments

Comments
 (0)