mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-27 10:41:27 +01:00
fixed environments
By: Tahg <tahgtahv@gmail.com>
This commit is contained in:
parent
d20f1b7bdc
commit
88299f417b
@ -26,7 +26,7 @@ import org.bukkit.World;
|
|||||||
|
|
||||||
public class CraftWorld implements World {
|
public class CraftWorld implements World {
|
||||||
private final WorldServer world;
|
private final WorldServer world;
|
||||||
private final Environment environment;
|
private Environment environment;
|
||||||
private final CraftServer server;
|
private final CraftServer server;
|
||||||
private final ChunkProviderServer provider;
|
private final ChunkProviderServer provider;
|
||||||
private HashMap<Integer,CraftChunk> unloadedChunks = new HashMap<Integer, CraftChunk>();
|
private HashMap<Integer,CraftChunk> unloadedChunks = new HashMap<Integer, CraftChunk>();
|
||||||
@ -38,11 +38,7 @@ public class CraftWorld implements World {
|
|||||||
this.server = world.getServer();
|
this.server = world.getServer();
|
||||||
this.provider = world.chunkProviderServer;
|
this.provider = world.chunkProviderServer;
|
||||||
|
|
||||||
if (world.worldProvider instanceof WorldProviderHell) {
|
environment = Environment.getEnvironment(world.worldProvider.dimension);
|
||||||
environment = Environment.NETHER;
|
|
||||||
} else {
|
|
||||||
environment = Environment.NORMAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
server.addWorld(this);
|
server.addWorld(this);
|
||||||
}
|
}
|
||||||
@ -444,6 +440,13 @@ public class CraftWorld implements World {
|
|||||||
return environment;
|
return environment;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setEnvironment(Environment env) {
|
||||||
|
if (environment != env) {
|
||||||
|
environment = env;
|
||||||
|
world.worldProvider = WorldProvider.a(environment.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public Block getBlockAt(Location location) {
|
public Block getBlockAt(Location location) {
|
||||||
return getBlockAt(location.getBlockX(), location.getBlockY(), location.getBlockZ());
|
return getBlockAt(location.getBlockX(), location.getBlockY(), location.getBlockZ());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user