diff --git a/plugin.yml b/plugin.yml
index e599b05..b0c1c3f 100644
--- a/plugin.yml
+++ b/plugin.yml
@@ -1,6 +1,6 @@
name: LimitedCreative
main: de.jaschastarke.minecraft.limitedcreative.Core
-version: 1.2.0-alpha
+version: 1.2.1-alpha
softdepend: [WorldGuard, WorldEdit, MultiInv]
dev-url: http://dev.bukkit.org/server-mods/limited-creative/
commands:
diff --git a/pom.xml b/pom.xml
index a5b04bc..ff520fa 100644
--- a/pom.xml
+++ b/pom.xml
@@ -26,9 +26,31 @@
sk89q-mvn2
http://mvn2.sk89q.com/repo
+
+
+ onarandombox
+ http://repo.onarandombox.com/content/groups/public
+
${basedir}/src
+
+
+
+ .
+ true
+ ${basedir}/
+
+ plugin.yml
+ config.yml
+
+
+
+ lang/
+ ${basedir}/lang/
+
+
+
org.apache.maven.plugins
@@ -45,7 +67,7 @@
org.bukkit
bukkit
- 1.2.3-R0.1-SNAPSHOT
+ 1.2.3-R0.2-SNAPSHOT
com.sk89q
@@ -58,9 +80,9 @@
2.6.2
- com.onarandombox
- multiverse-core
- 2.3-AB
+ com.onarandombox.multiversecore
+ Multiverse-Core
+ 2.4
com.cypherx
diff --git a/src/de/jaschastarke/minecraft/integration/Communicator.java b/src/de/jaschastarke/minecraft/integration/Communicator.java
index 111c473..283c085 100644
--- a/src/de/jaschastarke/minecraft/integration/Communicator.java
+++ b/src/de/jaschastarke/minecraft/integration/Communicator.java
@@ -40,15 +40,21 @@ public class Communicator extends AbstractCommunicator {
public boolean isCreative(World world) {
boolean creative = Bukkit.getServer().getDefaultGameMode() == GameMode.CREATIVE;
- if (isPluginEnabled("Multiverse-Core"))
- creative = MultiVerse.isCreative(world);
+ if (isMultiVerse()) {
+ GameMode tmp = MultiVerse.getGameMode(world);
+ if (tmp != null)
+ creative = tmp == GameMode.CREATIVE;
+ }
Core.debug("com: "+world.getName()+": is creative: "+creative);
return creative;
}
public GameMode getDefaultGameMode(World world) {
GameMode def = Bukkit.getServer().getDefaultGameMode();
- if (isMultiVerse())
- def = MultiVerse.getGameMode(world);
+ if (isMultiVerse()) {
+ GameMode tmp = MultiVerse.getGameMode(world);
+ if (tmp != null)
+ def = tmp;
+ }
Core.debug("com: "+world.getName()+": game mode: "+def);
return def;
}
diff --git a/src/de/jaschastarke/minecraft/integration/MultiVerse.java b/src/de/jaschastarke/minecraft/integration/MultiVerse.java
index e60185d..62875eb 100644
--- a/src/de/jaschastarke/minecraft/integration/MultiVerse.java
+++ b/src/de/jaschastarke/minecraft/integration/MultiVerse.java
@@ -22,19 +22,16 @@ import org.bukkit.GameMode;
import org.bukkit.World;
import com.onarandombox.MultiverseCore.MultiverseCore;
+import com.onarandombox.MultiverseCore.api.MultiverseWorld;
import de.jaschastarke.minecraft.limitedcreative.Core;
public class MultiVerse implements CommunicationBridge {
-
- public static boolean isCreative(World world) {
- boolean ic = getMV().getMVWorldManager().getMVWorld(world).getGameMode() == GameMode.CREATIVE;
- Core.debug("Multiverse: "+world.getName()+": is creative: "+ic);
- return ic;
- }
-
public static GameMode getGameMode(World world) {
- GameMode gm = getMV().getMVWorldManager().getMVWorld(world).getGameMode();
+ MultiverseWorld mvWorld = getMV().getMVWorldManager().getMVWorld(world);
+ if (mvWorld == null)
+ return null;
+ GameMode gm = mvWorld.getGameMode();
Core.debug("Multiverse: "+world.getName()+": game mode: "+gm);
return gm;
}