Fix plot redstone disabling (not sure why it was the way it was, but it was never going to work, so I fixed? it)

also minor reformat to PlayerEvents
This commit is contained in:
dordsor21 2018-12-28 17:25:29 +00:00
parent 750be6c5fe
commit 3156741664

View File

@ -58,8 +58,7 @@ import java.util.regex.Pattern;
/**
* Player Events involving plots.
*/
@SuppressWarnings("unused")
public class PlayerEvents extends PlotListener implements Listener {
@SuppressWarnings("unused") public class PlayerEvents extends PlotListener implements Listener {
private boolean pistonBlocks = true;
private float lastRadius;
@ -237,10 +236,9 @@ public class PlayerEvents extends PlotListener implements Listener {
}
}
@EventHandler
public void onRedstoneEvent(BlockRedstoneEvent event) {
@EventHandler public void onRedstoneEvent(BlockRedstoneEvent event) {
Block block = event.getBlock();
switch (block.getType()) {
/* switch (block.getType()) {
case OBSERVER:
case REDSTONE:
case REDSTONE_ORE:
@ -286,7 +284,7 @@ public class PlayerEvents extends PlotListener implements Listener {
case OAK_FENCE_GATE:
case POWERED_RAIL:
return;
default:
default:*/
Location loc = BukkitUtil.getLocation(block.getLocation());
PlotArea area = loc.getPlotArea();
if (area == null) {
@ -334,7 +332,7 @@ public class PlayerEvents extends PlotListener implements Listener {
}
event.setNewCurrent(0);
}
}
//}
}
@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST)
@ -416,8 +414,7 @@ public class PlayerEvents extends PlotListener implements Listener {
}
}
@EventHandler
public void onProjectileLaunch(ProjectileLaunchEvent event) {
@EventHandler public void onProjectileLaunch(ProjectileLaunchEvent event) {
Projectile entity = event.getEntity();
if (!(entity instanceof ThrownPotion)) {
return;
@ -438,8 +435,7 @@ public class PlayerEvents extends PlotListener implements Listener {
}
}
@EventHandler
public boolean onProjectileHit(ProjectileHitEvent event) {
@EventHandler public boolean onProjectileHit(ProjectileHitEvent event) {
Projectile entity = event.getEntity();
Location loc = BukkitUtil.getLocation(entity);
if (!PlotSquared.get().hasPlotArea(loc.getWorld())) {
@ -850,8 +846,7 @@ public class PlayerEvents extends PlotListener implements Listener {
}
}
@EventHandler(priority = EventPriority.LOW)
public void onChat(AsyncPlayerChatEvent event) {
@EventHandler(priority = EventPriority.LOW) public void onChat(AsyncPlayerChatEvent event) {
if (event.isCancelled())
return;
@ -903,8 +898,7 @@ public class PlayerEvents extends PlotListener implements Listener {
PlotSquared.debug(full);
}
@EventHandler(priority = EventPriority.LOWEST)
public void blockDestroy(BlockBreakEvent event) {
@EventHandler(priority = EventPriority.LOWEST) public void blockDestroy(BlockBreakEvent event) {
Player player = event.getPlayer();
Location location = BukkitUtil.getLocation(event.getBlock().getLocation());
PlotArea area = location.getPlotArea();
@ -2073,8 +2067,7 @@ public class PlayerEvents extends PlotListener implements Listener {
}
}
@EventHandler
public void onPrime(ExplosionPrimeEvent event) {
@EventHandler public void onPrime(ExplosionPrimeEvent event) {
this.lastRadius = event.getRadius() + 1;
}
@ -2234,8 +2227,7 @@ public class PlayerEvents extends PlotListener implements Listener {
PlotInventory.removePlotInventoryOpen(BukkitUtil.getPlayer(player));
}
@EventHandler(priority = EventPriority.MONITOR)
public void onLeave(PlayerQuitEvent event) {
@EventHandler(priority = EventPriority.MONITOR) public void onLeave(PlayerQuitEvent event) {
TaskManager.TELEPORT_QUEUE.remove(event.getPlayer().getName());
PlotPlayer pp = BukkitUtil.getPlayer(event.getPlayer());
pp.unregister();
@ -2523,8 +2515,7 @@ public class PlayerEvents extends PlotListener implements Listener {
}
}
@SuppressWarnings("deprecation")
@EventHandler(priority = EventPriority.HIGHEST)
@SuppressWarnings("deprecation") @EventHandler(priority = EventPriority.HIGHEST)
public void onEntityCombustByEntity(EntityCombustByEntityEvent event) {
EntityDamageByEntityEvent eventChange = null;
eventChange = new EntityDamageByEntityEvent(event.getCombuster(), event.getEntity(),