Compensate for allow-nether/allow-end as false; Fixes BUKKIT-3466

When either of those settings are false, the worlds are not loaded and
therefore will not be targeted for portal exits.  Existing worlds are
iterated directly to avoid defaulting to the first world if a direct
dimension match is not found.

Plugins must also specify exit from custom Bukkit worlds to comply with
original commit: https://github.com/Bukkit/CraftBukkit/commit/2dc2af0

This commit introduces a constant to clarify the dependency on the
CraftBukkit implementation of custom worlds having a dimension offset.

By: EdGruberman <ed@rjump.com>
This commit is contained in:
CraftBukkit/Spigot 2013-01-22 18:36:03 -07:00
parent 2cf54ae100
commit 78e16bd8de
2 changed files with 3 additions and 1 deletions

View File

@ -694,7 +694,7 @@ public final class CraftServer implements Server {
converter.convert(name, new ConvertProgressUpdater(console));
}
int dimension = 10 + console.worlds.size();
int dimension = CraftWorld.CUSTOM_DIMENSION_OFFSET + console.worlds.size();
boolean used = false;
do {
for (WorldServer server : console.worlds) {

View File

@ -49,6 +49,8 @@ import org.bukkit.plugin.messaging.StandardMessenger;
import org.bukkit.craftbukkit.util.LongHash;
public class CraftWorld implements World {
public static final int CUSTOM_DIMENSION_OFFSET = 10;
private final WorldServer world;
private Environment environment;
private final CraftServer server = (CraftServer) Bukkit.getServer();