Skip to content

Commit

Permalink
Fix XP duplication exploit with land claiming plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
Archy-X committed Jun 19, 2024
1 parent 6c72f32 commit 25f6ecf
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void checkPlace(BlockPlaceEvent event) {
regionManager.addPlacedBlock(block);
}

@EventHandler
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onSandFall(EntityChangeBlockEvent event) {
Block block = event.getBlock();
if (!regionManager.isPlacedBlock(block)) return;
Expand Down Expand Up @@ -113,15 +113,15 @@ public void checkBreak(BlockBreakEvent event) {
checkSupportSide(block);
}

@EventHandler
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onBlockPistonExtend(BlockPistonExtendEvent event) {
for (Block block : event.getBlocks()) {
regionManager.addPlacedBlock(block.getRelative(event.getDirection()));
}
regionManager.removePlacedBlock(event.getBlock().getRelative(event.getDirection()));
}

@EventHandler
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onBlockPistonRetract(BlockPistonRetractEvent event) {
Block lastBlock = event.getBlock();
for (Block block : event.getBlocks()) {
Expand All @@ -135,7 +135,7 @@ public void onBlockPistonRetract(BlockPistonRetractEvent event) {
regionManager.removePlacedBlock(lastBlock);
}

@EventHandler
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onStructureGrow(StructureGrowEvent event) {
int growY = event.getLocation().getBlockY();
for (BlockState state : event.getBlocks()) {
Expand Down

0 comments on commit 25f6ecf

Please sign in to comment.