summaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorNathan Adams <dinnerbone@dinnerbone.com>2011-11-24 18:48:01 +0000
committerNathan Adams <dinnerbone@dinnerbone.com>2011-11-24 18:48:01 +0000
commitc6beae8872f0b4729e4dc7354be2345cede8fca0 (patch)
tree6583d510fa1f7540099b03059f2dd31e7730ca19 /src/main/java
parentde7402ea8e5f55c14f012c63ae80b09f464df78d (diff)
downloadcraftbukkit-c6beae8872f0b4729e4dc7354be2345cede8fca0.tar
craftbukkit-c6beae8872f0b4729e4dc7354be2345cede8fca0.tar.gz
craftbukkit-c6beae8872f0b4729e4dc7354be2345cede8fca0.tar.lz
craftbukkit-c6beae8872f0b4729e4dc7354be2345cede8fca0.tar.xz
craftbukkit-c6beae8872f0b4729e4dc7354be2345cede8fca0.zip
Fixed allow-nether being ignored
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/net/minecraft/server/MinecraftServer.java12
-rw-r--r--src/main/java/net/minecraft/server/ServerConfigurationManager.java10
-rw-r--r--src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java2
3 files changed, 14 insertions, 10 deletions
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index c532593f..ecce9754 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -203,18 +203,18 @@ public class MinecraftServer implements Runnable, ICommandListener, IMinecraftSe
log.info("Default game type: " + j);
// CraftBukkit start (+ removed worldsettings and servernbtmanager)
- int worldCount = 2;
-
- if (this.propertyManager.getBoolean("allow-nether", true)) {
- worldCount++;
- }
+ int worldCount = 3;
for (int k = 0; k < worldCount; ++k) {
WorldServer world;
int dimension = 0;
if (k == 1) {
- dimension = -1;
+ if (this.propertyManager.getBoolean("allow-nether", true)) {
+ dimension = -1;
+ } else {
+ continue;
+ }
}
if (k == 2) {
diff --git a/src/main/java/net/minecraft/server/ServerConfigurationManager.java b/src/main/java/net/minecraft/server/ServerConfigurationManager.java
index fb3ec79c..f1a66bfc 100644
--- a/src/main/java/net/minecraft/server/ServerConfigurationManager.java
+++ b/src/main/java/net/minecraft/server/ServerConfigurationManager.java
@@ -217,10 +217,10 @@ public class ServerConfigurationManager {
// CraftBukkit start
public EntityPlayer moveToWorld(EntityPlayer entityplayer, int i, boolean flag) {
- return this.moveToWorld(entityplayer, i, null);
+ return this.moveToWorld(entityplayer, i, flag, null);
}
- public EntityPlayer moveToWorld(EntityPlayer entityplayer, int i, Location location) {
+ public EntityPlayer moveToWorld(EntityPlayer entityplayer, int i, boolean flag, Location location) {
this.server.getTracker(entityplayer.dimension).untrackPlayer(entityplayer);
// this.server.getTracker(entityplayer.dimension).untrackEntity(entityplayer); // CraftBukkit
this.getPlayerManager(entityplayer.dimension).removePlayer(entityplayer);
@@ -232,6 +232,10 @@ public class ServerConfigurationManager {
EntityPlayer entityplayer1 = entityplayer;
org.bukkit.World fromWorld = entityplayer1.getBukkitEntity().getWorld();
+ if (flag) {
+ entityplayer1.copyTo(entityplayer);
+ }
+
if (location == null) {
boolean isBedSpawn = false;
CraftWorld cworld = (CraftWorld) this.server.server.getWorld(entityplayer.spawnWorld);
@@ -328,7 +332,7 @@ public class ServerConfigurationManager {
finalLocation = event.getPortalTravelAgent().findOrCreate(finalLocation);
}
toWorld = ((CraftWorld) finalLocation.getWorld()).getHandle();
- this.moveToWorld(entityplayer, toWorld.dimension, finalLocation);
+ this.moveToWorld(entityplayer, toWorld.dimension, true, finalLocation);
// CraftBukkit end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index c6bb18bd..04b69b44 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -324,7 +324,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
if (fromWorld == toWorld) {
entity.netServerHandler.teleport(to);
} else {
- server.getHandle().moveToWorld(entity, toWorld.dimension, to);
+ server.getHandle().moveToWorld(entity, toWorld.dimension, true, to);
}
return true;
}