1212public class RemoteItemPickup extends AEFModule implements Listener {
1313
1414 private final double maxWidthX , maxHeight , maxWidthZ ;
15- private final boolean kickPlayer ;
15+ private final boolean kickPlayer , log ;
1616
1717 public RemoteItemPickup () {
1818 super ("patches.remote-item-pickup-exploit" , false ,
1919 "EXPERIMENTAL!\n " +
2020 "Attempts to patch an exploit where players are able to expand their own\n " +
2121 "hitbox, leading to them being able to pick up items at remote locations.\n " +
2222 "NOTE: This isn't entirely verified yet. Any feedback is appreciated." );
23+ this .log = config .getBoolean (configPath + ".log" , true );
2324 this .maxHeight = config .getDouble (configPath + ".max-height" , 4.0 );
2425 this .maxWidthX = config .getDouble (configPath + ".max-width-X" , 4.0 );
2526 this .maxWidthZ = config .getDouble (configPath + ".max-width-Z" , 4.0 );
@@ -45,6 +46,7 @@ public void disable() {
4546 @ EventHandler (priority = EventPriority .HIGHEST , ignoreCancelled = true )
4647 private void on (PlayerAttemptPickupItemEvent event ) {
4748 if (EntityUtil .isBoundingBoxTooLarge (event .getPlayer (), maxWidthX , maxWidthZ , maxHeight )) {
49+ if (log ) info ("Player " + event .getPlayer ().getName () + " tried to pickup an item but has a too large hitbox!" );
4850 event .setCancelled (true );
4951 if (kickPlayer ) {
5052 event .getPlayer ().kickPlayer (AnarchyExploitFixes .translation (event .getPlayer ()).misc_MaskedKickMessage );
0 commit comments