mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 12:35:15 +01:00
loc
This commit is contained in:
parent
55e2465bee
commit
eb828639bb
@ -2,12 +2,8 @@ package com.intellectualcrafters.plot;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import net.milkbowl.vault.economy.Economy;
|
||||
|
||||
import com.intellectualcrafters.plot.object.Location;
|
||||
import com.intellectualcrafters.plot.object.Plot;
|
||||
import com.intellectualcrafters.plot.object.PlotId;
|
||||
import com.intellectualcrafters.plot.util.TaskManager;
|
||||
|
||||
|
@ -14,9 +14,9 @@ import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
import net.milkbowl.vault.economy.Economy;
|
||||
|
||||
@ -49,10 +49,10 @@ import com.intellectualcrafters.plot.object.PlotWorld;
|
||||
import com.intellectualcrafters.plot.util.ClusterManager;
|
||||
import com.intellectualcrafters.plot.util.ExpireManager;
|
||||
import com.intellectualcrafters.plot.util.Logger;
|
||||
import com.intellectualcrafters.plot.util.PlotHelper;
|
||||
import com.intellectualcrafters.plot.util.UUIDHandler;
|
||||
import com.intellectualcrafters.plot.util.Logger.LogLevel;
|
||||
import com.intellectualcrafters.plot.util.PlotHelper;
|
||||
import com.intellectualcrafters.plot.util.TaskManager;
|
||||
import com.intellectualcrafters.plot.util.UUIDHandler;
|
||||
|
||||
public class PlotSquared {
|
||||
|
||||
|
@ -383,7 +383,7 @@ public class _PlotSquared {
|
||||
return true;
|
||||
}
|
||||
PlayerFunctions.sendMessage(player, C.TELEPORT_IN_SECONDS, Settings.TELEPORT_DELAY + "");
|
||||
Location loc = player.getLocation();
|
||||
Location loc = BukkitUtil.getLocation(entity);
|
||||
final String world = player.getWorld();
|
||||
final String name = player.getName();
|
||||
TaskManager.TELEPORT_QUEUE.add(name);
|
||||
@ -398,7 +398,7 @@ public class _PlotSquared {
|
||||
if (!player.isOnline()) {
|
||||
return;
|
||||
}
|
||||
Location loc = player.getLocation();
|
||||
Location loc = BukkitUtil.getLocation(entity);
|
||||
if (!loc.getWorld().equals(world)) {
|
||||
PlayerFunctions.sendMessage(player, C.TELEPORT_FAILED);
|
||||
return;
|
||||
|
@ -21,31 +21,6 @@
|
||||
|
||||
package com.intellectualcrafters.plot.api;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Set;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import com.intellectualcrafters.plot.PlotSquared;
|
||||
import com.intellectualcrafters.plot.commands.MainCommand;
|
||||
import com.intellectualcrafters.plot.commands.SubCommand;
|
||||
import com.intellectualcrafters.plot.config.C;
|
||||
import com.intellectualcrafters.plot.flag.AbstractFlag;
|
||||
import com.intellectualcrafters.plot.flag.FlagManager;
|
||||
import com.intellectualcrafters.plot.object.Plot;
|
||||
import com.intellectualcrafters.plot.object.PlotId;
|
||||
import com.intellectualcrafters.plot.object.PlotManager;
|
||||
import com.intellectualcrafters.plot.object.PlotWorld;
|
||||
import com.intellectualcrafters.plot.util.PlayerFunctions;
|
||||
import com.intellectualcrafters.plot.util.PlotHelper;
|
||||
import com.intellectualcrafters.plot.util.PlotSquaredException;
|
||||
import com.intellectualcrafters.plot.util.SchematicHandler;
|
||||
import com.intellectualcrafters.plot.util.UUIDHandler;
|
||||
|
||||
/**
|
||||
* PlotSquared API
|
||||
@ -423,7 +398,7 @@ import com.intellectualcrafters.plot.util.UUIDHandler;
|
||||
// * @see com.intellectualcrafters.plot.object.Plot
|
||||
// */
|
||||
// public Plot getPlot(final Player player) {
|
||||
// return this.getPlot(player.getLocation());
|
||||
// return this.getPlot(BukkitUtil.getLocation(entity));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
|
@ -27,11 +27,10 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.intellectualcrafters.plot.BukkitMain;
|
||||
import com.intellectualcrafters.plot.PlotSquared;
|
||||
import com.intellectualcrafters.plot.config.C;
|
||||
import com.intellectualcrafters.plot.events.PlayerClaimPlotEvent;
|
||||
import com.intellectualcrafters.plot.generator.ClassicPlotWorld;
|
||||
import com.intellectualcrafters.plot.generator.HybridPlotWorld;
|
||||
import com.intellectualcrafters.plot.object.Plot;
|
||||
import com.intellectualcrafters.plot.object.PlotWorld;
|
||||
import com.intellectualcrafters.plot.util.PlayerFunctions;
|
||||
@ -62,7 +61,7 @@ public class Claim extends SubCommand {
|
||||
PlotHelper.setSign(player, plot);
|
||||
PlayerFunctions.sendMessage(player, C.CLAIMED);
|
||||
if (teleport) {
|
||||
PlotSquared.teleportPlayer(player, player.getLocation(), plot);
|
||||
PlotSquared.teleportPlayer(player, BukkitUtil.getLocation(entity), plot);
|
||||
}
|
||||
World world = plot.getWorld();
|
||||
final PlotWorld plotworld = PlotSquared.getWorldSettings(world);
|
||||
@ -79,10 +78,10 @@ public class Claim extends SubCommand {
|
||||
sch = SchematicHandler.getSchematic(plotworld.SCHEMATIC_FILE);
|
||||
}
|
||||
}
|
||||
SchematicHandler.paste(player.getLocation(), sch, plot2, 0, 0);
|
||||
SchematicHandler.paste(BukkitUtil.getLocation(entity), sch, plot2, 0, 0);
|
||||
}
|
||||
PlotSquared.getPlotManager(plot.world).claimPlot(world, plotworld, plot);
|
||||
PlotHelper.update(player.getLocation());
|
||||
PlotHelper.update(BukkitUtil.getLocation(entity));
|
||||
}
|
||||
return event.isCancelled();
|
||||
}
|
||||
|
@ -24,6 +24,7 @@ package com.intellectualcrafters.plot.commands;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.intellectualcrafters.plot.BukkitMain;
|
||||
import com.intellectualcrafters.plot.PlotSquared;
|
||||
import com.intellectualcrafters.plot.config.C;
|
||||
import com.intellectualcrafters.plot.object.Plot;
|
||||
|
@ -30,6 +30,7 @@ import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.generator.BlockPopulator;
|
||||
|
||||
import com.intellectualcrafters.plot.BukkitMain;
|
||||
import com.intellectualcrafters.plot.PlotSquared;
|
||||
import com.intellectualcrafters.plot.config.C;
|
||||
import com.intellectualcrafters.plot.database.DBFunc;
|
||||
|
@ -23,7 +23,7 @@ package com.intellectualcrafters.plot.commands;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.intellectualcrafters.plot.PlotSquared;
|
||||
import com.intellectualcrafters.plot.BukkitMain;
|
||||
|
||||
/**
|
||||
* Created by Citymonstret on 2014-08-03.
|
||||
|
@ -27,7 +27,7 @@ import java.util.List;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.intellectualcrafters.plot.PlotSquared;
|
||||
import com.intellectualcrafters.plot.BukkitMain;
|
||||
import com.intellectualcrafters.plot.config.C;
|
||||
import com.intellectualcrafters.plot.database.DBFunc;
|
||||
import com.intellectualcrafters.plot.object.Plot;
|
||||
|
@ -23,7 +23,7 @@ package com.intellectualcrafters.plot.commands;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.intellectualcrafters.plot.PlotSquared;
|
||||
import com.intellectualcrafters.plot.BukkitMain;
|
||||
import com.intellectualcrafters.plot.config.C;
|
||||
import com.intellectualcrafters.plot.object.Plot;
|
||||
import com.intellectualcrafters.plot.object.PlotSelection;
|
||||
|
@ -54,7 +54,7 @@ public class CreateRoadSchematic extends SubCommand {
|
||||
HybridPlotManager manager = (HybridPlotManager) PlotSquared.getPlotManager(player.getWorld());
|
||||
|
||||
manager.setupRoadSchematic(plot);
|
||||
PlotHelper.update(player.getLocation());
|
||||
PlotHelper.update(BukkitUtil.getLocation(entity));
|
||||
PlayerFunctions.sendMessage(player, "&6Saved new road schematic");
|
||||
|
||||
return true;
|
||||
|
@ -68,7 +68,7 @@ public class DebugClaimTest extends SubCommand {
|
||||
PlotHelper.setSign(player, plot);
|
||||
PlayerFunctions.sendMessage(player, C.CLAIMED);
|
||||
if (teleport) {
|
||||
PlotSquared.teleportPlayer(player, player.getLocation(), plot);
|
||||
PlotSquared.teleportPlayer(player, BukkitUtil.getLocation(entity), plot);
|
||||
}
|
||||
}
|
||||
return event.isCancelled();
|
||||
|
@ -26,6 +26,7 @@ import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.intellectualcrafters.plot.BukkitMain;
|
||||
import com.intellectualcrafters.plot.PlotSquared;
|
||||
import com.intellectualcrafters.plot.config.C;
|
||||
import com.intellectualcrafters.plot.generator.SquarePlotWorld;
|
||||
|
@ -30,8 +30,8 @@ import com.intellectualcrafters.plot.PlotSquared;
|
||||
import com.intellectualcrafters.plot.config.C;
|
||||
import com.intellectualcrafters.plot.generator.HybridPlotManager;
|
||||
import com.intellectualcrafters.plot.generator.HybridPlotWorld;
|
||||
import com.intellectualcrafters.plot.util.SetBlockManager;
|
||||
import com.intellectualcrafters.plot.util.PlayerFunctions;
|
||||
import com.intellectualcrafters.plot.util.SetBlockManager;
|
||||
|
||||
public class DebugRoadRegen extends SubCommand {
|
||||
|
||||
@ -46,7 +46,7 @@ public class DebugRoadRegen extends SubCommand {
|
||||
}
|
||||
HybridPlotManager manager = (HybridPlotManager) PlotSquared.getPlotManager(player.getWorld());
|
||||
|
||||
Chunk chunk = player.getLocation().getChunk();
|
||||
Chunk chunk = BukkitUtil.getLocation(entity).getChunk();
|
||||
boolean result = manager.regenerateRoad(chunk);
|
||||
if (result) {
|
||||
SetBlockManager.setBlockManager.update(Arrays.asList(new Chunk[] {chunk}));
|
||||
|
@ -25,6 +25,7 @@ import net.milkbowl.vault.economy.Economy;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.intellectualcrafters.plot.BukkitMain;
|
||||
import com.intellectualcrafters.plot.PlotSquared;
|
||||
import com.intellectualcrafters.plot.config.C;
|
||||
import com.intellectualcrafters.plot.database.DBFunc;
|
||||
|
@ -26,7 +26,7 @@ import java.util.UUID;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.intellectualcrafters.plot.PlotSquared;
|
||||
import com.intellectualcrafters.plot.BukkitMain;
|
||||
import com.intellectualcrafters.plot.config.C;
|
||||
import com.intellectualcrafters.plot.database.DBFunc;
|
||||
import com.intellectualcrafters.plot.events.PlayerPlotDeniedEvent;
|
||||
|
@ -28,7 +28,7 @@ import java.util.HashMap;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.intellectualcrafters.plot.PlotSquared;
|
||||
import com.intellectualcrafters.plot.BukkitMain;
|
||||
import com.intellectualcrafters.plot.config.C;
|
||||
import com.intellectualcrafters.plot.database.DBFunc;
|
||||
import com.intellectualcrafters.plot.flag.AbstractFlag;
|
||||
|
@ -26,7 +26,7 @@ import java.util.UUID;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.intellectualcrafters.plot.PlotSquared;
|
||||
import com.intellectualcrafters.plot.BukkitMain;
|
||||
import com.intellectualcrafters.plot.config.C;
|
||||
import com.intellectualcrafters.plot.database.DBFunc;
|
||||
import com.intellectualcrafters.plot.events.PlayerPlotHelperEvent;
|
||||
|
@ -88,7 +88,7 @@ public class Home extends SubCommand {
|
||||
}
|
||||
|
||||
public void teleportPlayer(Player player, Plot plot) {
|
||||
PlotSquared.teleportPlayer(player, player.getLocation(), plot);
|
||||
PlotSquared.teleportPlayer(player, BukkitUtil.getLocation(entity), plot);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -29,6 +29,7 @@ import java.util.UUID;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.intellectualcrafters.plot.BukkitMain;
|
||||
import com.intellectualcrafters.plot.PlotSquared;
|
||||
import com.intellectualcrafters.plot.config.C;
|
||||
import com.intellectualcrafters.plot.database.DBFunc;
|
||||
|
@ -24,7 +24,7 @@ package com.intellectualcrafters.plot.commands;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.intellectualcrafters.plot.PlotSquared;
|
||||
import com.intellectualcrafters.plot.BukkitMain;
|
||||
import com.intellectualcrafters.plot.config.C;
|
||||
import com.intellectualcrafters.plot.object.Plot;
|
||||
import com.intellectualcrafters.plot.util.PlayerFunctions;
|
||||
|
@ -30,6 +30,7 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.intellectualcrafters.plot.BukkitMain;
|
||||
import com.intellectualcrafters.plot.PlotSquared;
|
||||
import com.intellectualcrafters.plot.config.C;
|
||||
import com.intellectualcrafters.plot.events.PlotMergeEvent;
|
||||
|
@ -21,21 +21,12 @@
|
||||
|
||||
package com.intellectualcrafters.plot.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.intellectualcrafters.plot.PlotSquared;
|
||||
import com.intellectualcrafters.plot.database.DBFunc;
|
||||
import com.intellectualcrafters.plot.object.Plot;
|
||||
import com.intellectualcrafters.plot.object.PlotId;
|
||||
import com.intellectualcrafters.plot.util.ChunkManager;
|
||||
import com.intellectualcrafters.plot.util.PlayerFunctions;
|
||||
import com.intellectualcrafters.plot.util.PlotHelper;
|
||||
import com.intellectualcrafters.plot.util.bukkit.BukkitTaskManager;
|
||||
|
||||
/**
|
||||
* Created 2014-08-01 for PlotSquared
|
||||
|
@ -23,7 +23,7 @@ package com.intellectualcrafters.plot.commands;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.intellectualcrafters.plot.PlotSquared;
|
||||
import com.intellectualcrafters.plot.BukkitMain;
|
||||
import com.intellectualcrafters.plot.config.C;
|
||||
import com.intellectualcrafters.plot.object.Plot;
|
||||
import com.intellectualcrafters.plot.object.PlotSelection;
|
||||
|
@ -26,6 +26,7 @@ import org.bukkit.entity.Player;
|
||||
import com.intellectualcrafters.plot.PlotSquared;
|
||||
import com.intellectualcrafters.plot.config.C;
|
||||
import com.intellectualcrafters.plot.object.PlotWorld;
|
||||
import com.intellectualcrafters.plot.util.MainUtil;
|
||||
import com.intellectualcrafters.plot.util.PlayerFunctions;
|
||||
|
||||
public class Reload extends SubCommand {
|
||||
|
@ -31,6 +31,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import com.intellectualcrafters.jnbt.CompoundTag;
|
||||
import com.intellectualcrafters.plot.BukkitMain;
|
||||
import com.intellectualcrafters.plot.PlotSquared;
|
||||
import com.intellectualcrafters.plot.config.C;
|
||||
import com.intellectualcrafters.plot.config.Settings;
|
||||
|
@ -21,7 +21,6 @@
|
||||
|
||||
package com.intellectualcrafters.plot.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@ -33,15 +32,14 @@ import org.bukkit.World;
|
||||
import org.bukkit.block.Biome;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.intellectualcrafters.plot.BukkitMain;
|
||||
import com.intellectualcrafters.plot.PlotSquared;
|
||||
import com.intellectualcrafters.plot.config.C;
|
||||
import com.intellectualcrafters.plot.config.Configuration;
|
||||
import com.intellectualcrafters.plot.config.Configuration.SettingValue;
|
||||
import com.intellectualcrafters.plot.database.DBFunc;
|
||||
import com.intellectualcrafters.plot.flag.AbstractFlag;
|
||||
import com.intellectualcrafters.plot.flag.Flag;
|
||||
import com.intellectualcrafters.plot.flag.FlagManager;
|
||||
import com.intellectualcrafters.plot.flag.FlagValue;
|
||||
import com.intellectualcrafters.plot.listeners.PlotListener;
|
||||
import com.intellectualcrafters.plot.object.BlockLoc;
|
||||
import com.intellectualcrafters.plot.object.Plot;
|
||||
|
@ -27,6 +27,7 @@ import java.util.UUID;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.intellectualcrafters.plot.BukkitMain;
|
||||
import com.intellectualcrafters.plot.PlotSquared;
|
||||
import com.intellectualcrafters.plot.config.C;
|
||||
import com.intellectualcrafters.plot.database.DBFunc;
|
||||
|
@ -24,6 +24,7 @@ package com.intellectualcrafters.plot.commands;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.intellectualcrafters.plot.BukkitMain;
|
||||
import com.intellectualcrafters.plot.PlotSquared;
|
||||
import com.intellectualcrafters.plot.config.C;
|
||||
import com.intellectualcrafters.plot.database.DBFunc;
|
||||
|
@ -28,7 +28,6 @@ import java.nio.file.Paths;
|
||||
import java.nio.file.attribute.BasicFileAttributes;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
@ -37,13 +36,10 @@ import org.bukkit.entity.Player;
|
||||
|
||||
import com.intellectualcrafters.plot.PlotSquared;
|
||||
import com.intellectualcrafters.plot.config.C;
|
||||
import com.intellectualcrafters.plot.generator.SquarePlotManager;
|
||||
import com.intellectualcrafters.plot.generator.SquarePlotWorld;
|
||||
import com.intellectualcrafters.plot.object.ChunkLoc;
|
||||
import com.intellectualcrafters.plot.object.Plot;
|
||||
import com.intellectualcrafters.plot.object.PlotId;
|
||||
import com.intellectualcrafters.plot.util.ChunkManager;
|
||||
import com.intellectualcrafters.plot.util.ExpireManager;
|
||||
import com.intellectualcrafters.plot.util.PlayerFunctions;
|
||||
import com.intellectualcrafters.plot.util.PlotHelper;
|
||||
import com.intellectualcrafters.plot.util.bukkit.BukkitTaskManager;
|
||||
|
@ -26,7 +26,7 @@ import java.util.UUID;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.intellectualcrafters.plot.PlotSquared;
|
||||
import com.intellectualcrafters.plot.BukkitMain;
|
||||
import com.intellectualcrafters.plot.config.C;
|
||||
import com.intellectualcrafters.plot.database.DBFunc;
|
||||
import com.intellectualcrafters.plot.events.PlayerPlotTrustedEvent;
|
||||
|
@ -26,6 +26,7 @@ import net.milkbowl.vault.economy.Economy;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.intellectualcrafters.plot.BukkitMain;
|
||||
import com.intellectualcrafters.plot.PlotSquared;
|
||||
import com.intellectualcrafters.plot.config.C;
|
||||
import com.intellectualcrafters.plot.database.DBFunc;
|
||||
|
@ -27,6 +27,7 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.intellectualcrafters.plot.BukkitMain;
|
||||
import com.intellectualcrafters.plot.PlotSquared;
|
||||
import com.intellectualcrafters.plot.config.C;
|
||||
import com.intellectualcrafters.plot.database.DBFunc;
|
||||
|
@ -23,6 +23,7 @@ package com.intellectualcrafters.plot.commands;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.intellectualcrafters.plot.BukkitMain;
|
||||
import com.intellectualcrafters.plot.PlotSquared;
|
||||
import com.intellectualcrafters.plot.util.PWE;
|
||||
import com.intellectualcrafters.plot.util.PlayerFunctions;
|
||||
|
@ -21,11 +21,15 @@
|
||||
|
||||
package com.intellectualcrafters.plot.config;
|
||||
|
||||
import com.intellectualcrafters.plot.PlotSquared;
|
||||
import com.intellectualsites.translation.*;
|
||||
import com.intellectualsites.translation.bukkit.BukkitTranslation;
|
||||
import org.bukkit.ChatColor;
|
||||
|
||||
import com.intellectualsites.translation.TranslationFile;
|
||||
import com.intellectualsites.translation.TranslationLanguage;
|
||||
import com.intellectualsites.translation.TranslationManager;
|
||||
import com.intellectualsites.translation.TranslationObject;
|
||||
import com.intellectualsites.translation.YamlTranslationFile;
|
||||
import com.intellectualsites.translation.bukkit.BukkitTranslation;
|
||||
|
||||
/**
|
||||
* Captions class.
|
||||
*
|
||||
|
@ -25,8 +25,6 @@ import java.sql.Connection;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import com.intellectualcrafters.plot.PlotSquared;
|
||||
|
||||
/**
|
||||
|
@ -27,8 +27,6 @@ import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import com.intellectualcrafters.plot.PlotSquared;
|
||||
|
||||
/**
|
||||
|
@ -30,8 +30,6 @@ import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import com.intellectualcrafters.plot.PlotSquared;
|
||||
|
||||
/**
|
||||
|
@ -17,9 +17,9 @@ import com.intellectualcrafters.plot.object.PlotId;
|
||||
import com.intellectualcrafters.plot.object.PlotManager;
|
||||
import com.intellectualcrafters.plot.object.PlotWorld;
|
||||
import com.intellectualcrafters.plot.object.RegionWrapper;
|
||||
import com.intellectualcrafters.plot.util.SetBlockManager;
|
||||
import com.intellectualcrafters.plot.util.ChunkManager;
|
||||
import com.intellectualcrafters.plot.util.PlotHelper;
|
||||
import com.intellectualcrafters.plot.util.SetBlockManager;
|
||||
import com.intellectualcrafters.plot.util.bukkit.BukkitTaskManager;
|
||||
|
||||
public class AugmentedPopulator extends BlockPopulator {
|
||||
|
@ -1,25 +1,16 @@
|
||||
package com.intellectualcrafters.plot.generator;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Biome;
|
||||
import org.bukkit.block.Block;
|
||||
|
||||
import com.intellectualcrafters.plot.PlotSquared;
|
||||
import com.intellectualcrafters.plot.config.C;
|
||||
import com.intellectualcrafters.plot.object.ChunkLoc;
|
||||
import com.intellectualcrafters.plot.object.Plot;
|
||||
import com.intellectualcrafters.plot.object.PlotBlock;
|
||||
import com.intellectualcrafters.plot.object.PlotId;
|
||||
import com.intellectualcrafters.plot.object.PlotWorld;
|
||||
import com.intellectualcrafters.plot.util.ChunkManager;
|
||||
import com.intellectualcrafters.plot.util.PlayerFunctions;
|
||||
import com.intellectualcrafters.plot.util.PlotHelper;
|
||||
import com.intellectualcrafters.plot.util.UUIDHandler;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -29,7 +29,6 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Biome;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
@ -41,11 +40,10 @@ import com.intellectualcrafters.plot.object.Plot;
|
||||
import com.intellectualcrafters.plot.object.PlotBlock;
|
||||
import com.intellectualcrafters.plot.object.PlotId;
|
||||
import com.intellectualcrafters.plot.object.PlotWorld;
|
||||
import com.intellectualcrafters.plot.util.SetBlockManager;
|
||||
import com.intellectualcrafters.plot.util.ChunkManager;
|
||||
import com.intellectualcrafters.plot.util.PlayerFunctions;
|
||||
import com.intellectualcrafters.plot.util.PlotHelper;
|
||||
import com.intellectualcrafters.plot.util.SchematicHandler;
|
||||
import com.intellectualcrafters.plot.util.SetBlockManager;
|
||||
import com.intellectualcrafters.plot.util.UUIDHandler;
|
||||
import com.intellectualcrafters.plot.util.bukkit.BukkitTaskManager;
|
||||
|
||||
|
@ -83,6 +83,7 @@ import org.bukkit.event.world.ChunkLoadEvent;
|
||||
import org.bukkit.event.world.StructureGrowEvent;
|
||||
import org.bukkit.event.world.WorldInitEvent;
|
||||
|
||||
import com.intellectualcrafters.plot.BukkitMain;
|
||||
import com.intellectualcrafters.plot.PlotSquared;
|
||||
import com.intellectualcrafters.plot.commands.Setup;
|
||||
import com.intellectualcrafters.plot.config.C;
|
||||
|
@ -7,7 +7,7 @@ import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerInteractAtEntityEvent;
|
||||
|
||||
import com.intellectualcrafters.plot.PlotSquared;
|
||||
import com.intellectualcrafters.plot.BukkitMain;
|
||||
import com.intellectualcrafters.plot.config.C;
|
||||
import com.intellectualcrafters.plot.object.Plot;
|
||||
import com.intellectualcrafters.plot.util.PlayerFunctions;
|
||||
|
@ -46,7 +46,7 @@ import org.bukkit.event.player.PlayerPickupItemEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import com.intellectualcrafters.plot.PlotSquared;
|
||||
import com.intellectualcrafters.plot.BukkitMain;
|
||||
import com.intellectualcrafters.plot.config.C;
|
||||
import com.intellectualcrafters.plot.events.PlayerEnterPlotEvent;
|
||||
import com.intellectualcrafters.plot.events.PlayerLeavePlotEvent;
|
||||
|
@ -40,6 +40,7 @@ import org.bukkit.event.player.PlayerMoveEvent;
|
||||
import org.bukkit.event.player.PlayerPortalEvent;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||
|
||||
import com.intellectualcrafters.plot.BukkitMain;
|
||||
import com.intellectualcrafters.plot.PlotSquared;
|
||||
import com.intellectualcrafters.plot.config.C;
|
||||
import com.intellectualcrafters.plot.config.Settings;
|
||||
|
@ -31,7 +31,7 @@ import org.bukkit.World;
|
||||
import org.bukkit.block.Biome;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.intellectualcrafters.plot.PlotSquared;
|
||||
import com.intellectualcrafters.plot.BukkitMain;
|
||||
import com.intellectualcrafters.plot.database.DBFunc;
|
||||
import com.intellectualcrafters.plot.flag.Flag;
|
||||
import com.intellectualcrafters.plot.util.PlotHelper;
|
||||
|
@ -23,7 +23,6 @@ package com.intellectualcrafters.plot.object;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Biome;
|
||||
|
||||
public abstract class PlotManager {
|
||||
|
@ -1,7 +1,5 @@
|
||||
package com.intellectualcrafters.plot.util;
|
||||
|
||||
import org.bukkit.World;
|
||||
|
||||
import com.intellectualcrafters.plot.object.PlotBlock;
|
||||
import com.intellectualcrafters.plot.util.bukkit.BukkitUtil;
|
||||
|
||||
|
@ -10,7 +10,6 @@ import org.apache.commons.lang.mutable.MutableInt;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.DyeColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Note;
|
||||
import org.bukkit.SkullType;
|
||||
@ -43,10 +42,12 @@ import org.bukkit.plugin.Plugin;
|
||||
import com.intellectualcrafters.plot.PlotSquared;
|
||||
import com.intellectualcrafters.plot.object.BlockLoc;
|
||||
import com.intellectualcrafters.plot.object.ChunkLoc;
|
||||
import com.intellectualcrafters.plot.object.Location;
|
||||
import com.intellectualcrafters.plot.object.Plot;
|
||||
import com.intellectualcrafters.plot.object.RegionWrapper;
|
||||
import com.intellectualcrafters.plot.object.entity.EntityWrapper;
|
||||
import com.intellectualcrafters.plot.util.bukkit.BukkitTaskManager;
|
||||
import com.intellectualcrafters.plot.util.bukkit.BukkitUtil;
|
||||
|
||||
public class ChunkManager {
|
||||
|
||||
@ -57,8 +58,8 @@ public class ChunkManager {
|
||||
public static HashMap<Integer, Integer> tasks = new HashMap<>();
|
||||
|
||||
public static ChunkLoc getChunkChunk(Location loc) {
|
||||
int x = loc.getBlockX() >> 9;
|
||||
int z = loc.getBlockZ() >> 9;
|
||||
int x = loc.getX() >> 9;
|
||||
int z = loc.getZ() >> 9;
|
||||
return new ChunkLoc(x, z);
|
||||
}
|
||||
|
||||
@ -153,21 +154,21 @@ public class ChunkManager {
|
||||
*/
|
||||
public static boolean copyRegion(final Location pos1, final Location pos2, final Location newPos, final Runnable whenDone) {
|
||||
index.increment();
|
||||
final int relX = newPos.getBlockX() - pos1.getBlockX();
|
||||
final int relZ = newPos.getBlockZ() - pos1.getBlockZ();
|
||||
final RegionWrapper region = new RegionWrapper(pos1.getBlockX(), pos2.getBlockX(), pos1.getBlockZ(), pos2.getBlockZ());
|
||||
final int relX = newPos.getX() - pos1.getX();
|
||||
final int relZ = newPos.getZ() - pos1.getZ();
|
||||
final RegionWrapper region = new RegionWrapper(pos1.getX(), pos2.getX(), pos1.getZ(), pos2.getZ());
|
||||
|
||||
final World world = pos1.getWorld();
|
||||
Chunk c1 = world.getChunkAt(pos1);
|
||||
Chunk c2 = world.getChunkAt(pos2);
|
||||
|
||||
Chunk c3 = world.getChunkAt((pos1.getBlockX() + relX) >> 4, (pos1.getBlockZ() + relZ) >> 4);
|
||||
Chunk c4 = world.getChunkAt((pos2.getBlockX() + relX) >> 4, (pos2.getBlockZ() + relZ) >> 4);
|
||||
Chunk c3 = world.getChunkAt((pos1.getX() + relX) >> 4, (pos1.getZ() + relZ) >> 4);
|
||||
Chunk c4 = world.getChunkAt((pos2.getX() + relX) >> 4, (pos2.getZ() + relZ) >> 4);
|
||||
|
||||
final int sx = pos1.getBlockX();
|
||||
final int sz = pos1.getBlockZ();
|
||||
final int ex = pos2.getBlockX();
|
||||
final int ez = pos2.getBlockZ();
|
||||
final int sx = pos1.getX();
|
||||
final int sz = pos1.getZ();
|
||||
final int ex = pos2.getX();
|
||||
final int ez = pos2.getZ();
|
||||
|
||||
final int c1x = c1.getX();
|
||||
final int c1z = c1.getZ();
|
||||
@ -275,10 +276,10 @@ public class ChunkManager {
|
||||
Chunk c1 = world.getChunkAt(pos1);
|
||||
Chunk c2 = world.getChunkAt(pos2);
|
||||
|
||||
final int sx = pos1.getBlockX();
|
||||
final int sz = pos1.getBlockZ();
|
||||
final int ex = pos2.getBlockX();
|
||||
final int ez = pos2.getBlockZ();
|
||||
final int sx = pos1.getX();
|
||||
final int sz = pos1.getZ();
|
||||
final int ex = pos2.getX();
|
||||
final int ez = pos2.getZ();
|
||||
|
||||
final int c1x = c1.getX();
|
||||
final int c1z = c1.getZ();
|
||||
@ -304,7 +305,7 @@ public class ChunkManager {
|
||||
tasks.remove(currentIndex);
|
||||
return;
|
||||
}
|
||||
CURRENT_PLOT_CLEAR = new RegionWrapper(pos1.getBlockX(), pos2.getBlockX(), pos1.getBlockZ(), pos2.getBlockZ());
|
||||
CURRENT_PLOT_CLEAR = new RegionWrapper(pos1.getX(), pos2.getX(), pos1.getZ(), pos2.getZ());
|
||||
Chunk chunk = chunks.get(0);
|
||||
chunks.remove(0);
|
||||
int x = chunk.getX();
|
||||
@ -396,8 +397,8 @@ public class ChunkManager {
|
||||
public static void saveEntitiesOut(Chunk chunk, RegionWrapper region) {
|
||||
for (Entity entity : chunk.getEntities()) {
|
||||
Location loc = entity.getLocation();
|
||||
int x = loc.getBlockX();
|
||||
int z = loc.getBlockZ();
|
||||
int x = loc.getX();
|
||||
int z = loc.getZ();
|
||||
if (isIn(region, x, z)) {
|
||||
continue;
|
||||
}
|
||||
@ -411,9 +412,9 @@ public class ChunkManager {
|
||||
|
||||
public static void saveEntitiesIn(Chunk chunk, RegionWrapper region) {
|
||||
for (Entity entity : chunk.getEntities()) {
|
||||
Location loc = entity.getLocation();
|
||||
int x = loc.getBlockX();
|
||||
int z = loc.getBlockZ();
|
||||
Location loc = BukkitUtil.getLocation(entity);
|
||||
int x = loc.getX();
|
||||
int z = loc.getZ();
|
||||
if (!isIn(region, x, z)) {
|
||||
continue;
|
||||
}
|
||||
|
@ -25,6 +25,7 @@ import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.intellectualcrafters.plot.BukkitMain;
|
||||
import com.intellectualcrafters.plot.PlotSquared;
|
||||
import com.intellectualcrafters.plot.database.DBFunc;
|
||||
import com.intellectualcrafters.plot.flag.FlagManager;
|
||||
|
@ -172,7 +172,7 @@ import java.util.UUID;
|
||||
if (!PlotSquared.isPlotWorld(player.getWorld())) {
|
||||
return null;
|
||||
}
|
||||
final PlotId id = getPlot(player.getLocation());
|
||||
final PlotId id = getPlot(BukkitUtil.getLocation(entity));
|
||||
final World world = player.getWorld();
|
||||
if (id == null) {
|
||||
return null;
|
||||
|
@ -3,9 +3,6 @@ package com.intellectualcrafters.plot.util;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.World;
|
||||
|
||||
import com.intellectualcrafters.plot.object.PlotBlock;
|
||||
|
||||
public abstract class SetBlockManager {
|
||||
public static SetBlockManager setBlockManager = null;
|
||||
|
@ -13,7 +13,6 @@ import org.bukkit.entity.Player;
|
||||
import com.google.common.collect.BiMap;
|
||||
import com.google.common.collect.HashBiMap;
|
||||
import com.intellectualcrafters.plot.PlotSquared;
|
||||
import com.intellectualcrafters.plot.PlotSquared;
|
||||
import com.intellectualcrafters.plot.config.C;
|
||||
import com.intellectualcrafters.plot.config.Settings;
|
||||
import com.intellectualcrafters.plot.database.DBFunc;
|
||||
|
@ -1,9 +1,6 @@
|
||||
package com.intellectualcrafters.plot.util.bukkit;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
import com.intellectualcrafters.plot.BukkitMain;
|
||||
import com.intellectualcrafters.plot.PlotSquared;
|
||||
import com.intellectualcrafters.plot.util.TaskManager;
|
||||
|
||||
public class BukkitTaskManager extends TaskManager {
|
||||
@ -21,9 +18,11 @@ public class BukkitTaskManager extends TaskManager {
|
||||
}
|
||||
|
||||
public void taskLater(final Runnable r, int delay) {
|
||||
if (r == null) {
|
||||
return;
|
||||
}
|
||||
BukkitMain.THIS.getServer().getScheduler().runTaskLater(BukkitMain.THIS, r, delay);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void taskLaterAsync(Runnable r, int delay) {
|
||||
BukkitMain.THIS.getServer().getScheduler().runTaskLaterAsynchronously(BukkitMain.THIS, r, delay);
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,6 @@ import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.intellectualcrafters.plot.object.Location;
|
||||
import com.intellectualcrafters.plot.object.PlotBlock;
|
||||
import com.intellectualcrafters.plot.util.BlockManager;
|
||||
import com.intellectualcrafters.plot.util.SetBlockManager;
|
||||
import com.intellectualcrafters.plot.util.SetBlockSlow;
|
||||
|
@ -33,7 +33,7 @@ public class TranslationPlugin extends JavaPlugin {
|
||||
e.printStackTrace();
|
||||
}
|
||||
// Now let's create some default files :D
|
||||
this.english = new YamlTranslationFile(BukkitTranslation.getParent(this), TranslationLanguage.englishAmerican, getName(), manager).read().header("Example file", "@author Citymonstret");
|
||||
this.english = new YamlTranslationFile(BukkitTranslation.getParent(), TranslationLanguage.englishAmerican, getName(), manager).read().header("Example file", "@author Citymonstret");
|
||||
// That created the file, read it, and made a default header
|
||||
getLogger().log(Level.INFO, BukkitTranslation.convert(manager.getTranslated("translator_loaded", TranslationLanguage.englishAmerican)));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user