@@ -18,12 +18,13 @@
|
||||
public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
|
||||
protected static final Logger LOGGER = LogManager.getLogger();
|
||||
@@ -46,7 +57,41 @@
|
||||
@@ -45,7 +56,49 @@
|
||||
private final BiomeManager biomeManager;
|
||||
private final ResourceKey<World> dimensionKey;
|
||||
private final ResourceKey<DimensionManager> typeKey;
|
||||
|
||||
- protected World(WorldDataMutable worlddatamutable, ResourceKey<World> resourcekey, ResourceKey<DimensionManager> resourcekey1, DimensionManager dimensionmanager, Supplier<GameProfilerFiller> supplier, boolean flag, boolean flag1, long i) {
|
||||
- protected World(WorldDataMutable worlddatamutable, ResourceKey<World> resourcekey, final DimensionManager dimensionmanager, Supplier<GameProfilerFiller> supplier, boolean flag, boolean flag1, long i) {
|
||||
+ // CraftBukkit start Added the following
|
||||
+ private final ResourceKey<DimensionManager> typeKey;
|
||||
+ private final CraftWorld world;
|
||||
+ public boolean pvpMode;
|
||||
+ public boolean keepSpawnInMemory = true;
|
||||
@@ -49,7 +50,11 @@
|
||||
+ return (CraftServer) Bukkit.getServer();
|
||||
+ }
|
||||
+
|
||||
+ protected World(WorldDataMutable worlddatamutable, ResourceKey<World> resourcekey, ResourceKey<DimensionManager> resourcekey1, DimensionManager dimensionmanager, Supplier<GameProfilerFiller> supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.World.Environment env) {
|
||||
+ public ResourceKey<DimensionManager> getTypeKey() {
|
||||
+ return typeKey;
|
||||
+ }
|
||||
+
|
||||
+ protected World(WorldDataMutable worlddatamutable, ResourceKey<World> resourcekey, final DimensionManager dimensionmanager, Supplier<GameProfilerFiller> supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.World.Environment env) {
|
||||
+ this.generator = gen;
|
||||
+ this.world = new CraftWorld((WorldServer) this, gen, env);
|
||||
+ this.ticksPerAnimalSpawns = this.getServer().getTicksPerAnimalSpawns(); // CraftBukkit
|
||||
@@ -57,26 +62,29 @@
|
||||
+ this.ticksPerWaterSpawns = this.getServer().getTicksPerWaterSpawns(); // CraftBukkit
|
||||
+ this.ticksPerWaterAmbientSpawns = this.getServer().getTicksPerWaterAmbientSpawns(); // CraftBukkit
|
||||
+ this.ticksPerAmbientSpawns = this.getServer().getTicksPerAmbientSpawns(); // CraftBukkit
|
||||
+ this.typeKey = (ResourceKey) this.getServer().getHandle().getServer().f.a().c(dimensionmanager).orElseThrow(() -> {
|
||||
+ return new IllegalStateException("Unregistered dimension type: " + dimensionmanager);
|
||||
+ });
|
||||
+ // CraftBukkit end
|
||||
this.methodProfiler = supplier;
|
||||
this.worldData = worlddatamutable;
|
||||
this.x = dimensionmanager;
|
||||
@@ -57,12 +102,12 @@
|
||||
@@ -55,12 +108,12 @@
|
||||
this.worldBorder = new WorldBorder() {
|
||||
@Override
|
||||
public double getCenterX() {
|
||||
- return super.getCenterX() / 8.0D;
|
||||
- return super.getCenterX() / dimensionmanager.getCoordinateScale();
|
||||
+ return super.getCenterX(); // CraftBukkit
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getCenterZ() {
|
||||
- return super.getCenterZ() / 8.0D;
|
||||
- return super.getCenterZ() / dimensionmanager.getCoordinateScale();
|
||||
+ return super.getCenterZ(); // CraftBukkit
|
||||
}
|
||||
};
|
||||
} else {
|
||||
@@ -72,6 +117,35 @@
|
||||
@@ -70,6 +123,35 @@
|
||||
this.serverThread = Thread.currentThread();
|
||||
this.biomeManager = new BiomeManager(this, i, dimensionmanager.getGenLayerZoomer());
|
||||
this.debugWorld = flag1;
|
||||
@@ -112,7 +120,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -176,6 +250,17 @@
|
||||
@@ -133,6 +215,17 @@
|
||||
|
||||
@Override
|
||||
public boolean a(BlockPosition blockposition, IBlockData iblockdata, int i, int j) {
|
||||
@@ -130,7 +138,7 @@
|
||||
if (isOutsideWorld(blockposition)) {
|
||||
return false;
|
||||
} else if (!this.isClientSide && this.isDebugWorld()) {
|
||||
@@ -183,9 +268,24 @@
|
||||
@@ -140,9 +233,24 @@
|
||||
} else {
|
||||
Chunk chunk = this.getChunkAtWorldCoords(blockposition);
|
||||
Block block = iblockdata.getBlock();
|
||||
@@ -156,7 +164,7 @@
|
||||
return false;
|
||||
} else {
|
||||
IBlockData iblockdata2 = this.getType(blockposition);
|
||||
@@ -196,6 +296,7 @@
|
||||
@@ -153,6 +261,7 @@
|
||||
this.getMethodProfiler().exit();
|
||||
}
|
||||
|
||||
@@ -164,7 +172,7 @@
|
||||
if (iblockdata2 == iblockdata) {
|
||||
if (iblockdata1 != iblockdata2) {
|
||||
this.b(blockposition, iblockdata1, iblockdata2);
|
||||
@@ -222,12 +323,65 @@
|
||||
@@ -179,12 +288,65 @@
|
||||
|
||||
this.a(blockposition, iblockdata1, iblockdata2);
|
||||
}
|
||||
@@ -230,7 +238,7 @@
|
||||
public void a(BlockPosition blockposition, IBlockData iblockdata, IBlockData iblockdata1) {}
|
||||
|
||||
@Override
|
||||
@@ -309,6 +463,17 @@
|
||||
@@ -266,6 +428,17 @@
|
||||
IBlockData iblockdata = this.getType(blockposition);
|
||||
|
||||
try {
|
||||
@@ -248,7 +256,7 @@
|
||||
iblockdata.doPhysics(this, blockposition, block, blockposition1, false);
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.a(throwable, "Exception while updating neighbours");
|
||||
@@ -351,6 +516,14 @@
|
||||
@@ -308,6 +481,14 @@
|
||||
|
||||
@Override
|
||||
public IBlockData getType(BlockPosition blockposition) {
|
||||
@@ -263,7 +271,7 @@
|
||||
if (isOutsideWorld(blockposition)) {
|
||||
return Blocks.VOID_AIR.getBlockData();
|
||||
} else {
|
||||
@@ -498,9 +671,11 @@
|
||||
@@ -455,9 +636,11 @@
|
||||
TileEntity tileentity1 = (TileEntity) this.tileEntityListPending.get(i);
|
||||
|
||||
if (!tileentity1.isRemoved()) {
|
||||
@@ -275,7 +283,7 @@
|
||||
|
||||
if (this.isLoaded(tileentity1.getPosition())) {
|
||||
Chunk chunk = this.getChunkAtWorldCoords(tileentity1.getPosition());
|
||||
@@ -508,6 +683,12 @@
|
||||
@@ -465,6 +648,12 @@
|
||||
|
||||
chunk.setTileEntity(tileentity1.getPosition(), tileentity1);
|
||||
this.notify(tileentity1.getPosition(), iblockdata, iblockdata, 3);
|
||||
@@ -288,7 +296,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -548,12 +729,25 @@
|
||||
@@ -505,12 +694,25 @@
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
@@ -314,7 +322,7 @@
|
||||
TileEntity tileentity = null;
|
||||
|
||||
if (this.tickingTileEntities) {
|
||||
@@ -588,6 +782,13 @@
|
||||
@@ -545,6 +747,13 @@
|
||||
public void setTileEntity(BlockPosition blockposition, @Nullable TileEntity tileentity) {
|
||||
if (!isOutsideWorld(blockposition)) {
|
||||
if (tileentity != null && !tileentity.isRemoved()) {
|
||||
@@ -328,7 +336,7 @@
|
||||
if (this.tickingTileEntities) {
|
||||
tileentity.setLocation(this, blockposition);
|
||||
Iterator iterator = this.tileEntityListPending.iterator();
|
||||
@@ -612,7 +813,7 @@
|
||||
@@ -569,7 +778,7 @@
|
||||
}
|
||||
|
||||
public void removeTileEntity(BlockPosition blockposition) {
|
||||
@@ -336,4 +344,4 @@
|
||||
+ TileEntity tileentity = this.getTileEntity(blockposition, false); // CraftBukkit
|
||||
|
||||
if (tileentity != null && this.tickingTileEntities) {
|
||||
tileentity.an_();
|
||||
tileentity.al_();
|
||||
|
||||
Reference in New Issue
Block a user