mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-24 03:25:15 +01:00
Changes to reflect new Environment enum
This commit is contained in:
parent
4e6f4e3031
commit
8b14c72a8d
@ -162,9 +162,6 @@ class PlayerInstance {
|
|||||||
} else {
|
} else {
|
||||||
this.a((Packet) (new Packet52MultiBlockChange(this.c, this.d, this.f, this.g, world))); // Craftbukkit
|
this.a((Packet) (new Packet52MultiBlockChange(this.c, this.d, this.f, this.g, world))); // Craftbukkit
|
||||||
|
|
||||||
System.out.println("MultiBlockChange called for world " + world.w);
|
|
||||||
new Exception().printStackTrace();
|
|
||||||
|
|
||||||
for (i = 0; i < this.g; ++i) {
|
for (i = 0; i < this.g; ++i) {
|
||||||
j = this.c * 16 + (this.g >> 12 & 15);
|
j = this.c * 16 + (this.g >> 12 & 15);
|
||||||
k = this.g & 255;
|
k = this.g & 255;
|
||||||
|
@ -192,14 +192,14 @@ public final class CraftServer implements Server {
|
|||||||
return "CraftServer{" + "serverName=" + serverName + "serverVersion=" + serverVersion + "protocolVersion=" + protocolVersion + '}';
|
return "CraftServer{" + "serverName=" + serverName + "serverVersion=" + serverVersion + "protocolVersion=" + protocolVersion + '}';
|
||||||
}
|
}
|
||||||
|
|
||||||
public World createWorld(String name, boolean nether) {
|
public World createWorld(String name, World.Environment environment) {
|
||||||
File folder = new File(name);
|
File folder = new File(name);
|
||||||
|
|
||||||
if ((folder.exists()) && (!folder.isDirectory())) {
|
if ((folder.exists()) && (!folder.isDirectory())) {
|
||||||
throw new IllegalArgumentException("File exists with the name '" + name + "' and isn't a folder");
|
throw new IllegalArgumentException("File exists with the name '" + name + "' and isn't a folder");
|
||||||
}
|
}
|
||||||
|
|
||||||
WorldServer internal = new WorldServer(console, new File("."), name, nether ? -1 : 0);
|
WorldServer internal = new WorldServer(console, new File("."), name, environment == World.Environment.NETHER ? -1 : 0);
|
||||||
|
|
||||||
internal.a(new WorldManager(console, internal));
|
internal.a(new WorldManager(console, internal));
|
||||||
internal.k = 1;
|
internal.k = 1;
|
||||||
|
@ -24,11 +24,18 @@ 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 static final Random rand = new Random();
|
private static final Random rand = new Random();
|
||||||
|
|
||||||
public CraftWorld(WorldServer world) {
|
public CraftWorld(WorldServer world) {
|
||||||
this.world = world;
|
this.world = world;
|
||||||
|
|
||||||
|
if (world.q instanceof WorldProviderHell) {
|
||||||
|
environment = Environment.NETHER;
|
||||||
|
} else {
|
||||||
|
environment = Environment.NORMAL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Block getBlockAt(int x, int y, int z) {
|
public Block getBlockAt(int x, int y, int z) {
|
||||||
@ -212,6 +219,10 @@ public class CraftWorld implements World {
|
|||||||
world.e = time;
|
world.e = time;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Environment getEnvironment() {
|
||||||
|
return environment;
|
||||||
|
}
|
||||||
|
|
||||||
private final class ChunkCoordinate {
|
private final class ChunkCoordinate {
|
||||||
public final int x;
|
public final int x;
|
||||||
public final int z;
|
public final int z;
|
||||||
|
Loading…
Reference in New Issue
Block a user