Handle gen flag for placeholder getChunkAtAsync (#2079)

Also fix a loadChunk call in heightmap api
This commit is contained in:
Spottedleaf
2019-05-26 22:17:12 -07:00
committed by Zach
parent 7fe6e643d1
commit 90141ff411
83 changed files with 167 additions and 144 deletions

View File

@@ -1,4 +1,4 @@
From 4ad300b90a4f9c708ccf1caa43826252d9cede13 Mon Sep 17 00:00:00 2001
From 941463f14cfc204a80c45bdd321f37df10d537e6 Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Tue, 1 Jan 2019 02:22:01 -0800
Subject: [PATCH] Add Heightmap API
@@ -20,7 +20,7 @@ index ad58d4fd63..c04d73e738 100644
if (i >= -30000000 && j >= -30000000 && i < 30000000 && j < 30000000) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 3ebea96931..174d2d4ea0 100644
index 3ebea96931..2c6a42d921 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -317,6 +317,29 @@ public class CraftWorld implements World {
@@ -30,7 +30,7 @@ index 3ebea96931..174d2d4ea0 100644
+ // Paper start - Implement heightmap api
+ @Override
+ public int getHighestBlockYAt(final int x, final int z, final com.destroystokyo.paper.HeightmapType heightmap) throws UnsupportedOperationException {
+ this.loadChunk(x >> 4, z >> 4); // heightmap will ret 0 on unloaded areas
+ this.getChunkAt(x >> 4, z >> 4); // heightmap will ret 0 on unloaded areas
+
+ switch (heightmap) {
+ case LIGHT_BLOCKING: