Plot auto clear confirmation
Add timediff to keep flag
Add expired parameter to list cmd
Fixes some compatibility issues
This commit is contained in:
Jesse Boyd
2016-03-02 06:56:50 +11:00
parent 106c3c5cb4
commit 8bf3ceac6f
21 changed files with 419 additions and 392 deletions

View File

@ -668,11 +668,8 @@ public class BukkitChunkManager extends ChunkManager {
if (!pLoc.getChunkLoc().equals(loc)) {
continue;
}
PlotBlock plotblock = WorldUtil.IMP.getBlock(pLoc);
if (plotblock.id != 0) {
Plot plot = pp.getCurrentPlot();
pp.teleport(plot.getDefaultHome());
}
pLoc.setY(WorldUtil.IMP.getHighestBlock(world, pLoc.getX(), pLoc.getZ()));
pp.teleport(pLoc);
}
}
@ -996,20 +993,7 @@ public class BukkitChunkManager extends ChunkManager {
final int tx = pos2.getX();
final int tz = pos2.getZ();
for (final Entity entity : entities) {
if (entity instanceof Player) {
final org.bukkit.Location loc = entity.getLocation();
if (loc.getX() >= bx && loc.getX() <= tx && loc.getZ() >= bz && loc.getZ() <= tz) {
final Player player = (Player) entity;
final PlotPlayer pp = BukkitUtil.getPlayer(player);
final Plot plot = pp.getCurrentPlot();
if (plot != null) {
final Location plotHome = plot.getDefaultHome();
if (pp.getLocation().getY() <= plotHome.getY()) {
pp.teleport(plotHome);
}
}
}
} else {
if (!(entity instanceof Player)) {
final org.bukkit.Location loc = entity.getLocation();
if (loc.getX() >= bx && loc.getX() <= tx && loc.getZ() >= bz && loc.getZ() <= tz) {
entity.remove();

View File

@ -5,17 +5,9 @@ import com.intellectualcrafters.plot.object.PlotBlock;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.object.RegionWrapper;
import com.intellectualcrafters.plot.object.schematic.PlotItem;
import com.intellectualcrafters.plot.util.MathMan;
import com.intellectualcrafters.plot.util.StringComparison;
import com.intellectualcrafters.plot.util.StringMan;
import com.intellectualcrafters.plot.util.TaskManager;
import com.intellectualcrafters.plot.util.UUIDHandler;
import com.intellectualcrafters.plot.util.WorldUtil;
import com.intellectualcrafters.plot.util.*;
import com.plotsquared.bukkit.object.BukkitPlayer;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.OfflinePlayer;
import org.bukkit.World;
import org.bukkit.*;
import org.bukkit.block.Biome;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
@ -25,12 +17,7 @@ import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
import org.bukkit.material.MaterialData;
import org.bukkit.material.Sandstone;
import org.bukkit.material.Step;
import org.bukkit.material.Tree;
import org.bukkit.material.WoodenStep;
import org.bukkit.material.Wool;
import org.bukkit.material.*;
import java.util.Arrays;
import java.util.List;

View File

@ -6,9 +6,9 @@ import com.google.common.collect.HashBiMap;
import com.google.common.collect.Lists;
import com.google.common.collect.MapMaker;
import com.google.common.io.ByteSink;
import com.google.common.io.ByteSource;
import com.google.common.io.Closeables;
import com.google.common.io.Files;
import com.google.common.io.InputSupplier;
import com.google.common.primitives.Primitives;
import org.bukkit.Bukkit;
import org.bukkit.Material;
@ -147,21 +147,20 @@ public class NbtFactory {
* @return The decoded NBT compound.
* @throws IOException If anything went wrong.
*/
public static NbtCompound fromStream(final ByteSource stream, final StreamOptions option) throws IOException {
public static NbtCompound fromStream(final InputSupplier<? extends InputStream> stream, final StreamOptions option) throws IOException {
InputStream input = null;
DataInputStream data = null;
boolean suppress = true;
try {
input = stream.openStream();
input = stream.getInput();
data = new DataInputStream(new BufferedInputStream(option == StreamOptions.GZIP_COMPRESSION ? new GZIPInputStream(input) : input));
final NbtCompound result = fromCompound(get().LOAD_COMPOUND.loadNbt(data));
suppress = false;
return result;
}
finally {
} finally {
if (data != null) {
Closeables.close(data, suppress);
} else if (input != null) {

View File

@ -34,7 +34,7 @@ public class SlowChunk extends PlotChunk<Chunk> {
if (result[y >> 4] == null) {
result[y >> 4] = new PlotBlock[4096];
}
result[MainUtil.CACHE_I[x][y][z]][MainUtil.CACHE_J[x][y][z]] = new PlotBlock((short) id, data);
result[MainUtil.CACHE_I[y][x][z]][MainUtil.CACHE_J[y][x][z]] = new PlotBlock((short) id, data);
}
@Override

View File

@ -123,6 +123,9 @@ public class SlowQueue implements PlotQueue<Chunk> {
final int z = MainUtil.z_loc[i][j];
Block block = chunk.getBlock(x, y, z);
PlotBlock newBlock = result2[j];
if (newBlock == null) {
continue;
}
switch (newBlock.id) {
case -1:
if (block.getData() == newBlock.data) {