diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java index 5faadc20b..851cfed6d 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java @@ -544,7 +544,7 @@ public class PlayerEvents extends PlotListener implements Listener { return; } Integer border = area.getBorder(); - if (x2 > border) { + if (x2 > border && this.tmpTeleport) { to.setX(x2 - 1); this.tmpTeleport = false; player.teleport(event.getTo()); @@ -552,7 +552,7 @@ public class PlayerEvents extends PlotListener implements Listener { MainUtil.sendMessage(pp, C.BORDER); return; } - if (x2 < -border) { + if (x2 < -border && this.tmpTeleport) { to.setX(x2 + 1); this.tmpTeleport = false; player.teleport(event.getTo()); @@ -606,13 +606,13 @@ public class PlayerEvents extends PlotListener implements Listener { return; } Integer border = area.getBorder(); - if (z2 > border) { + if (z2 > border && this.tmpTeleport) { to.setZ(z2 - 1); this.tmpTeleport = false; player.teleport(event.getTo()); this.tmpTeleport = true; MainUtil.sendMessage(pp, C.BORDER); - } else if (z2 < -border) { + } else if (z2 < -border && this.tmpTeleport) { to.setZ(z2 + 1); this.tmpTeleport = false; player.teleport(event.getTo()); diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/util/block/BukkitLocalQueue_1_8_3.java b/Bukkit/src/main/java/com/plotsquared/bukkit/util/block/BukkitLocalQueue_1_8_3.java index bf829c074..90982a1cc 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/util/block/BukkitLocalQueue_1_8_3.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/util/block/BukkitLocalQueue_1_8_3.java @@ -1,7 +1,5 @@ package com.plotsquared.bukkit.util.block; -import static com.intellectualcrafters.plot.util.ReflectionUtils.getRefClass; - import com.intellectualcrafters.plot.object.ChunkLoc; import com.intellectualcrafters.plot.object.ChunkWrapper; import com.intellectualcrafters.plot.object.PseudoRandom; @@ -11,11 +9,6 @@ import com.intellectualcrafters.plot.util.ReflectionUtils; import com.intellectualcrafters.plot.util.TaskManager; import com.intellectualcrafters.plot.util.block.BasicLocalBlockQueue; import com.plotsquared.bukkit.util.SendChunk; -import org.bukkit.Bukkit; -import org.bukkit.Chunk; -import org.bukkit.Material; -import org.bukkit.World; - import java.lang.reflect.Field; import java.lang.reflect.Method; import java.util.ArrayList; @@ -25,6 +18,13 @@ import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Set; +import org.bukkit.Bukkit; +import org.bukkit.Chunk; +import org.bukkit.Material; +import org.bukkit.World; + + +import static com.intellectualcrafters.plot.util.ReflectionUtils.getRefClass; public class BukkitLocalQueue_1_8_3 extends BukkitLocalQueue { @@ -276,7 +276,7 @@ public class BukkitLocalQueue_1_8_3 extends BukkitLocalQueue { Field tileEntities = clazz.getDeclaredField("tileEntities"); Field entitySlices = clazz.getDeclaredField("entitySlices"); Object[] sections = (Object[]) sections1.get(c); - HashMap tiles = (HashMap) tileEntities.get(c); + Map tiles = (Map) tileEntities.get(c); Collection[] entities = (Collection[]) entitySlices.get(c); Method getX = null; diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/util/block/BukkitLocalQueue_1_9.java b/Bukkit/src/main/java/com/plotsquared/bukkit/util/block/BukkitLocalQueue_1_9.java index 485bb53d9..580c7f664 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/util/block/BukkitLocalQueue_1_9.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/util/block/BukkitLocalQueue_1_9.java @@ -9,7 +9,6 @@ import java.lang.reflect.Field; import java.lang.reflect.Method; import java.util.Arrays; import java.util.Collection; -import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Set; @@ -254,7 +253,7 @@ public class BukkitLocalQueue_1_9 extends BukkitLocalQueue { Field tf = clazz.getDeclaredField("tileEntities"); Field entitySlices = clazz.getDeclaredField("entitySlices"); Object[] sections = (Object[]) sf.get(c); - HashMap tiles = (HashMap) tf.get(c); + Map tiles = (Map) tf.get(c); Collection[] entities = (Collection[]) entitySlices.get(c); Method xm = null;