yay, conflicts

This commit is contained in:
boy0001 2015-02-19 14:38:49 +11:00
parent 4a314144c6
commit f154754e1b
17 changed files with 46 additions and 625 deletions

View File

@ -53,24 +53,6 @@ import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
import me.confuser.barapi.BarAPI; import me.confuser.barapi.BarAPI;
import net.milkbowl.vault.economy.Economy; import net.milkbowl.vault.economy.Economy;
<<<<<<< Updated upstream
import org.bukkit.*;
import org.bukkit.Location;
import org.bukkit.command.PluginCommand;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.world.WorldLoadEvent;
import org.bukkit.generator.ChunkGenerator;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin;
=======
>>>>>>> Stashed changes
import java.io.File; import java.io.File;
import java.io.FileWriter; import java.io.FileWriter;
import java.io.IOException; import java.io.IOException;
@ -87,11 +69,7 @@ import java.util.Map.Entry;
* @author Citymonstret * @author Citymonstret
* @author Empire92 * @author Empire92
*/ */
<<<<<<< Updated upstream
public class PlotMain extends JavaPlugin implements Listener {
=======
public class PlotMain { public class PlotMain {
>>>>>>> Stashed changes
/** /**
* Permission that allows for "everything" * Permission that allows for "everything"
*/ */
@ -935,13 +913,7 @@ public class PlotMain {
} }
public static void loadWorld(final String world, final ChunkGenerator generator) { public static void loadWorld(final String world, final ChunkGenerator generator) {
<<<<<<< Updated upstream
System.out.print(2);
if (getWorldSettings(world) != null) { if (getWorldSettings(world) != null) {
System.out.print(3);
=======
if (getWorldSettings(world) != null) {
>>>>>>> Stashed changes
return; return;
} }
@ -953,10 +925,6 @@ public class PlotMain {
final String path = "worlds." + world; final String path = "worlds." + world;
if (!LOADING_WORLD && (generator != null) && (generator instanceof PlotGenerator)) { if (!LOADING_WORLD && (generator != null) && (generator instanceof PlotGenerator)) {
<<<<<<< Updated upstream
System.out.print(4);
=======
>>>>>>> Stashed changes
plotGenerator = (PlotGenerator) generator; plotGenerator = (PlotGenerator) generator;
plotWorld = plotGenerator.getNewPlotWorld(world); plotWorld = plotGenerator.getNewPlotWorld(world);
plotManager = plotGenerator.getPlotManager(); plotManager = plotGenerator.getPlotManager();
@ -980,13 +948,7 @@ public class PlotMain {
addPlotWorld(world, plotWorld, plotManager); addPlotWorld(world, plotWorld, plotManager);
PlotHelper.setupBorder(world); PlotHelper.setupBorder(world);
} else { } else {
<<<<<<< Updated upstream
System.out.print(5 + " | " + (generator instanceof PlotGenerator));
if (!worlds.contains(world)) { if (!worlds.contains(world)) {
System.out.print(6);
=======
if (!worlds.contains(world)) {
>>>>>>> Stashed changes
return; return;
} }
if (!LOADING_WORLD) { if (!LOADING_WORLD) {
@ -1616,32 +1578,18 @@ public class PlotMain {
{ {
if (checkVersion(1, 8, 0)) { if (checkVersion(1, 8, 0)) {
try { try {
<<<<<<< Updated upstream
AbstractSetBlock.setBlockManager = new SetBlockSlow();
}
catch (Throwable e) {
e.printStackTrace();
AbstractSetBlock.setBlockManager = new SetBlockSlow();
=======
SetBlockManager.setBlockManager = new SetBlockSlow(); SetBlockManager.setBlockManager = new SetBlockSlow();
} }
catch (Throwable e) { catch (Throwable e) {
e.printStackTrace(); e.printStackTrace();
SetBlockManager.setBlockManager = new SetBlockSlow(); SetBlockManager.setBlockManager = new SetBlockSlow();
>>>>>>> Stashed changes
} }
} }
else { else {
try { try {
<<<<<<< Updated upstream
AbstractSetBlock.setBlockManager = new SetBlockFast();
} catch (Throwable e) {
AbstractSetBlock.setBlockManager = new SetBlockSlow();
=======
SetBlockManager.setBlockManager = new SetBlockFast(); SetBlockManager.setBlockManager = new SetBlockFast();
} catch (Throwable e) { } catch (Throwable e) {
SetBlockManager.setBlockManager = new SetBlockSlow(); SetBlockManager.setBlockManager = new SetBlockSlow();
>>>>>>> Stashed changes
} }
} }
try { try {

View File

@ -30,11 +30,7 @@ import com.intellectualcrafters.plot.PlotMain;
import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.generator.HybridPlotManager; import com.intellectualcrafters.plot.generator.HybridPlotManager;
import com.intellectualcrafters.plot.generator.HybridPlotWorld; import com.intellectualcrafters.plot.generator.HybridPlotWorld;
<<<<<<< Updated upstream
import com.intellectualcrafters.plot.util.AbstractSetBlock;
=======
import com.intellectualcrafters.plot.util.SetBlockManager; import com.intellectualcrafters.plot.util.SetBlockManager;
>>>>>>> Stashed changes
import com.intellectualcrafters.plot.util.PlayerFunctions; import com.intellectualcrafters.plot.util.PlayerFunctions;
public class DebugRoadRegen extends SubCommand { public class DebugRoadRegen extends SubCommand {
@ -53,11 +49,7 @@ public class DebugRoadRegen extends SubCommand {
Chunk chunk = player.getLocation().getChunk(); Chunk chunk = player.getLocation().getChunk();
boolean result = manager.regenerateRoad(chunk); boolean result = manager.regenerateRoad(chunk);
if (result) { if (result) {
<<<<<<< Updated upstream
AbstractSetBlock.setBlockManager.update(Arrays.asList(new Chunk[] {chunk}));
=======
SetBlockManager.setBlockManager.update(Arrays.asList(new Chunk[] {chunk})); SetBlockManager.setBlockManager.update(Arrays.asList(new Chunk[] {chunk}));
>>>>>>> Stashed changes
} }
PlayerFunctions.sendMessage(player, "&6Regenerating chunk: "+chunk.getX() + "," + chunk.getZ() + "\n&6 - Result: " + (result == true ? "&aSuccess" : "&cFailed")); PlayerFunctions.sendMessage(player, "&6Regenerating chunk: "+chunk.getX() + "," + chunk.getZ() + "\n&6 - Result: " + (result == true ? "&aSuccess" : "&cFailed"));
return true; return true;

View File

@ -21,19 +21,6 @@
package com.intellectualcrafters.plot.commands; package com.intellectualcrafters.plot.commands;
<<<<<<< Updated upstream
import org.bukkit.entity.Player;
import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.util.PlayerFunctions;
public class Template extends SubCommand {
public Template() {
super("template", "plots.admin", "Create or use a world template", "template", "", CommandCategory.DEBUG, true);
}
=======
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
@ -54,15 +41,12 @@ public class Template extends SubCommand {
super("template", "plots.admin", "Create or use a world template", "template", "", CommandCategory.DEBUG, true); super("template", "plots.admin", "Create or use a world template", "template", "", CommandCategory.DEBUG, true);
} }
>>>>>>> Stashed changes
@Override @Override
public boolean execute(final Player plr, final String... args) { public boolean execute(final Player plr, final String... args) {
if (args.length != 2) { if (args.length != 2) {
PlayerFunctions.sendMessage(plr, C.COMMAND_SYNTAX, "/plot template <import|export> <world>"); PlayerFunctions.sendMessage(plr, C.COMMAND_SYNTAX, "/plot template <import|export> <world>");
return false; return false;
} }
<<<<<<< Updated upstream
=======
World world = Bukkit.getWorld(args[1]); World world = Bukkit.getWorld(args[1]);
PlotWorld plotworld = PlotMain.getWorldSettings(args[1]); PlotWorld plotworld = PlotMain.getWorldSettings(args[1]);
if (world == null || plotworld == null) { if (world == null || plotworld == null) {
@ -79,7 +63,6 @@ public class Template extends SubCommand {
PlayerFunctions.sendMessage(plr, "TODO"); PlayerFunctions.sendMessage(plr, "TODO");
} }
} }
>>>>>>> Stashed changes
// TODO allow world settings (including schematics to be packed into a single file) // TODO allow world settings (including schematics to be packed into a single file)
@ -87,8 +70,6 @@ public class Template extends SubCommand {
return true; return true;
} }
<<<<<<< Updated upstream
=======
public void gzipIt(String output, String input) { public void gzipIt(String output, String input) {
byte[] buffer = new byte[1024]; byte[] buffer = new byte[1024];
@ -106,5 +87,4 @@ public class Template extends SubCommand {
ex.printStackTrace(); ex.printStackTrace();
} }
} }
>>>>>>> Stashed changes
} }

View File

@ -161,10 +161,7 @@ public class SQLManager implements AbstractDB {
} }
stored.get(world).put(new PlotId(idx, idz), id); stored.get(world).put(new PlotId(idx, idz), id);
} }
<<<<<<< Updated upstream
=======
result.close(); result.close();
>>>>>>> Stashed changes
stmt.close(); stmt.close();
} catch (final SQLException e) { } catch (final SQLException e) {
e.printStackTrace(); e.printStackTrace();
@ -486,10 +483,7 @@ public class SQLManager implements AbstractDB {
while (r.next()) { while (r.next()) {
id = r.getInt("id"); id = r.getInt("id");
} }
<<<<<<< Updated upstream
=======
r.close(); r.close();
>>>>>>> Stashed changes
stmt.close(); stmt.close();
return id; return id;
} catch (final SQLException e) { } catch (final SQLException e) {
@ -523,10 +517,7 @@ public class SQLManager implements AbstractDB {
final Statement statement = this.connection.createStatement(); final Statement statement = this.connection.createStatement();
statement.addBatch("ALTER TABLE `" + this.prefix + "plot_settings` ADD `merged` int(11) DEFAULT NULL"); statement.addBatch("ALTER TABLE `" + this.prefix + "plot_settings` ADD `merged` int(11) DEFAULT NULL");
statement.executeBatch(); statement.executeBatch();
<<<<<<< Updated upstream
=======
rs.close(); rs.close();
>>>>>>> Stashed changes
statement.close(); statement.close();
} }
} catch (final Exception e) { } catch (final Exception e) {
@ -718,10 +709,7 @@ public class SQLManager implements AbstractDB {
} }
} }
stmt.close(); stmt.close();
<<<<<<< Updated upstream
=======
r.close(); r.close();
>>>>>>> Stashed changes
for (final Plot plot : plots.values()) { for (final Plot plot : plots.values()) {
final String world = plot.world; final String world = plot.world;
if (!newplots.containsKey(world)) { if (!newplots.containsKey(world)) {
@ -967,11 +955,8 @@ public class SQLManager implements AbstractDB {
} }
} }
purgeIds(world, ids); purgeIds(world, ids);
<<<<<<< Updated upstream
=======
stmt.close(); stmt.close();
r.close(); r.close();
>>>>>>> Stashed changes
} catch (SQLException e) { } catch (SQLException e) {
e.printStackTrace(); e.printStackTrace();
PlotMain.sendConsoleSenderMessage("&c[ERROR] "+"FAILED TO PURGE WORLD '" + world + "'!"); PlotMain.sendConsoleSenderMessage("&c[ERROR] "+"FAILED TO PURGE WORLD '" + world + "'!");
@ -1047,10 +1032,7 @@ public class SQLManager implements AbstractDB {
h.put(var, val); h.put(var, val);
} }
stmt.close(); stmt.close();
<<<<<<< Updated upstream
=======
r.close(); r.close();
>>>>>>> Stashed changes
} catch (final SQLException e) { } catch (final SQLException e) {
PlotMain.sendConsoleSenderMessage("&7[WARN] "+"Failed to load settings for plot: " + id); PlotMain.sendConsoleSenderMessage("&7[WARN] "+"Failed to load settings for plot: " + id);
e.printStackTrace(); e.printStackTrace();
@ -1112,10 +1094,7 @@ public class SQLManager implements AbstractDB {
comments.add(comment); comments.add(comment);
} }
statement.close(); statement.close();
<<<<<<< Updated upstream
=======
set.close(); set.close();
>>>>>>> Stashed changes
} catch (final SQLException e) { } catch (final SQLException e) {
PlotMain.sendConsoleSenderMessage("&7[WARN] "+"Failed to fetch comment"); PlotMain.sendConsoleSenderMessage("&7[WARN] "+"Failed to fetch comment");
e.printStackTrace(); e.printStackTrace();
@ -1312,10 +1291,7 @@ public class SQLManager implements AbstractDB {
rating = set.getDouble("rating"); rating = set.getDouble("rating");
} }
statement.close(); statement.close();
<<<<<<< Updated upstream
=======
set.close(); set.close();
>>>>>>> Stashed changes
return rating; return rating;
} catch (final SQLException e) { } catch (final SQLException e) {
PlotMain.sendConsoleSenderMessage("&7[WARN] "+"Failed to fetch rating for plot " + plot.getId().toString()); PlotMain.sendConsoleSenderMessage("&7[WARN] "+"Failed to fetch rating for plot " + plot.getId().toString());
@ -1371,10 +1347,7 @@ public class SQLManager implements AbstractDB {
c_id = r.getInt("id"); c_id = r.getInt("id");
} }
stmt.close(); stmt.close();
<<<<<<< Updated upstream
=======
r.close(); r.close();
>>>>>>> Stashed changes
return c_id; return c_id;
} catch (final SQLException e) { } catch (final SQLException e) {
e.printStackTrace(); e.printStackTrace();
@ -1553,10 +1526,7 @@ public class SQLManager implements AbstractDB {
} }
} }
stmt.close(); stmt.close();
<<<<<<< Updated upstream
=======
r.close(); r.close();
>>>>>>> Stashed changes
for (final PlotCluster c : clusters.values()) { for (final PlotCluster c : clusters.values()) {
final String world = c.world; final String world = c.world;
if (!newClusters.containsKey(world)) { if (!newClusters.containsKey(world)) {
@ -1786,10 +1756,7 @@ public class SQLManager implements AbstractDB {
h.put(var, val); h.put(var, val);
} }
stmt.close(); stmt.close();
<<<<<<< Updated upstream
=======
r.close(); r.close();
>>>>>>> Stashed changes
} catch (final SQLException e) { } catch (final SQLException e) {
PlotMain.sendConsoleSenderMessage("&7[WARN] "+"Failed to load settings for cluster: " + id); PlotMain.sendConsoleSenderMessage("&7[WARN] "+"Failed to load settings for cluster: " + id);
e.printStackTrace(); e.printStackTrace();

View File

@ -5,30 +5,19 @@ import java.util.Random;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Chunk; import org.bukkit.Chunk;
<<<<<<< Updated upstream
import org.bukkit.Location;
=======
>>>>>>> Stashed changes
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.generator.BlockPopulator; import org.bukkit.generator.BlockPopulator;
import com.intellectualcrafters.plot.PlotMain; import com.intellectualcrafters.plot.PlotMain;
import com.intellectualcrafters.plot.object.BlockWrapper; import com.intellectualcrafters.plot.object.BlockWrapper;
<<<<<<< Updated upstream
=======
import com.intellectualcrafters.plot.object.Location; import com.intellectualcrafters.plot.object.Location;
>>>>>>> Stashed changes
import com.intellectualcrafters.plot.object.PlotCluster; import com.intellectualcrafters.plot.object.PlotCluster;
import com.intellectualcrafters.plot.object.PlotGenerator; import com.intellectualcrafters.plot.object.PlotGenerator;
import com.intellectualcrafters.plot.object.PlotId; import com.intellectualcrafters.plot.object.PlotId;
import com.intellectualcrafters.plot.object.PlotManager; import com.intellectualcrafters.plot.object.PlotManager;
import com.intellectualcrafters.plot.object.PlotWorld; import com.intellectualcrafters.plot.object.PlotWorld;
import com.intellectualcrafters.plot.object.RegionWrapper; import com.intellectualcrafters.plot.object.RegionWrapper;
<<<<<<< Updated upstream
import com.intellectualcrafters.plot.util.AbstractSetBlock;
=======
import com.intellectualcrafters.plot.util.SetBlockManager; import com.intellectualcrafters.plot.util.SetBlockManager;
>>>>>>> Stashed changes
import com.intellectualcrafters.plot.util.ChunkManager; import com.intellectualcrafters.plot.util.ChunkManager;
import com.intellectualcrafters.plot.util.PlotHelper; import com.intellectualcrafters.plot.util.PlotHelper;
import com.intellectualcrafters.plot.util.TaskManager; import com.intellectualcrafters.plot.util.TaskManager;
@ -49,11 +38,7 @@ public class AugmentedPopulator extends BlockPopulator {
private final int tx; private final int tx;
private final int tz; private final int tz;
<<<<<<< Updated upstream
public BlockWrapper getBlock(int X, int Z, int i, int j, short[][] r, boolean c) {
=======
public BlockWrapper get(int X, int Z, int i, int j, short[][] r, boolean c) { public BlockWrapper get(int X, int Z, int i, int j, short[][] r, boolean c) {
>>>>>>> Stashed changes
int y = (i << 4) + (j >> 8); int y = (i << 4) + (j >> 8);
int a = (j - ((y & 0xF) << 8)); int a = (j - ((y & 0xF) << 8));
int z = (a >> 4); int z = (a >> 4);
@ -81,19 +66,11 @@ public class AugmentedPopulator extends BlockPopulator {
Location bl = manager.getPlotBottomLocAbs(plotworld, cluster.getP1()); Location bl = manager.getPlotBottomLocAbs(plotworld, cluster.getP1());
Location tl = manager.getPlotTopLocAbs(plotworld, cluster.getP2()).add(1,0,1); Location tl = manager.getPlotTopLocAbs(plotworld, cluster.getP2()).add(1,0,1);
<<<<<<< Updated upstream
this.bx = bl.getBlockX();
this.bz = bl.getBlockZ();
this.tx = tl.getBlockX();
this.tz = tl.getBlockZ();
=======
this.bx = bl.getX(); this.bx = bl.getX();
this.bz = bl.getZ(); this.bz = bl.getZ();
this.tx = tl.getX(); this.tx = tl.getX();
this.tz = tl.getZ(); this.tz = tl.getZ();
>>>>>>> Stashed changes
} }
else { else {
this.bx = Integer.MIN_VALUE; this.bx = Integer.MIN_VALUE;
@ -141,13 +118,8 @@ public class AugmentedPopulator extends BlockPopulator {
check = false; check = false;
} }
if (plotworld.TERRAIN == 2) { if (plotworld.TERRAIN == 2) {
<<<<<<< Updated upstream
PlotId plot1 = manager.getPlotIdAbs(plotworld, new Location(world, x, 0, z));
PlotId plot2 = manager.getPlotIdAbs(plotworld, new Location(world, x2, 0, z2));
=======
PlotId plot1 = manager.getPlotIdAbs(plotworld, x, 0, z); PlotId plot1 = manager.getPlotIdAbs(plotworld, x, 0, z);
PlotId plot2 = manager.getPlotIdAbs(plotworld, x2, 0, z2); PlotId plot2 = manager.getPlotIdAbs(plotworld, x2, 0, z2);
>>>>>>> Stashed changes
if (plot1 != null && plot2 != null && plot1.equals(plot2)) { if (plot1 != null && plot2 != null && plot1.equals(plot2)) {
return; return;
} }
@ -160,11 +132,7 @@ public class AugmentedPopulator extends BlockPopulator {
public void run() { public void run() {
populateBiome(world, x, z); populateBiome(world, x, z);
chunk.unload(true, true); chunk.unload(true, true);
<<<<<<< Updated upstream
AbstractSetBlock.setBlockManager.update(Arrays.asList( new Chunk[] {chunk}));
=======
SetBlockManager.setBlockManager.update(Arrays.asList( new Chunk[] {chunk})); SetBlockManager.setBlockManager.update(Arrays.asList( new Chunk[] {chunk}));
>>>>>>> Stashed changes
} }
}, 20); }, 20);
} }
@ -181,11 +149,7 @@ public class AugmentedPopulator extends BlockPopulator {
chunk.load(true); chunk.load(true);
populateBlocks(world, rand, X, Z, x, z, check); populateBlocks(world, rand, X, Z, x, z, check);
chunk.unload(true, true); chunk.unload(true, true);
<<<<<<< Updated upstream
AbstractSetBlock.setBlockManager.update(Arrays.asList( new Chunk[] {chunk}));
=======
SetBlockManager.setBlockManager.update(Arrays.asList( new Chunk[] {chunk})); SetBlockManager.setBlockManager.update(Arrays.asList( new Chunk[] {chunk}));
>>>>>>> Stashed changes
} }
}, 40 + rand.nextInt(40)); }, 40 + rand.nextInt(40));
} }
@ -206,11 +170,7 @@ public class AugmentedPopulator extends BlockPopulator {
int length = result[0].length; int length = result[0].length;
for(int i = 0; i < result.length; i++) { for(int i = 0; i < result.length; i++) {
for(int j = 0; j < length; j++) { for(int j = 0; j < length; j++) {
<<<<<<< Updated upstream
BlockWrapper blockInfo = getBlock(x, z, i, j, result, check);
=======
BlockWrapper blockInfo = get(x, z, i, j, result, check); BlockWrapper blockInfo = get(x, z, i, j, result, check);
>>>>>>> Stashed changes
if (blockInfo == null) { if (blockInfo == null) {
continue; continue;
} }
@ -222,11 +182,7 @@ public class AugmentedPopulator extends BlockPopulator {
continue; continue;
} }
} }
<<<<<<< Updated upstream
else if (manager.getPlotIdAbs(plotworld, new Location(world, xx, 0, zz)) != null) {
=======
else if (manager.getPlotIdAbs(plotworld, xx, 0, zz) != null) { else if (manager.getPlotIdAbs(plotworld, xx, 0, zz) != null) {
>>>>>>> Stashed changes
continue; continue;
} }
} }

View File

@ -48,11 +48,7 @@ public abstract class ClassicPlotManager extends SquarePlotManager {
public boolean setFloor(final World world, final PlotWorld plotworld, final PlotId plotid, final PlotBlock[] blocks) { public boolean setFloor(final World world, final PlotWorld plotworld, final PlotId plotid, final PlotBlock[] blocks) {
final ClassicPlotWorld dpw = (ClassicPlotWorld) plotworld; final ClassicPlotWorld dpw = (ClassicPlotWorld) plotworld;
<<<<<<< Updated upstream
final Location pos1 = PlotHelper.getPlotBottomLoc(world, plotid).add(1, 0, 1);
=======
final Location pos1 = PlotHelper.getPlotBottomLoc(plotworld.worldname, plotid).add(1, 0, 1); final Location pos1 = PlotHelper.getPlotBottomLoc(plotworld.worldname, plotid).add(1, 0, 1);
>>>>>>> Stashed changes
final Location pos2 = PlotHelper.getPlotTopLoc(world, plotid); final Location pos2 = PlotHelper.getPlotTopLoc(world, plotid);
PlotHelper.setCuboid(world, new Location(world, pos1.getX(), dpw.PLOT_HEIGHT, pos1.getZ()), new Location(world, pos2.getX() + 1, dpw.PLOT_HEIGHT + 1, pos2.getZ() + 1), blocks); PlotHelper.setCuboid(world, new Location(world, pos1.getX(), dpw.PLOT_HEIGHT, pos1.getZ()), new Location(world, pos2.getX() + 1, dpw.PLOT_HEIGHT + 1, pos2.getZ() + 1), blocks);
return true; return true;
@ -63,11 +59,7 @@ public abstract class ClassicPlotManager extends SquarePlotManager {
if (dpw.ROAD_WIDTH == 0) { if (dpw.ROAD_WIDTH == 0) {
return false; return false;
} }
<<<<<<< Updated upstream
final Location bottom = PlotHelper.getPlotBottomLoc(w, plotid);
=======
final Location bottom = PlotHelper.getPlotBottomLoc(plotworld.worldname, plotid); final Location bottom = PlotHelper.getPlotBottomLoc(plotworld.worldname, plotid);
>>>>>>> Stashed changes
final Location top = PlotHelper.getPlotTopLoc(w, plotid); final Location top = PlotHelper.getPlotTopLoc(w, plotid);
int x, z; int x, z;
@ -105,11 +97,7 @@ public abstract class ClassicPlotManager extends SquarePlotManager {
if (dpw.ROAD_WIDTH == 0) { if (dpw.ROAD_WIDTH == 0) {
return false; return false;
} }
<<<<<<< Updated upstream
final Location bottom = PlotHelper.getPlotBottomLoc(w, plotid);
=======
final Location bottom = PlotHelper.getPlotBottomLoc(plotworld.worldname, plotid); final Location bottom = PlotHelper.getPlotBottomLoc(plotworld.worldname, plotid);
>>>>>>> Stashed changes
final Location top = PlotHelper.getPlotTopLoc(w, plotid); final Location top = PlotHelper.getPlotTopLoc(w, plotid);
int x, z; int x, z;
@ -330,11 +318,7 @@ public abstract class ClassicPlotManager extends SquarePlotManager {
} }
@Override @Override
<<<<<<< Updated upstream
public String[] getPlotComponents(World world, PlotWorld plotworld, PlotId plotid) {
=======
public String[] getPlotComponents(PlotWorld plotworld, PlotId plotid) { public String[] getPlotComponents(PlotWorld plotworld, PlotId plotid) {
>>>>>>> Stashed changes
return new String[] { return new String[] {
"floor", "floor",
"wall", "wall",
@ -346,15 +330,9 @@ public abstract class ClassicPlotManager extends SquarePlotManager {
* Remove sign for a plot * Remove sign for a plot
*/ */
@Override @Override
<<<<<<< Updated upstream
public Location getSignLoc(final World world, final PlotWorld plotworld, final Plot plot) {
final ClassicPlotWorld dpw = (ClassicPlotWorld) plotworld;
return new Location(world, PlotHelper.getPlotBottomLoc(world, plot.id).getBlockX(), dpw.ROAD_HEIGHT + 1, PlotHelper.getPlotBottomLoc(world, plot.id).getBlockZ() - 1);
=======
public com.intellectualcrafters.plot.object.Location getSignLoc(final PlotWorld plotworld, final Plot plot) { public com.intellectualcrafters.plot.object.Location getSignLoc(final PlotWorld plotworld, final Plot plot) {
final ClassicPlotWorld dpw = (ClassicPlotWorld) plotworld; final ClassicPlotWorld dpw = (ClassicPlotWorld) plotworld;
Location bot = PlotHelper.getPlotBottomLoc(plotworld.worldname, plot.id); Location bot = PlotHelper.getPlotBottomLoc(plotworld.worldname, plot.id);
return new com.intellectualcrafters.plot.object.Location(plotworld.worldname, bot.getBlockX(), dpw.ROAD_HEIGHT + 1, bot.getBlockZ() - 1); return new com.intellectualcrafters.plot.object.Location(plotworld.worldname, bot.getBlockX(), dpw.ROAD_HEIGHT + 1, bot.getBlockZ() - 1);
>>>>>>> Stashed changes
} }
} }

View File

@ -41,11 +41,7 @@ import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotBlock; import com.intellectualcrafters.plot.object.PlotBlock;
import com.intellectualcrafters.plot.object.PlotId; import com.intellectualcrafters.plot.object.PlotId;
import com.intellectualcrafters.plot.object.PlotWorld; import com.intellectualcrafters.plot.object.PlotWorld;
<<<<<<< Updated upstream
import com.intellectualcrafters.plot.util.AbstractSetBlock;
=======
import com.intellectualcrafters.plot.util.SetBlockManager; import com.intellectualcrafters.plot.util.SetBlockManager;
>>>>>>> Stashed changes
import com.intellectualcrafters.plot.util.ChunkManager; import com.intellectualcrafters.plot.util.ChunkManager;
import com.intellectualcrafters.plot.util.PlayerFunctions; import com.intellectualcrafters.plot.util.PlayerFunctions;
import com.intellectualcrafters.plot.util.PlotHelper; import com.intellectualcrafters.plot.util.PlotHelper;
@ -200,11 +196,7 @@ import com.intellectualcrafters.plot.util.UUIDHandler;
regenerateRoad(chunk); regenerateRoad(chunk);
} }
} }
<<<<<<< Updated upstream
AbstractSetBlock.setBlockManager.update(chunks2);
=======
SetBlockManager.setBlockManager.update(chunks2); SetBlockManager.setBlockManager.update(chunks2);
>>>>>>> Stashed changes
} }
public boolean scheduleRoadUpdate(final World world) { public boolean scheduleRoadUpdate(final World world) {

View File

@ -160,14 +160,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
final Location f = event.getFrom(); final Location f = event.getFrom();
final Location t = event.getTo(); final Location t = event.getTo();
final Location q = new Location(t.getWorld(), t.getBlockX(), 0, t.getZ()); final Location q = new Location(t.getWorld(), t.getBlockX(), 0, t.getZ());
<<<<<<< Updated upstream
if ((f.getBlockX() != q.getBlockX()) || (f.getBlockZ() != q.getBlockZ())) { if ((f.getBlockX() != q.getBlockX()) || (f.getBlockZ() != q.getBlockZ())) {
=======
if ((f.getBlockX() != q.getBlockX()) || (f.getBlockZ() != q.getBlockZ())) {
System.out.print("=========================");
System.out.print("4. " + f);
>>>>>>> Stashed changes
if (Settings.TELEPORT_DELAY != 0 && TaskManager.TELEPORT_QUEUE.size() > 0) { if (Settings.TELEPORT_DELAY != 0 && TaskManager.TELEPORT_QUEUE.size() > 0) {
String name = player.getName(); String name = player.getName();
if (TaskManager.TELEPORT_QUEUE.contains(name)) { if (TaskManager.TELEPORT_QUEUE.contains(name)) {
@ -198,10 +191,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
passed = true; passed = true;
} }
if (passed) { if (passed) {
<<<<<<< Updated upstream
=======
q.setY(t.getBlockY()); q.setY(t.getBlockY());
>>>>>>> Stashed changes
event.setTo(q); event.setTo(q);
PlayerFunctions.sendMessage(player, C.BORDER); PlayerFunctions.sendMessage(player, C.BORDER);
return; return;
@ -209,29 +199,14 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
} }
Plot plot = getCurrentPlot(q); Plot plot = getCurrentPlot(q);
if (plot != null) { if (plot != null) {
<<<<<<< Updated upstream
if (!plot.equals(getCurrentPlot(f))) {
if (plot.deny_entry(player)) {
if (!PlotMain.hasPermission(player, "plots.admin.entry.denied")) {
PlayerFunctions.sendMessage(player, C.NO_PERMISSION, "plots.admin.entry.denied");
event.setCancelled(true);
return;
}
}
=======
if (plot.deny_entry(player)) { if (plot.deny_entry(player)) {
if (!PlotMain.hasPermission(player, "plots.admin.entry.denied")) { if (!PlotMain.hasPermission(player, "plots.admin.entry.denied")) {
PlayerFunctions.sendMessage(player, C.NO_PERMISSION, "plots.admin.entry.denied"); PlayerFunctions.sendMessage(player, C.NO_PERMISSION, "plots.admin.entry.denied");
System.out.print("DENY ENTRY");
System.out.print("5. " + f);
event.setCancelled(true); event.setCancelled(true);
return; return;
} }
} }
System.out.print("6. " + f);
if (!plot.equals(getCurrentPlot(f))) { if (!plot.equals(getCurrentPlot(f))) {
System.out.print("7. " + f);
>>>>>>> Stashed changes
plotEntry(player, plot); plotEntry(player, plot);
} }
} else if (leftPlot(f, event.getTo())) { } else if (leftPlot(f, event.getTo())) {

View File

@ -11,21 +11,13 @@ import java.lang.reflect.Method;
*/ */
public class Location implements Cloneable, Comparable<Location> { public class Location implements Cloneable, Comparable<Location> {
<<<<<<< Updated upstream
private double x, y, z;
=======
private int x, y, z; private int x, y, z;
>>>>>>> Stashed changes
private float yaw, pitch; private float yaw, pitch;
private String world; private String world;
private boolean built; private boolean built;
private Object o; private Object o;
<<<<<<< Updated upstream
public Location(final String world, final double x, final double y, final double z, final float yaw, final float pitch) {
=======
public Location(final String world, final int x, final int y, final int z, final float yaw, final float pitch) { public Location(final String world, final int x, final int y, final int z, final float yaw, final float pitch) {
>>>>>>> Stashed changes
this.world = world; this.world = world;
this.x = x; this.x = x;
this.y = y; this.y = y;
@ -37,20 +29,6 @@ public class Location implements Cloneable, Comparable<Location> {
} }
public Location() { public Location() {
<<<<<<< Updated upstream
this("", 0d, 0d, 0d, 0f, 0f);
}
public Location(final String world, final double x, final double y, final double z) {
this(world, x, y, z, 0f, 0f);
}
public double getX() {
return this.x;
}
public void setX(final double x) {
=======
this("", 0, 0, 0, 0, 0); this("", 0, 0, 0, 0, 0);
} }
@ -63,41 +41,24 @@ public class Location implements Cloneable, Comparable<Location> {
} }
public void setX(final int x) { public void setX(final int x) {
>>>>>>> Stashed changes
this.x = x; this.x = x;
this.built = false; this.built = false;
} }
<<<<<<< Updated upstream
public double getY() {
return this.y;
}
public void setY(final double y) {
=======
public int getY() { public int getY() {
return this.y; return this.y;
} }
public void setY(final int y) { public void setY(final int y) {
>>>>>>> Stashed changes
this.y = y; this.y = y;
this.built = false; this.built = false;
} }
<<<<<<< Updated upstream
public double getZ() {
return this.z;
}
public void setZ(final double z) {
=======
public int getZ() { public int getZ() {
return this.z; return this.z;
} }
public void setZ(final int z) { public void setZ(final int z) {
>>>>>>> Stashed changes
this.z = z; this.z = z;
this.built = false; this.built = false;
} }
@ -129,19 +90,11 @@ public class Location implements Cloneable, Comparable<Location> {
this.built = false; this.built = false;
} }
<<<<<<< Updated upstream
public void add(double x, double y, double z) {
=======
public Location add(int x, int y, int z) {
>>>>>>> Stashed changes
this.x += x; this.x += x;
this.y += y; this.y += y;
this.z += z; this.z += z;
this.built = false; this.built = false;
<<<<<<< Updated upstream
=======
return this; return this;
>>>>>>> Stashed changes
} }
public double getEuclideanDistanceSquared(final Location l2) { public double getEuclideanDistanceSquared(final Location l2) {
@ -175,11 +128,6 @@ public class Location implements Cloneable, Comparable<Location> {
y <= max.getY() && z >= min.getX() && z < max.getZ(); y <= max.getY() && z >= min.getX() && z < max.getZ();
} }
<<<<<<< Updated upstream
public void lookTowards(double x, double y) {
=======
public void lookTowards(int x, int y) {
>>>>>>> Stashed changes
double l = this.x - x; double l = this.x - x;
double w = this.z - z; double w = this.z - z;
double c = Math.sqrt(l * l + w * w); double c = Math.sqrt(l * l + w * w);
@ -191,34 +139,21 @@ public class Location implements Cloneable, Comparable<Location> {
this.built = false; this.built = false;
} }
<<<<<<< Updated upstream
public void subtract(double x, double y, double z) {
=======
public Location subtract(int x, int y, int z) {
>>>>>>> Stashed changes
this.x -= x; this.x -= x;
this.y -= y; this.y -= y;
this.z -= z; this.z -= z;
this.built = false; this.built = false;
<<<<<<< Updated upstream
=======
return this; return this;
>>>>>>> Stashed changes
} }
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
<<<<<<< Updated upstream
if (!(o instanceof Location))
return false;
=======
if (o == null) { if (o == null) {
return false; return false;
} }
if (!(o instanceof Location)) { if (!(o instanceof Location)) {
return false; return false;
} }
>>>>>>> Stashed changes
Location l = (Location) o; Location l = (Location) o;
return x == l.getX() && y == l.getY() && return x == l.getX() && y == l.getY() &&
z == l.getZ() && world.equals(l.getWorld()) && z == l.getZ() && world.equals(l.getWorld()) &&
@ -251,12 +186,6 @@ public class Location implements Cloneable, Comparable<Location> {
} }
} }
<<<<<<< Updated upstream
=======
/**
* Please use utility class as this is not efficient
*/
>>>>>>> Stashed changes
public Object toBukkitLocation() { public Object toBukkitLocation() {
if (built) { if (built) {
return o; return o;
@ -270,12 +199,9 @@ public class Location implements Cloneable, Comparable<Location> {
} }
} }
<<<<<<< Updated upstream
=======
/** /**
* Please use utility class as this is not efficient * Please use utility class as this is not efficient
*/ */
>>>>>>> Stashed changes
public void teleport(final Object o) throws Exception { public void teleport(final Object o) throws Exception {
if (o.getClass().getName().contains("org.bukkit.entity")) { if (o.getClass().getName().contains("org.bukkit.entity")) {
Method m = o.getClass().getMethod("teleport", Class.forName("org.bukkit.Location")); Method m = o.getClass().getMethod("teleport", Class.forName("org.bukkit.Location"));

View File

@ -23,10 +23,6 @@ package com.intellectualcrafters.plot.object;
import java.util.ArrayList; import java.util.ArrayList;
<<<<<<< Updated upstream
import org.bukkit.Location;
=======
>>>>>>> Stashed changes
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.Biome; import org.bukkit.block.Biome;
@ -37,15 +33,9 @@ public abstract class PlotManager {
* plots) * plots)
*/ */
<<<<<<< Updated upstream
public abstract PlotId getPlotIdAbs(final PlotWorld plotworld, final Location loc);
public abstract PlotId getPlotId(final PlotWorld plotworld, final Location loc);
=======
public abstract PlotId getPlotIdAbs(final PlotWorld plotworld, final int x, final int y, final int z); public abstract PlotId getPlotIdAbs(final PlotWorld plotworld, final int x, final int y, final int z);
public abstract PlotId getPlotId(final PlotWorld plotworld, final int x, final int y, final int z); public abstract PlotId getPlotId(final PlotWorld plotworld, final int x, final int y, final int z);
>>>>>>> Stashed changes
// If you have a circular plot, just return the corner if it were a square // If you have a circular plot, just return the corner if it were a square
public abstract Location getPlotBottomLocAbs(final PlotWorld plotworld, final PlotId plotid); public abstract Location getPlotBottomLocAbs(final PlotWorld plotworld, final PlotId plotid);
@ -55,15 +45,6 @@ public abstract class PlotManager {
/* /*
* Plot clearing (return false if you do not support some method) * Plot clearing (return false if you do not support some method)
*/ */
<<<<<<< Updated upstream
public abstract boolean clearPlot(final World world, final PlotWorld plotworld, final Plot plot, boolean isDelete, Runnable whenDone);
public abstract boolean claimPlot(final World world, final PlotWorld plotworld, final Plot plot);
public abstract boolean unclaimPlot(final World world, final PlotWorld plotworld, final Plot plot);
public abstract Location getSignLoc(final World world, final PlotWorld plotworld, final Plot plot);
=======
public abstract boolean clearPlot(final PlotWorld plotworld, final Plot plot, boolean isDelete, Runnable whenDone); public abstract boolean clearPlot(final PlotWorld plotworld, final Plot plot, boolean isDelete, Runnable whenDone);
public abstract boolean claimPlot(final PlotWorld plotworld, final Plot plot); public abstract boolean claimPlot(final PlotWorld plotworld, final Plot plot);
@ -71,26 +52,17 @@ public abstract class PlotManager {
public abstract boolean unclaimPlot(final PlotWorld plotworld, final Plot plot); public abstract boolean unclaimPlot(final PlotWorld plotworld, final Plot plot);
public abstract Location getSignLoc(final PlotWorld plotworld, final Plot plot); public abstract Location getSignLoc(final PlotWorld plotworld, final Plot plot);
>>>>>>> Stashed changes
/* /*
* Plot set functions (return false if you do not support the specific set * Plot set functions (return false if you do not support the specific set
* method) * method)
*/ */
<<<<<<< Updated upstream
public abstract String[] getPlotComponents(final World world, final PlotWorld plotworld, final PlotId plotid);
public abstract boolean setComponent(final World world, final PlotWorld plotworld, final PlotId plotid, final String component, final PlotBlock[] blocks);
public abstract boolean setBiome(final World world, final Plot plot, final Biome biome);
=======
public abstract String[] getPlotComponents(final PlotWorld plotworld, final PlotId plotid); public abstract String[] getPlotComponents(final PlotWorld plotworld, final PlotId plotid);
public abstract boolean setComponent(final PlotWorld plotworld, final PlotId plotid, final String component, final PlotBlock[] blocks); public abstract boolean setComponent(final PlotWorld plotworld, final PlotId plotid, final String component, final PlotBlock[] blocks);
public abstract boolean setBiome(final Plot plot, final Biome biome); public abstract boolean setBiome(final Plot plot, final Biome biome);
>>>>>>> Stashed changes
/* /*
* PLOT MERGING (return false if your generator does not support plot * PLOT MERGING (return false if your generator does not support plot
@ -108,15 +80,6 @@ public abstract class PlotManager {
public abstract boolean removeRoadSouthEast(final PlotWorld plotworld, final Plot plot); public abstract boolean removeRoadSouthEast(final PlotWorld plotworld, final Plot plot);
<<<<<<< Updated upstream
public abstract boolean startPlotMerge(final World world, final PlotWorld plotworld, final ArrayList<PlotId> plotIds);
public abstract boolean startPlotUnlink(final World world, final PlotWorld plotworld, final ArrayList<PlotId> plotIds);
public abstract boolean finishPlotMerge(final World world, final PlotWorld plotworld, final ArrayList<PlotId> plotIds);
public abstract boolean finishPlotUnlink(final World world, final PlotWorld plotworld, final ArrayList<PlotId> plotIds);
=======
public abstract boolean startPlotMerge(final PlotWorld plotworld, final ArrayList<PlotId> plotIds); public abstract boolean startPlotMerge(final PlotWorld plotworld, final ArrayList<PlotId> plotIds);
public abstract boolean startPlotUnlink(final PlotWorld plotworld, final ArrayList<PlotId> plotIds); public abstract boolean startPlotUnlink(final PlotWorld plotworld, final ArrayList<PlotId> plotIds);
@ -124,6 +87,5 @@ public abstract class PlotManager {
public abstract boolean finishPlotMerge(final PlotWorld plotworld, final ArrayList<PlotId> plotIds); public abstract boolean finishPlotMerge(final PlotWorld plotworld, final ArrayList<PlotId> plotIds);
public abstract boolean finishPlotUnlink(final PlotWorld plotworld, final ArrayList<PlotId> plotIds); public abstract boolean finishPlotUnlink(final PlotWorld plotworld, final ArrayList<PlotId> plotIds);
>>>>>>> Stashed changes
} }

View File

@ -229,21 +229,15 @@ public class ChunkManager {
Block block = world.getBlockAt(x, y, z); Block block = world.getBlockAt(x, y, z);
int id = block.getTypeId(); int id = block.getTypeId();
byte data = block.getData(); byte data = block.getData();
<<<<<<< Updated upstream
AbstractSetBlock.setBlockManager.set(world, x + relX, y, z + relZ, id, data);
=======
SetBlockManager.setBlockManager.set(world, x + relX, y, z + relZ, id, data); SetBlockManager.setBlockManager.set(world, x + relX, y, z + relZ, id, data);
>>>>>>> Stashed changes
} }
} }
mx.increment(); mx.increment();
if (x == ex) { // done! if (x == ex) { // done!
restoreBlocks(world, relX, relZ); restoreBlocks(world, relX, relZ);
<<<<<<< Updated upstream
AbstractSetBlock.setBlockManager.update(chunks);
=======
SetBlockManager.setBlockManager.update(chunks); SetBlockManager.setBlockManager.update(chunks);
>>>>>>> Stashed changes
for (Chunk chunk : chunks) { for (Chunk chunk : chunks) {
chunk.unload(true, true); chunk.unload(true, true);
} }
@ -359,11 +353,8 @@ public class ChunkManager {
restoreEntities(world, 0, 0); restoreEntities(world, 0, 0);
} }
chunk.unload(true, true); chunk.unload(true, true);
<<<<<<< Updated upstream
AbstractSetBlock.setBlockManager.update(Arrays.asList( new Chunk[] {chunk}));
=======
SetBlockManager.setBlockManager.update(Arrays.asList( new Chunk[] {chunk})); SetBlockManager.setBlockManager.update(Arrays.asList( new Chunk[] {chunk}));
>>>>>>> Stashed changes
} }
CURRENT_PLOT_CLEAR = null; CURRENT_PLOT_CLEAR = null;
} }

View File

@ -288,11 +288,8 @@ public class ClusterManager {
@Override @Override
public void run() { public void run() {
if (populator == null || plotworld.TYPE == 0) { if (populator == null || plotworld.TYPE == 0) {
<<<<<<< Updated upstream
AbstractSetBlock.setBlockManager.update(Arrays.asList( new Chunk[] {chunk}));
=======
SetBlockManager.setBlockManager.update(Arrays.asList( new Chunk[] {chunk})); SetBlockManager.setBlockManager.update(Arrays.asList( new Chunk[] {chunk}));
>>>>>>> Stashed changes
world.regenerateChunk(chunk.getX(), chunk.getZ()); world.regenerateChunk(chunk.getX(), chunk.getZ());
chunk.unload(true, true); chunk.unload(true, true);
} }

View File

@ -65,11 +65,8 @@ import java.util.UUID;
return myplots; return myplots;
} }
<<<<<<< Updated upstream
public static ArrayList<PlotId> getMaxPlotSelectionIds(final World world, PlotId pos1, PlotId pos2) {
=======
public static ArrayList<PlotId> getMaxPlotSelectionIds(final String world, PlotId pos1, PlotId pos2) { public static ArrayList<PlotId> getMaxPlotSelectionIds(final String world, PlotId pos1, PlotId pos2) {
>>>>>>> Stashed changes
final Plot plot1 = PlotMain.getPlots(world).get(pos1); final Plot plot1 = PlotMain.getPlots(world).get(pos1);
final Plot plot2 = PlotMain.getPlots(world).get(pos2); final Plot plot2 = PlotMain.getPlots(world).get(pos2);
@ -91,11 +88,8 @@ import java.util.UUID;
return myplots; return myplots;
} }
<<<<<<< Updated upstream
public static Plot getBottomPlot(final World world, final Plot plot) {
=======
public static Plot getBottomPlot(final String world, final Plot plot) { public static Plot getBottomPlot(final String world, final Plot plot) {
>>>>>>> Stashed changes
if (plot.settings.getMerged(0)) { if (plot.settings.getMerged(0)) {
final Plot p = PlotMain.getPlots(world).get(new PlotId(plot.id.x, plot.id.y - 1)); final Plot p = PlotMain.getPlots(world).get(new PlotId(plot.id.x, plot.id.y - 1));
if (p == null) { if (p == null) {
@ -113,11 +107,8 @@ import java.util.UUID;
return plot; return plot;
} }
<<<<<<< Updated upstream
public static Plot getTopPlot(final World world, final Plot plot) {
=======
public static Plot getTopPlot(final String world, final Plot plot) { public static Plot getTopPlot(final String world, final Plot plot) {
>>>>>>> Stashed changes
if (plot.settings.getMerged(2)) { if (plot.settings.getMerged(2)) {
return getTopPlot(world, PlotMain.getPlots(world).get(new PlotId(plot.id.x, plot.id.y + 1))); return getTopPlot(world, PlotMain.getPlots(world).get(new PlotId(plot.id.x, plot.id.y + 1)));
} }
@ -141,11 +132,8 @@ import java.util.UUID;
return null; return null;
} }
final PlotWorld plotworld = PlotMain.getWorldSettings(world); final PlotWorld plotworld = PlotMain.getWorldSettings(world);
<<<<<<< Updated upstream
return manager.getPlotIdAbs(plotworld, loc);
=======
return manager.getPlotIdAbs(plotworld, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()); return manager.getPlotIdAbs(plotworld, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
>>>>>>> Stashed changes
} }
/** /**
@ -162,11 +150,8 @@ import java.util.UUID;
return null; return null;
} }
final PlotWorld plotworld = PlotMain.getWorldSettings(world); final PlotWorld plotworld = PlotMain.getWorldSettings(world);
<<<<<<< Updated upstream
PlotId id = manager.getPlotId(plotworld, loc);
=======
PlotId id = manager.getPlotId(plotworld, loc.getBlockX(),loc.getBlockY(), loc.getBlockZ()); PlotId id = manager.getPlotId(plotworld, loc.getBlockX(),loc.getBlockY(), loc.getBlockZ());
>>>>>>> Stashed changes
if (id!=null && plotworld.TYPE == 2) { if (id!=null && plotworld.TYPE == 2) {
if (ClusterManager.getCluster(world, id) == null) { if (ClusterManager.getCluster(world, id) == null) {
return null; return null;

View File

@ -31,10 +31,7 @@ import net.milkbowl.vault.economy.Economy;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Chunk; import org.bukkit.Chunk;
<<<<<<< Updated upstream
import org.bukkit.Location;
=======
>>>>>>> Stashed changes
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.OfflinePlayer; import org.bukkit.OfflinePlayer;
import org.bukkit.World; import org.bukkit.World;
@ -50,10 +47,8 @@ import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.database.DBFunc; import com.intellectualcrafters.plot.database.DBFunc;
import com.intellectualcrafters.plot.listeners.PlotListener; import com.intellectualcrafters.plot.listeners.PlotListener;
import com.intellectualcrafters.plot.object.BlockLoc; import com.intellectualcrafters.plot.object.BlockLoc;
<<<<<<< Updated upstream
=======
import com.intellectualcrafters.plot.object.Location; import com.intellectualcrafters.plot.object.Location;
>>>>>>> Stashed changes
import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotBlock; import com.intellectualcrafters.plot.object.PlotBlock;
import com.intellectualcrafters.plot.object.PlotId; import com.intellectualcrafters.plot.object.PlotId;
@ -140,11 +135,8 @@ import com.intellectualcrafters.plot.object.PlotWorld;
* *
* @return * @return
*/ */
<<<<<<< Updated upstream
public static boolean mergePlots(final Player plr, final World world, final ArrayList<PlotId> plotIds) {
=======
public static boolean mergePlots(final Player plr, final String world, final ArrayList<PlotId> plotIds) { public static boolean mergePlots(final Player plr, final String world, final ArrayList<PlotId> plotIds) {
>>>>>>> Stashed changes
final PlotWorld plotworld = PlotMain.getWorldSettings(world); final PlotWorld plotworld = PlotMain.getWorldSettings(world);
if (PlotMain.useEconomy && plotworld.USE_ECONOMY) { if (PlotMain.useEconomy && plotworld.USE_ECONOMY) {
final double cost = plotIds.size() * plotworld.MERGE_PRICE; final double cost = plotIds.size() * plotworld.MERGE_PRICE;
@ -172,11 +164,8 @@ import com.intellectualcrafters.plot.object.PlotWorld;
* *
* @return boolean (success) * @return boolean (success)
*/ */
<<<<<<< Updated upstream
public static boolean mergePlots(final World world, final ArrayList<PlotId> plotIds, boolean removeRoads) {
=======
public static boolean mergePlots(final String world, final ArrayList<PlotId> plotIds, boolean removeRoads) { public static boolean mergePlots(final String world, final ArrayList<PlotId> plotIds, boolean removeRoads) {
>>>>>>> Stashed changes
if (plotIds.size() < 2) { if (plotIds.size() < 2) {
return false; return false;
} }
@ -186,11 +175,8 @@ import com.intellectualcrafters.plot.object.PlotWorld;
final PlotManager manager = PlotMain.getPlotManager(world); final PlotManager manager = PlotMain.getPlotManager(world);
final PlotWorld plotworld = PlotMain.getWorldSettings(world); final PlotWorld plotworld = PlotMain.getWorldSettings(world);
<<<<<<< Updated upstream
manager.startPlotMerge(world, plotworld, plotIds);
=======
manager.startPlotMerge(plotworld, plotIds); manager.startPlotMerge(plotworld, plotIds);
>>>>>>> Stashed changes
boolean result = false; boolean result = false;
@ -209,11 +195,8 @@ import com.intellectualcrafters.plot.object.PlotWorld;
Plot plot2 = null; Plot plot2 = null;
if (removeRoads) { if (removeRoads) {
<<<<<<< Updated upstream
removeSign(world, plot);
=======
removeSign(plot); removeSign(plot);
>>>>>>> Stashed changes
} }
if (lx) { if (lx) {
if (ly) { if (ly) {
@ -248,20 +231,14 @@ import com.intellectualcrafters.plot.object.PlotWorld;
for (int y = pos1.y; y <= pos2.y; y++) { for (int y = pos1.y; y <= pos2.y; y++) {
final PlotId id = new PlotId(x, y); final PlotId id = new PlotId(x, y);
final Plot plot = PlotMain.getPlots(world).get(id); final Plot plot = PlotMain.getPlots(world).get(id);
<<<<<<< Updated upstream
DBFunc.setMerged(world.getName(), plot, plot.settings.getMerged());
=======
DBFunc.setMerged(world, plot, plot.settings.getMerged()); DBFunc.setMerged(world, plot, plot.settings.getMerged());
>>>>>>> Stashed changes
} }
} }
<<<<<<< Updated upstream
manager.finishPlotMerge(world, plotworld, plotIds);
=======
manager.finishPlotMerge(plotworld, plotIds); manager.finishPlotMerge(plotworld, plotIds);
>>>>>>> Stashed changes
return result; return result;
} }
@ -274,11 +251,8 @@ import com.intellectualcrafters.plot.object.PlotWorld;
* @param lesserPlot * @param lesserPlot
* @param greaterPlot * @param greaterPlot
*/ */
<<<<<<< Updated upstream
public static void mergePlot(final World world, final Plot lesserPlot, final Plot greaterPlot, boolean removeRoads) {
=======
public static void mergePlot(final String world, final Plot lesserPlot, final Plot greaterPlot, boolean removeRoads) { public static void mergePlot(final String world, final Plot lesserPlot, final Plot greaterPlot, boolean removeRoads) {
>>>>>>> Stashed changes
final PlotManager manager = PlotMain.getPlotManager(world); final PlotManager manager = PlotMain.getPlotManager(world);
final PlotWorld plotworld = PlotMain.getWorldSettings(world); final PlotWorld plotworld = PlotMain.getWorldSettings(world);
@ -300,53 +274,6 @@ import com.intellectualcrafters.plot.object.PlotWorld;
} }
} }
} }
<<<<<<< Updated upstream
/*
* Random number gen section
*/
public static long nextLong() {
final long a = state;
state = xorShift64(a);
return a;
}
/*
* End of random number gen section
*/
public static long xorShift64(long a) {
a ^= (a << 21);
a ^= (a >>> 35);
a ^= (a << 4);
return a;
}
public static int random(final int n) {
if (n == 1) {
return 0;
}
final long r = ((nextLong() >>> 32) * n) >> 32;
return (int) r;
}
public static void removeSign(final World world, final Plot p) {
final PlotManager manager = PlotMain.getPlotManager(world);
final PlotWorld plotworld = PlotMain.getWorldSettings(world);
final Location loc = manager.getSignLoc(world, plotworld, p);
final Block bs = loc.getBlock();
if (bs.getType() == Material.WALL_SIGN) {
bs.setType(Material.AIR);
}
}
public static void setSign(final Player player, final Plot p) {
setSign(Bukkit.getWorld(p.world), player.getName(), p);
}
@SuppressWarnings("deprecation")
public static void setSign(final World world, String name, final Plot p) {
=======
@ -359,17 +286,14 @@ import com.intellectualcrafters.plot.object.PlotWorld;
} }
public static void setSign(String name, final Plot p) { public static void setSign(String name, final Plot p) {
>>>>>>> Stashed changes
if (name == null) { if (name == null) {
name = "unknown"; name = "unknown";
} }
final PlotManager manager = PlotMain.getPlotManager(world); final PlotManager manager = PlotMain.getPlotManager(world);
final PlotWorld plotworld = PlotMain.getWorldSettings(world); final PlotWorld plotworld = PlotMain.getWorldSettings(world);
<<<<<<< Updated upstream
final Location loc = manager.getSignLoc(world, plotworld, p);
=======
final Location loc = manager.getSignLoc(plotworld, p); final Location loc = manager.getSignLoc(plotworld, p);
>>>>>>> Stashed changes
final Block bs = loc.getBlock(); final Block bs = loc.getBlock();
bs.setType(Material.AIR); bs.setType(Material.AIR);
bs.setTypeIdAndData(Material.WALL_SIGN.getId(), (byte) 2, false); bs.setTypeIdAndData(Material.WALL_SIGN.getId(), (byte) 2, false);
@ -400,45 +324,8 @@ import com.intellectualcrafters.plot.object.PlotWorld;
return string; return string;
} }
<<<<<<< Updated upstream
public static boolean setBlock(World world, int x, int y, int z, int id, byte data) {
try {
return AbstractSetBlock.setBlockManager.set(world, x, y, z, id, data);
}
catch (Throwable e) {
AbstractSetBlock.setBlockManager = new SetBlockSlow();
return AbstractSetBlock.setBlockManager.set(world, x, y, z, id, data);
}
}
public static boolean setBlock(World world, int x, int y, int z, PlotBlock[] blocks) {
final int i = random(blocks.length);
final PlotBlock newblock = blocks[i];
try {
return AbstractSetBlock.setBlockManager.set(world, x, y, z, newblock.id, newblock.data);
}
catch (Throwable e) {
AbstractSetBlock.setBlockManager = new SetBlockSlow();
return AbstractSetBlock.setBlockManager.set(world, x, y, z, newblock.id, newblock.data);
}
}
public static void update(Location loc) {
ArrayList<Chunk> chunks = new ArrayList<>();
final int distance = Bukkit.getViewDistance();
for (int cx = -distance; cx < distance; cx++) {
for (int cz = -distance; cz < distance; cz++) {
final Chunk chunk = loc.getWorld().getChunkAt(loc.getChunk().getX() + cx, loc.getChunk().getZ() + cz);
chunks.add(chunk);
}
}
AbstractSetBlock.setBlockManager.update(chunks);
}
public static void autoMerge(final World world, final Plot plot, final Player player) {
=======
public static void autoMerge(final String world, final Plot plot, final Player player) { public static void autoMerge(final String world, final Plot plot, final Player player) {
>>>>>>> Stashed changes
if (plot == null) { if (plot == null) {
return; return;
} }
@ -496,11 +383,8 @@ import com.intellectualcrafters.plot.object.PlotWorld;
update(player.getLocation()); update(player.getLocation());
} }
<<<<<<< Updated upstream
private static boolean ownsPlots(final World world, final ArrayList<PlotId> plots, final Player player, final int dir) {
=======
private static boolean ownsPlots(final String world, final ArrayList<PlotId> plots, final Player player, final int dir) { private static boolean ownsPlots(final String world, final ArrayList<PlotId> plots, final Player player, final int dir) {
>>>>>>> Stashed changes
final PlotId id_min = plots.get(0); final PlotId id_min = plots.get(0);
final PlotId id_max = plots.get(plots.size() - 1); final PlotId id_max = plots.get(plots.size() - 1);
for (final PlotId myid : plots) { for (final PlotId myid : plots) {
@ -566,28 +450,18 @@ import com.intellectualcrafters.plot.object.PlotWorld;
return p; return p;
} }
<<<<<<< Updated upstream
public static int getLoadedChunks(final World world) {
return world.getLoadedChunks().length;
}
public static int getEntities(final World world) {
=======
public static int getLoadedChunks(final String world) { public static int getLoadedChunks(final String world) {
return world.getLoadedChunks().length; return world.getLoadedChunks().length;
} }
public static int getEntities(final String world) { public static int getEntities(final String world) {
>>>>>>> Stashed changes
return world.getEntities().size(); return world.getEntities().size();
} }
<<<<<<< Updated upstream
public static int getTileEntities(final World world) {
=======
public static int getTileEntities(final String world) { public static int getTileEntities(final String world) {
>>>>>>> Stashed changes
PlotMain.getWorldSettings(world); PlotMain.getWorldSettings(world);
int x = 0; int x = 0;
for (final Chunk chunk : world.getLoadedChunks()) { for (final Chunk chunk : world.getLoadedChunks()) {
@ -596,11 +470,8 @@ import com.intellectualcrafters.plot.object.PlotWorld;
return x; return x;
} }
<<<<<<< Updated upstream
public static double getWorldFolderSize(final World world) {
=======
public static double getWorldFolderSize(final String world) { public static double getWorldFolderSize(final String world) {
>>>>>>> Stashed changes
// long size = FileUtil.sizeOfDirectory(world.getWorldFolder()); // long size = FileUtil.sizeOfDirectory(world.getWorldFolder());
final File folder = world.getWorldFolder(); final File folder = world.getWorldFolder();
final long size = folder.length(); final long size = folder.length();
@ -623,11 +494,8 @@ import com.intellectualcrafters.plot.object.PlotWorld;
return new short[]{Short.parseShort(block), 0}; return new short[]{Short.parseShort(block), 0};
} }
<<<<<<< Updated upstream
public static void clearAllEntities(final World world, final Plot plot, final boolean tile) {
=======
public static void clearAllEntities(final String world, final Plot plot, final boolean tile) { public static void clearAllEntities(final String world, final Plot plot, final boolean tile) {
>>>>>>> Stashed changes
final List<Entity> entities = world.getEntities(); final List<Entity> entities = world.getEntities();
for (final Entity entity : entities) { for (final Entity entity : entities) {
@ -651,11 +519,8 @@ import com.intellectualcrafters.plot.object.PlotWorld;
* @param plot * @param plot
* @param isDelete * @param isDelete
*/ */
<<<<<<< Updated upstream
public static void clear(final Player player, final World world, final Plot plot, final boolean isDelete) {
=======
public static void clear(final Player player, final String world, final Plot plot, final boolean isDelete) { public static void clear(final Player player, final String world, final Plot plot, final boolean isDelete) {
>>>>>>> Stashed changes
if (runners.containsKey(plot)) { if (runners.containsKey(plot)) {
PlayerFunctions.sendMessage(null, C.WAIT_FOR_TIMER); PlayerFunctions.sendMessage(null, C.WAIT_FOR_TIMER);
return; return;
@ -721,11 +586,6 @@ import com.intellectualcrafters.plot.object.PlotWorld;
PlayerFunctions.sendMessage(requester, C.CLEARING_PLOT); PlayerFunctions.sendMessage(requester, C.CLEARING_PLOT);
<<<<<<< Updated upstream
final World world;
=======
final String world;
>>>>>>> Stashed changes
world = requester.getWorld(); world = requester.getWorld();
clearAllEntities(world, plot, false); clearAllEntities(world, plot, false);
@ -733,11 +593,6 @@ import com.intellectualcrafters.plot.object.PlotWorld;
removeSign(world, plot); removeSign(world, plot);
} }
<<<<<<< Updated upstream
public static void setCuboid(final World world, final Location pos1, final Location pos2, final PlotBlock newblock) {
=======
public static void setCuboid(final String world, final Location pos1, final Location pos2, final PlotBlock newblock) {
>>>>>>> Stashed changes
for (int y = pos1.getBlockY(); y < pos2.getBlockY(); y++) { for (int y = pos1.getBlockY(); y < pos2.getBlockY(); y++) {
for (int x = pos1.getBlockX(); x < pos2.getBlockX(); x++) { for (int x = pos1.getBlockX(); x < pos2.getBlockX(); x++) {
for (int z = pos1.getBlockZ(); z < pos2.getBlockZ(); z++) { for (int z = pos1.getBlockZ(); z < pos2.getBlockZ(); z++) {
@ -750,11 +605,8 @@ import com.intellectualcrafters.plot.object.PlotWorld;
} }
} }
<<<<<<< Updated upstream
public static void setCuboid(final World world, final Location pos1, final Location pos2, final PlotBlock[] blocks) {
=======
public static void setCuboid(final String world, final Location pos1, final Location pos2, final PlotBlock[] blocks) { public static void setCuboid(final String world, final Location pos1, final Location pos2, final PlotBlock[] blocks) {
>>>>>>> Stashed changes
if (blocks.length == 1) { if (blocks.length == 1) {
setCuboid(world, pos1, pos2, blocks[0]); setCuboid(world, pos1, pos2, blocks[0]);
return; return;
@ -773,11 +625,8 @@ import com.intellectualcrafters.plot.object.PlotWorld;
} }
} }
<<<<<<< Updated upstream
public static void setSimpleCuboid(final World world, final Location pos1, final Location pos2, final PlotBlock newblock) {
=======
public static void setSimpleCuboid(final String world, final Location pos1, final Location pos2, final PlotBlock newblock) { public static void setSimpleCuboid(final String world, final Location pos1, final Location pos2, final PlotBlock newblock) {
>>>>>>> Stashed changes
for (int y = pos1.getBlockY(); y < pos2.getBlockY(); y++) { for (int y = pos1.getBlockY(); y < pos2.getBlockY(); y++) {
for (int x = pos1.getBlockX(); x < pos2.getBlockX(); x++) { for (int x = pos1.getBlockX(); x < pos2.getBlockX(); x++) {
for (int z = pos1.getBlockZ(); z < pos2.getBlockZ(); z++) { for (int z = pos1.getBlockZ(); z < pos2.getBlockZ(); z++) {
@ -790,11 +639,8 @@ import com.intellectualcrafters.plot.object.PlotWorld;
} }
} }
<<<<<<< Updated upstream
public static void setBiome(final World world, final Plot plot, final Biome b) {
=======
public static void setBiome(final String world, final Plot plot, final Biome b) { public static void setBiome(final String world, final Plot plot, final Biome b) {
>>>>>>> Stashed changes
final int bottomX = getPlotBottomLoc(world, plot.id).getBlockX(); final int bottomX = getPlotBottomLoc(world, plot.id).getBlockX();
final int topX = getPlotTopLoc(world, plot.id).getBlockX() + 1; final int topX = getPlotTopLoc(world, plot.id).getBlockX() + 1;
final int bottomZ = getPlotBottomLoc(world, plot.id).getBlockZ(); final int bottomZ = getPlotBottomLoc(world, plot.id).getBlockZ();
@ -820,11 +666,8 @@ import com.intellectualcrafters.plot.object.PlotWorld;
} }
} }
<<<<<<< Updated upstream
public static int getHeighestBlock(final World world, final int x, final int z) {
=======
public static int getHeighestBlock(final String world, final int x, final int z) { public static int getHeighestBlock(final String world, final int x, final int z) {
>>>>>>> Stashed changes
boolean safe = false; boolean safe = false;
int id; int id;
for (int i = 1; i < world.getMaxHeight(); i++) { for (int i = 1; i < world.getMaxHeight(); i++) {
@ -898,11 +741,8 @@ import com.intellectualcrafters.plot.object.PlotWorld;
* @param world World in which the plot is located * @param world World in which the plot is located
* @param plot Plot Object * @param plot Plot Object
*/ */
<<<<<<< Updated upstream
public static void refreshPlotChunks(final World world, final Plot plot) {
=======
public static void refreshPlotChunks(final String world, final Plot plot) { public static void refreshPlotChunks(final String world, final Plot plot) {
>>>>>>> Stashed changes
final int bottomX = getPlotBottomLoc(world, plot.id).getBlockX(); final int bottomX = getPlotBottomLoc(world, plot.id).getBlockX();
final int topX = getPlotTopLoc(world, plot.id).getBlockX(); final int topX = getPlotTopLoc(world, plot.id).getBlockX();
final int bottomZ = getPlotBottomLoc(world, plot.id).getBlockZ(); final int bottomZ = getPlotBottomLoc(world, plot.id).getBlockZ();
@ -946,11 +786,8 @@ import com.intellectualcrafters.plot.object.PlotWorld;
* *
* @return * @return
*/ */
<<<<<<< Updated upstream
public static Location getPlotTopLocAbs(final World world, final PlotId id) {
=======
public static Location getPlotTopLocAbs(final String world, final PlotId id) { public static Location getPlotTopLocAbs(final String world, final PlotId id) {
>>>>>>> Stashed changes
final PlotWorld plotworld = PlotMain.getWorldSettings(world); final PlotWorld plotworld = PlotMain.getWorldSettings(world);
final PlotManager manager = PlotMain.getPlotManager(world); final PlotManager manager = PlotMain.getPlotManager(world);
return manager.getPlotTopLocAbs(plotworld, id); return manager.getPlotTopLocAbs(plotworld, id);
@ -965,11 +802,8 @@ import com.intellectualcrafters.plot.object.PlotWorld;
* *
* @return * @return
*/ */
<<<<<<< Updated upstream
public static Location getPlotBottomLocAbs(final World world, final PlotId id) {
=======
public static Location getPlotBottomLocAbs(final String world, final PlotId id) { public static Location getPlotBottomLocAbs(final String world, final PlotId id) {
>>>>>>> Stashed changes
final PlotWorld plotworld = PlotMain.getWorldSettings(world); final PlotWorld plotworld = PlotMain.getWorldSettings(world);
final PlotManager manager = PlotMain.getPlotManager(world); final PlotManager manager = PlotMain.getPlotManager(world);
return manager.getPlotBottomLocAbs(plotworld, id); return manager.getPlotBottomLocAbs(plotworld, id);
@ -983,11 +817,8 @@ import com.intellectualcrafters.plot.object.PlotWorld;
* *
* @return * @return
*/ */
<<<<<<< Updated upstream
public static int getPlotWidth(final World world, final PlotId id) {
=======
public static int getPlotWidth(final String world, final PlotId id) { public static int getPlotWidth(final String world, final PlotId id) {
>>>>>>> Stashed changes
return getPlotTopLoc(world, id).getBlockX() - getPlotBottomLoc(world, id).getBlockX(); return getPlotTopLoc(world, id).getBlockX() - getPlotBottomLoc(world, id).getBlockX();
} }
@ -1000,11 +831,8 @@ import com.intellectualcrafters.plot.object.PlotWorld;
* *
* @return * @return
*/ */
<<<<<<< Updated upstream
public static Location getPlotTopLoc(final World world, PlotId id) {
=======
public static Location getPlotTopLoc(final String world, PlotId id) { public static Location getPlotTopLoc(final String world, PlotId id) {
>>>>>>> Stashed changes
final Plot plot = PlotMain.getPlots(world).get(id); final Plot plot = PlotMain.getPlots(world).get(id);
if (plot != null) { if (plot != null) {
id = PlayerFunctions.getTopPlot(world, plot).id; id = PlayerFunctions.getTopPlot(world, plot).id;
@ -1023,11 +851,8 @@ import com.intellectualcrafters.plot.object.PlotWorld;
* *
* @return * @return
*/ */
<<<<<<< Updated upstream
public static Location getPlotBottomLoc(final World world, PlotId id) {
=======
public static Location getPlotBottomLoc(final String world, PlotId id) { public static Location getPlotBottomLoc(final String world, PlotId id) {
>>>>>>> Stashed changes
final Plot plot = PlotMain.getPlots(world).get(id); final Plot plot = PlotMain.getPlots(world).get(id);
if (plot != null) { if (plot != null) {
id = PlayerFunctions.getBottomPlot(world, plot).id; id = PlayerFunctions.getBottomPlot(world, plot).id;
@ -1037,11 +862,8 @@ import com.intellectualcrafters.plot.object.PlotWorld;
return manager.getPlotBottomLocAbs(plotworld, id); return manager.getPlotBottomLocAbs(plotworld, id);
} }
<<<<<<< Updated upstream
public static boolean isUnowned(final World world, final PlotId pos1, final PlotId pos2) {
=======
public static boolean isUnowned(final String world, final PlotId pos1, final PlotId pos2) { public static boolean isUnowned(final String world, final PlotId pos1, final PlotId pos2) {
>>>>>>> Stashed changes
for (int x = pos1.x; x <= pos2.x; x++) { for (int x = pos1.x; x <= pos2.x; x++) {
for (int y = pos1.y; y <= pos2.y; y++) { for (int y = pos1.y; y <= pos2.y; y++) {
final PlotId id = new PlotId(x, y); final PlotId id = new PlotId(x, y);
@ -1055,18 +877,6 @@ import com.intellectualcrafters.plot.object.PlotWorld;
return true; return true;
} }
<<<<<<< Updated upstream
public static boolean move(final World world, final PlotId current, PlotId newPlot, final Runnable whenDone) {
final Location bot1 = PlotHelper.getPlotBottomLoc(world, current);
Location bot2 = PlotHelper.getPlotBottomLoc(world, newPlot);
final Location top = PlotHelper.getPlotTopLoc(world, current);
final Plot currentPlot = PlotHelper.getPlot(world, current);
if (currentPlot.owner == null) {
return false;
}
Plot pos1 = PlayerFunctions.getBottomPlot(world, currentPlot);
Plot pos2 = PlayerFunctions.getTopPlot(world, currentPlot);
=======
public static boolean move(final String world, final PlotId current, PlotId newPlot, final Runnable whenDone) { public static boolean move(final String world, final PlotId current, PlotId newPlot, final Runnable whenDone) {
String worldname = world.getName(); String worldname = world.getName();
final com.intellectualcrafters.plot.object.Location bot1 = PlotHelper.getPlotBottomLoc(worldname, current); final com.intellectualcrafters.plot.object.Location bot1 = PlotHelper.getPlotBottomLoc(worldname, current);
@ -1078,7 +888,7 @@ import com.intellectualcrafters.plot.object.PlotWorld;
} }
Plot pos1 = PlayerFunctions.getBottomPlot(worldname, currentPlot); Plot pos1 = PlayerFunctions.getBottomPlot(worldname, currentPlot);
Plot pos2 = PlayerFunctions.getTopPlot(worldname, currentPlot); Plot pos2 = PlayerFunctions.getTopPlot(worldname, currentPlot);
>>>>>>> Stashed changes
PlotId size = PlotHelper.getSize(world, currentPlot); PlotId size = PlotHelper.getSize(world, currentPlot);
if (!PlotHelper.isUnowned(world, newPlot, new PlotId(newPlot.x + size.x - 1, newPlot.y + size.y - 1))) { if (!PlotHelper.isUnowned(world, newPlot, new PlotId(newPlot.x + size.x - 1, newPlot.y + size.y - 1))) {
return false; return false;
@ -1107,11 +917,8 @@ import com.intellectualcrafters.plot.object.PlotWorld;
return true; return true;
} }
<<<<<<< Updated upstream
public static PlotId getSize(World world, Plot plot) {
=======
public static PlotId getSize(String world, Plot plot) { public static PlotId getSize(String world, Plot plot) {
>>>>>>> Stashed changes
PlotSettings settings = plot.settings; PlotSettings settings = plot.settings;
if (!settings.isMerged()) { if (!settings.isMerged()) {
return new PlotId(1,1); return new PlotId(1,1);
@ -1129,11 +936,8 @@ import com.intellectualcrafters.plot.object.PlotWorld;
* *
* @return * @return
*/ */
<<<<<<< Updated upstream
public static Plot getPlot(final World world, final PlotId id) {
=======
public static Plot getPlot(final String world, final PlotId id) { public static Plot getPlot(final String world, final PlotId id) {
>>>>>>> Stashed changes
if (id == null) { if (id == null) {
return null; return null;
} }

View File

@ -36,11 +36,8 @@ import com.intellectualcrafters.plot.util.ReflectionUtils.RefMethod;
* *
* @author Empire92 * @author Empire92
*/ */
<<<<<<< Updated upstream
public class SetBlockFast extends AbstractSetBlock {
=======
public class SetBlockFast extends SetBlockManager { public class SetBlockFast extends SetBlockManager {
>>>>>>> Stashed changes
private static final RefClass classBlock = getRefClass("{nms}.Block"); private static final RefClass classBlock = getRefClass("{nms}.Block");
private static final RefClass classChunk = getRefClass("{nms}.Chunk"); private static final RefClass classChunk = getRefClass("{nms}.Chunk");
@ -77,20 +74,11 @@ public class SetBlockFast extends SetBlockManager {
* @return true * @return true
*/ */
@Override @Override
<<<<<<< Updated upstream
public boolean set(final org.bukkit.World world, final int x, final int y, final int z, final int blockId, final byte data) {
=======
public void set(final org.bukkit.World world, final int x, final int y, final int z, final int blockId, final byte data) { public void set(final org.bukkit.World world, final int x, final int y, final int z, final int blockId, final byte data) {
>>>>>>> Stashed changes
final Object w = methodGetHandle.of(world).call(); final Object w = methodGetHandle.of(world).call();
final Object chunk = methodGetChunkAt.of(w).call(x >> 4, z >> 4); final Object chunk = methodGetChunkAt.of(w).call(x >> 4, z >> 4);
final Object block = methodGetById.of(null).call(blockId); final Object block = methodGetById.of(null).call(blockId);
methodA.of(chunk).call(x & 0x0f, y, z & 0x0f, block, data); methodA.of(chunk).call(x & 0x0f, y, z & 0x0f, block, data);
<<<<<<< Updated upstream
return true;
=======
>>>>>>> Stashed changes
} }
/** /**

View File

@ -37,11 +37,8 @@ import com.intellectualcrafters.plot.util.ReflectionUtils.RefMethod;
* *
* @author Empire92 * @author Empire92
*/ */
<<<<<<< Updated upstream
public class SetBlockFast_1_8 extends AbstractSetBlock {
=======
public class SetBlockFast_1_8 extends SetBlockManager { public class SetBlockFast_1_8 extends SetBlockManager {
>>>>>>> Stashed changes
private static final RefClass classBlock = getRefClass("{nms}.Block"); private static final RefClass classBlock = getRefClass("{nms}.Block");
private static final RefClass classBlockPosition = getRefClass("{nms}.BlockPosition"); private static final RefClass classBlockPosition = getRefClass("{nms}.BlockPosition");
@ -89,20 +86,14 @@ public class SetBlockFast_1_8 extends SetBlockManager {
* @return true * @return true
*/ */
@Override @Override
<<<<<<< Updated upstream
public boolean set(final World world, final int x, final int y, final int z, final int blockId, final byte data) {
=======
public void set(final World world, final int x, final int y, final int z, final int blockId, final byte data) { public void set(final World world, final int x, final int y, final int z, final int blockId, final byte data) {
>>>>>>> Stashed changes
final Object w = methodGetHandle.of(world).call(); final Object w = methodGetHandle.of(world).call();
final Object chunk = methodGetChunkAt.of(w).call(x >> 4, z >> 4); final Object chunk = methodGetChunkAt.of(w).call(x >> 4, z >> 4);
final Object pos = constructorBlockPosition.create((int) (x & 0x0f), y, (int) (z & 0x0f)); final Object pos = constructorBlockPosition.create((int) (x & 0x0f), y, (int) (z & 0x0f));
final Object id = methodGetByCombinedId.of(null).call(blockId + (data << 12)); final Object id = methodGetByCombinedId.of(null).call(blockId + (data << 12));
methodA.of(chunk).call(pos, id); methodA.of(chunk).call(pos, id);
<<<<<<< Updated upstream
return true;
=======
>>>>>>> Stashed changes
} }
/** /**

View File

@ -6,17 +6,11 @@ import org.bukkit.Chunk;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.Block; import org.bukkit.block.Block;
<<<<<<< Updated upstream
public class SetBlockSlow extends AbstractSetBlock {
@Override
public boolean set(World world, int x, int y, int z, int id, byte data) {
=======
public class SetBlockSlow extends SetBlockManager { public class SetBlockSlow extends SetBlockManager {
@Override @Override
public void set(World world, int x, int y, int z, int id, byte data) { public void set(World world, int x, int y, int z, int id, byte data) {
>>>>>>> Stashed changes
Block block = world.getBlockAt(x, y, z); Block block = world.getBlockAt(x, y, z);
if (block.getData() == data) { if (block.getData() == data) {
if (block.getTypeId() != id) { if (block.getTypeId() != id) {
@ -29,16 +23,11 @@ public class SetBlockSlow extends SetBlockManager {
block.setTypeIdAndData(id, data, false); block.setTypeIdAndData(id, data, false);
} }
} }
<<<<<<< Updated upstream
return false;
=======
>>>>>>> Stashed changes
} }
@Override @Override
public void update(List<Chunk> chunks) { public void update(List<Chunk> chunks) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
} }
} }