From 00679460a967e47a03a87bd233ee9d983178db7d Mon Sep 17 00:00:00 2001 From: embeddedt <42941056+embeddedt@users.noreply.github.com> Date: Wed, 1 Nov 2023 01:57:19 -0400 Subject: [PATCH] Fix DebugLevelSource being off-by-one on grid height (#226) --- .../minecraft/world/level/levelgen/DebugLevelSource.java.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/net/minecraft/world/level/levelgen/DebugLevelSource.java.patch b/patches/net/minecraft/world/level/levelgen/DebugLevelSource.java.patch index d5625c5650..73827fcef2 100644 --- a/patches/net/minecraft/world/level/levelgen/DebugLevelSource.java.patch +++ b/patches/net/minecraft/world/level/levelgen/DebugLevelSource.java.patch @@ -7,7 +7,7 @@ + public static void initValidStates() { + ALL_BLOCKS = StreamSupport.stream(BuiltInRegistries.BLOCK.spliterator(), false).flatMap(block -> block.getStateDefinition().getPossibleStates().stream()).collect(Collectors.toList()); + GRID_WIDTH = Mth.ceil(Mth.sqrt(ALL_BLOCKS.size())); -+ GRID_HEIGHT = Mth.ceil((float) (ALL_BLOCKS.size() / GRID_WIDTH)); ++ GRID_HEIGHT = Mth.ceil((float)ALL_BLOCKS.size() / (float)GRID_WIDTH); + } + @Override