Initial port to 1.16.2

This commit is contained in:
Sebastian Hartte
2020-08-13 23:14:49 +02:00
parent 87c2c94bd4
commit fd67e0e5c6
49 changed files with 612 additions and 302 deletions
@@ -31,8 +31,7 @@ import net.minecraft.block.Block;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.ChunkPos;
import net.minecraft.world.IWorld;
import net.minecraft.world.World;
import net.minecraft.world.IServerWorld;
import net.minecraft.world.chunk.IChunk;
import net.minecraft.world.server.ServerWorld;
import net.minecraftforge.event.world.WorldEvent;
@@ -92,18 +91,14 @@ public final class CompassService {
}
}
public void tryUpdateArea(final IWorld w, ChunkPos chunkPos) {
public void tryUpdateArea(final IServerWorld w, ChunkPos chunkPos) {
// If this seems weird: during worldgen, WorldAccess is a specific region, but
// getWorld is
// still the server world. We do need to use the world access to get the chunk
// in question
// though, since during worldgen, it's not comitted to the actual world yet.
World world = w.getWorld();
if (!(world instanceof ServerWorld)) {
return;
}
IChunk chunk = w.getChunk(chunkPos.x, chunkPos.z);
updateArea((ServerWorld) world, chunk);
updateArea(w.getWorld(), chunk);
}
public void updateArea(final ServerWorld w, IChunk chunk) {