Skip to content

Commit

Permalink
fix packed methods condition
Browse files Browse the repository at this point in the history
  • Loading branch information
alvindimas05 committed Aug 13, 2024
1 parent a311fa5 commit 60c2c27
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .idea/modules/lagassist.test.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .idea/modules/org.alvindimas05.lagassist.lagassist.main.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ public static void Enabler() {
return;
}
try {
PacketInjector.playerConnection = Reflection.getClass(VersionMgr.isV_17Plus() ? "{nms}.level.EntityPlayer" : "{nms}.EntityPlayer").getField(VersionMgr.isV_17Plus() ? "b" : "playerConnection");
PacketInjector.networkManager = Reflection.getClass(VersionMgr.isV_17Plus() ? "{nms}.network.PlayerConnection" : "{nms}.PlayerConnection").getField(VersionMgr.isV_17Plus() ? "a" : "networkManager");

PacketInjector.channel = Reflection.getClass(VersionMgr.isV_17Plus() ? "{nm}.network.NetworkManager" : "{nms}.NetworkManager").getField(VersionMgr.isV_17Plus() ? "k" : "channel");

if(VersionMgr.isV_21Plus()){
if(VersionMgr.isV_20Plus()){
PacketInjector.playerConnection = Reflection.getClass("{nms}.level.EntityPlayer").getField("c");
PacketInjector.networkManager = Reflection.getClass("{nms}.network.PlayerConnection").getField("e");

PacketInjector.channel = Reflection.getClass(VersionMgr.isV_17Plus() ? "{nm}.network.NetworkManager" : "{nms}.NetworkManager").getField("n");
} else {
PacketInjector.playerConnection = Reflection.getClass(VersionMgr.isV_17Plus() ? "{nms}.level.EntityPlayer" : "{nms}.EntityPlayer").getField(VersionMgr.isV_17Plus() ? "b" : "playerConnection");
PacketInjector.networkManager = Reflection.getClass(VersionMgr.isV_17Plus() ? "{nms}.network.PlayerConnection" : "{nms}.PlayerConnection").getField(VersionMgr.isV_17Plus() ? "a" : "networkManager");

PacketInjector.channel = Reflection.getClass(VersionMgr.isV_17Plus() ? "{nm}.network.NetworkManager" : "{nms}.NetworkManager").getField(VersionMgr.isV_17Plus() ? "k" : "channel");
}

PacketInjector.refreshSessions();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ public static boolean isV_17Plus() {
return isV1_17() || isV1_18() || isV1_19() || isV1_20() || isV1_21();
}

public static boolean isV_21Plus() {
return isV1_21();
public static boolean isV_20Plus() {
return isV1_20() || isV1_21();
}

public static boolean isNewMaterials() {
Expand Down

0 comments on commit 60c2c27

Please sign in to comment.