Skip to content

Commit

Permalink
patch other altered field
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Dec 14, 2018
1 parent 8e9eb3d commit 738a75e
Showing 1 changed file with 20 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1437,17 +1437,26 @@ public static SoundEffect getSoundEffect(NPC npc, SoundEffect snd, String meta)
}

public static void initNetworkManager(NetworkManager network) {
if (NETWORK_ADDRESS == null)
return;
network.channel = new EmptyChannel(null);
SocketAddress socketAddress = new SocketAddress() {
private static final long serialVersionUID = 8207338859896320185L;
};
try {
network.channel = new EmptyChannel(null);
NETWORK_ADDRESS.set(network, new SocketAddress() {
private static final long serialVersionUID = 8207338859896320185L;
});
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
network.socketAddress = socketAddress;
}
catch (NoSuchFieldError ex) {
if (NETWORK_ADDRESS == null) {
return;
}
try {
NETWORK_ADDRESS.set(network, socketAddress);
}
catch (IllegalArgumentException e) {
e.printStackTrace();
}
catch (IllegalAccessException e) {
e.printStackTrace();
}
}
}

Expand Down Expand Up @@ -1573,7 +1582,7 @@ public static void updateNavigation(NavigationAbstract navigation) {
private static final Field JUMP_FIELD = NMS.getField(EntityLiving.class, "bg");
private static Method MAKE_REQUEST;
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);
private static Field PATHFINDING_RANGE = NMS.getField(NavigationAbstract.class, "p");
private static final Field RABBIT_FIELD = NMS.getField(EntityRabbit.class, "bC");
Expand Down

0 comments on commit 738a75e

Please sign in to comment.