Skip to content

Commit

Permalink
1.18.20 - Burrow bypass
Browse files Browse the repository at this point in the history
  • Loading branch information
moom0o committed Oct 10, 2021
1 parent 82bec12 commit 709f49d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>me.moomoo</groupId>
<artifactId>anarchyexploitfixes</artifactId>
<version>1.18.19</version>
<version>1.18.20</version>
<packaging>jar</packaging>

<name>AnarchyExploitFixes</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,19 @@ public void onPacketReceiving(PacketEvent event) {
}
}
});
// Bypass
protocolManager.addPacketListener(
new PacketAdapter(plugin, ListenerPriority.NORMAL, PacketType.Play.Client.USE_ITEM) {
@Override
public void onPacketReceiving(PacketEvent event) {
if (event.getPacketType() == PacketType.Play.Client.USE_ITEM) {
final BlockPosition packetLocation = event.getPacket().getBlockPositionModifier().read(0);
if (event.getPlayer().getLocation().distance(packetLocation.toLocation(event.getPlayer().getWorld())) > plugin.getConfig().getInt("NoComMaxDistance")) {
event.setCancelled(true);
}
}
}
});
}
}
}

0 comments on commit 709f49d

Please sign in to comment.