patch other altered field

This commit is contained in:
mcmonkey 2018-12-14 15:24:28 -08:00
parent 8e9eb3d373
commit 738a75e5c9
No known key found for this signature in database
GPG Key ID: 2F0F11928478A6F5

View File

@ -1437,17 +1437,26 @@ public class NMSImpl implements NMSBridge {
} }
public static void initNetworkManager(NetworkManager network) { public static void initNetworkManager(NetworkManager network) {
if (NETWORK_ADDRESS == null) network.channel = new EmptyChannel(null);
return; SocketAddress socketAddress = new SocketAddress() {
private static final long serialVersionUID = 8207338859896320185L;
};
try { try {
network.channel = new EmptyChannel(null); network.socketAddress = socketAddress;
NETWORK_ADDRESS.set(network, new SocketAddress() { }
private static final long serialVersionUID = 8207338859896320185L; catch (NoSuchFieldError ex) {
}); if (NETWORK_ADDRESS == null) {
} catch (IllegalArgumentException e) { return;
e.printStackTrace(); }
} catch (IllegalAccessException e) { try {
e.printStackTrace(); NETWORK_ADDRESS.set(network, socketAddress);
}
catch (IllegalArgumentException e) {
e.printStackTrace();
}
catch (IllegalAccessException e) {
e.printStackTrace();
}
} }
} }
@ -1573,7 +1582,7 @@ public class NMSImpl implements NMSBridge {
private static final Field JUMP_FIELD = NMS.getField(EntityLiving.class, "bg"); private static final Field JUMP_FIELD = NMS.getField(EntityLiving.class, "bg");
private static Method MAKE_REQUEST; private static Method MAKE_REQUEST;
private static Field NAVIGATION_WORLD_FIELD = NMS.getField(NavigationAbstract.class, "b"); private static Field NAVIGATION_WORLD_FIELD = NMS.getField(NavigationAbstract.class, "b");
public static Field NETWORK_ADDRESS = NMS.getField(NetworkManager.class, "l"); public static Field NETWORK_ADDRESS = NMS.getField(NetworkManager.class, "l", false);
public static final Location PACKET_CACHE_LOCATION = new Location(null, 0, 0, 0); public static final Location PACKET_CACHE_LOCATION = new Location(null, 0, 0, 0);
private static Field PATHFINDING_RANGE = NMS.getField(NavigationAbstract.class, "p"); private static Field PATHFINDING_RANGE = NMS.getField(NavigationAbstract.class, "p");
private static final Field RABBIT_FIELD = NMS.getField(EntityRabbit.class, "bC"); private static final Field RABBIT_FIELD = NMS.getField(EntityRabbit.class, "bC");