Issue#128: EntityChangeBlockEvent not causing block updates

master
Aleksey-Terzi 2016-09-05 16:03:29 +03:00
parent 9b6ce3679d
commit c1f346237a
5 changed files with 17 additions and 33 deletions

View File

@ -4,7 +4,7 @@
<groupId>com.lishid</groupId>
<artifactId>orebfuscator</artifactId>
<version>4.1.7-SNAPSHOT</version>
<version>4.1.8-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Orebfuscator4</name>

View File

@ -32,7 +32,6 @@ import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.metadata.FixedMetadataValue;
import com.lishid.orebfuscator.cache.ObfuscatedDataCache;

View File

@ -33,19 +33,15 @@ import com.lishid.orebfuscator.obfuscation.BlockUpdate;
public class OrebfuscatorBlockListener implements Listener {
@EventHandler(priority = EventPriority.MONITOR)
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onBlockBreak(BlockBreakEvent event) {
if (event.isCancelled()) {
return;
}
BlockUpdate.update(event.getBlock());
BlockHitManager.breakBlock(event.getPlayer(), event.getBlock());
}
@EventHandler(priority = EventPriority.MONITOR)
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onBlockDamage(BlockDamageEvent event) {
if (event.isCancelled() || !OrebfuscatorConfig.UpdateOnDamage) {
if (!OrebfuscatorConfig.UpdateOnDamage) {
return;
}
@ -60,12 +56,8 @@ public class OrebfuscatorBlockListener implements Listener {
BlockUpdate.update(event.getBlock());
}
@EventHandler(priority = EventPriority.MONITOR)
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onBlockPhysics(BlockPhysicsEvent event) {
if (event.isCancelled()) {
return;
}
if (event.getBlock().getType() != Material.SAND && event.getBlock().getType() != Material.GRAVEL) {
return;
}
@ -77,21 +69,13 @@ public class OrebfuscatorBlockListener implements Listener {
BlockUpdate.update(event.getBlock());
}
@EventHandler(priority = EventPriority.MONITOR)
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onBlockPistonExtend(BlockPistonExtendEvent event) {
if (event.isCancelled()) {
return;
}
BlockUpdate.update(event.getBlocks());
}
@EventHandler(priority = EventPriority.MONITOR)
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onBlockPistonRetract(BlockPistonRetractEvent event) {
if (event.isCancelled()) {
return;
}
BlockUpdate.update(event.getBlock());
}
}

View File

@ -24,12 +24,13 @@ import org.bukkit.event.entity.*;
import com.lishid.orebfuscator.obfuscation.BlockUpdate;
public class OrebfuscatorEntityListener implements Listener {
@EventHandler(priority = EventPriority.MONITOR)
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onEntityExplode(EntityExplodeEvent event) {
if (event.isCancelled()) {
return;
}
BlockUpdate.update(event.blockList());
}
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onEntityChangeBlock(EntityChangeBlockEvent event) {
BlockUpdate.update(event.getBlock());
}
}

View File

@ -38,7 +38,7 @@ import com.lishid.orebfuscator.obfuscation.BlockUpdate;
import com.lishid.orebfuscator.obfuscation.ProximityHider;
public class OrebfuscatorPlayerListener implements Listener {
@EventHandler(priority = EventPriority.NORMAL)
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onPlayerJoin(PlayerJoinEvent event) {
Player player = event.getPlayer();
@ -55,7 +55,7 @@ public class OrebfuscatorPlayerListener implements Listener {
}
}
@EventHandler(priority = EventPriority.NORMAL)
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onPlayerQuit(PlayerQuitEvent event) {
BlockHitManager.clearHistory(event.getPlayer());
if (OrebfuscatorConfig.UseProximityHider) {
@ -63,7 +63,7 @@ public class OrebfuscatorPlayerListener implements Listener {
}
}
@EventHandler(priority = EventPriority.MONITOR)
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onPlayerInteract(PlayerInteractEvent event) {
if (event.getAction() != Action.RIGHT_CLICK_BLOCK || event.useInteractedBlock() == Result.DENY)
return;
@ -81,7 +81,7 @@ public class OrebfuscatorPlayerListener implements Listener {
}
}
@EventHandler(priority = EventPriority.MONITOR)
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onPlayerChangeWorld(PlayerChangedWorldEvent event) {
BlockHitManager.clearHistory(event.getPlayer());