summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Miller (Me4502) <mnmiller1@hotmail.com>2016-02-27 23:27:19 +1000
committerMatthew Miller (Me4502) <mnmiller1@hotmail.com>2016-02-27 23:27:19 +1000
commit89f69b8a047e06f4b4f176232667a2f935eb913a (patch)
tree7233adeec450fcea43b78a09dc1f53aa368aa2b2
parent80a7f49379bd2cbd0cf56bf8dc2694bfe460e5b7 (diff)
downloadEssentials-4.x.tar
Essentials-4.x.tar.gz
Essentials-4.x.tar.lz
Essentials-4.x.tar.xz
Essentials-4.x.zip
Update for latest SpongeAPI & ModularFramework.4.x
-rw-r--r--build.gradle6
-rw-r--r--gradle/wrapper/gradle-wrapper.properties2
-rw-r--r--src/main/java/org/mcess/essentials/Essentials.java9
-rw-r--r--src/main/java/org/mcess/essentials/modules/Teleport.java20
4 files changed, 18 insertions, 19 deletions
diff --git a/build.gradle b/build.gradle
index cc726c292..70b202a98 100644
--- a/build.gradle
+++ b/build.gradle
@@ -6,7 +6,7 @@ buildscript {
}
dependencies {
- classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.2'
+ classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3'
}
}
@@ -30,10 +30,10 @@ repositories {
}
dependencies {
- compile 'org.spongepowered:spongeapi:2.1-SNAPSHOT'
+ compile 'org.spongepowered:spongeapi:3.1.0-SNAPSHOT'
compile 'com.google.guava:guava:18.0'
compile 'com.google.code.findbugs:jsr305:1.3.9'
- compile 'com.me4502:ModularFramework:1.2.1'
+ compile 'com.me4502:ModularFramework:1.3.0'
testCompile 'org.mockito:mockito-core:2.+'
testCompile 'junit:junit:4.+'
}
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 7db537ebe..c56084c1e 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-2.5-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-2.11-all.zip
diff --git a/src/main/java/org/mcess/essentials/Essentials.java b/src/main/java/org/mcess/essentials/Essentials.java
index 728e6776c..940deb560 100644
--- a/src/main/java/org/mcess/essentials/Essentials.java
+++ b/src/main/java/org/mcess/essentials/Essentials.java
@@ -3,10 +3,11 @@ package org.mcess.essentials;
import com.google.inject.Inject;
import com.me4502.modularframework.ModuleController;
import com.me4502.modularframework.ShadedModularFramework;
+import org.spongepowered.api.Sponge;
+import org.spongepowered.api.config.DefaultConfig;
import org.spongepowered.api.event.Listener;
import org.spongepowered.api.event.game.state.GameStartedServerEvent;
import org.spongepowered.api.plugin.Plugin;
-import org.spongepowered.api.service.config.DefaultConfig;
import java.io.File;
@@ -19,14 +20,12 @@ public class Essentials {
@DefaultConfig(sharedRoot = false)
private File mainConfig;
- private File configurationDirectory;
-
@Listener
public void onInitialize(GameStartedServerEvent event) {
- moduleController = ShadedModularFramework.registerModuleController(this, event.getGame());
+ moduleController = ShadedModularFramework.registerModuleController(this, Sponge.getGame());
- configurationDirectory = new File(mainConfig.getParent(), "modules");
+ File configurationDirectory = new File(mainConfig.getParent(), "modules");
configurationDirectory.mkdir();
moduleController.setConfigurationDirectory(configurationDirectory);
diff --git a/src/main/java/org/mcess/essentials/modules/Teleport.java b/src/main/java/org/mcess/essentials/modules/Teleport.java
index 68b6c6a25..99dfd1fa3 100644
--- a/src/main/java/org/mcess/essentials/modules/Teleport.java
+++ b/src/main/java/org/mcess/essentials/modules/Teleport.java
@@ -1,30 +1,30 @@
package org.mcess.essentials.modules;
import com.me4502.modularframework.module.Module;
-import org.spongepowered.api.text.Texts;
-import org.spongepowered.api.util.command.CommandException;
-import org.spongepowered.api.util.command.CommandResult;
-import org.spongepowered.api.util.command.CommandSource;
-import org.spongepowered.api.util.command.args.CommandContext;
-import org.spongepowered.api.util.command.spec.CommandExecutor;
-import org.spongepowered.api.util.command.spec.CommandSpec;
+import org.spongepowered.api.command.CommandException;
+import org.spongepowered.api.command.CommandResult;
+import org.spongepowered.api.command.CommandSource;
+import org.spongepowered.api.command.args.CommandContext;
+import org.spongepowered.api.command.spec.CommandExecutor;
+import org.spongepowered.api.command.spec.CommandSpec;
+import org.spongepowered.api.text.Text;
@Module(moduleName = "Teleport", onEnable = "onInitialize")
public class Teleport {
public void onInitialize() {
CommandSpec myCommandSpec = CommandSpec.builder()
- .description(Texts.of("Teleport to a player"))
+ .description(Text.of("Teleport to a player"))
.permission("essentials.teleport")
.executor(new TeleportCommand())
.build();
}
- private class TeleportCommand implements CommandExecutor {
+ private static class TeleportCommand implements CommandExecutor {
@Override
public CommandResult execute(CommandSource src, CommandContext args) throws CommandException {
- return null;
+ return CommandResult.success();
}
}
}