diff --git a/sponge/pom.xml b/sponge/pom.xml index 217c217..8a26895 100644 --- a/sponge/pom.xml +++ b/sponge/pom.xml @@ -97,6 +97,10 @@ war-repo http://ci.tommytony.com/plugin/repository/everything/ + + sponge-repo + http://repo.spongepowered.org/Sponge/maven/ + @@ -108,8 +112,8 @@ org.spongepowered - SpongeAPI - 1.0.0-SNAPSHOT + spongeapi + 1.0 org.xerial diff --git a/sponge/src/main/java/com/tommytony/war/WarConfig.java b/sponge/src/main/java/com/tommytony/war/WarConfig.java index 58e16fb..7e35b9a 100644 --- a/sponge/src/main/java/com/tommytony/war/WarConfig.java +++ b/sponge/src/main/java/com/tommytony/war/WarConfig.java @@ -3,7 +3,7 @@ package com.tommytony.war; import com.google.common.base.Optional; import com.google.common.collect.ImmutableList; import com.tommytony.war.zone.ZoneConfig; -import org.spongepowered.api.entity.Player; +import org.spongepowered.api.entity.player.Player; import java.io.Closeable; import java.io.File; diff --git a/sponge/src/main/java/com/tommytony/war/WarPlugin.java b/sponge/src/main/java/com/tommytony/war/WarPlugin.java index 70178ec..32a2e26 100644 --- a/sponge/src/main/java/com/tommytony/war/WarPlugin.java +++ b/sponge/src/main/java/com/tommytony/war/WarPlugin.java @@ -1,12 +1,12 @@ package com.tommytony.war; -import org.apache.logging.log4j.Logger; +import org.slf4j.Logger; import org.spongepowered.api.Game; -import org.spongepowered.api.event.SpongeEventHandler; import org.spongepowered.api.event.state.PreInitializationEvent; import org.spongepowered.api.event.state.ServerStartedEvent; import org.spongepowered.api.event.state.ServerStartingEvent; import org.spongepowered.api.plugin.Plugin; +import org.spongepowered.api.util.event.Subscribe; import java.io.File; import java.io.FileNotFoundException; @@ -19,7 +19,7 @@ public class WarPlugin { private File dataDir; private WarConfig config; - @SpongeEventHandler + @Subscribe public void onConstruction(PreInitializationEvent event) throws InstantiationException { game = event.getGame(); logger = event.getPluginLog(); @@ -31,14 +31,14 @@ public class WarPlugin { } } - @SpongeEventHandler + @Subscribe public void onStartUp(ServerStartingEvent event) throws FileNotFoundException, SQLException { if (!dataDir.exists() && !dataDir.mkdirs()) throw new FileNotFoundException("Failed to make War data folder at " + dataDir.getPath()); config = new WarConfig(this, new File(dataDir, "war.sl3")); } - @SpongeEventHandler + @Subscribe public void onStart(ServerStartedEvent event) { // register commands } diff --git a/sponge/src/main/java/com/tommytony/war/command/WarConfigCommand.java b/sponge/src/main/java/com/tommytony/war/command/WarConfigCommand.java index 399b80e..12ddf4f 100644 --- a/sponge/src/main/java/com/tommytony/war/command/WarConfigCommand.java +++ b/sponge/src/main/java/com/tommytony/war/command/WarConfigCommand.java @@ -1,17 +1,14 @@ package com.tommytony.war.command; import com.google.common.base.Optional; -import com.google.common.collect.ImmutableList; import com.tommytony.war.WarConfig; import com.tommytony.war.WarPlugin; -import org.spongepowered.api.entity.Player; +import org.spongepowered.api.entity.player.Player; import org.spongepowered.api.service.permission.Subject; import org.spongepowered.api.util.command.CommandCallable; import org.spongepowered.api.util.command.CommandException; import org.spongepowered.api.util.command.CommandSource; -import org.spongepowered.api.util.command.Description; -import javax.annotation.Nullable; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; @@ -46,36 +43,6 @@ public class WarConfigCommand implements CommandCallable { return false; } - /** - * Get a description of the command, detailing usage information. - * - * @return The command description - */ - @Override - public Description getDescription() { - return new Description() { - @Override - public Optional getShortDescription() { - return Optional.of("View/modify war config"); - } - - @Override - public Optional getHelp() { - return Optional.of("Allows viewing of the war server config or changing various settings."); - } - - @Override - public String getUsage() { - return "[-p] setting:value..."; - } - - @Override - public List getPermissions() { - return ImmutableList.of("war.admin", "war.admin.config"); - } - }; - } - /** * Test whether this command can probably be executed by the given source. *

@@ -110,6 +77,39 @@ public class WarConfigCommand implements CommandCallable { return false; } + /** + * Get a short one-line description of this command. + * + * @return A description, if available + */ + @Override + public Optional getShortDescription() { + return Optional.of("View/modify war config"); + } + + /** + * Get a longer help text about this command. + * + * @return A help text, if available + */ + @Override + public Optional getHelp() { + return Optional.of("Allows viewing of the war server config or changing various settings."); + } + + /** + * Get the usage string of this command. + *

+ *

A usage string may look like + * {@code [-w <world>] <var1> <var2>}.

+ * + * @return A usage string + */ + @Override + public String getUsage() { + return "[-p] setting:value..."; + } + /** * Get a list of suggestions based on input. *

diff --git a/sponge/src/main/java/com/tommytony/war/struct/Region.java b/sponge/src/main/java/com/tommytony/war/struct/Region.java index 3575d65..ecbf06f 100644 --- a/sponge/src/main/java/com/tommytony/war/struct/Region.java +++ b/sponge/src/main/java/com/tommytony/war/struct/Region.java @@ -1,6 +1,6 @@ package com.tommytony.war.struct; -import org.spongepowered.api.block.Block; +import org.spongepowered.api.block.BlockLoc; import org.spongepowered.api.math.Vector3d; import org.spongepowered.api.world.Location; import org.spongepowered.api.world.extent.BlockVolume; @@ -84,7 +84,7 @@ public class Region implements BlockVolume { * @return The block */ @Override - public Block getBlock(Vector3d position) { + public BlockLoc getBlock(Vector3d position) { return first.getExtent().getBlock(position); } @@ -97,7 +97,7 @@ public class Region implements BlockVolume { * @return The block */ @Override - public Block getBlock(int x, int y, int z) { + public BlockLoc getBlock(int x, int y, int z) { return first.getExtent().getBlock(x, y, z); } }