Try to fix forge compatibility

Addresses #825
This commit is contained in:
Dan Mulloy 2020-05-27 21:41:56 -04:00
parent 3f7b7f4bb3
commit e92abda187
No known key found for this signature in database
GPG Key ID: 2B62F7DACFF133E8
2 changed files with 4 additions and 6 deletions

View File

@ -297,9 +297,7 @@ public class ProtocolInjector implements ChannelListener {
PacketContainer container = new PacketContainer(PacketRegistry.getPacketType(clazz), packet); PacketContainer container = new PacketContainer(PacketRegistry.getPacketType(clazz), packet);
return packetQueued(container, injector.getPlayer(), marker); return packetQueued(container, injector.getPlayer(), marker);
} catch (LinkageError e) { } catch (LinkageError e) {
// So far this has been seen when the jar is shared System.err.println("[ProtocolLib] Encountered a LinkageError (likely a misbehaving wrapper), please report this!");
System.err.println("[ProtocolLib] Encountered a LinkageError. Make sure you\'re not using this jar for multiple server instances!");
System.err.println("[ProtocolLib] If you\'re getting this error for other reasons, please report it!");
e.printStackTrace(); e.printStackTrace();
} }
} }

View File

@ -47,7 +47,7 @@ public class BukkitCloner implements Cloner {
if (nmsClass != null) { if (nmsClass != null) {
CLONERS.put(nmsClass, nmsObject -> fromHandle.apply(nmsObject).deepClone().getHandle()); CLONERS.put(nmsClass, nmsObject -> fromHandle.apply(nmsObject).deepClone().getHandle());
} }
} catch (RuntimeException ignored) { } } catch (Throwable ignored) { }
} }
@SuppressWarnings({"unchecked", "rawtypes"}) @SuppressWarnings({"unchecked", "rawtypes"})
@ -57,7 +57,7 @@ public class BukkitCloner implements Cloner {
if (nmsClass != null) { if (nmsClass != null) {
CLONERS.put(nmsClass, nmsObject -> converter.getGeneric(converter.getSpecific(nmsObject))); CLONERS.put(nmsClass, nmsObject -> converter.getGeneric(converter.getSpecific(nmsObject)));
} }
} catch (RuntimeException ignored) { } } catch (Throwable ignored) { }
} }
private static void fromManual(Supplier<Class<?>> getClass, Function<Object, Object> cloner) { private static void fromManual(Supplier<Class<?>> getClass, Function<Object, Object> cloner) {
@ -66,7 +66,7 @@ public class BukkitCloner implements Cloner {
if (nmsClass != null) { if (nmsClass != null) {
CLONERS.put(nmsClass, cloner); CLONERS.put(nmsClass, cloner);
} }
} catch (RuntimeException ignored) { } } catch (Throwable ignored) { }
} }
static { static {