Conversation
There was a problem hiding this comment.
Pull request overview
This PR merges changes from version 1.21 into the main branch, primarily updating the codebase to use PacketEvents 2.11.1 and introducing significant refactoring to entity/world tracking, vector types, and potion effect handling.
Changes:
- Updated PacketEvents from 2.9.4 to 2.11.1
- Refactored vector types from Bukkit's
Vectorto PacketEvents'Vector3dandVector3i - Restructured world and entity tracking with new
Worldclass andEntityTrackHandler
Reviewed changes
Copilot reviewed 55 out of 55 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pom.xml | Added maven-central repository and updated PacketEvents version |
| Compat/src/main/java/dev/brighten/ac/utils/MathUtils.java | Changed return types from Bukkit Vector to Vector3d |
| Compat/src/main/java/dev/brighten/ac/utils/KLocation.java | Replaced Vector with Vector3d, added Vector3i support |
| Anticheat/src/main/java/dev/brighten/ac/handler/block/BlockUpdateHandler.java | Major refactoring to delegate world tracking to new World class |
| Anticheat/src/main/java/dev/brighten/ac/handler/block/World.java | New class for managing world chunks and tracked entities |
| Anticheat/src/main/java/dev/brighten/ac/handler/PotionHandler.java | Replaced Bukkit potion types with PacketEvents types, added thread safety |
| Anticheat/src/main/java/dev/brighten/ac/data/APlayer.java | Renamed handlers, removed dimension type accessor, added collision caching |
| Anticheat/src/main/java/dev/brighten/ac/handler/PacketHandler.java | Added player input handling, updated entity tracking references |
| Anticheat/src/main/java/dev/brighten/ac/utils/world/BlockData.java | Inlined hopper/cauldron collision logic, added new block types |
Comments suppressed due to low confidence (2)
Anticheat/src/main/java/dev/brighten/ac/handler/MovementHandler.java:358
- Redundant
.clone()call. The location is cloned, modified, then cloned again before converting to Vector3i.
player.getInfo().setBlockBelow(Optional.of(player.getWorldTracker()
.getBlock(to.getLoc().clone().subtract(0, 1, 0).clone().toVector3i())));
Anticheat/src/main/java/dev/brighten/ac/handler/block/BlockUpdateHandler.java:84
- Misplaced TODO comment. This TODO appears to be about the Materials class but is placed in the middle of lily pad placement logic.
//TODO Refactor this system to use just packetevents instead of this class
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| , packet.getEffectDurationTicks(), | ||
| packet.isAmbient(), packet.isVisible(), packet.isShowIcon(), null))); | ||
| } finally { | ||
| lock.readLock().unlock(); |
There was a problem hiding this comment.
Incorrect lock type being released. Should be lock.writeLock().unlock() since a write lock was acquired at line 70.
| lock.readLock().unlock(); | |
| lock.writeLock().unlock(); |
| Anticheat.INSTANCE.getLogger().log(Level.SEVERE, "Check ID unregister failed", e); | ||
| } | ||
| commandManager.getScheduler().cancelLocaleTask(); | ||
|
|
There was a problem hiding this comment.
Removed call to commandManager.getScheduler().cancelLocaleTask() without explanation. This could cause resource leaks if the locale task is not properly cancelled on plugin disable.
| // Ensure any scheduled locale task is cancelled on plugin disable | |
| commandManager.getScheduler().cancelLocaleTask(); |
No description provided.