-m \'So I hear you like commits ...\'

This commit is contained in:
Sauilitired
2015-07-27 19:50:04 +02:00
parent e50605d69a
commit 3a15254d8d
230 changed files with 1217 additions and 2125 deletions

View File

@ -2,37 +2,37 @@ package com.plotsquared.bukkit;
import com.intellectualcrafters.plot.IPlotMain;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.commands.*;
import com.intellectualcrafters.plot.commands.MainCommand;
import com.intellectualcrafters.plot.commands.WE_Anywhere;
import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.config.Settings;
import com.plotsquared.bukkit.commands.BukkitCommand;
import com.plotsquared.bukkit.database.plotme.ClassicPlotMeConnector;
import com.plotsquared.bukkit.database.plotme.LikePlotMeConverter;
import com.plotsquared.bukkit.database.plotme.PlotMeConnector_017;
import com.intellectualcrafters.plot.flag.FlagManager;
import com.intellectualcrafters.plot.generator.BukkitHybridUtils;
import com.plotsquared.bukkit.generator.BukkitGeneratorWrapper;
import com.plotsquared.bukkit.generator.HybridGen;
import com.intellectualcrafters.plot.generator.HybridUtils;
import com.plotsquared.bukkit.listeners.*;
import com.plotsquared.bukkit.listeners.worldedit.WEListener;
import com.plotsquared.bukkit.listeners.worldedit.WESubscriber;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.object.PlotWorld;
import com.plotsquared.bukkit.titles.AbstractTitle;
import com.plotsquared.bukkit.titles.DefaultTitle;
import com.intellectualcrafters.plot.util.*;
import com.intellectualcrafters.plot.uuid.DefaultUUIDWrapper;
import com.intellectualcrafters.plot.uuid.LowerOfflineUUIDWrapper;
import com.intellectualcrafters.plot.uuid.OfflineUUIDWrapper;
import com.intellectualcrafters.plot.uuid.UUIDWrapper;
import com.plotsquared.bukkit.commands.BukkitCommand;
import com.plotsquared.bukkit.database.plotme.ClassicPlotMeConnector;
import com.plotsquared.bukkit.database.plotme.LikePlotMeConverter;
import com.plotsquared.bukkit.database.plotme.PlotMeConnector_017;
import com.plotsquared.bukkit.generator.BukkitGeneratorWrapper;
import com.plotsquared.bukkit.generator.HybridGen;
import com.plotsquared.bukkit.listeners.*;
import com.plotsquared.bukkit.listeners.worldedit.WEListener;
import com.plotsquared.bukkit.listeners.worldedit.WESubscriber;
import com.plotsquared.bukkit.titles.AbstractTitle;
import com.plotsquared.bukkit.titles.DefaultTitle;
import com.plotsquared.bukkit.util.SetupUtils;
import com.plotsquared.bukkit.util.bukkit.*;
import com.plotsquared.bukkit.util.bukkit.uuid.FileUUIDHandler;
import com.plotsquared.bukkit.util.bukkit.uuid.SQLUUIDHandler;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
@ -124,7 +124,7 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
Bukkit.getServer().getConsoleSender().sendMessage(message);
return;
}
catch (Throwable e) {};
catch (Throwable e) {}
}
System.out.println(ConsoleColors.fromString(message));
}

View File

@ -1,24 +1,17 @@
package com.plotsquared.bukkit.commands;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import com.intellectualcrafters.plot.commands.MainCommand;
import com.intellectualsites.commands.Command;
import com.intellectualcrafters.plot.object.ConsolePlayer;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.StringComparison;
import com.plotsquared.bukkit.util.bukkit.BukkitUtil;
import com.plotsquared.general.commands.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter;
import org.bukkit.entity.Player;
import com.intellectualcrafters.plot.object.ConsolePlayer;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.StringComparison;
import com.plotsquared.bukkit.util.bukkit.BukkitUtil;
import java.util.*;
/**
* Created 2015-02-20 for PlotSquared

View File

@ -1,18 +1,17 @@
package com.plotsquared.bukkit.database.plotme;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.Arrays;
import java.util.HashMap;
import org.bukkit.Bukkit;
import org.bukkit.World;
import com.intellectualcrafters.configuration.file.FileConfiguration;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotId;
import org.bukkit.Bukkit;
import org.bukkit.World;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.Arrays;
import java.util.HashMap;
public abstract class APlotMeConnector {
public abstract Connection getPlotMeConnection(String plugin, FileConfiguration plotConfig, String dataFolder);

View File

@ -1,15 +1,5 @@
package com.plotsquared.bukkit.database.plotme;
import java.io.File;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map.Entry;
import java.util.UUID;
import com.intellectualcrafters.configuration.file.FileConfiguration;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.config.Settings;
@ -22,6 +12,12 @@ import com.intellectualcrafters.plot.object.StringWrapper;
import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.UUIDHandler;
import java.io.File;
import java.sql.*;
import java.util.HashMap;
import java.util.Map.Entry;
import java.util.UUID;
public class ClassicPlotMeConnector extends APlotMeConnector {
private String plugin;

View File

@ -20,6 +20,19 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
package com.plotsquared.bukkit.database.plotme;
import com.intellectualcrafters.configuration.file.FileConfiguration;
import com.intellectualcrafters.configuration.file.YamlConfiguration;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.config.Settings;
import com.intellectualcrafters.plot.database.DBFunc;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotId;
import com.intellectualcrafters.plot.util.TaskManager;
import com.plotsquared.bukkit.generator.HybridGen;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.WorldCreator;
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
@ -34,20 +47,6 @@ import java.util.HashMap;
import java.util.Map.Entry;
import java.util.Set;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.WorldCreator;
import com.intellectualcrafters.configuration.file.FileConfiguration;
import com.intellectualcrafters.configuration.file.YamlConfiguration;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.config.Settings;
import com.intellectualcrafters.plot.database.DBFunc;
import com.plotsquared.bukkit.generator.HybridGen;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotId;
import com.intellectualcrafters.plot.util.TaskManager;
/**
* Created 2014-08-17 for PlotSquared
*

View File

@ -1,15 +1,5 @@
package com.plotsquared.bukkit.database.plotme;
import java.io.File;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map.Entry;
import java.util.UUID;
import com.intellectualcrafters.configuration.file.FileConfiguration;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.config.Settings;
@ -22,6 +12,12 @@ import com.intellectualcrafters.plot.object.StringWrapper;
import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.UUIDHandler;
import java.io.File;
import java.sql.*;
import java.util.HashMap;
import java.util.Map.Entry;
import java.util.UUID;
public class PlotMeConnector_017 extends APlotMeConnector {
private String plugin;

View File

@ -20,13 +20,12 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
package com.plotsquared.bukkit.events;
import com.intellectualcrafters.plot.flag.Flag;
import com.intellectualcrafters.plot.object.PlotCluster;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import com.intellectualcrafters.plot.flag.Flag;
import com.intellectualcrafters.plot.object.PlotCluster;
/**
* Called when a flag is removed from a plot
*

View File

@ -20,13 +20,12 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
package com.plotsquared.bukkit.events;
import com.intellectualcrafters.plot.object.Plot;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
import org.bukkit.event.player.PlayerEvent;
import com.intellectualcrafters.plot.object.Plot;
/**
* @author Citymonstret
* @author Empire92

View File

@ -20,12 +20,11 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
package com.plotsquared.bukkit.events;
import com.intellectualcrafters.plot.object.Plot;
import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList;
import org.bukkit.event.player.PlayerEvent;
import com.intellectualcrafters.plot.object.Plot;
/**
* @author Citymonstret
* @author Empire92

View File

@ -20,12 +20,11 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
package com.plotsquared.bukkit.events;
import com.intellectualcrafters.plot.object.Plot;
import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList;
import org.bukkit.event.player.PlayerEvent;
import com.intellectualcrafters.plot.object.Plot;
/**
* @author Citymonstret
* @author Empire92

View File

@ -20,12 +20,11 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
package com.plotsquared.bukkit.events;
import java.util.UUID;
import com.intellectualcrafters.plot.object.Plot;
import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList;
import com.intellectualcrafters.plot.object.Plot;
import java.util.UUID;
/**
* @author Citymonstret

View File

@ -20,12 +20,11 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
package com.plotsquared.bukkit.events;
import java.util.UUID;
import com.intellectualcrafters.plot.object.Plot;
import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList;
import com.intellectualcrafters.plot.object.Plot;
import java.util.UUID;
/**
* @author Empire92

View File

@ -20,12 +20,11 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
package com.plotsquared.bukkit.events;
import java.util.UUID;
import com.intellectualcrafters.plot.object.Plot;
import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList;
import com.intellectualcrafters.plot.object.Plot;
import java.util.UUID;
/**
* @author Citymonstret

View File

@ -20,14 +20,13 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
package com.plotsquared.bukkit.events;
import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.Plot;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
import org.bukkit.event.player.PlayerEvent;
import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.Plot;
/**
* Called when a player teleports to a plot
*

View File

@ -20,12 +20,11 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
package com.plotsquared.bukkit.events;
import com.intellectualcrafters.plot.object.PlotId;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import com.intellectualcrafters.plot.object.PlotId;
/**
* Called when a plot is cleared
*

View File

@ -20,11 +20,10 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
package com.plotsquared.bukkit.events;
import com.intellectualcrafters.plot.object.PlotId;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import com.intellectualcrafters.plot.object.PlotId;
/**
* Called when a plot is deleted
*

View File

@ -1,8 +1,7 @@
package com.plotsquared.bukkit.events;
import org.bukkit.event.Event;
import com.intellectualcrafters.plot.object.Plot;
import org.bukkit.event.Event;
public abstract class PlotEvent extends Event {

View File

@ -20,11 +20,10 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
package com.plotsquared.bukkit.events;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
import com.intellectualcrafters.plot.flag.Flag;
import com.intellectualcrafters.plot.object.Plot;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
/**
* Called when a Flag is added to a plot

View File

@ -20,11 +20,10 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
package com.plotsquared.bukkit.events;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
import com.intellectualcrafters.plot.flag.Flag;
import com.intellectualcrafters.plot.object.Plot;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
/**
* Called when a flag is removed from a plot

View File

@ -20,15 +20,14 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
package com.plotsquared.bukkit.events;
import java.util.ArrayList;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotId;
import org.bukkit.World;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotId;
import java.util.ArrayList;
/**
* @author Empire92

View File

@ -1,9 +1,8 @@
package com.plotsquared.bukkit.events;
import org.bukkit.event.HandlerList;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotPlayer;
import org.bukkit.event.HandlerList;
/**
* Created 2015-07-13 for PlotSquaredGit

View File

@ -20,14 +20,13 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
package com.plotsquared.bukkit.events;
import java.util.ArrayList;
import com.intellectualcrafters.plot.object.PlotId;
import org.bukkit.World;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import com.intellectualcrafters.plot.object.PlotId;
import java.util.ArrayList;
/**
* @author Empire92

View File

@ -1,29 +1,22 @@
package com.plotsquared.bukkit.generator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map.Entry;
import java.util.Random;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.object.*;
import com.intellectualcrafters.plot.util.ChunkManager;
import com.intellectualcrafters.plot.util.TaskManager;
import com.plotsquared.bukkit.object.BlockWrapper;
import com.plotsquared.bukkit.util.bukkit.BukkitChunkManager;
import com.plotsquared.bukkit.util.bukkit.BukkitSetBlockManager;
import org.bukkit.Bukkit;
import org.bukkit.Chunk;
import org.bukkit.World;
import org.bukkit.block.Biome;
import org.bukkit.generator.BlockPopulator;
import com.intellectualcrafters.plot.PS;
import com.plotsquared.bukkit.object.BlockWrapper;
import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.PlotCluster;
import com.intellectualcrafters.plot.object.PlotId;
import com.intellectualcrafters.plot.object.PlotLoc;
import com.intellectualcrafters.plot.object.PlotManager;
import com.intellectualcrafters.plot.object.PlotWorld;
import com.intellectualcrafters.plot.object.RegionWrapper;
import com.intellectualcrafters.plot.util.ChunkManager;
import com.intellectualcrafters.plot.util.TaskManager;
import com.plotsquared.bukkit.util.bukkit.BukkitChunkManager;
import com.plotsquared.bukkit.util.bukkit.BukkitSetBlockManager;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map.Entry;
import java.util.Random;
public class AugmentedPopulator extends BlockPopulator {
public static short[][] x_loc;

View File

@ -1,12 +1,11 @@
package com.plotsquared.bukkit.generator;
import org.bukkit.generator.ChunkGenerator;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.generator.PlotGenerator;
import com.intellectualcrafters.plot.object.PlotCluster;
import com.intellectualcrafters.plot.object.PlotManager;
import com.intellectualcrafters.plot.object.PlotWorld;
import org.bukkit.generator.ChunkGenerator;
public class BukkitGeneratorWrapper extends PlotGenerator<ChunkGenerator> {

View File

@ -20,23 +20,21 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
package com.plotsquared.bukkit.generator;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map.Entry;
import java.util.Random;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.object.*;
import com.intellectualcrafters.plot.util.ChunkManager;
import com.plotsquared.bukkit.listeners.WorldEvents;
import com.plotsquared.bukkit.object.PlotPopulator;
import org.bukkit.World;
import org.bukkit.block.Biome;
import org.bukkit.generator.BlockPopulator;
import org.bukkit.generator.ChunkGenerator;
import com.intellectualcrafters.plot.PS;
import com.plotsquared.bukkit.listeners.WorldEvents;
import com.plotsquared.bukkit.object.PlotPopulator;
import com.intellectualcrafters.plot.util.ChunkManager;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map.Entry;
import java.util.Random;
public abstract class BukkitPlotGenerator extends ChunkGenerator {

View File

@ -20,24 +20,19 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
package com.plotsquared.bukkit.generator;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map.Entry;
import com.intellectualcrafters.plot.generator.HybridPlotManager;
import com.intellectualcrafters.plot.generator.HybridPlotWorld;
import com.intellectualcrafters.plot.generator.HybridPop;
import com.intellectualcrafters.plot.object.*;
import com.plotsquared.bukkit.object.PlotPopulator;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.block.Biome;
import com.intellectualcrafters.plot.object.PlotLoc;
import com.intellectualcrafters.plot.object.PlotManager;
import com.plotsquared.bukkit.object.PlotPopulator;
import com.intellectualcrafters.plot.object.PlotWorld;
import com.intellectualcrafters.plot.object.PseudoRandom;
import com.intellectualcrafters.plot.object.RegionWrapper;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map.Entry;
/**
* The default generator is very messy, as we have decided to try externalize all calculations from within the loop. -

View File

@ -1,7 +1,10 @@
package com.plotsquared.bukkit.listeners;
import java.util.Set;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.object.*;
import com.intellectualcrafters.plot.util.MainUtil;
import com.plotsquared.bukkit.util.bukkit.BukkitUtil;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
@ -10,15 +13,7 @@ import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.player.AsyncPlayerChatEvent;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotId;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.object.PlotWorld;
import com.intellectualcrafters.plot.util.MainUtil;
import com.plotsquared.bukkit.util.bukkit.BukkitUtil;
import java.util.Set;
/**
* Created 2015-07-13 for PlotSquaredGit

View File

@ -1,5 +1,8 @@
package com.plotsquared.bukkit.listeners;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.config.Settings;
import com.intellectualcrafters.plot.util.TaskManager;
import org.bukkit.Bukkit;
import org.bukkit.Chunk;
import org.bukkit.Material;
@ -17,10 +20,6 @@ import org.bukkit.event.entity.ItemSpawnEvent;
import org.bukkit.event.world.ChunkLoadEvent;
import org.bukkit.event.world.ChunkUnloadEvent;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.config.Settings;
import com.intellectualcrafters.plot.util.TaskManager;
public class ChunkListener implements Listener {
private Chunk lastChunk = null;

View File

@ -20,24 +20,23 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
package com.plotsquared.bukkit.listeners;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
import com.intellectualcrafters.plot.flag.FlagManager;
import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.UUIDHandler;
import com.plotsquared.bukkit.events.PlayerEnterPlotEvent;
import com.plotsquared.bukkit.util.bukkit.BukkitPlayerFunctions;
import com.plotsquared.bukkit.util.bukkit.BukkitUtil;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.util.Vector;
import com.plotsquared.bukkit.events.PlayerEnterPlotEvent;
import com.intellectualcrafters.plot.flag.FlagManager;
import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.UUIDHandler;
import com.plotsquared.bukkit.util.bukkit.BukkitPlayerFunctions;
import com.plotsquared.bukkit.util.bukkit.BukkitUtil;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
/**
* @author Citymonstret

View File

@ -1,5 +1,8 @@
package com.plotsquared.bukkit.listeners;
import com.intellectualcrafters.plot.util.MainUtil;
import com.plotsquared.bukkit.object.InfoInventory;
import com.plotsquared.bukkit.util.bukkit.BukkitUtil;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.EventHandler;
@ -8,10 +11,6 @@ import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryInteractEvent;
import org.bukkit.inventory.Inventory;
import com.plotsquared.bukkit.object.InfoInventory;
import com.intellectualcrafters.plot.util.MainUtil;
import com.plotsquared.bukkit.util.bukkit.BukkitUtil;
/**
* Created 2014-11-18 for PlotSquared
* @author Citymonstret

View File

@ -1,81 +1,36 @@
package com.plotsquared.bukkit.listeners;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import java.util.regex.Pattern;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Chunk;
import org.bukkit.Material;
import org.bukkit.World;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.config.Settings;
import com.intellectualcrafters.plot.database.DBFunc;
import com.intellectualcrafters.plot.flag.Flag;
import com.intellectualcrafters.plot.flag.FlagManager;
import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.*;
import com.intellectualcrafters.plot.util.*;
import com.plotsquared.bukkit.listeners.worldedit.WEManager;
import com.plotsquared.bukkit.object.BukkitLazyBlock;
import com.plotsquared.bukkit.object.BukkitPlayer;
import com.plotsquared.bukkit.util.bukkit.BukkitUtil;
import org.bukkit.*;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.block.BlockState;
import org.bukkit.command.PluginCommand;
import org.bukkit.entity.Animals;
import org.bukkit.entity.ArmorStand;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.Creature;
import org.bukkit.entity.EnderDragon;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.FallingBlock;
import org.bukkit.entity.Hanging;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Monster;
import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile;
import org.bukkit.entity.Tameable;
import org.bukkit.entity.Vehicle;
import org.bukkit.entity.*;
import org.bukkit.entity.minecart.RideableMinecart;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.BlockDamageEvent;
import org.bukkit.event.block.BlockFadeEvent;
import org.bukkit.event.block.BlockFormEvent;
import org.bukkit.event.block.BlockFromToEvent;
import org.bukkit.event.block.BlockGrowEvent;
import org.bukkit.event.block.BlockIgniteEvent;
import org.bukkit.event.block.BlockPhysicsEvent;
import org.bukkit.event.block.BlockPistonExtendEvent;
import org.bukkit.event.block.BlockPistonRetractEvent;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.block.BlockRedstoneEvent;
import org.bukkit.event.block.BlockSpreadEvent;
import org.bukkit.event.block.EntityBlockFormEvent;
import org.bukkit.event.entity.CreatureSpawnEvent;
import org.bukkit.event.entity.EntityChangeBlockEvent;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.event.entity.ProjectileHitEvent;
import org.bukkit.event.block.*;
import org.bukkit.event.entity.*;
import org.bukkit.event.hanging.HangingBreakByEntityEvent;
import org.bukkit.event.hanging.HangingPlaceEvent;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryCloseEvent;
import org.bukkit.event.player.AsyncPlayerChatEvent;
import org.bukkit.event.player.PlayerBucketEmptyEvent;
import org.bukkit.event.player.PlayerBucketFillEvent;
import org.bukkit.event.player.PlayerChangedWorldEvent;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerEggThrowEvent;
import org.bukkit.event.player.PlayerInteractEntityEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerLoginEvent;
import org.bukkit.event.player.*;
import org.bukkit.event.player.PlayerLoginEvent.Result;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.player.PlayerTeleportEvent;
import org.bukkit.event.vehicle.VehicleCreateEvent;
import org.bukkit.event.vehicle.VehicleDestroyEvent;
import org.bukkit.event.world.ChunkLoadEvent;
@ -86,35 +41,8 @@ import org.bukkit.projectiles.BlockProjectileSource;
import org.bukkit.projectiles.ProjectileSource;
import org.bukkit.util.Vector;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.config.Settings;
import com.intellectualcrafters.plot.database.DBFunc;
import com.intellectualcrafters.plot.flag.Flag;
import com.intellectualcrafters.plot.flag.FlagManager;
import com.plotsquared.bukkit.listeners.worldedit.WEManager;
import com.plotsquared.bukkit.object.BukkitLazyBlock;
import com.plotsquared.bukkit.object.BukkitPlayer;
import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotBlock;
import com.intellectualcrafters.plot.object.PlotHandler;
import com.intellectualcrafters.plot.object.PlotId;
import com.intellectualcrafters.plot.object.PlotInventory;
import com.intellectualcrafters.plot.object.PlotManager;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.object.PlotWorld;
import com.intellectualcrafters.plot.object.StringWrapper;
import com.intellectualcrafters.plot.util.ChunkManager;
import com.intellectualcrafters.plot.util.EventUtil;
import com.intellectualcrafters.plot.util.ExpireManager;
import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.Permissions;
import com.intellectualcrafters.plot.util.RegExUtil;
import com.intellectualcrafters.plot.util.StringMan;
import com.intellectualcrafters.plot.util.TaskManager;
import com.intellectualcrafters.plot.util.UUIDHandler;
import com.plotsquared.bukkit.util.bukkit.BukkitUtil;
import java.util.*;
import java.util.regex.Pattern;
/**
* Player Events involving plots

View File

@ -1,9 +1,13 @@
package com.plotsquared.bukkit.listeners;
import java.util.HashSet;
import java.util.List;
import java.util.UUID;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.Permissions;
import com.plotsquared.bukkit.util.bukkit.BukkitUtil;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
import org.bukkit.entity.ArmorStand;
@ -20,14 +24,9 @@ import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory;
import org.bukkit.inventory.meta.ItemMeta;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.Permissions;
import com.plotsquared.bukkit.util.bukkit.BukkitUtil;
import java.util.HashSet;
import java.util.List;
import java.util.UUID;
public class PlayerEvents_1_8 extends PlotListener implements Listener {

View File

@ -1,19 +1,18 @@
package com.plotsquared.bukkit.listeners;
import java.util.Iterator;
import org.bukkit.block.Block;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockExplodeEvent;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.flag.FlagManager;
import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.util.MainUtil;
import com.plotsquared.bukkit.util.bukkit.BukkitUtil;
import org.bukkit.block.Block;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockExplodeEvent;
import java.util.Iterator;
public class PlayerEvents_1_8_3 implements Listener {
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)

View File

@ -20,37 +20,27 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
package com.plotsquared.bukkit.listeners;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.config.Settings;
import com.intellectualcrafters.plot.flag.Flag;
import com.intellectualcrafters.plot.flag.FlagManager;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.*;
import com.plotsquared.bukkit.events.PlayerEnterPlotEvent;
import com.plotsquared.bukkit.events.PlayerLeavePlotEvent;
import com.plotsquared.bukkit.object.BukkitPlayer;
import com.plotsquared.bukkit.object.comment.CommentManager;
import com.plotsquared.bukkit.titles.AbstractTitle;
import org.bukkit.*;
import org.bukkit.entity.Player;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Effect;
import org.bukkit.GameMode;
import org.bukkit.Material;
import org.bukkit.WeatherType;
import org.bukkit.entity.Player;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.config.Settings;
import com.plotsquared.bukkit.events.PlayerEnterPlotEvent;
import com.plotsquared.bukkit.events.PlayerLeavePlotEvent;
import com.intellectualcrafters.plot.flag.Flag;
import com.intellectualcrafters.plot.flag.FlagManager;
import com.plotsquared.bukkit.object.BukkitPlayer;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.plotsquared.bukkit.object.comment.CommentManager;
import com.plotsquared.bukkit.titles.AbstractTitle;
import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.Permissions;
import com.intellectualcrafters.plot.util.StringMan;
import com.intellectualcrafters.plot.util.TaskManager;
import com.intellectualcrafters.plot.util.UUIDHandler;
/**
* @author Citymonstret
* @author Empire92

View File

@ -20,13 +20,18 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
package com.plotsquared.bukkit.listeners;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map.Entry;
import java.util.UUID;
import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.flag.Flag;
import com.intellectualcrafters.plot.flag.FlagManager;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotHandler;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.Permissions;
import com.intellectualcrafters.plot.util.UUIDHandler;
import com.plotsquared.bukkit.events.PlayerEnterPlotEvent;
import com.plotsquared.bukkit.events.PlayerLeavePlotEvent;
import com.plotsquared.bukkit.util.bukkit.BukkitUtil;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.GameMode;
@ -43,18 +48,8 @@ import org.bukkit.event.player.PlayerPickupItemEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.plugin.java.JavaPlugin;
import com.intellectualcrafters.plot.config.C;
import com.plotsquared.bukkit.events.PlayerEnterPlotEvent;
import com.plotsquared.bukkit.events.PlayerLeavePlotEvent;
import com.intellectualcrafters.plot.flag.Flag;
import com.intellectualcrafters.plot.flag.FlagManager;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotHandler;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.Permissions;
import com.intellectualcrafters.plot.util.UUIDHandler;
import com.plotsquared.bukkit.util.bukkit.BukkitUtil;
import java.util.*;
import java.util.Map.Entry;
/**
* Created 2014-10-30 for PlotSquared

View File

@ -1,7 +1,11 @@
package com.plotsquared.bukkit.listeners;
import java.util.List;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.flag.FlagManager;
import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.util.MainUtil;
import com.plotsquared.bukkit.util.bukkit.BukkitUtil;
import org.bukkit.World;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
@ -12,12 +16,7 @@ import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.event.entity.ExplosionPrimeEvent;
import org.bukkit.util.Vector;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.flag.FlagManager;
import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.util.MainUtil;
import com.plotsquared.bukkit.util.bukkit.BukkitUtil;
import java.util.List;
public class TNTListener implements Listener {
private double lastRadius;

View File

@ -1,5 +1,9 @@
package com.plotsquared.bukkit.listeners;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.util.UUIDHandler;
import com.plotsquared.bukkit.generator.BukkitGeneratorWrapper;
import com.plotsquared.bukkit.generator.BukkitPlotGenerator;
import org.bukkit.World;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
@ -8,11 +12,6 @@ import org.bukkit.event.world.WorldInitEvent;
import org.bukkit.event.world.WorldLoadEvent;
import org.bukkit.generator.ChunkGenerator;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.util.UUIDHandler;
import com.plotsquared.bukkit.generator.BukkitGeneratorWrapper;
import com.plotsquared.bukkit.generator.BukkitPlotGenerator;
public class WorldEvents implements Listener {
public static String lastWorld = null;

View File

@ -1,8 +1,5 @@
package com.plotsquared.bukkit.listeners.worldedit;
import java.util.ArrayList;
import java.util.List;
import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.Vector2D;
import com.sk89q.worldedit.WorldEditException;
@ -15,6 +12,9 @@ import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.util.Location;
import com.sk89q.worldedit.world.biome.BaseBiome;
import java.util.ArrayList;
import java.util.List;
public class NullExtent implements Extent {
@Override

View File

@ -1,7 +1,5 @@
package com.plotsquared.bukkit.listeners.worldedit;
import java.util.HashSet;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.config.Settings;
import com.intellectualcrafters.plot.object.RegionWrapper;
@ -16,6 +14,8 @@ import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.util.Location;
import com.sk89q.worldedit.world.biome.BaseBiome;
import java.util.HashSet;
public class ProcessedWEExtent extends AbstractDelegateExtent {
private final HashSet<RegionWrapper> mask;
int BScount = 0;

View File

@ -1,7 +1,5 @@
package com.plotsquared.bukkit.listeners.worldedit;
import java.util.HashSet;
import com.intellectualcrafters.plot.object.RegionWrapper;
import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.Vector2D;
@ -14,6 +12,8 @@ import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.util.Location;
import com.sk89q.worldedit.world.biome.BaseBiome;
import java.util.HashSet;
public class WEExtent extends AbstractDelegateExtent {
private final HashSet<RegionWrapper> mask;

View File

@ -1,16 +1,5 @@
package com.plotsquared.bukkit.listeners.worldedit;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.config.Settings;
@ -22,6 +11,16 @@ import com.intellectualcrafters.plot.util.Permissions;
import com.plotsquared.bukkit.util.bukkit.BukkitUtil;
import com.sk89q.worldedit.BlockVector;
import com.sk89q.worldedit.bukkit.selections.Selection;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
public class WEListener implements Listener {

View File

@ -1,8 +1,5 @@
package com.plotsquared.bukkit.listeners.worldedit;
import java.util.HashSet;
import java.util.UUID;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.config.Settings;
import com.intellectualcrafters.plot.object.Location;
@ -11,6 +8,9 @@ import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.object.RegionWrapper;
import com.intellectualcrafters.plot.util.MainUtil;
import java.util.HashSet;
import java.util.UUID;
public class WEManager {
public static HashSet<String> bypass = new HashSet<>();
@ -39,10 +39,7 @@ public class WEManager {
}
public static boolean intersects(RegionWrapper region1, RegionWrapper region2) {
if ((region1.minX <= region2.maxX) && (region1.maxX >= region2.minX) && (region1.minZ <= region2.maxZ) && (region1.maxZ >= region2.minZ)) {
return true;
}
return false;
return (region1.minX <= region2.maxX) && (region1.maxX >= region2.minX) && (region1.minZ <= region2.maxZ) && (region1.maxZ >= region2.minZ);
}
public static boolean regionContains(RegionWrapper selection, HashSet<RegionWrapper> mask) {

View File

@ -1,7 +1,5 @@
package com.plotsquared.bukkit.listeners.worldedit;
import java.util.HashSet;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.config.Settings;
@ -15,6 +13,8 @@ import com.sk89q.worldedit.extension.platform.Actor;
import com.sk89q.worldedit.util.eventbus.EventHandler.Priority;
import com.sk89q.worldedit.util.eventbus.Subscribe;
import java.util.HashSet;
public class WESubscriber {
@Subscribe(priority=Priority.VERY_EARLY)
public void onEditSession(EditSessionEvent event) {

View File

@ -1,10 +1,10 @@
package com.plotsquared.bukkit.object;
import java.util.UUID;
import com.intellectualcrafters.plot.object.OfflinePlotPlayer;
import org.bukkit.OfflinePlayer;
import java.util.UUID;
public class BukkitOfflinePlayer implements OfflinePlotPlayer {
public final OfflinePlayer player;

View File

@ -1,24 +1,22 @@
package com.plotsquared.bukkit.object;
import java.util.HashMap;
import java.util.HashSet;
import java.util.UUID;
import com.intellectualcrafters.plot.commands.RequiredType;
import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.config.Settings;
import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.EconHandler;
import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.UUIDHandler;
import com.plotsquared.bukkit.util.bukkit.BukkitUtil;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.permissions.Permission;
import org.bukkit.permissions.PermissionDefault;
import com.intellectualcrafters.plot.commands.RequiredType;
import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.config.Settings;
import com.intellectualcrafters.plot.util.EconHandler;
import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.UUIDHandler;
import com.plotsquared.bukkit.util.bukkit.BukkitUtil;
import java.util.HashMap;
import java.util.HashSet;
import java.util.UUID;
public class BukkitPlayer implements PlotPlayer {
@ -98,10 +96,7 @@ public class BukkitPlayer implements PlotPlayer {
@Override
public boolean isOp() {
if (this.op != 0) {
if (this.op == 1) {
return false;
}
return true;
return this.op != 1;
}
final boolean result = this.player.isOp();
if (!result) {

View File

@ -1,13 +1,9 @@
package com.plotsquared.bukkit.object;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.UUIDHandler;
import com.plotsquared.bukkit.util.bukkit.BukkitUtil;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
@ -17,7 +13,9 @@ import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import com.plotsquared.bukkit.util.bukkit.BukkitUtil;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
* Created 2014-11-18 for PlotSquared

View File

@ -1,18 +1,17 @@
package com.plotsquared.bukkit.object;
import java.util.HashMap;
import java.util.Map.Entry;
import java.util.Random;
import com.intellectualcrafters.plot.object.PlotLoc;
import com.intellectualcrafters.plot.object.PseudoRandom;
import com.intellectualcrafters.plot.object.RegionWrapper;
import com.intellectualcrafters.plot.util.ChunkManager;
import com.plotsquared.bukkit.util.bukkit.BukkitUtil;
import org.bukkit.Chunk;
import org.bukkit.World;
import org.bukkit.generator.BlockPopulator;
import com.intellectualcrafters.plot.util.ChunkManager;
import com.plotsquared.bukkit.util.bukkit.BukkitUtil;
import java.util.HashMap;
import java.util.Map.Entry;
import java.util.Random;
public abstract class PlotPopulator extends BlockPopulator {

View File

@ -1,20 +1,19 @@
package com.plotsquared.bukkit.object.comment;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.concurrent.atomic.AtomicInteger;
import com.intellectualcrafters.plot.object.comment.*;
import org.bukkit.ChatColor;
import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.config.Settings;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.object.RunnableVal;
import com.plotsquared.bukkit.titles.AbstractTitle;
import com.intellectualcrafters.plot.object.comment.*;
import com.intellectualcrafters.plot.util.TaskManager;
import com.plotsquared.bukkit.titles.AbstractTitle;
import org.bukkit.ChatColor;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.concurrent.atomic.AtomicInteger;
public class CommentManager {

View File

@ -1,42 +1,24 @@
package com.plotsquared.bukkit.object.entity;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.object.entity.AgeableStats;
import com.intellectualcrafters.plot.object.entity.ArmorStandStats;
import com.intellectualcrafters.plot.object.entity.EntityBaseStats;
import com.intellectualcrafters.plot.object.entity.HorseStats;
import org.bukkit.Art;
import org.bukkit.DyeColor;
import org.bukkit.Location;
import org.bukkit.Rotation;
import org.bukkit.World;
import org.bukkit.*;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Ageable;
import org.bukkit.entity.ArmorStand;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Guardian;
import org.bukkit.entity.Horse;
import org.bukkit.entity.*;
import org.bukkit.entity.Horse.Color;
import org.bukkit.entity.Horse.Style;
import org.bukkit.entity.Horse.Variant;
import org.bukkit.entity.Item;
import org.bukkit.entity.ItemFrame;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Painting;
import org.bukkit.entity.Rabbit;
import org.bukkit.entity.Rabbit.Type;
import org.bukkit.entity.Sheep;
import org.bukkit.entity.Skeleton;
import org.bukkit.entity.Skeleton.SkeletonType;
import org.bukkit.entity.Tameable;
import org.bukkit.inventory.EntityEquipment;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
import org.bukkit.util.EulerAngle;
import org.bukkit.util.Vector;
import com.intellectualcrafters.plot.PS;
public class EntityWrapper {
public short id;
public float yaw;

View File

@ -1,10 +1,10 @@
package com.plotsquared.bukkit.object.entity;
import java.util.Collection;
import org.bukkit.inventory.ItemStack;
import org.bukkit.potion.PotionEffect;
import java.util.Collection;
public class LivingEntityStats {
public boolean loot;
public String name;

View File

@ -1,28 +1,21 @@
package com.plotsquared.bukkit.object.schematic;
import com.intellectualcrafters.jnbt.*;
import com.intellectualcrafters.plot.object.schematic.ItemType;
import com.intellectualcrafters.plot.object.schematic.PlotItem;
import com.intellectualcrafters.plot.util.MathMan;
import com.intellectualcrafters.plot.util.SchematicHandler.Schematic;
import org.bukkit.block.BlockState;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import com.intellectualcrafters.plot.object.schematic.ItemType;
import com.intellectualcrafters.plot.object.schematic.PlotItem;
import org.bukkit.block.BlockState;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
import com.intellectualcrafters.jnbt.ByteTag;
import com.intellectualcrafters.jnbt.CompoundTag;
import com.intellectualcrafters.jnbt.ListTag;
import com.intellectualcrafters.jnbt.ShortTag;
import com.intellectualcrafters.jnbt.Tag;
import com.intellectualcrafters.plot.util.MathMan;
import com.intellectualcrafters.plot.util.SchematicHandler.Schematic;
import com.intellectualcrafters.plot.util.StringMan;
public class StateWrapper {
public BlockState state = null;

View File

@ -1,8 +1,7 @@
package com.plotsquared.bukkit.titles;
import org.bukkit.ChatColor;
import com.intellectualcrafters.plot.object.PlotPlayer;
import org.bukkit.ChatColor;
public abstract class AbstractTitle {
public static AbstractTitle TITLE_CLASS;

View File

@ -1,9 +1,8 @@
package com.plotsquared.bukkit.titles;
import org.bukkit.ChatColor;
import com.plotsquared.bukkit.object.BukkitPlayer;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.plotsquared.bukkit.object.BukkitPlayer;
import org.bukkit.ChatColor;
public class DefaultTitle extends AbstractTitle {
@Override

View File

@ -1,15 +1,15 @@
package com.plotsquared.bukkit.titles;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
/**
* [ PlotSquared DefaultTitleManager by Maxim Van de Wynckel ]
*

View File

@ -1,15 +1,15 @@
package com.plotsquared.bukkit.titles;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
/**
* [ PlotSquared DefaultTitleManager by Maxim Van de Wynckel ]
*

View File

@ -1,9 +1,8 @@
package com.plotsquared.bukkit.titles;
import org.bukkit.ChatColor;
import com.plotsquared.bukkit.object.BukkitPlayer;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.plotsquared.bukkit.object.BukkitPlayer;
import org.bukkit.ChatColor;
public class DefaultTitle_183 extends AbstractTitle {
@Override

View File

@ -1,11 +1,10 @@
package com.plotsquared.bukkit.titles;
import org.bukkit.ChatColor;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.config.Settings;
import com.plotsquared.bukkit.object.BukkitPlayer;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.plotsquared.bukkit.object.BukkitPlayer;
import org.bukkit.ChatColor;
public class HackTitle extends AbstractTitle {
@Override

View File

@ -1,14 +1,14 @@
package com.plotsquared.bukkit.titles;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
/**
* Minecraft 1.8 Title
*

View File

@ -1,12 +1,12 @@
package com.plotsquared.bukkit.util;
import org.bukkit.Bukkit;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import org.bukkit.Bukkit;
/**
* Reflection Utilities for minecraft
*

View File

@ -1,12 +1,11 @@
package com.plotsquared.bukkit.util;
import java.util.HashMap;
import java.util.Map;
import org.bukkit.generator.ChunkGenerator;
import com.intellectualcrafters.plot.object.PlotWorld;
import com.intellectualcrafters.plot.object.SetupObject;
import org.bukkit.generator.ChunkGenerator;
import java.util.HashMap;
import java.util.Map;
public abstract class SetupUtils {

View File

@ -1,17 +1,16 @@
package com.plotsquared.bukkit.util;
import java.io.File;
import com.intellectualcrafters.plot.util.MainUtil;
import org.bukkit.Bukkit;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.PlotId;
import com.intellectualcrafters.plot.util.MainUtil;
import com.sk89q.worldedit.CuboidClipboard;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.bukkit.BukkitWorld;
import org.bukkit.Bukkit;
import java.io.File;
public class WorldEditSchematic {
public void saveSchematic(String file, final String world, final PlotId id) {

View File

@ -1,69 +1,28 @@
package com.plotsquared.bukkit.util.bukkit;
import com.plotsquared.bukkit.BukkitMain;
import com.intellectualcrafters.plot.PS;
import com.plotsquared.bukkit.generator.AugmentedPopulator;
import com.intellectualcrafters.plot.object.BlockLoc;
import com.intellectualcrafters.plot.object.ChunkLoc;
import com.intellectualcrafters.plot.object.*;
import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotBlock;
import com.intellectualcrafters.plot.object.PlotId;
import com.intellectualcrafters.plot.object.PlotLoc;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.object.PlotWorld;
import com.intellectualcrafters.plot.object.RegionWrapper;
import com.plotsquared.bukkit.object.entity.EntityWrapper;
import com.intellectualcrafters.plot.util.ChunkManager;
import com.intellectualcrafters.plot.util.ClusterManager;
import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.SetBlockQueue.ChunkWrapper;
import com.intellectualcrafters.plot.util.TaskManager;
import org.bukkit.Bukkit;
import org.bukkit.Chunk;
import org.bukkit.DyeColor;
import org.bukkit.Material;
import org.bukkit.Note;
import org.bukkit.SkullType;
import org.bukkit.World;
import org.bukkit.block.Banner;
import org.bukkit.block.Beacon;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.block.BlockState;
import org.bukkit.block.BrewingStand;
import org.bukkit.block.Chest;
import org.bukkit.block.CommandBlock;
import org.bukkit.block.CreatureSpawner;
import org.bukkit.block.Dispenser;
import org.bukkit.block.Dropper;
import org.bukkit.block.Furnace;
import org.bukkit.block.Hopper;
import org.bukkit.block.Jukebox;
import org.bukkit.block.NoteBlock;
import org.bukkit.block.Sign;
import org.bukkit.block.Skull;
import com.plotsquared.bukkit.BukkitMain;
import com.plotsquared.bukkit.generator.AugmentedPopulator;
import com.plotsquared.bukkit.object.entity.EntityWrapper;
import org.bukkit.*;
import org.bukkit.block.*;
import org.bukkit.block.banner.Pattern;
import org.bukkit.block.banner.PatternType;
import org.bukkit.entity.Animals;
import org.bukkit.entity.Creature;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.entity.Vehicle;
import org.bukkit.entity.*;
import org.bukkit.generator.BlockPopulator;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.Plugin;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Random;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
public class BukkitChunkManager extends ChunkManager {
@ -285,7 +244,7 @@ public class BukkitChunkManager extends ChunkManager {
return;
}
}
};
}
}, 1, 1);
TaskManager.tasks.put(currentIndex, task);
}

View File

@ -1,16 +1,14 @@
package com.plotsquared.bukkit.util.bukkit;
import net.milkbowl.vault.economy.Economy;
import net.milkbowl.vault.permission.Permission;
import org.bukkit.Bukkit;
import org.bukkit.plugin.RegisteredServiceProvider;
import com.plotsquared.bukkit.object.BukkitOfflinePlayer;
import com.plotsquared.bukkit.object.BukkitPlayer;
import com.intellectualcrafters.plot.object.OfflinePlotPlayer;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.EconHandler;
import com.plotsquared.bukkit.object.BukkitOfflinePlayer;
import com.plotsquared.bukkit.object.BukkitPlayer;
import net.milkbowl.vault.economy.Economy;
import net.milkbowl.vault.permission.Permission;
import org.bukkit.Bukkit;
import org.bukkit.plugin.RegisteredServiceProvider;
public class BukkitEconHandler extends EconHandler {

View File

@ -1,35 +1,17 @@
package com.plotsquared.bukkit.util.bukkit;
import java.util.ArrayList;
import java.util.UUID;
import com.intellectualcrafters.plot.flag.Flag;
import com.intellectualcrafters.plot.object.*;
import com.intellectualcrafters.plot.util.EventUtil;
import com.plotsquared.bukkit.events.*;
import com.plotsquared.bukkit.object.BukkitPlayer;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import com.plotsquared.bukkit.events.ClusterFlagRemoveEvent;
import com.plotsquared.bukkit.events.PlayerClaimPlotEvent;
import com.plotsquared.bukkit.events.PlayerEnterPlotEvent;
import com.plotsquared.bukkit.events.PlayerLeavePlotEvent;
import com.plotsquared.bukkit.events.PlayerPlotDeniedEvent;
import com.plotsquared.bukkit.events.PlayerPlotHelperEvent;
import com.plotsquared.bukkit.events.PlayerPlotTrustedEvent;
import com.plotsquared.bukkit.events.PlayerTeleportToPlotEvent;
import com.plotsquared.bukkit.events.PlotClearEvent;
import com.plotsquared.bukkit.events.PlotDeleteEvent;
import com.plotsquared.bukkit.events.PlotFlagAddEvent;
import com.plotsquared.bukkit.events.PlotFlagRemoveEvent;
import com.plotsquared.bukkit.events.PlotMergeEvent;
import com.plotsquared.bukkit.events.PlotUnlinkEvent;
import com.intellectualcrafters.plot.flag.Flag;
import com.plotsquared.bukkit.object.BukkitPlayer;
import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotCluster;
import com.intellectualcrafters.plot.object.PlotId;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.EventUtil;
import java.util.ArrayList;
import java.util.UUID;
public class BukkitEventUtil extends EventUtil {

View File

@ -1,8 +1,10 @@
package com.plotsquared.bukkit.util.bukkit;
import java.util.ArrayList;
import java.util.List;
import com.intellectualcrafters.plot.object.PlotInventory;
import com.intellectualcrafters.plot.object.PlotItemStack;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.InventoryUtil;
import com.plotsquared.bukkit.object.BukkitPlayer;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.event.inventory.InventoryType;
@ -12,11 +14,8 @@ import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory;
import org.bukkit.inventory.meta.ItemMeta;
import com.plotsquared.bukkit.object.BukkitPlayer;
import com.intellectualcrafters.plot.object.PlotInventory;
import com.intellectualcrafters.plot.object.PlotItemStack;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.InventoryUtil;
import java.util.ArrayList;
import java.util.List;
public class BukkitInventoryUtil extends InventoryUtil {

View File

@ -20,19 +20,18 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
package com.plotsquared.bukkit.util.bukkit;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
import org.bukkit.entity.Player;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotId;
import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.UUIDHandler;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
/**
* Functions involving players, plots and locations.

View File

@ -1,8 +1,8 @@
package com.plotsquared.bukkit.util.bukkit;
import com.plotsquared.bukkit.object.BukkitPlayer;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.PlayerManager;
import com.plotsquared.bukkit.object.BukkitPlayer;
public class BukkitPlayerManager extends PlayerManager {

View File

@ -20,31 +20,24 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
package com.plotsquared.bukkit.util.bukkit;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import com.intellectualcrafters.jnbt.*;
import com.intellectualcrafters.plot.object.ChunkLoc;
import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.RunnableVal;
import com.intellectualcrafters.plot.util.SchematicHandler;
import com.intellectualcrafters.plot.util.TaskManager;
import com.plotsquared.bukkit.object.schematic.StateWrapper;
import org.bukkit.Bukkit;
import org.bukkit.Chunk;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
import com.intellectualcrafters.jnbt.ByteArrayTag;
import com.intellectualcrafters.jnbt.CompoundTag;
import com.intellectualcrafters.jnbt.IntTag;
import com.intellectualcrafters.jnbt.ListTag;
import com.intellectualcrafters.jnbt.ShortTag;
import com.intellectualcrafters.jnbt.StringTag;
import com.intellectualcrafters.jnbt.Tag;
import com.intellectualcrafters.plot.object.ChunkLoc;
import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.RunnableVal;
import com.plotsquared.bukkit.object.schematic.StateWrapper;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
/**
* Schematic Handler

View File

@ -1,13 +1,12 @@
package com.plotsquared.bukkit.util.bukkit;
import java.util.ArrayList;
import java.util.Collection;
import org.bukkit.Chunk;
import org.bukkit.World;
import com.intellectualcrafters.plot.object.ChunkLoc;
import com.intellectualcrafters.plot.util.BlockUpdateUtil;
import org.bukkit.Chunk;
import org.bukkit.World;
import java.util.ArrayList;
import java.util.Collection;
public abstract class BukkitSetBlockManager extends BlockUpdateUtil {
public static BukkitSetBlockManager setBlockManager = null;

View File

@ -1,8 +1,11 @@
package com.plotsquared.bukkit.util.bukkit;
import java.io.IOException;
import java.util.Map.Entry;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.config.ConfigurationNode;
import com.intellectualcrafters.plot.object.PlotWorld;
import com.intellectualcrafters.plot.object.SetupObject;
import com.plotsquared.bukkit.generator.BukkitPlotGenerator;
import com.plotsquared.bukkit.util.SetupUtils;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.World.Environment;
@ -10,12 +13,8 @@ import org.bukkit.WorldCreator;
import org.bukkit.generator.ChunkGenerator;
import org.bukkit.plugin.Plugin;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.config.ConfigurationNode;
import com.plotsquared.bukkit.generator.BukkitPlotGenerator;
import com.intellectualcrafters.plot.object.PlotWorld;
import com.intellectualcrafters.plot.object.SetupObject;
import com.plotsquared.bukkit.util.SetupUtils;
import java.io.IOException;
import java.util.Map.Entry;
public class BukkitSetupUtils extends SetupUtils {

View File

@ -1,9 +1,8 @@
package com.plotsquared.bukkit.util.bukkit;
import org.bukkit.Bukkit;
import com.plotsquared.bukkit.BukkitMain;
import com.intellectualcrafters.plot.util.TaskManager;
import com.plotsquared.bukkit.BukkitMain;
import org.bukkit.Bukkit;
public class BukkitTaskManager extends TaskManager {
@Override

View File

@ -1,14 +1,13 @@
package com.plotsquared.bukkit.util.bukkit;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import org.bukkit.Bukkit;
import org.bukkit.Chunk;
import org.bukkit.Material;
import org.bukkit.OfflinePlayer;
import org.bukkit.World;
import com.intellectualcrafters.plot.object.ChunkLoc;
import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.PlotBlock;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.object.schematic.PlotItem;
import com.intellectualcrafters.plot.util.*;
import com.plotsquared.bukkit.object.BukkitPlayer;
import org.bukkit.*;
import org.bukkit.block.Biome;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
@ -18,24 +17,11 @@ import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
import org.bukkit.material.MaterialData;
import org.bukkit.material.Sandstone;
import org.bukkit.material.Step;
import org.bukkit.material.Tree;
import org.bukkit.material.WoodenStep;
import org.bukkit.material.Wool;
import org.bukkit.material.*;
import com.plotsquared.bukkit.object.BukkitPlayer;
import com.intellectualcrafters.plot.object.ChunkLoc;
import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.PlotBlock;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.object.schematic.PlotItem;
import com.intellectualcrafters.plot.util.BlockManager;
import com.intellectualcrafters.plot.util.ChunkManager;
import com.intellectualcrafters.plot.util.MathMan;
import com.intellectualcrafters.plot.util.StringComparison;
import com.intellectualcrafters.plot.util.UUIDHandler;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
public class BukkitUtil extends BlockManager {
private static HashMap<String, World> worlds = new HashMap<>();

View File

@ -20,36 +20,24 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
package com.plotsquared.bukkit.util.bukkit;
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.InvocationTargetException;
import java.net.Proxy;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.UUID;
import java.util.logging.Level;
import java.util.zip.GZIPOutputStream;
import com.intellectualcrafters.configuration.InvalidConfigurationException;
import com.intellectualcrafters.configuration.file.YamlConfiguration;
import com.intellectualcrafters.plot.PS;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.scheduler.BukkitTask;
import com.intellectualcrafters.configuration.InvalidConfigurationException;
import com.intellectualcrafters.configuration.file.YamlConfiguration;
import com.intellectualcrafters.plot.PS;
import java.io.*;
import java.lang.reflect.InvocationTargetException;
import java.net.Proxy;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;
import java.util.*;
import java.util.logging.Level;
import java.util.zip.GZIPOutputStream;
public class Metrics {
/**

View File

@ -1,22 +1,16 @@
package com.plotsquared.bukkit.util.bukkit;
import static com.intellectualcrafters.plot.util.ReflectionUtils.callConstructor;
import static com.intellectualcrafters.plot.util.ReflectionUtils.callMethod;
import static com.intellectualcrafters.plot.util.ReflectionUtils.getCbClass;
import static com.intellectualcrafters.plot.util.ReflectionUtils.getNmsClass;
import static com.intellectualcrafters.plot.util.ReflectionUtils.getUtilClass;
import static com.intellectualcrafters.plot.util.ReflectionUtils.makeConstructor;
import static com.intellectualcrafters.plot.util.ReflectionUtils.makeMethod;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.util.UUID;
import static com.intellectualcrafters.plot.util.ReflectionUtils.*;
public class OfflinePlayerUtil {
public static Player loadPlayer(final String name) {

View File

@ -1,21 +1,20 @@
package com.plotsquared.bukkit.util.bukkit;
import static com.intellectualcrafters.plot.util.ReflectionUtils.getRefClass;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.bukkit.Bukkit;
import org.bukkit.Chunk;
import org.bukkit.World;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.object.ChunkLoc;
import com.intellectualcrafters.plot.util.ReflectionUtils.RefClass;
import com.intellectualcrafters.plot.util.ReflectionUtils.RefConstructor;
import com.intellectualcrafters.plot.util.ReflectionUtils.RefField;
import com.intellectualcrafters.plot.util.ReflectionUtils.RefMethod;
import org.bukkit.Bukkit;
import org.bukkit.Chunk;
import org.bukkit.World;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import static com.intellectualcrafters.plot.util.ReflectionUtils.getRefClass;
/**
* An utility that can be used to send chunks, rather than using bukkit code to do so (uses heavy NMS)

View File

@ -20,18 +20,17 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
package com.plotsquared.bukkit.util.bukkit;
import static com.intellectualcrafters.plot.util.ReflectionUtils.getRefClass;
import java.util.Collection;
import java.util.HashMap;
import org.bukkit.Chunk;
import com.intellectualcrafters.plot.object.ChunkLoc;
import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.ReflectionUtils.RefClass;
import com.intellectualcrafters.plot.util.ReflectionUtils.RefMethod;
import com.intellectualcrafters.plot.util.TaskManager;
import org.bukkit.Chunk;
import java.util.Collection;
import java.util.HashMap;
import static com.intellectualcrafters.plot.util.ReflectionUtils.getRefClass;
/**
* SetBlockFast class<br> Used to do fast world editing

View File

@ -20,7 +20,15 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
package com.plotsquared.bukkit.util.bukkit;
import static com.intellectualcrafters.plot.util.ReflectionUtils.getRefClass;
import com.intellectualcrafters.plot.object.ChunkLoc;
import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.ReflectionUtils.RefClass;
import com.intellectualcrafters.plot.util.ReflectionUtils.RefConstructor;
import com.intellectualcrafters.plot.util.ReflectionUtils.RefMethod;
import com.intellectualcrafters.plot.util.TaskManager;
import org.bukkit.Chunk;
import org.bukkit.World;
import org.bukkit.block.Block;
import java.util.ArrayList;
import java.util.Collection;
@ -28,16 +36,7 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.Map.Entry;
import org.bukkit.Chunk;
import org.bukkit.World;
import org.bukkit.block.Block;
import com.intellectualcrafters.plot.object.ChunkLoc;
import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.ReflectionUtils.RefClass;
import com.intellectualcrafters.plot.util.ReflectionUtils.RefConstructor;
import com.intellectualcrafters.plot.util.ReflectionUtils.RefMethod;
import com.intellectualcrafters.plot.util.TaskManager;
import static com.intellectualcrafters.plot.util.ReflectionUtils.getRefClass;
/**
* SetBlockFast class<br> Used to do fast world editing

View File

@ -1,12 +1,11 @@
package com.plotsquared.bukkit.util.bukkit;
import java.util.Collection;
import com.intellectualcrafters.plot.util.MainUtil;
import org.bukkit.Chunk;
import org.bukkit.World;
import org.bukkit.block.Block;
import com.intellectualcrafters.plot.util.MainUtil;
import java.util.Collection;
public class SetBlockSlow extends BukkitSetBlockManager {
@Override

View File

@ -1,18 +1,17 @@
package com.plotsquared.bukkit.util.bukkit;
import com.intellectualcrafters.plot.PS;
import com.plotsquared.bukkit.generator.AugmentedPopulator;
import com.plotsquared.bukkit.util.SetupUtils;
import org.bukkit.World;
import org.bukkit.generator.BlockPopulator;
import org.bukkit.generator.ChunkGenerator;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Iterator;
import org.bukkit.World;
import org.bukkit.generator.BlockPopulator;
import org.bukkit.generator.ChunkGenerator;
import com.intellectualcrafters.plot.PS;
import com.plotsquared.bukkit.generator.AugmentedPopulator;
import com.plotsquared.bukkit.util.SetupUtils;
public class SetGenCB {
public static void setGenerator(World world) throws Exception {
SetupUtils.manager.updateGenerators();

View File

@ -1,11 +1,11 @@
package com.plotsquared.bukkit.util.bukkit.chat;
import org.apache.commons.lang.Validate;
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Collection;
import org.apache.commons.lang.Validate;
/**
* Represents a wrapper around an array class of an arbitrary reference type,
* which properly implements "value" hash code and equality functions.

View File

@ -1,33 +1,5 @@
package com.plotsquared.bukkit.util.bukkit.chat;
import static com.plotsquared.bukkit.util.bukkit.chat.TextualComponent.rawText;
import java.io.IOException;
import java.io.StringWriter;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import org.bukkit.Achievement;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.Statistic;
import org.bukkit.Statistic.Type;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
@ -35,6 +7,20 @@ import com.google.gson.JsonParser;
import com.google.gson.stream.JsonWriter;
import com.intellectualcrafters.configuration.serialization.ConfigurationSerializable;
import com.intellectualcrafters.configuration.serialization.ConfigurationSerialization;
import org.bukkit.*;
import org.bukkit.Statistic.Type;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import java.io.IOException;
import java.io.StringWriter;
import java.lang.reflect.*;
import java.util.*;
import java.util.logging.Level;
import static com.plotsquared.bukkit.util.bukkit.chat.TextualComponent.rawText;
/**
* Represents a formattable message. Such messages can use elements such as colors, formatting codes, hover and click data, and other features provided by the vanilla Minecraft <a href="http://minecraft.gamepedia.com/Tellraw#Raw_JSON_Text">JSON message formatter</a>.

View File

@ -1,9 +1,9 @@
package com.plotsquared.bukkit.util.bukkit.chat;
import java.io.IOException;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
/**
* Represents an object that can be serialized to a JSON writer instance.
*/
@ -14,6 +14,6 @@ interface JsonRepresentedObject {
* @param writer The JSON writer which will receive the object.
* @throws IOException If an error occurs writing to the stream.
*/
public void writeJson(JsonWriter writer) throws IOException;
void writeJson(JsonWriter writer) throws IOException;
}

View File

@ -1,12 +1,12 @@
package com.plotsquared.bukkit.util.bukkit.chat;
import com.google.gson.stream.JsonWriter;
import com.intellectualcrafters.configuration.serialization.ConfigurationSerializable;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import com.google.gson.stream.JsonWriter;
import com.intellectualcrafters.configuration.serialization.ConfigurationSerializable;
/**
* Represents a JSON string value.
* Writes by this object will not write name values nor begin/end objects in the JSON stream.

View File

@ -1,19 +1,18 @@
package com.plotsquared.bukkit.util.bukkit.chat;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import com.google.common.collect.BiMap;
import com.google.common.collect.ImmutableBiMap;
import com.google.gson.stream.JsonWriter;
import com.intellectualcrafters.configuration.serialization.ConfigurationSerializable;
import com.intellectualcrafters.configuration.serialization.ConfigurationSerialization;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
/**
* Internal class: Represents a component of a JSON-serializable {@link FancyMessage}.

View File

@ -1,13 +1,13 @@
package com.plotsquared.bukkit.util.bukkit.chat;
import org.bukkit.Bukkit;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import org.bukkit.Bukkit;
/**
* A class containing static utility methods and caches which are intended as reflective conveniences.
* Unless otherwise noted, upon failure methods will return {@code null}.

View File

@ -1,15 +1,15 @@
package com.plotsquared.bukkit.util.bukkit.chat;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableMap;
import com.google.gson.stream.JsonWriter;
import com.intellectualcrafters.configuration.serialization.ConfigurationSerializable;
import com.intellectualcrafters.configuration.serialization.ConfigurationSerialization;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
/**
* Represents a textual component of a message part.
* This can be used to not only represent string literals in a JSON message,

View File

@ -1,16 +1,5 @@
package com.plotsquared.bukkit.util.bukkit.uuid;
import java.io.File;
import java.io.FileInputStream;
import java.io.FilenameFilter;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.World;
import com.google.common.collect.HashBiMap;
import com.google.common.io.Files;
import com.google.common.io.InputSupplier;
@ -21,12 +10,18 @@ import com.intellectualcrafters.plot.database.DBFunc;
import com.intellectualcrafters.plot.object.OfflinePlotPlayer;
import com.intellectualcrafters.plot.object.RunnableVal;
import com.intellectualcrafters.plot.object.StringWrapper;
import com.intellectualcrafters.plot.util.ExpireManager;
import com.intellectualcrafters.plot.util.NbtFactory;
import com.intellectualcrafters.plot.util.TaskManager;
import com.intellectualcrafters.plot.util.UUIDHandler;
import com.intellectualcrafters.plot.util.UUIDHandlerImplementation;
import com.intellectualcrafters.plot.util.*;
import com.intellectualcrafters.plot.uuid.UUIDWrapper;
import org.bukkit.Bukkit;
import org.bukkit.World;
import java.io.File;
import java.io.FileInputStream;
import java.io.FilenameFilter;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.UUID;
public class FileUUIDHandler extends UUIDHandlerImplementation {

View File

@ -1,23 +1,5 @@
package com.plotsquared.bukkit.util.bukkit.uuid;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import com.google.common.collect.HashBiMap;
import com.intellectualcrafters.json.JSONObject;
import com.intellectualcrafters.plot.PS;
@ -32,6 +14,17 @@ import com.intellectualcrafters.plot.util.UUIDHandler;
import com.intellectualcrafters.plot.util.UUIDHandlerImplementation;
import com.intellectualcrafters.plot.uuid.UUIDWrapper;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.*;
public class SQLUUIDHandler extends UUIDHandlerImplementation {
public SQLUUIDHandler(UUIDWrapper wrapper) {

View File

@ -0,0 +1,84 @@
package com.plotsquared.general.commands;
import com.intellectualcrafters.plot.object.ConsolePlayer;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotId;
import com.intellectualcrafters.plot.util.MainUtil;
public abstract class Argument<T> {
private final String name;
private final T example;
public Argument(String name, T example) {
this.name = name;
this.example = example;
}
public abstract T parse(String in);
@Override
public final String toString() {
return this.getName();
}
public final String getName() {
return this.name;
}
public final T getExample() {
return this.example;
}
public static final Argument<Integer> Integer = new Argument<Integer>("int", 16) {
@Override
public Integer parse(String in) {
Integer value = null;
try {
value = java.lang.Integer.parseInt(in);
} catch(final Exception ignored) {}
return value;
}
};
public static final Argument<Boolean> Boolean = new Argument<Boolean>("boolean", true) {
@Override
public Boolean parse(String in) {
Boolean value = null;
if (in.equalsIgnoreCase("true") || in.equalsIgnoreCase("Yes") || in.equalsIgnoreCase("1")) {
value = true;
} else if (in.equalsIgnoreCase("false") || in.equalsIgnoreCase("No") || in.equalsIgnoreCase("0")) {
value = false;
}
return value;
}
};
public static final Argument<String> String = new Argument<String>("String", "Example") {
@Override
public String parse(String in) {
return in;
}
};
public static Argument<String> PlayerName = new Argument<String>("PlayerName", "Dinnerbone") {
@Override
public String parse(String in) {
return in.length() < 16 ? in : null;
}
};
public static Argument<PlotId> PlotID = new Argument<PlotId>("PlotID", new PlotId(-6, 3)) {
@Override
public PlotId parse(String in) {
return PlotId.fromString(in);
}
};
public static Argument<Plot> Plot = new Argument<Plot>("Plot", new Plot("plotworld", new PlotId(3, -6), null)) {
@Override
public Plot parse(String in) {
return MainUtil.getPlotFromString(ConsolePlayer.getConsole(), in, false);
}
};
}

View File

@ -0,0 +1,170 @@
package com.plotsquared.general.commands;
import com.intellectualcrafters.plot.commands.CommandCategory;
import com.intellectualcrafters.plot.commands.RequiredType;
import java.lang.annotation.Annotation;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
public abstract class Command<E extends CommandCaller> extends CommandManager {
private RequiredType requiredType = RequiredType.NONE;
private String command, usage = "", description = "", permission = "";
private Set<String> aliases = new HashSet<>();
private CommandCategory category;
protected Argument<?>[] requiredArguments;
public Command() {
super(null, new ArrayList<Command>());
}
public Command(String command) {
super(null, new ArrayList<Command>());
this.command = command;
}
public Command(String command, String usage) {
super(null, new ArrayList<Command>());
this.command = command;
this.usage = usage;
}
public Command(String command, String usage, String description) {
super(null, new ArrayList<Command>());
this.command = command;
this.usage = usage;
this.description = description;
}
public Command(String command, String usage, String description, String permission) {
super(null, new ArrayList<Command>());
this.command = command;
this.usage = usage;
this.description = description;
this.permission = permission;
}
public Command(String command, String[] aliases, String usage) {
super(null, new ArrayList<Command>());
this.command = command;
this.aliases = new HashSet<>(Arrays.asList(aliases));
this.usage = usage;
}
public Command(String command, String[] aliases) {
super(null, new ArrayList<Command>());
this.command = command;
this.aliases = new HashSet<>(Arrays.asList(aliases));
}
public Command(String command, String usage, String description, String permission, String[] aliases, RequiredType requiredType) {
super(null, new ArrayList<Command>());
this.command = command;
this.usage = usage;
this.description = description;
this.permission = permission;
this.aliases = new HashSet<>(Arrays.asList(aliases));
this.requiredType = requiredType;
}
final public RequiredType getRequiredType() {
return this.requiredType;
}
final protected void create() {
Annotation annotation = getClass().getAnnotation(CommandDeclaration.class);
if (annotation == null) {
throw new RuntimeException("Command does not have a CommandDeclaration");
}
CommandDeclaration declaration = (CommandDeclaration) annotation;
this.command = declaration.command();
this.usage = declaration.usage();
this.description = declaration.description();
this.usage = declaration.usage();
this.permission = declaration.permission();
this.aliases = new HashSet<>(Arrays.asList(declaration.aliases()));
this.requiredType = declaration.requiredType();
this.category = declaration.category();
}
@Override
final public String toString() {
return this.command;
}
public abstract boolean onCommand(E plr, String[] arguments);
final public int handle(E plr, String[] args) {
if (args.length == 0) {
return super.handle(plr, "");
}
StringBuilder builder = new StringBuilder();
for (String s : args) {
builder.append(s).append(" ");
}
String s = builder.substring(0, builder.length() - 1);
return super.handle(plr, s);
}
final public String getCommand() {
return this.command;
}
final public String getUsage() {
if (this.usage.length() == 0) {
return "/{label} " + command;
}
return this.usage;
}
final public String getPermission() {
return this.permission;
}
final public String getDescription() {
return this.description;
}
final public Set<String> getAliases() {
return this.aliases;
}
final public Argument<?>[] getRequiredArguments() {
return this.requiredArguments;
}
final public CommandCategory getCategory() {
return this.category;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Command<?> other = (Command<?>) obj;
if (this.hashCode() != other.hashCode()) {
return false;
}
return this.command.equals(other.command);
}
private int hash;
@Override
public int hashCode() {
if (hash == 0) {
hash = getCommand().hashCode();
}
return hash;
}
}

View File

@ -0,0 +1,14 @@
package com.plotsquared.general.commands;
import com.intellectualcrafters.plot.commands.RequiredType;
import com.intellectualcrafters.plot.config.C;
public interface CommandCaller {
void sendMessage(final String message);
void sendMessage(C c, String ... args);
boolean hasPermission(final String perm);
RequiredType getSuperCaller();
}

View File

@ -0,0 +1,28 @@
package com.plotsquared.general.commands;
import com.intellectualcrafters.plot.commands.CommandCategory;
import com.intellectualcrafters.plot.commands.RequiredType;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface CommandDeclaration {
String command();
String[] aliases() default {};
String permission() default "";
String usage() default "";
String description() default "";
RequiredType requiredType() default RequiredType.NONE;
CommandCategory category();
}

View File

@ -0,0 +1,31 @@
package com.plotsquared.general.commands;
import java.lang.reflect.Field;
public class CommandHandlingOutput {
public static int CALLER_OF_WRONG_TYPE = -6;
public static int NOT_COMMAND = -5;
public static int NOT_FOUND = -4;
public static int NOT_PERMITTED = -3;
public static int ERROR = -2;
public static int WRONG_USAGE = -1;
public static int SUCCESS = 1;
public static String nameField(int code) {
Field[] fields = CommandHandlingOutput.class.getDeclaredFields();
for (final Field field : fields) {
if (field.getGenericType() == Integer.TYPE) {
try {
if ((Integer) field.get(CommandHandlingOutput.class) == code) {
return field.getName();
}
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
}
return "null??";
}
}

View File

@ -0,0 +1,141 @@
package com.plotsquared.general.commands;
import com.intellectualcrafters.plot.config.C;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
@SuppressWarnings("unused")
public class CommandManager<T extends CommandCaller> {
protected final ConcurrentHashMap<String, Command<T>> commands;
protected final Character initialCharacter;
public CommandManager() {
this('/', new ArrayList<Command<T>>());
}
public CommandManager(Character initialCharacter, List<Command<T>> commands) {
this.commands = new ConcurrentHashMap<>();
for (Command<T> command : commands) {
addCommand(command);
}
this.initialCharacter = initialCharacter;
}
final public void addCommand(final Command<T> command) {
this.commands.put(command.getCommand().toLowerCase(), command);
for (String alias : command.getAliases()) {
this.commands.put(alias.toLowerCase(), command);
}
}
final public boolean createCommand(final Command<T> command) {
try {
command.create();
} catch(final Exception e) {
e.printStackTrace();
return false;
}
if (command.getCommand() != null) {
addCommand(command);
return true;
}
return false;
}
final public ArrayList<Command<T>> getCommands() {
ArrayList<Command<T>> result = new ArrayList<>(this.commands.values());
Collections.sort(result, new Comparator<Command<T>>() {
@Override
public int compare(Command<T> a, Command<T> b) {
if (a == b) {
return 0;
}
if (a == null) {
return -1;
}
if (b == null) {
return 1;
}
return a.getCommand().compareTo(b.getCommand());
}
});
return result;
}
final public ArrayList<String> getCommandLabels(ArrayList<Command<T>> cmds) {
ArrayList<String> labels = new ArrayList<>(cmds.size());
for (Command<T> cmd : cmds) {
labels.add(cmd.getCommand());
}
return labels;
}
public int handle(T plr, String input) {
if (initialCharacter != null && !input.startsWith(initialCharacter + "")) {
return CommandHandlingOutput.NOT_COMMAND;
}
input = initialCharacter == null ? input : input.substring(1);
String[] parts = input.split(" ");
String[] args;
String command = parts[0].toLowerCase();
if (parts.length == 1) {
args = new String[0];
} else {
args = new String[parts.length - 1];
System.arraycopy(parts, 1, args, 0, args.length);
}
Command<T> cmd = null;
cmd = commands.get(command);
if (cmd == null) {
return CommandHandlingOutput.NOT_FOUND;
}
if (!cmd.getRequiredType().allows(plr)) {
return CommandHandlingOutput.CALLER_OF_WRONG_TYPE;
}
if (!plr.hasPermission(cmd.getPermission())) {
return CommandHandlingOutput.NOT_PERMITTED;
}
Argument<?>[] requiredArguments = cmd.getRequiredArguments();
if (requiredArguments != null && requiredArguments.length > 0) {
boolean success = true;
if (args.length < requiredArguments.length) {
success = false;
} else {
for (int i = 0; i < requiredArguments.length; i++) {
if (requiredArguments[i].parse(args[i]) == null) {
success = false;
break;
}
}
}
if (!success) {
String usage = cmd.getUsage();
C.COMMAND_SYNTAX.send(plr, cmd.getUsage());
return CommandHandlingOutput.WRONG_USAGE;
}
}
try {
boolean a = cmd.onCommand(plr, args);
if (!a) {
String usage = cmd.getUsage();
if (usage != null && !usage.isEmpty()) {
plr.sendMessage(usage);
}
return CommandHandlingOutput.WRONG_USAGE;
}
} catch(final Throwable t) {
t.printStackTrace();
return CommandHandlingOutput.ERROR;
}
return CommandHandlingOutput.SUCCESS;
}
final public char getInitialCharacter() {
return this.initialCharacter;
}
}

View File

@ -1,5 +1,6 @@
package com.plotsquared.sponge;
import com.flowpowered.math.vector.Vector3i;
import org.spongepowered.api.block.BlockState;
import org.spongepowered.api.block.BlockTypes;
import org.spongepowered.api.world.World;
@ -7,8 +8,6 @@ import org.spongepowered.api.world.extent.ImmutableBiomeArea;
import org.spongepowered.api.world.extent.MutableBlockVolume;
import org.spongepowered.api.world.gen.GeneratorPopulator;
import com.flowpowered.math.vector.Vector3i;
public class PlotGen implements GeneratorPopulator {
public String worldname;

View File

@ -1,11 +1,10 @@
package com.plotsquared.sponge;
import org.spongepowered.api.world.gen.WorldGenerator;
import com.intellectualcrafters.plot.generator.PlotGenerator;
import com.intellectualcrafters.plot.object.PlotCluster;
import com.intellectualcrafters.plot.object.PlotManager;
import com.intellectualcrafters.plot.object.PlotWorld;
import org.spongepowered.api.world.gen.WorldGenerator;
public class SpongeGeneratorWrapper extends PlotGenerator<WorldGenerator>{

View File

@ -1,9 +1,16 @@
package com.plotsquared.sponge;
import java.io.File;
import java.util.Collection;
import java.util.UUID;
import com.google.inject.Inject;
import com.intellectualcrafters.configuration.ConfigurationSection;
import com.intellectualcrafters.plot.IPlotMain;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.config.Settings;
import com.intellectualcrafters.plot.generator.HybridUtils;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.*;
import com.plotsquared.bukkit.listeners.APlotListener;
import com.plotsquared.bukkit.util.SetupUtils;
import org.slf4j.Logger;
import org.spongepowered.api.Game;
import org.spongepowered.api.Server;
@ -19,27 +26,9 @@ import org.spongepowered.api.world.DimensionTypes;
import org.spongepowered.api.world.GeneratorTypes;
import org.spongepowered.api.world.World;
import com.google.inject.Inject;
import com.intellectualcrafters.configuration.ConfigurationSection;
import com.intellectualcrafters.plot.IPlotMain;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.config.Settings;
import com.intellectualcrafters.plot.generator.HybridUtils;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.BlockManager;
import com.intellectualcrafters.plot.util.ChunkManager;
import com.intellectualcrafters.plot.util.ConsoleColors;
import com.intellectualcrafters.plot.util.EconHandler;
import com.intellectualcrafters.plot.util.EventUtil;
import com.intellectualcrafters.plot.util.InventoryUtil;
import com.intellectualcrafters.plot.util.PlayerManager;
import com.intellectualcrafters.plot.util.TaskManager;
import com.intellectualcrafters.plot.util.UUIDHandler;
import com.intellectualcrafters.plot.util.UUIDHandlerImplementation;
import com.intellectualcrafters.plot.uuid.UUIDWrapper;
import com.plotsquared.bukkit.listeners.APlotListener;
import com.plotsquared.bukkit.util.SetupUtils;
import java.io.File;
import java.util.Collection;
import java.util.UUID;
/**
* Created by robin on 01/11/2014

View File

@ -31,21 +31,13 @@ package com.plotsquared.sponge;
import ninja.leaping.configurate.commented.CommentedConfigurationNode;
import ninja.leaping.configurate.hocon.HoconConfigurationLoader;
import ninja.leaping.configurate.loader.ConfigurationLoader;
import org.spongepowered.api.Game;
import org.spongepowered.api.plugin.PluginContainer;
import org.spongepowered.api.service.scheduler.Task;
import org.spongepowered.api.service.scheduler.TaskBuilder;
import javax.inject.Inject;
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.io.*;
import java.net.Proxy;
import java.net.URL;
import java.net.URLConnection;

View File

@ -1,18 +1,11 @@
package com.plotsquared.sponge;
import java.util.List;
import org.bukkit.World;
import org.spongepowered.api.world.gen.BiomeGenerator;
import org.spongepowered.api.world.gen.GeneratorPopulator;
import org.spongepowered.api.world.gen.Populator;
import org.spongepowered.api.world.gen.WorldGenerator;
import com.intellectualcrafters.plot.object.PlotManager;
import com.intellectualcrafters.plot.object.PlotWorld;
import com.intellectualcrafters.plot.object.PseudoRandom;
import com.intellectualcrafters.plot.object.RegionWrapper;
import com.plotsquared.bukkit.object.PlotPopulator;
import java.util.List;
public class SpongePlotGenerator implements WorldGenerator {