Set CraftTravelAgent.DEFAULT to a non-null value. Fixes BUKKIT-3578

Currently, CraftTravelAgent will call s() on the passed-in WorldServer in order to set DEFAULT. However, s() will always return null at this point, because WorldServer.P will still be null, as it is set after the constructor is called. Instead, we set CraftTravelAgent.DEFAULT to the instance that is being constructed.
This commit is contained in:
James Clarke 2013-02-05 20:34:02 +00:00 committed by feildmaster
parent 2e99e02094
commit 5bb81b75c7

View File

@ -18,7 +18,7 @@ public class CraftTravelAgent extends PortalTravelAgent implements TravelAgent {
public CraftTravelAgent(WorldServer worldserver) { public CraftTravelAgent(WorldServer worldserver) {
super(worldserver); super(worldserver);
if (DEFAULT == null && worldserver.dimension == 0) { if (DEFAULT == null && worldserver.dimension == 0) {
DEFAULT = (TravelAgent) worldserver.s(); DEFAULT = this;
} }
} }