mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-08-26 07:45:34 +02:00
Some random bukkitutil/worldutil improvements
This commit is contained in:

committed by
Alexander Söderberg

parent
932052772c
commit
d077fafd29
@@ -171,7 +171,7 @@ import static com.plotsquared.core.util.entity.EntityCategories.CAP_VEHICLE;
|
||||
if (X > bx && X < tx && Z > bz && Z < tz) {
|
||||
count(count, entity);
|
||||
} else {
|
||||
Plot other = area.getPlot(BukkitUtil.getLocation(location));
|
||||
Plot other = area.getPlot(BukkitUtil.adapt(location));
|
||||
if (plot.equals(other)) {
|
||||
count(count, entity);
|
||||
}
|
||||
@@ -186,7 +186,7 @@ import static com.plotsquared.core.util.entity.EntityCategories.CAP_VEHICLE;
|
||||
Entity[] entities1 = chunk.getEntities();
|
||||
for (Entity entity : entities1) {
|
||||
if (X == bx || X == tx || Z == bz || Z == tz) {
|
||||
Plot other = area.getPlot(BukkitUtil.getLocation(entity));
|
||||
Plot other = area.getPlot(BukkitUtil.adapt(entity.getLocation()));
|
||||
if (plot.equals(other)) {
|
||||
count(count, entity);
|
||||
}
|
||||
@@ -411,7 +411,15 @@ import static com.plotsquared.core.util.entity.EntityCategories.CAP_VEHICLE;
|
||||
|
||||
@Override public void clearAllEntities(Location pos1, Location pos2) {
|
||||
String world = pos1.getWorldName();
|
||||
List<Entity> entities = BukkitUtil.getEntities(world);
|
||||
|
||||
final World bukkitWorld = BukkitUtil.getWorld(world);
|
||||
final List<Entity> entities;
|
||||
if (bukkitWorld != null) {
|
||||
entities = new ArrayList<>(bukkitWorld.getEntities());
|
||||
} else {
|
||||
entities = new ArrayList<>();
|
||||
}
|
||||
|
||||
int bx = pos1.getX();
|
||||
int bz = pos1.getZ();
|
||||
int tx = pos2.getX();
|
||||
|
Reference in New Issue
Block a user