|
@@ -140,7 +140,7 @@ public class BlockListener implements Listener {
|
|
|
movedBlock = block.getRelative(direction);
|
|
|
|
|
|
if(BlockUtils.isWithinWorldBounds(movedBlock)) {
|
|
|
- mcMMO.getPlaceStore().setTrue(movedBlock);
|
|
|
+ BlockUtils.setUnnaturalBlock(block);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -166,12 +166,13 @@ public class BlockListener implements Listener {
|
|
|
|
|
|
//Spigot makes bad things happen in its API
|
|
|
if(BlockUtils.isWithinWorldBounds(movedBlock)) {
|
|
|
- mcMMO.getPlaceStore().setTrue(movedBlock);
|
|
|
+ BlockUtils.setUnnaturalBlock(movedBlock);
|
|
|
}
|
|
|
|
|
|
for (Block block : event.getBlocks()) {
|
|
|
- if(BlockUtils.isWithinWorldBounds(block)) {
|
|
|
- mcMMO.getPlaceStore().setTrue(block.getRelative(direction));
|
|
|
+ if(BlockUtils.isWithinWorldBounds(block) && BlockUtils.isWithinWorldBounds(block.getRelative(direction))) {
|
|
|
+ Block relativeBlock = block.getRelative(direction);
|
|
|
+ BlockUtils.setUnnaturalBlock(relativeBlock);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -189,14 +190,13 @@ public class BlockListener implements Listener {
|
|
|
if(WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld()))
|
|
|
return;
|
|
|
|
|
|
-
|
|
|
BlockState blockState = event.getNewState();
|
|
|
|
|
|
if(ExperienceConfig.getInstance().isSnowExploitPrevented() && BlockUtils.shouldBeWatched(blockState)) {
|
|
|
Block block = blockState.getBlock();
|
|
|
|
|
|
if(BlockUtils.isWithinWorldBounds(block)) {
|
|
|
- mcMMO.getPlaceStore().setTrue(block);
|
|
|
+ BlockUtils.setUnnaturalBlock(block);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -217,8 +217,9 @@ public class BlockListener implements Listener {
|
|
|
BlockState newState = event.getNewState();
|
|
|
|
|
|
if(newState.getType() != Material.OBSIDIAN && ExperienceConfig.getInstance().doesBlockGiveSkillXP(PrimarySkillType.MINING, newState.getBlockData())) {
|
|
|
- if(BlockUtils.isWithinWorldBounds(newState.getBlock())) {
|
|
|
- mcMMO.getPlaceStore().setTrue(newState);
|
|
|
+ Block block = newState.getBlock();
|
|
|
+ if(BlockUtils.isWithinWorldBounds(block)) {
|
|
|
+ BlockUtils.setUnnaturalBlock(block);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -245,7 +246,7 @@ public class BlockListener implements Listener {
|
|
|
if(BlockUtils.isWithinWorldBounds(block)) {
|
|
|
//NOTE: BlockMultiPlace has its own logic so don't handle anything that would overlap
|
|
|
if (!(event instanceof BlockMultiPlaceEvent)) {
|
|
|
- mcMMO.getPlaceStore().setTrue(blockState);
|
|
|
+ BlockUtils.setUnnaturalBlock(block);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -289,8 +290,8 @@ public class BlockListener implements Listener {
|
|
|
}
|
|
|
|
|
|
//Track unnatural blocks
|
|
|
- for(BlockState replacedStates : event.getReplacedBlockStates()) {
|
|
|
- mcMMO.getPlaceStore().setTrue(replacedStates);
|
|
|
+ for(BlockState replacedState : event.getReplacedBlockStates()) {
|
|
|
+ BlockUtils.setUnnaturalBlock(replacedState.getBlock());
|
|
|
}
|
|
|
}
|
|
|
}
|