This commit is contained in:
Jesse Boyd 2016-12-23 15:33:19 +11:00
parent a843203ca3
commit 6ec96870c0
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
3 changed files with 13 additions and 14 deletions

View File

@ -544,7 +544,7 @@ public class PlayerEvents extends PlotListener implements Listener {
return; return;
} }
Integer border = area.getBorder(); Integer border = area.getBorder();
if (x2 > border) { if (x2 > border && this.tmpTeleport) {
to.setX(x2 - 1); to.setX(x2 - 1);
this.tmpTeleport = false; this.tmpTeleport = false;
player.teleport(event.getTo()); player.teleport(event.getTo());
@ -552,7 +552,7 @@ public class PlayerEvents extends PlotListener implements Listener {
MainUtil.sendMessage(pp, C.BORDER); MainUtil.sendMessage(pp, C.BORDER);
return; return;
} }
if (x2 < -border) { if (x2 < -border && this.tmpTeleport) {
to.setX(x2 + 1); to.setX(x2 + 1);
this.tmpTeleport = false; this.tmpTeleport = false;
player.teleport(event.getTo()); player.teleport(event.getTo());
@ -606,13 +606,13 @@ public class PlayerEvents extends PlotListener implements Listener {
return; return;
} }
Integer border = area.getBorder(); Integer border = area.getBorder();
if (z2 > border) { if (z2 > border && this.tmpTeleport) {
to.setZ(z2 - 1); to.setZ(z2 - 1);
this.tmpTeleport = false; this.tmpTeleport = false;
player.teleport(event.getTo()); player.teleport(event.getTo());
this.tmpTeleport = true; this.tmpTeleport = true;
MainUtil.sendMessage(pp, C.BORDER); MainUtil.sendMessage(pp, C.BORDER);
} else if (z2 < -border) { } else if (z2 < -border && this.tmpTeleport) {
to.setZ(z2 + 1); to.setZ(z2 + 1);
this.tmpTeleport = false; this.tmpTeleport = false;
player.teleport(event.getTo()); player.teleport(event.getTo());

View File

@ -1,7 +1,5 @@
package com.plotsquared.bukkit.util.block; 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.ChunkLoc;
import com.intellectualcrafters.plot.object.ChunkWrapper; import com.intellectualcrafters.plot.object.ChunkWrapper;
import com.intellectualcrafters.plot.object.PseudoRandom; 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.TaskManager;
import com.intellectualcrafters.plot.util.block.BasicLocalBlockQueue; import com.intellectualcrafters.plot.util.block.BasicLocalBlockQueue;
import com.plotsquared.bukkit.util.SendChunk; 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.Field;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.ArrayList; import java.util.ArrayList;
@ -25,6 +18,13 @@ import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.Map; import java.util.Map;
import java.util.Set; 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<char[]> { public class BukkitLocalQueue_1_8_3 extends BukkitLocalQueue<char[]> {
@ -276,7 +276,7 @@ public class BukkitLocalQueue_1_8_3 extends BukkitLocalQueue<char[]> {
Field tileEntities = clazz.getDeclaredField("tileEntities"); Field tileEntities = clazz.getDeclaredField("tileEntities");
Field entitySlices = clazz.getDeclaredField("entitySlices"); Field entitySlices = clazz.getDeclaredField("entitySlices");
Object[] sections = (Object[]) sections1.get(c); Object[] sections = (Object[]) sections1.get(c);
HashMap<?, ?> tiles = (HashMap<?, ?>) tileEntities.get(c); Map<?, ?> tiles = (Map<?, ?>) tileEntities.get(c);
Collection<?>[] entities = (Collection<?>[]) entitySlices.get(c); Collection<?>[] entities = (Collection<?>[]) entitySlices.get(c);
Method getX = null; Method getX = null;

View File

@ -9,7 +9,6 @@ import java.lang.reflect.Field;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
@ -254,7 +253,7 @@ public class BukkitLocalQueue_1_9 extends BukkitLocalQueue<char[]> {
Field tf = clazz.getDeclaredField("tileEntities"); Field tf = clazz.getDeclaredField("tileEntities");
Field entitySlices = clazz.getDeclaredField("entitySlices"); Field entitySlices = clazz.getDeclaredField("entitySlices");
Object[] sections = (Object[]) sf.get(c); Object[] sections = (Object[]) sf.get(c);
HashMap<?, ?> tiles = (HashMap<?, ?>) tf.get(c); Map<?, ?> tiles = (Map<?, ?>) tf.get(c);
Collection<?>[] entities = (Collection<?>[]) entitySlices.get(c); Collection<?>[] entities = (Collection<?>[]) entitySlices.get(c);
Method xm = null; Method xm = null;