mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-12-30 17:57:53 +01:00
parent
d8e7c9805b
commit
64063463ec
@ -51,6 +51,9 @@ public class PlotInventory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public PlotItemStack getItem(int index) {
|
public PlotItemStack getItem(int index) {
|
||||||
|
if (index < 0 || index >= items.length) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return items[index];
|
return items[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -913,13 +913,16 @@ public class BukkitChunkManager extends ChunkManager {
|
|||||||
final int tz = pos2.getZ();
|
final int tz = pos2.getZ();
|
||||||
for (final Entity entity : entities) {
|
for (final Entity entity : entities) {
|
||||||
if (entity instanceof Player) {
|
if (entity instanceof Player) {
|
||||||
final Player player = (Player) entity;
|
org.bukkit.Location loc = entity.getLocation();
|
||||||
final PlotPlayer pp = BukkitUtil.getPlayer(player);
|
if (loc.getX() >= bx && loc.getX() <= tx && loc.getZ() >= bz && loc.getZ() <= tz) {
|
||||||
Plot plot = pp.getCurrentPlot();
|
final Player player = (Player) entity;
|
||||||
if (plot != null) {
|
final PlotPlayer pp = BukkitUtil.getPlayer(player);
|
||||||
final Location plotHome = MainUtil.getDefaultHome(plot);
|
Plot plot = pp.getCurrentPlot();
|
||||||
if (pp.getLocation().getY() <= plotHome.getY()) {
|
if (plot != null) {
|
||||||
pp.teleport(plotHome);
|
final Location plotHome = MainUtil.getDefaultHome(plot);
|
||||||
|
if (pp.getLocation().getY() <= plotHome.getY()) {
|
||||||
|
pp.teleport(plotHome);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user