Issue#128: EntityChangeBlockEvent not causing block updates
parent
9b6ce3679d
commit
c1f346237a
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
<groupId>com.lishid</groupId>
|
<groupId>com.lishid</groupId>
|
||||||
<artifactId>orebfuscator</artifactId>
|
<artifactId>orebfuscator</artifactId>
|
||||||
<version>4.1.7-SNAPSHOT</version>
|
<version>4.1.8-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>Orebfuscator4</name>
|
<name>Orebfuscator4</name>
|
||||||
|
|
|
@ -32,7 +32,6 @@ import org.bukkit.Material;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.configuration.file.FileConfiguration;
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.metadata.FixedMetadataValue;
|
|
||||||
|
|
||||||
import com.lishid.orebfuscator.cache.ObfuscatedDataCache;
|
import com.lishid.orebfuscator.cache.ObfuscatedDataCache;
|
||||||
|
|
||||||
|
|
|
@ -33,19 +33,15 @@ import com.lishid.orebfuscator.obfuscation.BlockUpdate;
|
||||||
|
|
||||||
public class OrebfuscatorBlockListener implements Listener {
|
public class OrebfuscatorBlockListener implements Listener {
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR)
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
public void onBlockBreak(BlockBreakEvent event) {
|
public void onBlockBreak(BlockBreakEvent event) {
|
||||||
if (event.isCancelled()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
BlockUpdate.update(event.getBlock());
|
BlockUpdate.update(event.getBlock());
|
||||||
BlockHitManager.breakBlock(event.getPlayer(), event.getBlock());
|
BlockHitManager.breakBlock(event.getPlayer(), event.getBlock());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR)
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
public void onBlockDamage(BlockDamageEvent event) {
|
public void onBlockDamage(BlockDamageEvent event) {
|
||||||
if (event.isCancelled() || !OrebfuscatorConfig.UpdateOnDamage) {
|
if (!OrebfuscatorConfig.UpdateOnDamage) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,12 +56,8 @@ public class OrebfuscatorBlockListener implements Listener {
|
||||||
BlockUpdate.update(event.getBlock());
|
BlockUpdate.update(event.getBlock());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR)
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
public void onBlockPhysics(BlockPhysicsEvent event) {
|
public void onBlockPhysics(BlockPhysicsEvent event) {
|
||||||
if (event.isCancelled()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (event.getBlock().getType() != Material.SAND && event.getBlock().getType() != Material.GRAVEL) {
|
if (event.getBlock().getType() != Material.SAND && event.getBlock().getType() != Material.GRAVEL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -77,21 +69,13 @@ public class OrebfuscatorBlockListener implements Listener {
|
||||||
BlockUpdate.update(event.getBlock());
|
BlockUpdate.update(event.getBlock());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR)
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
public void onBlockPistonExtend(BlockPistonExtendEvent event) {
|
public void onBlockPistonExtend(BlockPistonExtendEvent event) {
|
||||||
if (event.isCancelled()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
BlockUpdate.update(event.getBlocks());
|
BlockUpdate.update(event.getBlocks());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR)
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
public void onBlockPistonRetract(BlockPistonRetractEvent event) {
|
public void onBlockPistonRetract(BlockPistonRetractEvent event) {
|
||||||
if (event.isCancelled()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
BlockUpdate.update(event.getBlock());
|
BlockUpdate.update(event.getBlock());
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -24,12 +24,13 @@ import org.bukkit.event.entity.*;
|
||||||
import com.lishid.orebfuscator.obfuscation.BlockUpdate;
|
import com.lishid.orebfuscator.obfuscation.BlockUpdate;
|
||||||
|
|
||||||
public class OrebfuscatorEntityListener implements Listener {
|
public class OrebfuscatorEntityListener implements Listener {
|
||||||
@EventHandler(priority = EventPriority.MONITOR)
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
public void onEntityExplode(EntityExplodeEvent event) {
|
public void onEntityExplode(EntityExplodeEvent event) {
|
||||||
if (event.isCancelled()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
BlockUpdate.update(event.blockList());
|
BlockUpdate.update(event.blockList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
|
public void onEntityChangeBlock(EntityChangeBlockEvent event) {
|
||||||
|
BlockUpdate.update(event.getBlock());
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -38,7 +38,7 @@ import com.lishid.orebfuscator.obfuscation.BlockUpdate;
|
||||||
import com.lishid.orebfuscator.obfuscation.ProximityHider;
|
import com.lishid.orebfuscator.obfuscation.ProximityHider;
|
||||||
|
|
||||||
public class OrebfuscatorPlayerListener implements Listener {
|
public class OrebfuscatorPlayerListener implements Listener {
|
||||||
@EventHandler(priority = EventPriority.NORMAL)
|
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
||||||
public void onPlayerJoin(PlayerJoinEvent event) {
|
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||||
Player player = event.getPlayer();
|
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) {
|
public void onPlayerQuit(PlayerQuitEvent event) {
|
||||||
BlockHitManager.clearHistory(event.getPlayer());
|
BlockHitManager.clearHistory(event.getPlayer());
|
||||||
if (OrebfuscatorConfig.UseProximityHider) {
|
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) {
|
public void onPlayerInteract(PlayerInteractEvent event) {
|
||||||
if (event.getAction() != Action.RIGHT_CLICK_BLOCK || event.useInteractedBlock() == Result.DENY)
|
if (event.getAction() != Action.RIGHT_CLICK_BLOCK || event.useInteractedBlock() == Result.DENY)
|
||||||
return;
|
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) {
|
public void onPlayerChangeWorld(PlayerChangedWorldEvent event) {
|
||||||
BlockHitManager.clearHistory(event.getPlayer());
|
BlockHitManager.clearHistory(event.getPlayer());
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue