Remove bukkit classes from core

This commit is contained in:
Jesse Boyd 2016-02-11 06:43:47 +11:00
parent 50f891a974
commit 893c2b3088
20 changed files with 30 additions and 47 deletions

View File

@ -41,10 +41,6 @@ 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.generator.AugmentedPopulator;
//import com.plotsquared.bukkit.generator.AugmentedPopulator;
//import com.plotsquared.bukkit.generator.BukkitPlotGenerator;
//import com.plotsquared.bukkit.generator.HybridGen;
import com.plotsquared.general.commands.CommandDeclaration;
@CommandDeclaration(

View File

@ -71,7 +71,6 @@ import com.intellectualcrafters.plot.util.StringMan;
import com.intellectualcrafters.plot.util.TaskManager;
import com.intellectualcrafters.plot.util.UUIDHandler;
import com.intellectualcrafters.plot.util.WorldUtil;
import com.plotsquared.bukkit.util.BukkitHybridUtils;
import com.plotsquared.general.commands.Command;
import com.plotsquared.general.commands.CommandDeclaration;
@ -238,7 +237,7 @@ public class DebugExec extends SubCommand {
return false;
}
if (HybridUtils.regions != null) {
result = ((BukkitHybridUtils) (HybridUtils.manager)).scheduleRoadUpdate(area, HybridUtils.regions, 0);
result = ((HybridUtils.manager)).scheduleRoadUpdate(area, HybridUtils.regions, 0);
} else {
result = HybridUtils.manager.scheduleRoadUpdate(area, 0);
}

View File

@ -32,7 +32,6 @@ import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.Permissions;
import com.intellectualcrafters.plot.util.UUIDHandler;
import com.intellectualcrafters.plot.util.WorldUtil;
import com.plotsquared.bukkit.uuid.SQLUUIDHandler;
import com.plotsquared.general.commands.Argument;
import com.plotsquared.general.commands.CommandDeclaration;
@ -66,11 +65,7 @@ public class Deny extends SubCommand {
uuid = UUIDHandler.getUUID(args[0], null);
}
if (uuid == null) {
if (UUIDHandler.implementation instanceof SQLUUIDHandler) {
MainUtil.sendMessage(plr, C.INVALID_PLAYER_WAIT, args[0]);
} else {
MainUtil.sendMessage(plr, C.INVALID_PLAYER, args[0]);
}
MainUtil.sendMessage(plr, C.INVALID_PLAYER, args[0]);
return false;
}
if (plot.isOwner(uuid)) {

View File

@ -31,7 +31,6 @@ 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.uuid.SQLUUIDHandler;
import com.plotsquared.general.commands.Argument;
import com.plotsquared.general.commands.CommandDeclaration;
@ -126,11 +125,7 @@ public class Remove extends SubCommand {
break;
}
if (count == 0) {
if (UUIDHandler.implementation instanceof SQLUUIDHandler) {
MainUtil.sendMessage(plr, C.INVALID_PLAYER_WAIT, args[0]);
} else {
MainUtil.sendMessage(plr, C.INVALID_PLAYER, args[0]);
}
MainUtil.sendMessage(plr, C.INVALID_PLAYER, args[0]);
return false;
} else {
MainUtil.sendMessage(plr, C.REMOVED_PLAYERS, count + "");

View File

@ -31,7 +31,6 @@ import com.intellectualcrafters.plot.util.EventUtil;
import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.Permissions;
import com.intellectualcrafters.plot.util.UUIDHandler;
import com.plotsquared.bukkit.uuid.SQLUUIDHandler;
import com.plotsquared.general.commands.Argument;
import com.plotsquared.general.commands.CommandDeclaration;
@ -71,11 +70,7 @@ public class Trust extends SubCommand {
uuid = UUIDHandler.getUUID(args[0], null);
}
if (uuid == null) {
if (UUIDHandler.implementation instanceof SQLUUIDHandler) {
MainUtil.sendMessage(plr, C.INVALID_PLAYER_WAIT, args[0]);
} else {
MainUtil.sendMessage(plr, C.INVALID_PLAYER, args[0]);
}
MainUtil.sendMessage(plr, C.INVALID_PLAYER, args[0]);
return false;
}
if (plot.isOwner(uuid)) {

View File

@ -30,7 +30,6 @@ 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.uuid.SQLUUIDHandler;
import com.plotsquared.general.commands.Argument;
import com.plotsquared.general.commands.CommandDeclaration;
@ -93,11 +92,7 @@ public class Undeny extends SubCommand {
break;
}
if (count == 0) {
if (UUIDHandler.implementation instanceof SQLUUIDHandler) {
MainUtil.sendMessage(plr, C.INVALID_PLAYER_WAIT, args[0]);
} else {
MainUtil.sendMessage(plr, C.INVALID_PLAYER, args[0]);
}
MainUtil.sendMessage(plr, C.INVALID_PLAYER, args[0]);
return false;
} else {
MainUtil.sendMessage(plr, C.REMOVED_PLAYERS, count + "");

View File

@ -17,7 +17,7 @@ import com.intellectualcrafters.plot.object.PlotCluster;
import com.intellectualcrafters.plot.object.PlotId;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.object.Rating;
import com.plotsquared.bukkit.listeners.PlayerBlockEventType;
import com.plotsquared.listener.PlayerBlockEventType;
public abstract class EventUtil {

View File

@ -51,7 +51,6 @@ import com.intellectualcrafters.plot.object.PlotBlock;
import com.intellectualcrafters.plot.object.RegionWrapper;
import com.intellectualcrafters.plot.object.RunnableVal;
import com.intellectualcrafters.plot.object.schematic.PlotItem;
import com.plotsquared.object.schematic.StateWrapper;
public abstract class SchematicHandler {
public static SchematicHandler manager;
@ -439,7 +438,7 @@ public abstract class SchematicHandler {
final short x = IntTag.class.cast(state.get("x")).getValue().shortValue();
final short y = IntTag.class.cast(state.get("y")).getValue().shortValue();
final short z = IntTag.class.cast(state.get("z")).getValue().shortValue();
new StateWrapper(ct).restoreTag(x, y, z, schem);
manager.restoreTag(ct, x, y, z, schem);
} catch (final Exception e) {
e.printStackTrace();
}
@ -450,6 +449,8 @@ public abstract class SchematicHandler {
return schem;
}
public abstract void restoreTag(CompoundTag ct, short x, short y, short z, Schematic schem);
/**
* Get a schematic
*

View File

@ -26,6 +26,7 @@ import org.bukkit.plugin.java.JavaPlugin;
import com.intellectualcrafters.configuration.ConfigurationSection;
import com.intellectualcrafters.plot.IPlotMain;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.commands.MainCommand;
import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.config.ConfigurationNode;
import com.intellectualcrafters.plot.config.Settings;
@ -56,6 +57,7 @@ import com.intellectualcrafters.plot.util.UUIDHandler;
import com.intellectualcrafters.plot.util.UUIDHandlerImplementation;
import com.intellectualcrafters.plot.util.WorldUtil;
import com.intellectualcrafters.plot.uuid.UUIDWrapper;
import com.plotsquared.bukkit.commands.DebugUUID;
import com.plotsquared.bukkit.database.plotme.ClassicPlotMeConnector;
import com.plotsquared.bukkit.database.plotme.LikePlotMeConverter;
import com.plotsquared.bukkit.database.plotme.PlotMeConnector_017;
@ -174,6 +176,7 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
plotCommand.setExecutor(bcmd);
plotCommand.setAliases(Arrays.asList("p", "ps", "plotme", "plot"));
plotCommand.setTabCompleter(bcmd);
MainCommand.getInstance().addCommand(new DebugUUID());
}
@Override

View File

@ -18,7 +18,7 @@
// /
// You can contact us via: support@intellectualsites.com /
////////////////////////////////////////////////////////////////////////////////////////////////////
package com.intellectualcrafters.plot.commands;
package com.plotsquared.bukkit.commands;
import java.io.File;
import java.io.FilenameFilter;
@ -33,6 +33,9 @@ import java.util.Map.Entry;
import java.util.UUID;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.commands.CommandCategory;
import com.intellectualcrafters.plot.commands.RequiredType;
import com.intellectualcrafters.plot.commands.SubCommand;
import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.database.AbstractDB;
import com.intellectualcrafters.plot.database.DBFunc;

View File

@ -116,6 +116,7 @@ import com.plotsquared.bukkit.BukkitMain;
import com.plotsquared.bukkit.object.BukkitLazyBlock;
import com.plotsquared.bukkit.object.BukkitPlayer;
import com.plotsquared.bukkit.util.BukkitUtil;
import com.plotsquared.listener.PlayerBlockEventType;
/**
* Player Events involving plots

View File

@ -1,4 +1,4 @@
package com.intellectualcrafters.plot.object.entity;
package com.plotsquared.bukkit.object.entity;
public class AgeableStats {
public int age;

View File

@ -1,4 +1,4 @@
package com.intellectualcrafters.plot.object.entity;
package com.plotsquared.bukkit.object.entity;
public class ArmorStandStats {
public float[] head = new float[3];

View File

@ -1,6 +1,5 @@
package com.intellectualcrafters.plot.object.entity;
package com.plotsquared.bukkit.object.entity;
import com.plotsquared.bukkit.object.entity.EntityWrapper;
public class EntityBaseStats {
public EntityWrapper passenger;

View File

@ -32,10 +32,6 @@ import org.bukkit.util.EulerAngle;
import org.bukkit.util.Vector;
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;
public class EntityWrapper {
public short id;

View File

@ -1,4 +1,4 @@
package com.intellectualcrafters.plot.object.entity;
package com.plotsquared.bukkit.object.entity;
public class HorseStats {
public double jump;

View File

@ -1,4 +1,4 @@
package com.plotsquared.object.schematic;
package com.plotsquared.bukkit.object.schematic;
import java.util.ArrayList;
import java.util.HashMap;

View File

@ -12,12 +12,12 @@ import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter;
import org.bukkit.entity.Player;
import com.intellectualcrafters.plot.commands.DebugUUID;
import com.intellectualcrafters.plot.commands.MainCommand;
import com.intellectualcrafters.plot.object.ConsolePlayer;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.Permissions;
import com.intellectualcrafters.plot.util.StringComparison;
import com.plotsquared.bukkit.commands.DebugUUID;
import com.plotsquared.general.commands.Command;
/**

View File

@ -48,7 +48,7 @@ import com.intellectualcrafters.plot.object.RunnableVal;
import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.SchematicHandler;
import com.intellectualcrafters.plot.util.TaskManager;
import com.plotsquared.object.schematic.StateWrapper;
import com.plotsquared.bukkit.object.schematic.StateWrapper;
/**
* Schematic Handler
@ -327,4 +327,9 @@ public class BukkitSchematicHandler extends SchematicHandler {
}
});
}
@Override
public void restoreTag(CompoundTag ct, short x, short y, short z, Schematic schem) {
new StateWrapper(ct).restoreTag(x, y, z, schem);
}
}

View File

@ -1,4 +1,4 @@
package com.plotsquared.bukkit.listeners;
package com.plotsquared.listener;
public enum PlayerBlockEventType {
// Non interactive