mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-07-20 14:24:44 +02:00
restructure a couple things.
This commit is contained in:
@ -61,7 +61,7 @@ public class AugmentedPopulator implements Populator {
|
||||
this.b = b;
|
||||
o = (plotworld.TERRAIN == 1) || (plotworld.TERRAIN == 2);
|
||||
if (cluster != null) {
|
||||
final Location bl = manager.getPlotBottomLocAbs(plotworld, cluster.getP1());
|
||||
final Location bl = manager.getPlotBottomLocAbs(plotworld, cluster.getP1()).subtract(1, 0, 1);
|
||||
final Location tl = manager.getPlotTopLocAbs(plotworld, cluster.getP2()).add(1, 0, 1);
|
||||
bx = bl.getX();
|
||||
bz = bl.getZ();
|
||||
|
@ -27,9 +27,6 @@ public class SpongeBasicGen extends SpongePlotGenerator {
|
||||
|
||||
/**
|
||||
* Some generator specific variables (implementation dependent)
|
||||
*
|
||||
* TODO USE THESE
|
||||
*
|
||||
*/
|
||||
public int plotsize;
|
||||
public int pathsize;
|
||||
|
@ -93,6 +93,7 @@ public class MainListener {
|
||||
* - HangingBreakEvent
|
||||
* - Liquid flow
|
||||
* - PVP
|
||||
* - block dispense
|
||||
* - PVE
|
||||
* - VehicleDestroy
|
||||
* - Projectile
|
||||
@ -164,7 +165,7 @@ public class MainListener {
|
||||
return;
|
||||
}
|
||||
if (mobs == null) {
|
||||
mobs = ChunkManager.manager.countEntities(plot);
|
||||
mobs = MainUtil.countEntities(plot);
|
||||
}
|
||||
if (mobs[3] >= cap) {
|
||||
event.setCancelled(true);
|
||||
@ -180,7 +181,7 @@ public class MainListener {
|
||||
return;
|
||||
}
|
||||
if (mobs == null) {
|
||||
mobs = ChunkManager.manager.countEntities(plot);
|
||||
mobs = MainUtil.countEntities(plot);
|
||||
}
|
||||
if (mobs[1] >= cap) {
|
||||
event.setCancelled(true);
|
||||
@ -197,7 +198,7 @@ public class MainListener {
|
||||
return;
|
||||
}
|
||||
if (mobs == null) {
|
||||
mobs = ChunkManager.manager.countEntities(plot);
|
||||
mobs = MainUtil.countEntities(plot);
|
||||
}
|
||||
if (mobs[2] >= cap) {
|
||||
event.setCancelled(true);
|
||||
@ -216,7 +217,7 @@ public class MainListener {
|
||||
return;
|
||||
}
|
||||
if (mobs == null) {
|
||||
mobs = ChunkManager.manager.countEntities(plot);
|
||||
mobs = MainUtil.countEntities(plot);
|
||||
}
|
||||
if (mobs[4] >= cap) {
|
||||
event.setCancelled(true);
|
||||
@ -232,7 +233,7 @@ public class MainListener {
|
||||
return;
|
||||
}
|
||||
if (mobs == null) {
|
||||
mobs = ChunkManager.manager.countEntities(plot);
|
||||
mobs = MainUtil.countEntities(plot);
|
||||
}
|
||||
if (mobs[0] >= cap) {
|
||||
event.setCancelled(true);
|
||||
@ -266,7 +267,6 @@ public class MainListener {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
// TODO
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
@ -519,7 +519,7 @@ public class MainListener {
|
||||
}
|
||||
MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_DESTROY_OTHER);
|
||||
event.setCancelled(true);
|
||||
} else if (Settings.DONE_RESTRICTS_BUILDING && plot.getSettings().flags.containsKey("done")) {
|
||||
} else if (Settings.DONE_RESTRICTS_BUILDING && plot.getFlags().containsKey("done")) {
|
||||
if (!Permissions.hasPermission(pp, C.PERMISSION_ADMIN_BUILD_OTHER)) {
|
||||
MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_BUILD_OTHER);
|
||||
event.setCancelled(true);
|
||||
@ -570,7 +570,7 @@ public class MainListener {
|
||||
}
|
||||
MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_DESTROY_OTHER);
|
||||
event.setCancelled(true);
|
||||
} else if (Settings.DONE_RESTRICTS_BUILDING && plot.getSettings().flags.containsKey("done")) {
|
||||
} else if (Settings.DONE_RESTRICTS_BUILDING && plot.getFlags().containsKey("done")) {
|
||||
if (!Permissions.hasPermission(pp, C.PERMISSION_ADMIN_BUILD_OTHER)) {
|
||||
MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_BUILD_OTHER);
|
||||
event.setCancelled(true);
|
||||
@ -658,9 +658,6 @@ public class MainListener {
|
||||
final UUID uuid = pp.getUUID();
|
||||
UUIDHandler.add(name, uuid);
|
||||
ExpireManager.dates.put(uuid, System.currentTimeMillis());
|
||||
|
||||
// TODO worldedit bypass
|
||||
|
||||
if ((PS.get().update != null) && pp.hasPermission("plots.admin")) {
|
||||
TaskManager.runTaskLater(new Runnable() {
|
||||
@Override
|
||||
@ -740,7 +737,7 @@ public class MainListener {
|
||||
final Plot plot = MainUtil.getPlot(worldname, id);
|
||||
if (!PlotListener.plotEntry(pp, plot)) {
|
||||
MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_ENTRY_DENIED);
|
||||
if (!plot.equals(MainUtil.getPlot(SpongeUtil.getLocation(worldname, from)))) {
|
||||
if (!plot.getBasePlot(false).equals(MainUtil.getPlot(SpongeUtil.getLocation(worldname, from)))) {
|
||||
event.setNewLocation(from);
|
||||
} else {
|
||||
event.setNewLocation(world.getSpawnLocation());
|
||||
@ -964,9 +961,6 @@ public class MainListener {
|
||||
|
||||
player.deleteMeta("location");
|
||||
player.deleteMeta("lastplot");
|
||||
|
||||
// TODO worldedit mask
|
||||
|
||||
if (Settings.PERMISSION_CACHING) {
|
||||
((SpongePlayer) player).hasPerm = new HashSet<>();
|
||||
((SpongePlayer) player).noPerm = new HashSet<>();
|
||||
|
@ -1,7 +1,9 @@
|
||||
package com.plotsquared.sponge.util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.spongepowered.api.entity.Entity;
|
||||
import org.spongepowered.api.entity.living.Living;
|
||||
@ -32,8 +34,8 @@ public class SpongeChunkManager extends ChunkManager {
|
||||
|
||||
@Override
|
||||
public int[] countEntities(final Plot plot) {
|
||||
final Location pos1 = plot.getBottom();
|
||||
final Location pos2 = plot.getTop();
|
||||
final Location pos1 = plot.getBottomAbs();
|
||||
final Location pos2 = plot.getTopAbs();
|
||||
|
||||
final String worldname = pos1.getWorld();
|
||||
final World world = SpongeUtil.getWorld(worldname);
|
||||
@ -87,8 +89,8 @@ public class SpongeChunkManager extends ChunkManager {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ChunkLoc> getChunkChunks(final String world) {
|
||||
final ArrayList<ChunkLoc> chunks = new ArrayList<ChunkLoc>();
|
||||
public Set<ChunkLoc> getChunkChunks(final String world) {
|
||||
final HashSet<ChunkLoc> chunks = new HashSet<ChunkLoc>();
|
||||
final World worldObj = SpongeUtil.getWorld(world);
|
||||
final ChunkDataStream storage = worldObj.getWorldStorage().getGeneratedChunks();
|
||||
while (storage.hasNext()) {
|
||||
|
Reference in New Issue
Block a user