diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index d932e65f7..a7e9e2e71 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -74,6 +74,7 @@ import org.bukkit.plugin.Plugin; import org.bukkit.plugin.PluginDescriptionFile; import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.java.JavaPlugin; +import org.bukkit.plugin.java.JavaPluginLoader; import org.bukkit.scheduler.BukkitScheduler; import org.bukkit.scheduler.BukkitTask; import org.yaml.snakeyaml.error.YAMLException; @@ -81,7 +82,7 @@ import org.yaml.snakeyaml.error.YAMLException; public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials { - public static final int BUKKIT_VERSION = 2882; + public static final int BUKKIT_VERSION = 2985; private static final Logger LOGGER = Logger.getLogger("Essentials"); private transient ISettings settings; private final transient TNTExplodeListener tntListener = new TNTExplodeListener(this); @@ -102,6 +103,16 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials private transient List vanishedPlayers = new ArrayList(); private transient SimpleCommandMap scm; + public Essentials() + { + + } + + public Essentials(final Server server) + { + super(new JavaPluginLoader(server), new PluginDescriptionFile("Essentials", "", "com.earth2me.essentials.Essentials"), null, null); + } + @Override public ISettings getSettings() { diff --git a/Essentials/src/com/earth2me/essentials/OfflinePlayer.java b/Essentials/src/com/earth2me/essentials/OfflinePlayer.java index 10e205a65..c06f6888e 100644 --- a/Essentials/src/com/earth2me/essentials/OfflinePlayer.java +++ b/Essentials/src/com/earth2me/essentials/OfflinePlayer.java @@ -474,30 +474,126 @@ public class OfflinePlayer implements Player throw new UnsupportedOperationException(_("notSupportedYet")); } + @Override + public void removeAchievement(Achievement achievement) + { + throw new UnsupportedOperationException(_("notSupportedYet")); + } + + @Override + public boolean hasAchievement(Achievement achievement) + { + throw new UnsupportedOperationException(_("notSupportedYet")); + } + @Override public void incrementStatistic(Statistic ststc) { throw new UnsupportedOperationException(_("notSupportedYet")); } + @Override + public void decrementStatistic(Statistic statistic) throws IllegalArgumentException + { + throw new UnsupportedOperationException(_("notSupportedYet")); + } + @Override public void incrementStatistic(Statistic ststc, int i) { throw new UnsupportedOperationException(_("notSupportedYet")); } + @Override + public void decrementStatistic(Statistic statistic, int i) throws IllegalArgumentException + { + throw new UnsupportedOperationException(_("notSupportedYet")); + } + + @Override + public void setStatistic(Statistic statistic, int i) throws IllegalArgumentException + { + throw new UnsupportedOperationException(_("notSupportedYet")); + } + + @Override + public int getStatistic(Statistic statistic) throws IllegalArgumentException + { + throw new UnsupportedOperationException(_("notSupportedYet")); + } + @Override public void incrementStatistic(Statistic ststc, Material mtrl) { throw new UnsupportedOperationException(_("notSupportedYet")); } + @Override + public void decrementStatistic(Statistic statistic, Material material) throws IllegalArgumentException + { + throw new UnsupportedOperationException(_("notSupportedYet")); + } + + @Override + public int getStatistic(Statistic statistic, Material material) throws IllegalArgumentException + { + throw new UnsupportedOperationException(_("notSupportedYet")); + } + @Override public void incrementStatistic(Statistic ststc, Material mtrl, int i) { throw new UnsupportedOperationException(_("notSupportedYet")); } + @Override + public void decrementStatistic(Statistic statistic, Material material, int i) throws IllegalArgumentException + { + throw new UnsupportedOperationException(_("notSupportedYet")); + } + + @Override + public void setStatistic(Statistic statistic, Material material, int i) throws IllegalArgumentException + { + throw new UnsupportedOperationException(_("notSupportedYet")); + } + + @Override + public void incrementStatistic(Statistic statistic, EntityType entityType) throws IllegalArgumentException + { + throw new UnsupportedOperationException(_("notSupportedYet")); + } + + @Override + public void decrementStatistic(Statistic statistic, EntityType entityType) throws IllegalArgumentException + { + throw new UnsupportedOperationException(_("notSupportedYet")); + } + + @Override + public int getStatistic(Statistic statistic, EntityType entityType) throws IllegalArgumentException + { + throw new UnsupportedOperationException(_("notSupportedYet")); + } + + @Override + public void incrementStatistic(Statistic statistic, EntityType entityType, int i) throws IllegalArgumentException + { + throw new UnsupportedOperationException(_("notSupportedYet")); + } + + @Override + public void decrementStatistic(Statistic statistic, EntityType entityType, int i) + { + throw new UnsupportedOperationException(_("notSupportedYet")); + } + + @Override + public void setStatistic(Statistic statistic, EntityType entityType, int i) + { + throw new UnsupportedOperationException(_("notSupportedYet")); + } + @Override public void playNote(Location lctn, byte b, byte b1) { diff --git a/Essentials/test/com/earth2me/essentials/EconomyTest.java b/Essentials/test/com/earth2me/essentials/EconomyTest.java index de73cc15e..648113c0b 100644 --- a/Essentials/test/com/earth2me/essentials/EconomyTest.java +++ b/Essentials/test/com/earth2me/essentials/EconomyTest.java @@ -19,9 +19,9 @@ public class EconomyTest extends TestCase public EconomyTest(final String testName) { super(testName); - ess = new Essentials(); final FakeServer server = new FakeServer(); server.createWorld("testWorld", Environment.NORMAL); + ess = new Essentials(server); try { ess.setupForTesting(server); diff --git a/Essentials/test/com/earth2me/essentials/FakeServer.java b/Essentials/test/com/earth2me/essentials/FakeServer.java index 10b6a14de..b16ff3ea0 100644 --- a/Essentials/test/com/earth2me/essentials/FakeServer.java +++ b/Essentials/test/com/earth2me/essentials/FakeServer.java @@ -1136,7 +1136,7 @@ public class FakeServer implements Server @Override public WarningState getWarningState() { - throw new UnsupportedOperationException("Not supported yet."); + return WarningState.DEFAULT; } @Override @@ -1177,4 +1177,22 @@ public class FakeServer implements Server public CachedServerIcon loadServerIcon(BufferedImage bufferedImage) throws IllegalArgumentException, Exception { throw new UnsupportedOperationException("Not supported yet."); } + + @Override + public void setIdleTimeout(int i) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getIdleTimeout() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public UnsafeValues getUnsafe() + { + throw new UnsupportedOperationException("Not supported yet."); + } } diff --git a/Essentials/test/com/earth2me/essentials/StorageTest.java b/Essentials/test/com/earth2me/essentials/StorageTest.java index bde770997..0412e2264 100644 --- a/Essentials/test/com/earth2me/essentials/StorageTest.java +++ b/Essentials/test/com/earth2me/essentials/StorageTest.java @@ -17,9 +17,9 @@ public class StorageTest extends TestCase public StorageTest() { - ess = new Essentials(); server = new FakeServer(); world = server.createWorld("testWorld", Environment.NORMAL); + ess = new Essentials(server); try { ess.setupForTesting(server); diff --git a/Essentials/test/com/earth2me/essentials/ToggleTest.java b/Essentials/test/com/earth2me/essentials/ToggleTest.java index e66d7a9c7..c45bd3916 100644 --- a/Essentials/test/com/earth2me/essentials/ToggleTest.java +++ b/Essentials/test/com/earth2me/essentials/ToggleTest.java @@ -18,9 +18,9 @@ public class ToggleTest extends TestCase public ToggleTest(String testName) { super(testName); - ess = new Essentials(); server = new FakeServer(); server.createWorld("testWorld", Environment.NORMAL); + ess = new Essentials(server); try { ess.setupForTesting(server); diff --git a/Essentials/test/com/earth2me/essentials/UserTest.java b/Essentials/test/com/earth2me/essentials/UserTest.java index 150f9653d..24d39cc0f 100644 --- a/Essentials/test/com/earth2me/essentials/UserTest.java +++ b/Essentials/test/com/earth2me/essentials/UserTest.java @@ -17,9 +17,9 @@ public class UserTest extends TestCase public UserTest(String testName) { super(testName); - ess = new Essentials(); server = new FakeServer(); server.createWorld("testWorld", Environment.NORMAL); + ess = new Essentials(server); try { ess.setupForTesting(server); diff --git a/Essentials/test/com/earth2me/essentials/UtilTest.java b/Essentials/test/com/earth2me/essentials/UtilTest.java index 53f79d387..497d26d7a 100644 --- a/Essentials/test/com/earth2me/essentials/UtilTest.java +++ b/Essentials/test/com/earth2me/essentials/UtilTest.java @@ -19,9 +19,9 @@ public class UtilTest extends TestCase public UtilTest() { - ess = new Essentials(); server = new FakeServer(); server.createWorld("testWorld", Environment.NORMAL); + ess = new Essentials(server); try { ess.setupForTesting(server); diff --git a/pom.xml b/pom.xml index 1aafcc580..a6764ecb1 100644 --- a/pom.xml +++ b/pom.xml @@ -44,6 +44,10 @@ ess-repo http://repo.ess3.net/content/groups/public + + bukkit-repo + http://repo.bukkit.org/content/groups/public + @@ -71,7 +75,7 @@ org.bukkit bukkit - 1.7.2-R0.1 + 1.7.2-R0.3-SNAPSHOT junit