PaperMC/patches/server/Fix-MC-187716-Use-configured-height.patch

46 lines
3.4 KiB
Diff
Raw Normal View History

2021-06-11 14:02:28 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Sat, 15 Aug 2020 08:04:49 -0500
Subject: [PATCH] Fix MC-187716 Use configured height
diff --git a/src/main/java/net/minecraft/world/level/levelgen/surfacebuilders/NetherCappedSurfaceBuilder.java b/src/main/java/net/minecraft/world/level/levelgen/surfacebuilders/NetherCappedSurfaceBuilder.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/surfacebuilders/NetherCappedSurfaceBuilder.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/surfacebuilders/NetherCappedSurfaceBuilder.java
@@ -0,0 +0,0 @@ public abstract class NetherCappedSurfaceBuilder extends SurfaceBuilder<SurfaceB
2021-06-14 12:42:08 +02:00
BlockPos.MutableBlockPos mutableBlockPos = new BlockPos.MutableBlockPos();
BlockState blockState3 = chunk.getBlockState(mutableBlockPos.set(k, 128, m));
2021-06-11 14:02:28 +02:00
2021-06-14 12:42:08 +02:00
- for(int p = 127; p >= i; --p) {
+ for(int p = height; p >= i; --p) { // Paper - fix MC-187716 - use configured height
mutableBlockPos.set(k, p, m);
BlockState blockState4 = chunk.getBlockState(mutableBlockPos);
if (blockState3.is(defaultBlock.getBlock()) && (blockState4.isAir() || blockState4 == defaultFluid)) {
2021-06-11 14:02:28 +02:00
diff --git a/src/main/java/net/minecraft/world/level/levelgen/surfacebuilders/NetherForestSurfaceBuilder.java b/src/main/java/net/minecraft/world/level/levelgen/surfacebuilders/NetherForestSurfaceBuilder.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/surfacebuilders/NetherForestSurfaceBuilder.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/surfacebuilders/NetherForestSurfaceBuilder.java
@@ -0,0 +0,0 @@ public class NetherForestSurfaceBuilder extends SurfaceBuilder<SurfaceBuilderBas
2021-06-14 12:42:08 +02:00
int o = -1;
BlockState blockState = surfaceBuilderBaseConfiguration.getUnderMaterial();
2021-06-11 14:02:28 +02:00
2021-06-14 12:42:08 +02:00
- for(int p = 127; p >= i; --p) {
+ for(int p = height; p >= i; --p) { // Paper - fix MC-187716 - use configured height
mutableBlockPos.set(k, p, m);
BlockState blockState2 = surfaceBuilderBaseConfiguration.getTopMaterial();
BlockState blockState3 = chunk.getBlockState(mutableBlockPos);
2021-06-11 14:02:28 +02:00
diff --git a/src/main/java/net/minecraft/world/level/levelgen/surfacebuilders/NetherSurfaceBuilder.java b/src/main/java/net/minecraft/world/level/levelgen/surfacebuilders/NetherSurfaceBuilder.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/surfacebuilders/NetherSurfaceBuilder.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/surfacebuilders/NetherSurfaceBuilder.java
@@ -0,0 +0,0 @@ public class NetherSurfaceBuilder extends SurfaceBuilder<SurfaceBuilderBaseConfi
2021-06-14 12:42:08 +02:00
BlockState blockState = surfaceBuilderBaseConfiguration.getTopMaterial();
BlockState blockState2 = surfaceBuilderBaseConfiguration.getUnderMaterial();
2021-06-11 14:02:28 +02:00
2021-06-14 12:42:08 +02:00
- for(int p = 127; p >= i; --p) {
+ for(int p = height; p >= i; --p) { // Paper - fix MC-187716 - use configured height
mutableBlockPos.set(k, p, m);
BlockState blockState3 = chunk.getBlockState(mutableBlockPos);
if (blockState3.isAir()) {