diff --git a/game/client/src/main/java/net/minecraft/client/Minecraft.java b/game/client/src/main/java/net/minecraft/client/Minecraft.java
index ef2411cfe..b7ee32021 100644
--- a/game/client/src/main/java/net/minecraft/client/Minecraft.java
+++ b/game/client/src/main/java/net/minecraft/client/Minecraft.java
@@ -34,6 +34,8 @@ import net.minecraft.client.gui.server.ScreenSelectServer;
 import net.minecraft.client.gui.toasts.GuiElementToastsHud;
 import net.minecraft.client.holiday.Holidays;
 import net.minecraft.client.player.controller.PlayerControllerSP;
+import net.minecraft.client.world.chunk.provider.ChunkProviderDynamic;
+import net.minecraft.client.world.chunk.provider.ChunkProviderThreadedClient;
 import net.minecraft.client.world.save.SaveHandlerClientSP;
 import net.minecraft.core.net.CertificateHelper;
 import net.minecraft.client.net.handler.PacketHandlerClient;
@@ -86,6 +88,7 @@ import net.minecraft.core.util.helper.Color;
 import net.minecraft.core.util.helper.DyeColor;
 import net.minecraft.core.util.helper.LoggedPrintStream;
 import net.minecraft.core.util.helper.UUIDHelper;
+import net.minecraft.core.world.chunk.provider.ChunkProviderThreaded;
 import net.minecraft.core.world.save.SaveFormatBase;
 import net.minecraft.core.world.settings.WorldConfiguration;
 import net.minecraft.core.world.type.WorldType;
@@ -675,6 +678,7 @@ public class Minecraft
         	// This thing takes forever to load, so it has been moved down here,
         	// so that the loading time is spent on the loading screen and not a black screen
             rpcThread = new RichPresenceHandlerThread(this);
+            rpcThread.setName("Discord RPC Thread");
             rpcThread.start();
         }
 
@@ -841,7 +845,16 @@ public class Minecraft
     @Override
     public IChunkProvider createChunkProvider(World world, IChunkLoader chunkLoader)
     {
-        return new ChunkProviderStatic(world, chunkLoader, world.getWorldType().createChunkGenerator(world));
+        return switch (gameSettings.enableThreadedChunkProvider.value) {
+            case DYNAMIC ->
+                new ChunkProviderDynamic(world, chunkLoader, world.getWorldType().createChunkGenerator(world));
+
+            case THREADED ->
+                 new ChunkProviderThreadedClient(world, chunkLoader, world.getWorldType().createChunkGenerator(world));
+
+            default ->
+                new ChunkProviderStatic(world, chunkLoader, world.getWorldType().createChunkGenerator(world));
+        };
     }
 
     public static File getAppDir(String s)
@@ -1904,6 +1917,12 @@ public class Minecraft
                     throw t;
                 }
                 Debug.change("misc");
+            } else {
+                try {
+                    currentWorld.getChunkProvider().tick();
+                } catch (Throwable throwable) {
+                    LOGGER.error("Issue while ticking chunk provider!", throwable);
+                }
             }
             if(!isGamePaused && currentWorld != null)
             {
@@ -2451,6 +2470,7 @@ public class Minecraft
                 }
                 currentWorld.getChunkProvider().unloadAllChunks();
                 currentWorld.onUnload();
+                currentWorld.close();
                 if (player != null) {
                     currentWorld.saveHandler.save(player);
                 }
@@ -2587,9 +2607,21 @@ public class Minecraft
             {
                 loadingScreen.progressStagePercentage((i++ * 100) / j);
                 currentWorld.getBlockId(chunkcoordinates.x + k, 64, chunkcoordinates.z + l);
-                while(currentWorld.updatingLighting()) ;
             }
+        }
+        loadingScreen.progressStage("Updating Lights");
+        int count = this.currentWorld.getLightingEngine().pendingUpdates();
+
+        int v = 0;
+        while (currentWorld.updatingLighting()) {
+            v++;
+            loadingScreen.progressStagePercentage((Math.min(v, count) * 100) / count);
 
+            if (v >= 10000) {
+                LOGGER.error("Updating lights took to long panic skipping!");
+                Thread.dumpStack();
+                break;
+            }
         }
 
         loadingScreen.progressStage("Simulating world for a bit...");
diff --git a/game/client/src/main/java/net/minecraft/client/gui/ScreenPause.java b/game/client/src/main/java/net/minecraft/client/gui/ScreenPause.java
index 38bcd3fd5..9b29bfa62 100644
--- a/game/client/src/main/java/net/minecraft/client/gui/ScreenPause.java
+++ b/game/client/src/main/java/net/minecraft/client/gui/ScreenPause.java
@@ -9,6 +9,7 @@ import net.minecraft.client.gui.options.data.OptionsPages;
 import net.minecraft.client.util.helper.UrlHelper;
 import net.minecraft.core.data.registry.Registries;
 import net.minecraft.core.data.registry.recipe.SearchQuery;
+import net.minecraft.core.util.helper.Color;
 import net.minecraft.core.util.helper.MathHelper;
 import net.minecraft.core.achievement.stat.StatList;
 import net.minecraft.core.lang.I18n;
@@ -16,82 +17,77 @@ import net.minecraft.core.net.command.TextFormatting;
 import net.minecraft.client.input.InputType;
 import org.jetbrains.annotations.NotNull;
 
-public class ScreenPause extends Screen
-{
-
-    public ScreenPause()
-    {
-        updateCounter2 = 0;
-        updateCounter = 0;
+public class ScreenPause extends Screen {
+    public static boolean photoModeDisabled = false;
+    private int tickCount;
+    private boolean saving = false;
+    public ScreenPause() {
+        this.tickCount = 0;
     }
 
     @Override
-	public void init()
-    {
+    public void init() {
+        this.saving = !this.mc.currentWorld.pauseScreenSave(this.tickCount);
         I18n i = I18n.getInstance();
-        updateCounter2 = 0;
-        buttons.clear();
+        this.buttons.clear();
         byte byte0 = -16;
-        buttons.add(new ButtonElement(1, width / 2 - 100, height / 4 + 120 + byte0, i.translateKey("gui.ingame_menu.button.save_and_quit")));
-        if(mc.isMultiplayerWorld())
-        {
-            buttons.get(0).displayString = i.translateKey("gui.ingame_menu.button.disconnect");
+        this.buttons.add(new ButtonElement(1, this.width / 2 - 100, this.height / 4 + 120 + byte0, i.translateKey("gui.ingame_menu.button.save_and_quit")));
+        if (this.mc.isMultiplayerWorld()) {
+            this.buttons.get(0).displayString = i.translateKey("gui.ingame_menu.button.disconnect");
         }
-        buttons.add(new ButtonElement(4, width / 2 - 100, height / 4 + 24 + byte0, i.translateKey("gui.ingame_menu.button.back_to_game")));
-        buttons.add(new ButtonElement(0, width / 2 - 100, height / 4 + 96 + byte0, 98, 20, i.translateKey("gui.ingame_menu.button.options")));
-        ButtonElement photoModeButton = new ButtonElement(7, width / 2 + 2, height / 4 + 96 + byte0, 98, 20, i.translateKey("gui.ingame_menu.button.photo_mode"));
-        buttons.add(photoModeButton);
-        if (photoModeDisabled)
-        {
+        this.buttons.add(new ButtonElement(4, this.width / 2 - 100, this.height / 4 + 24 + byte0, i.translateKey("gui.ingame_menu.button.back_to_game")));
+        this.buttons.add(new ButtonElement(0, this.width / 2 - 100, this.height / 4 + 96 + byte0, 98, 20, i.translateKey("gui.ingame_menu.button.options")));
+        ButtonElement photoModeButton = new ButtonElement(7, this.width / 2 + 2, this.height / 4 + 96 + byte0, 98, 20, i.translateKey("gui.ingame_menu.button.photo_mode"));
+        this.buttons.add(photoModeButton);
+        if (photoModeDisabled) {
             photoModeButton.enabled = false;
         }
-        buttons.add(new ButtonElement(5, width / 2 - 100, height / 4 + 48 + byte0, 98, 20, I18n.getInstance().translateKey("gui.ingame_menu.button.achievements")));
-        buttons.add(new ButtonElement(6, width / 2 + 2, height / 4 + 48 + byte0, 98, 20, I18n.getInstance().translateKey("gui.ingame_menu.button.statistics")));
-        ButtonElement debugButton = new ButtonElement(9, width - 8, height - 8, 8, 8, "");
+        this.buttons.add(new ButtonElement(5, this.width / 2 - 100, this.height / 4 + 48 + byte0, 98, 20, I18n.getInstance().translateKey("gui.ingame_menu.button.achievements")));
+        this.buttons.add(new ButtonElement(6, this.width / 2 + 2, this.height / 4 + 48 + byte0, 98, 20, I18n.getInstance().translateKey("gui.ingame_menu.button.statistics")));
+        ButtonElement debugButton = new ButtonElement(9, this.width - 8, this.height - 8, 8, 8, "");
         debugButton.visible = false;
-        buttons.add(debugButton);
-        buttons.add(new ButtonElement(10, width / 2 - 100 - 24, height / 4 + 120 + byte0, 20, 20, "")
+        this.buttons.add(debugButton);
+        this.buttons.add(new ButtonElement(10, this.width / 2 - 100 - 24, this.height / 4 + 120 + byte0, 20, 20, "")
             .setTextures("minecraft:gui/misc/button_support", "minecraft:gui/misc/button_support_highlighted", "minecraft:gui/misc/button_support"));
     }
 
     @Override
-	protected void buttonClicked(@NotNull ButtonElement button)
-    {
+    protected void buttonClicked(@NotNull ButtonElement button) {
         switch (button.id) {
             case 0:
-                mc.displayScreen(new ScreenOptions(this));
+                this.mc.displayScreen(new ScreenOptions(this));
                 break;
             case 1:
-                mc.statsCounter.add(StatList.leaveGameStat, 1);
-                if (mc.isMultiplayerWorld()) {
-                    mc.currentWorld.sendQuittingDisconnectingPacket();
+                this.mc.statsCounter.add(StatList.leaveGameStat, 1);
+                if (this.mc.isMultiplayerWorld()) {
+                    this.mc.currentWorld.sendQuittingDisconnectingPacket();
                     Registries.RECIPES = Registries.RECIPES_LOCAL_COPY;
                     GuidebookPageSearch.searchField.setText("");
                     GuidebookPageManager.searchQuery = SearchQuery.resolve(GuidebookPageSearch.searchField.getText());
                     ScreenGuidebook.getPageManager().updatePages();
                 }
-                mc.changeWorld(null);
-                mc.displayScreen(new ScreenMainMenu());
+                this.mc.changeWorld(null);
+                this.mc.displayScreen(new ScreenMainMenu());
                 break;
             case 4:
-                mc.displayScreen(null);
-                mc.setIngameFocus();
+                this.mc.displayScreen(null);
+                this.mc.setIngameFocus();
 
                 //Cancel A press so you dont jump because you hold the jump button
-                if (mc.inputType == InputType.CONTROLLER) mc.controllerInput.buttonA.cancelButtonPress();
+                if (this.mc.inputType == InputType.CONTROLLER) this.mc.controllerInput.buttonA.cancelButtonPress();
 
                 break;
             case 5:
-                mc.displayScreen(new ScreenAchievements(this, mc.statsCounter));
+                this.mc.displayScreen(new ScreenAchievements(this, this.mc.statsCounter));
                 break;
             case 6:
-                mc.displayScreen(new ScreenStats(this, mc.statsCounter));
+                this.mc.displayScreen(new ScreenStats(this, this.mc.statsCounter));
                 break;
             case 7:
-                mc.displayScreen(new ScreenPhotoMode());
+                this.mc.displayScreen(new ScreenPhotoMode());
                 break;
             case 9:
-                mc.displayScreen(new ScreenOptions(this, OptionsPages.DEBUG));
+                this.mc.displayScreen(new ScreenOptions(this, OptionsPages.DEBUG));
                 break;
             case 10:
                 UrlHelper.openURL("https://bugs.betterthanadventure.net/");
@@ -100,37 +96,29 @@ public class ScreenPause extends Screen
     }
 
     @Override
-	public void tick()
-    {
+    public void tick() {
         super.tick();
-        updateCounter++;
+        this.tickCount++;
+        this.saving = !this.mc.currentWorld.pauseScreenSave(this.tickCount);
     }
 
     @Override
-	public void render(int mx, int my, float partialTick)
-    {
+    public void render(int mx, int my, float partialTick) {
         I18n i = I18n.getInstance();
         renderBackground();
-        if(mc == null || mc.currentWorld == null) {
-        	mc.displayScreen(null);
-        	return;
+        if (this.mc.currentWorld == null) {
+            this.mc.displayScreen(null);
+            return;
         }
-        boolean isSaving = !mc.currentWorld.pauseScreenSave(updateCounter2++);
-        if(isSaving || updateCounter < 20)
-        {
-            float f1 = ((float)(updateCounter % 10) + partialTick) / 10F;
-            f1 = MathHelper.sin(f1 * MathHelper.PI * 2.0F) * 0.2F + 0.8F;
-            int k = (int)(255F * f1);
-            drawStringShadow(fontRenderer, i.translateKey("gui.ingame_menu.label.saving"), 8, height - 16, k << 16 | k << 8 | k);
+
+        if (this.saving) {
+            float brightness = ((float) (this.tickCount % 10) + partialTick) / 10F;
+            brightness = MathHelper.sin(brightness * MathHelper.PI * 2.0F) * 0.2F + 0.8F;
+            drawStringShadow(this.fontRenderer, i.translateKey("gui.ingame_menu.label.saving"), 8, this.height - 16, Color.floatToIntARGB(1f, brightness, brightness, brightness));
         }
-        drawStringCenteredShadow(fontRenderer, i.translateKey("gui.ingame_menu.label.title"), width / 2, 40, 0xffffff);
-        String score = TextFormatting.YELLOW.toString() + mc.thePlayer.getScore();
-        drawStringCenteredShadow(fontRenderer, i.translateKeyAndFormat("gui.ingame_menu.label.score", score), width / 2, 56, 0xfefefe);
+        drawStringCenteredShadow(this.fontRenderer, i.translateKey("gui.ingame_menu.label.title"), this.width / 2, 40, 0xffffff);
+        String score = TextFormatting.YELLOW.toString() + this.mc.thePlayer.getScore();
+        drawStringCenteredShadow(this.fontRenderer, i.translateKeyAndFormat("gui.ingame_menu.label.score", score), this.width / 2, 56, 0xfefefe);
         super.render(mx, my, partialTick);
     }
-
-    private int updateCounter2;
-    private int updateCounter;
-
-    public static boolean photoModeDisabled = false;
 }
diff --git a/game/client/src/main/java/net/minecraft/client/gui/hud/HudIngame.java b/game/client/src/main/java/net/minecraft/client/gui/hud/HudIngame.java
index 0247b7971..fc6c28c5c 100644
--- a/game/client/src/main/java/net/minecraft/client/gui/hud/HudIngame.java
+++ b/game/client/src/main/java/net/minecraft/client/gui/hud/HudIngame.java
@@ -341,7 +341,7 @@ public class HudIngame extends Gui
                     debugOffset += space;
 
                     Block<?> block = Blocks.blocksList[mc.currentWorld.getBlockId(mc.objectMouseOver.x, mc.objectMouseOver.y, mc.objectMouseOver.z)];
-                    if (block.id() > 0 && block.id() < Blocks.blocksList.length) {
+                    if (block != null) {
                         drawDebugScreenLineRight("Looking at:");
 
                         String name;
diff --git a/game/client/src/main/java/net/minecraft/client/gui/options/data/OptionsPages.java b/game/client/src/main/java/net/minecraft/client/gui/options/data/OptionsPages.java
index 1bd9c7592..f0f811d09 100644
--- a/game/client/src/main/java/net/minecraft/client/gui/options/data/OptionsPages.java
+++ b/game/client/src/main/java/net/minecraft/client/gui/options/data/OptionsPages.java
@@ -359,6 +359,7 @@ public abstract class OptionsPages
                 .withComponent(new BooleanOptionComponent(mc.gameSettings.enableDevResourceLoading))
                 .withComponent(new BooleanOptionComponent(mc.gameSettings.devModels))
                 .withComponent(new BooleanOptionComponent(mc.gameSettings.enableMultiDrawRendering))
+                .withComponent(new ToggleableOptionComponent<>(mc.gameSettings.enableThreadedChunkProvider))
                 .withComponent(new BooleanOptionComponent(mc.gameSettings.doJCECheck))
             )
             .withComponent(new OptionsCategory("gui.options.page.debug.category.utility")
diff --git a/game/client/src/main/java/net/minecraft/client/option/GameSettings.java b/game/client/src/main/java/net/minecraft/client/option/GameSettings.java
index 3143dca81..d7cf32df4 100644
--- a/game/client/src/main/java/net/minecraft/client/option/GameSettings.java
+++ b/game/client/src/main/java/net/minecraft/client/option/GameSettings.java
@@ -23,6 +23,7 @@ import net.minecraft.client.input.InputDevice;
 import net.minecraft.client.option.enums.Colorblindness;
 import net.minecraft.client.render.font.Fonts;
 import net.minecraft.client.option.enums.DescriptionPromptEnum;
+import net.minecraft.client.world.chunk.provider.SelectedProvider;
 import net.minecraft.core.entity.player.Player;
 import net.minecraft.core.enums.ChatVisibility;
 import net.minecraft.core.enums.Difficulty;
@@ -143,6 +144,7 @@ public class GameSettings {
 	public @NotNull OptionBoolean turnWithVehicle = new OptionBoolean(this, "turnWithVehicle", true);
 	public @NotNull OptionBoolean disableCrashHandler = new OptionBoolean(this, "disableCrashHandler", false);
 	public @NotNull OptionBoolean enableMultiDrawRendering = new OptionBoolean(this, "enableMultiDrawRendering", true);
+	public @NotNull OptionEnum<SelectedProvider> enableThreadedChunkProvider = new OptionEnum<>(this, "enableThreadedChunkProvider", SelectedProvider.class, SelectedProvider.THREADED);
 	public @NotNull OptionBoolean musicToasts = new OptionBoolean(this, "musicToasts", true);
 	public @NotNull OptionEnum<MusicFrequency> musicFrequency = new OptionEnum<>(this, "musicFrequency", MusicFrequency.class, MusicFrequency.DEFAULT);
 
@@ -190,6 +192,8 @@ public class GameSettings {
 	public @NotNull OptionBoolean enableHolidayTextures = new OptionBoolean(this, "enableHolidayTextures", true);
 	public @NotNull OptionBoolean dynamicCursor = new OptionBoolean(this, "dynamicCursor", true);
 	public @NotNull OptionBoolean devModels = new OptionBoolean(this, "devModels", true);
+	public @NotNull OptionBoolean doJCECheck = new OptionBoolean(this, "doJCECheck", true);
+	public @NotNull OptionString uuidServer = new OptionString(this, "uuidServer", "https://api.minecraftservices.com/minecraft/profile/lookup/name/%s");
 
 	public @NotNull OptionBoolean playerLeftHanded = new OptionBoolean(this, "player.left.handed", false);
 	public @NotNull OptionBoolean playerCape = new OptionBoolean(this, "player.cape", true);
@@ -201,8 +205,6 @@ public class GameSettings {
 	public @NotNull OptionBoolean playerPantRight = new OptionBoolean(this, "player.pant.right", true);
 	public @NotNull OptionBoolean playerDevModel = new OptionBoolean(this, "player.devmodel", true);
 	public @NotNull OptionEnum<Player.PlayerConfig.HurtSound> playerHurtSound = new OptionEnum<>(this, "player.hurtsound", Player.PlayerConfig.HurtSound.class, Player.PlayerConfig.HurtSound.MASCULINE);
-	public @NotNull OptionBoolean doJCECheck = new OptionBoolean(this, "doJCECheck", true);
-	public @NotNull OptionString uuidServer = new OptionString(this, "uuidServer", "https://api.minecraftservices.com/minecraft/profile/lookup/name/%s");
 
 	public @NotNull KeyBinding keyAttack = new KeyBinding("key.attack").setDefault(InputDevice.mouse, 0);
 	public @NotNull KeyBinding keyInteract = new KeyBinding("key.interact").setDefault(InputDevice.mouse, 1);
@@ -537,6 +539,7 @@ public class GameSettings {
 			if (discordRichPresence.value && mc.rpcThread == null)
 			{
 				mc.rpcThread = new RichPresenceHandlerThread(mc);
+				mc.rpcThread.setName("Discord RPC Thread");
 				mc.rpcThread.start();
 			}
 		}
diff --git a/game/client/src/main/java/net/minecraft/client/render/DirtyChunkRendererSorter.java b/game/client/src/main/java/net/minecraft/client/render/DirtyChunkRendererSorter.java
index 91b34646a..2f2d0adfa 100644
--- a/game/client/src/main/java/net/minecraft/client/render/DirtyChunkRendererSorter.java
+++ b/game/client/src/main/java/net/minecraft/client/render/DirtyChunkRendererSorter.java
@@ -2,50 +2,72 @@ package net.minecraft.client.render;
 
 import net.minecraft.client.render.camera.ICamera;
 import net.minecraft.client.render.terrain.ChunkRenderer;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 
 import java.util.Comparator;
 
 public class DirtyChunkRendererSorter
-    implements Comparator<ChunkRenderer>
-{
+    implements Comparator<@NotNull ChunkRenderer> {
 
-    public DirtyChunkRendererSorter(ICamera activeCamera)
-    {
-        this.activeCamera = activeCamera;
+    private @Nullable ICamera activeCamera;
+
+    public DirtyChunkRendererSorter() {
+
+    }
+
+    public void setActiveCamera(@NotNull ICamera camera) {
+        this.activeCamera = camera;
     }
 
+//    @Override
+//    public int compare(@NotNull ChunkRenderer cr1, @NotNull ChunkRenderer cr2) {
+//        double cr1Distance = cr1.distanceToCameraSquared(this.activeCamera);
+//        double cr2Distance = cr2.distanceToCameraSquared(this.activeCamera);
+//        if (cr2Distance > 2048 && cr1Distance > 2048) {
+//            boolean cr1InFrustum = cr1.visible;
+//            boolean cr2InFrustum = cr2.visible;
+//            if (cr2 == cr1) {
+//                return 0;
+//            }
+//            if (cr2InFrustum && !cr1InFrustum) {
+//                return 1;
+//            }
+//            if (cr1InFrustum && !cr2InFrustum) {
+//                return -1;
+//            }
+//        }
+//        if (cr2Distance < cr1Distance) {
+//            return 1;
+//        }
+//        if (cr2Distance > cr1Distance) {
+//            return -1;
+//        }
+//        return cr2.id >= cr1.id ? -1 : 1;
+//    }
+
     @Override
-    public int compare(ChunkRenderer cr1, ChunkRenderer cr2)
-    {
+    public int compare(@NotNull ChunkRenderer cr1, @NotNull ChunkRenderer cr2) {
         boolean cr1InFrustum = cr1.visible;
         boolean cr2InFrustum = cr2.visible;
-        if (cr1.equals(cr2))
-        {
+        if (cr1 == cr2) {
             return 0;
         }
-        if(cr1InFrustum && !cr2InFrustum)
-        {
+        if (cr1InFrustum && !cr2InFrustum) {
             return 1;
         }
-        if(cr2InFrustum && !cr1InFrustum)
-        {
+        if (cr2InFrustum && !cr1InFrustum) {
             return -1;
         }
         double cr1Distance = cr1.distanceToCameraSquared(activeCamera);
         double cr2Distance = cr2.distanceToCameraSquared(activeCamera);
-        if(cr1Distance < cr2Distance)
-        {
+        if (cr1Distance < cr2Distance) {
             return 1;
         }
-        if(cr1Distance > cr2Distance)
-        {
+        if (cr1Distance > cr2Distance) {
             return -1;
-        }
-        else
-        {
+        } else {
             return cr1.id >= cr2.id ? -1 : 1;
         }
     }
-
-    private final ICamera activeCamera;
 }
diff --git a/game/client/src/main/java/net/minecraft/client/render/RenderGlobal.java b/game/client/src/main/java/net/minecraft/client/render/RenderGlobal.java
index 64e3ddd39..825a17084 100644
--- a/game/client/src/main/java/net/minecraft/client/render/RenderGlobal.java
+++ b/game/client/src/main/java/net/minecraft/client/render/RenderGlobal.java
@@ -1,5 +1,6 @@
 package net.minecraft.client.render;
 
+import it.unimi.dsi.fastutil.objects.ObjectArrayList;
 import net.minecraft.client.GLAllocation;
 import net.minecraft.client.Minecraft;
 import net.minecraft.client.entity.particle.Particle;
@@ -45,6 +46,7 @@ import net.minecraft.core.world.LevelListener;
 import net.minecraft.core.world.season.Seasons;
 import net.minecraft.core.world.weather.Weather;
 import net.minecraft.core.world.weather.Weathers;
+import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 import org.lwjgl.opengl.ARBOcclusionQuery;
 import org.lwjgl.opengl.GL11;
@@ -53,29 +55,32 @@ import org.lwjgl.opengl.GL15;
 import java.nio.IntBuffer;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Random;
+import java.util.Set;
 
 import static org.lwjgl.opengl.GL11.*;
 
 public class RenderGlobal
-    implements LevelListener
-{
+    implements LevelListener {
     public static IconCoordinate[] breakingAnimation = new IconCoordinate[10];
+
     static {
         for (int i = 0; i < breakingAnimation.length; i++) {
             breakingAnimation[i] = TextureRegistry.getTexture("minecraft:block/breaking/" + i);
         }
     }
+
     public static final int RENDER_CHUNK_SIZE = 16;
-    public static final int MAX_VISIBLE_REBUILDS_PER_FRAME = 2;
+    public static final int MAX_VISIBLE_REBUILDS_PER_FRAME = 6;
     public static final int MAX_INVISIBLE_REBUILDS_PER_FRAME = 1;
     public static final int RENDER_LIST_BASE_WIDTH = 48;
 
-    public List<TileEntity> renderableTileEntities = new ArrayList<>();
+    public List<TileEntity> renderableTileEntities = new ObjectArrayList<>();
     private WorldClient world;
     private final TextureManager textureManager;
-    private final List<ChunkRenderer> dirtyChunks = new ArrayList<>();
+    private final List<@NotNull ChunkRenderer> dirtyChunks = new ObjectArrayList<>();
     private ChunkRenderer[] sortedChunkRenderers;
     private ChunkRenderer[] chunkRenderers;
     private int xChunks;
@@ -100,7 +105,7 @@ public class RenderGlobal
     private int xMaxChunk;
     private int yMaxChunk;
     private int zMaxChunk;
-    private Integer renderDistance = null;
+    private int renderDistance = 0;
     private int noEntityRenderFrames = 2;
     private int totalEntities;
     private int renderedEntities;
@@ -112,7 +117,7 @@ public class RenderGlobal
     private int renderedChunks;
     private int emptyChunks;
     private int chunkFixOffs;
-    private final List<ChunkRenderer> renderChunks = new ArrayList<>();
+    private final List<ChunkRenderer> renderChunks = new ObjectArrayList<>();
     private final DisplayList[] renderLists = {
         new DisplayList(), new DisplayList(), new DisplayList(), new DisplayList()
     };
@@ -130,14 +135,12 @@ public class RenderGlobal
     private double targetRainbowBrightness = Double.NaN;
     private double rainbowBrightnessDelta = Double.NaN;
 
-    public RenderGlobal(Minecraft mc, TextureManager textureManager)
-    {
+    public RenderGlobal(Minecraft mc, TextureManager textureManager) {
         this.mc = mc;
         this.textureManager = textureManager;
         chunkLists = GLAllocation.generateDisplayLists(RENDER_LIST_BASE_WIDTH * RENDER_LIST_BASE_WIDTH * RENDER_LIST_BASE_WIDTH * MAX_VISIBLE_REBUILDS_PER_FRAME);
         occlusionCheck = OpenGLHelper.enableOcclusionCheck;
-        if(occlusionCheck)
-        {
+        if (occlusionCheck) {
             resultBuffer.clear();
             occlusionCheckIds = GLAllocation.createDirectIntBuffer(RENDER_LIST_BASE_WIDTH * RENDER_LIST_BASE_WIDTH * RENDER_LIST_BASE_WIDTH);
             occlusionCheckIds.clear();
@@ -157,10 +160,8 @@ public class RenderGlobal
         int s = 64;
         int d = 256 / s + 2;
         float yy = 16F;
-        for(int xx = -s * d; xx <= s * d; xx += s)
-        {
-            for(int zz = -s * d; zz <= s * d; zz += s)
-            {
+        for (int xx = -s * d; xx <= s * d; xx += s) {
+            for (int zz = -s * d; zz <= s * d; zz += s) {
                 t.startDrawingQuads();
                 t.addVertex(xx, yy, zz);
                 t.addVertex(xx + s, yy, zz);
@@ -180,21 +181,18 @@ public class RenderGlobal
         GL11.glPopMatrix();
     }
 
-    private void renderStars()
-    {
+    private void renderStars() {
         Random random = new Random(10842L);
         Random colorRandom = new Random(10842L); // Created a second random so the new color don't change the positions of the stars
         Tessellator tessellator = Tessellator.instance;
         tessellator.startDrawingQuads();
-        for(int i = 0; i < 1500; i++)
-        {
+        for (int i = 0; i < 1500; i++) {
             double d = random.nextFloat() * 2.0F - 1.0F;
             double d1 = random.nextFloat() * 2.0F - 1.0F;
             double d2 = random.nextFloat() * 2.0F - 1.0F;
             double d3 = 0.25F + random.nextFloat() * 0.25F;
             double d4 = d * d + d1 * d1 + d2 * d2;
-            if(d4 >= 1.0D || d4 <= 0.01D)
-            {
+            if (d4 >= 1.0D || d4 <= 0.01D) {
                 continue;
             }
             d4 = 1.0D / java.lang.Math.sqrt(d4);
@@ -215,11 +213,10 @@ public class RenderGlobal
             double d16 = java.lang.Math.cos(d14);
 
             double color = colorRandom.nextDouble();
-            for(int j = 0; j < 4; j++)
-            {
+            for (int j = 0; j < 4; j++) {
                 double d17 = 0.0D;
-                double d18 = (double)((j & 2) - 1) * d3;
-                double d19 = (double)((j + 1 & 2) - 1) * d3;
+                double d18 = (double) ((j & 2) - 1) * d3;
+                double d19 = (double) ((j + 1 & 2) - 1) * d3;
                 double d21 = d18 * d16 - d19 * d15;
                 double d22 = d19 * d16 + d18 * d15;
                 double yOff = d21 * d12 + d17 * d13;
@@ -235,10 +232,8 @@ public class RenderGlobal
         tessellator.draw();
     }
 
-    public void setWorld(final WorldClient world)
-    {
-        if(this.world != null)
-        {
+    public void setWorld(final WorldClient world) {
+        if (this.world != null) {
             this.world.removeListener(this);
         }
         this.xOld = -9999D;
@@ -247,14 +242,13 @@ public class RenderGlobal
         this.world = world;
         this.auroraBrightness = 0.0f;
         this.targetAuroraBrightness = Float.NaN;
-        if(world != null)
-        {
+        if (world != null) {
             world.addListener(this);
             allChanged();
         }
     }
-    public void allChanged()
-    {
+
+    public void allChanged() {
         ScreenOptions.queueReload = false;
         updateStars();
         // Delete all display lists - this is a (hopefully temporary) workaround to AMD's OpenGL driver leaking memory
@@ -267,18 +261,16 @@ public class RenderGlobal
         if (world == null) return;
 
         // Reset all world renderers
-        if(chunkRenderers != null)
-        {
-            for (ChunkRenderer chunkRenderer : chunkRenderers)
-            {
+        if (chunkRenderers != null) {
+            for (ChunkRenderer chunkRenderer : chunkRenderers) {
                 chunkRenderer.delete();
             }
         }
         int dist = renderDistance * 16 * 2;
 
-		xChunks = dist / RENDER_CHUNK_SIZE + 1;
+        xChunks = dist / RENDER_CHUNK_SIZE + 1;
         yChunks = world.getHeightBlocks() / RENDER_CHUNK_SIZE;
-		zChunks =  dist / RENDER_CHUNK_SIZE + 1;
+        zChunks = dist / RENDER_CHUNK_SIZE + 1;
 
         chunkRenderers = new ChunkRenderer[xChunks * yChunks * zChunks];
         sortedChunkRenderers = new ChunkRenderer[xChunks * yChunks * zChunks];
@@ -293,24 +285,19 @@ public class RenderGlobal
         yMaxChunk = yChunks;
         zMaxChunk = zChunks;
 
-        for (ChunkRenderer cr : dirtyChunks)
-        {
+        for (ChunkRenderer cr : dirtyChunks) {
             cr.dirty = false;
         }
 
         dirtyChunks.clear();
         renderableTileEntities.clear();
 
-        for(int x = 0; x < xChunks; x++)
-        {
-            for(int y = 0; y < yChunks; y++)
-            {
-                for(int z = 0; z < zChunks; z++)
-                {
+        for (int x = 0; x < xChunks; x++) {
+            for (int y = 0; y < yChunks; y++) {
+                for (int z = 0; z < zChunks; z++) {
                     int index = (z * yChunks + y) * xChunks + x;
                     chunkRenderers[index] = mc.terrainRenderer.createChunkRenderer(world, renderableTileEntities, x * RENDER_CHUNK_SIZE, y * RENDER_CHUNK_SIZE, z * RENDER_CHUNK_SIZE, RENDER_CHUNK_SIZE, chunkLists + id);
-                    if(occlusionCheck)
-                    {
+                    if (occlusionCheck) {
                         chunkRenderers[index].occlusionId = occlusionCheckIds.get(count);
                     }
                     chunkRenderers[index].occlusionQuerying = false;
@@ -327,10 +314,8 @@ public class RenderGlobal
 
         }
 
-        if(world != null)
-        {
-            if (mc.activeCamera != null)
-            {
+        if (world != null) {
+            if (mc.activeCamera != null) {
                 resortChunks(MathHelper.floor(mc.activeCamera.getX()), MathHelper.floor(mc.activeCamera.getY()), MathHelper.floor(mc.activeCamera.getZ()));
                 Arrays.sort(sortedChunkRenderers, new CameraSorter(mc.activeCamera));
             }
@@ -339,8 +324,7 @@ public class RenderGlobal
         noEntityRenderFrames = 2;
     }
 
-    public void renderAurora(ICamera camera, float partialTick)
-    {
+    public void renderAurora(ICamera camera, float partialTick) {
         float celestialAngle = world.getCelestialAngle(partialTick);
         if (celestialAngle < 0.25f) return;
 
@@ -348,10 +332,9 @@ public class RenderGlobal
         double cameraY = camera.getY(partialTick);
         double cameraZ = camera.getZ(partialTick);
         double cameraYaw = camera.getYRot(partialTick);
-        double temperature = world.getBlockTemperature((int)cameraX, (int)cameraZ);
+        double temperature = world.getBlockTemperature((int) cameraX, (int) cameraZ);
         float mult = 0.0f;
-        if ((temperature <= 0.4f || world.getSeasonManager().getCurrentSeason() == Seasons.OVERWORLD_WINTER_ENDLESS) && world.isChunkLoaded((int)cameraX, (int)cameraZ))
-        {
+        if ((temperature <= 0.4f || world.getSeasonManager().getCurrentSeason() == Seasons.OVERWORLD_WINTER_ENDLESS) && world.isChunkLoaded((int) cameraX, (int) cameraZ)) {
             // temperature from 0.0f to 0.4f
             temperature /= 0.4f;
             // temperature from 0.0f to 1.0f
@@ -360,9 +343,8 @@ public class RenderGlobal
             mult += temperature;
         }
 
-        double altitude = world.getWorldType().getYPercentage((int)cameraY);
-        if ((temperature <= 0.6f || world.getSeasonManager().getCurrentSeason() == Seasons.OVERWORLD_WINTER || world.getSeasonManager().getCurrentSeason() == Seasons.OVERWORLD_WINTER_ENDLESS) && altitude >= 0.8f)
-        {
+        double altitude = world.getWorldType().getYPercentage((int) cameraY);
+        if ((temperature <= 0.6f || world.getSeasonManager().getCurrentSeason() == Seasons.OVERWORLD_WINTER || world.getSeasonManager().getCurrentSeason() == Seasons.OVERWORLD_WINTER_ENDLESS) && altitude >= 0.8f) {
             // altitude from 0.8f to 1.0f
             altitude -= 0.8f;
             // altitude from 0.0f to 0.4f
@@ -373,8 +355,7 @@ public class RenderGlobal
         if (mult < 0.0f) mult = 0.0f;
         if (mult > 1.0f) mult = 1.0f;
 
-        if (Double.isNaN(targetAuroraBrightness))
-        {
+        if (Double.isNaN(targetAuroraBrightness)) {
             auroraBrightness = mult;
         }
 
@@ -406,10 +387,8 @@ public class RenderGlobal
         long worldTime = world.getWorldTime();
 
         Tessellator.instance.startDrawingQuads();
-        for (double x = -radius; x < radius; x += 8f)
-        {
-            for (double z = -radius; z < radius; z += 8f)
-            {
+        for (double x = -radius; x < radius; x += 16) {
+            for (double z = -radius; z < radius; z += 16) {
                 double posX = cameraX + x;
                 double posZ = cameraZ + z;
 
@@ -420,16 +399,22 @@ public class RenderGlobal
                 double sample = aurora.getAuroraPresence(posX, posZ, worldTime, celestialAngle) * auroraBrightness;
                 if (sample * 0.3f * distanceSqPercentage < 0.01f) continue;
 
-                renderAuroraBeam(
-                    x * scale,
-                    (auroraY * scale - cameraY * scale) + aurora.getAuroraHeightOffset(posX, posZ, time),
-                    z * scale,
-                    rotationX, rotationZ,
-                    aurora.getAuroraRedOffset(posX, posZ, time),
-                    aurora.getAuroraGreenOffset(posX, posZ, time),
-                    aurora.getAuroraBlueOffset(posX, posZ, time),
-                    scale, (float) (sample * 0.3f * distanceSqPercentage)
-                );
+                for (int i = 0; i < 2; i++) {
+                    for (int j = 0; j < 2; j++) {
+                        double xOff = i * 8;
+                        double zOff = j * 8;
+                        renderAuroraBeam(
+                            (x + xOff) * scale,
+                            (auroraY * scale - cameraY * scale) + aurora.getAuroraHeightOffset((posX + xOff), (posZ + zOff), time),
+                            (z + zOff) * scale,
+                            rotationX, rotationZ,
+                            aurora.getAuroraRedOffset((posX + xOff), (posZ + zOff), time),
+                            aurora.getAuroraGreenOffset((posX + xOff), (posZ + zOff), time),
+                            aurora.getAuroraBlueOffset((posX + xOff), (posZ + zOff), time),
+                            scale, (float) (sample * 0.3f * distanceSqPercentage)
+                        );
+                    }
+                }
             }
         }
         Tessellator.instance.draw();
@@ -442,8 +427,7 @@ public class RenderGlobal
         GL11.glDisable(GL11.GL_LIGHTING);
     }
 
-    private void renderAuroraBeam(double x, double y, double z, double xOffset, double zOffset, float redOffset, float greenOffset, float blueOffset, double scale, float transparency)
-    {
+    private void renderAuroraBeam(double x, double y, double z, double xOffset, double zOffset, float redOffset, float greenOffset, float blueOffset, double scale, float transparency) {
         float width = 16f;
         Tessellator tessellator = Tessellator.instance;
         tessellator.setColorRGBA_F(0 / 255f + redOffset, 255 / 255f + greenOffset, 127 / 255f + blueOffset, transparency);
@@ -453,10 +437,8 @@ public class RenderGlobal
         tessellator.addVertexWithUV(x + xOffset * scale * width, y - scale * 256, z + zOffset * scale * width, 0.0, 1.0);
     }
 
-    public void renderEntities(ICamera camera, float partialTick)
-    {
-        if(noEntityRenderFrames > 0)
-        {
+    public void renderEntities(ICamera camera, float partialTick) {
+        if (noEntityRenderFrames > 0) {
             noEntityRenderFrames--;
             return;
         }
@@ -475,43 +457,34 @@ public class RenderGlobal
         totalEntities = loadedEntities.size();
         Tessellator tessellator = Tessellator.instance;
         // Render weather effects
-        for (int i = 0; i < world.weatherEffects.size(); i++)
-        {
+        for (int i = 0; i < world.weatherEffects.size(); i++) {
             Entity entity = world.weatherEffects.get(i);
             renderedEntities++;
-            if(entity.shouldRender(camera.getPosition(partialTick), 1) || mc.thePlayer.vehicle == entity)
-            {
+            if (entity.shouldRender(camera.getPosition(partialTick), 1) || mc.thePlayer.vehicle == entity) {
                 EntityRenderDispatcher.instance.renderEntity(tessellator, entity, partialTick);
             }
         }
 
         // DO NOT TURN THIS INTO A FOREACH
-        for (int i = 0; i < loadedEntities.size(); i++)
-        {
+        for (int i = 0; i < loadedEntities.size(); i++) {
             Entity entity = loadedEntities.get(i);
-            if (mc.activeCamera != null && mc.activeCamera instanceof EntityCamera && ((EntityCamera) mc.activeCamera).mob == entity)
-            {
-                if (!mc.activeCamera.showPlayer())
-                {
+            if (mc.activeCamera != null && mc.activeCamera instanceof EntityCamera && ((EntityCamera) mc.activeCamera).mob == entity) {
+                if (!mc.activeCamera.showPlayer()) {
                     continue;
                 }
             }
-            if (mc.thePlayer.vehicle != entity && (!entity.shouldRender(camera.getPosition(partialTick), mc.gameSettings.entityRenderDistance.value) || !entity.ignoreFrustumCheck && !camera.getFrustum().isVisible(EntityRenderDispatcher.instance.getRenderer(entity).entityViewBox(entity), partialTick)))
-            {
+            if (mc.thePlayer.vehicle != entity && (!entity.shouldRender(camera.getPosition(partialTick), mc.gameSettings.entityRenderDistance.value) || !entity.ignoreFrustumCheck && !camera.getFrustum().isVisible(EntityRenderDispatcher.instance.getRenderer(entity).entityViewBox(entity), partialTick))) {
                 continue;
             }
             int floorY = MathHelper.floor(entity.y);
-            if (floorY < 0)
-            {
+            if (floorY < 0) {
                 floorY = 0;
             }
-            if(floorY >= world.getHeightBlocks())
-            {
+            if (floorY >= world.getHeightBlocks()) {
                 floorY = world.getHeightBlocks() - 1;
 
             }
-            if (world.isBlockLoaded(MathHelper.floor(entity.x), floorY, MathHelper.floor(entity.z)) || mc.thePlayer.vehicle == entity)
-            {
+            if (world.isBlockLoaded(MathHelper.floor(entity.x), floorY, MathHelper.floor(entity.z)) || mc.thePlayer.vehicle == entity) {
                 renderedEntities++;
                 EntityRenderDispatcher.instance.renderEntity(tessellator, entity, partialTick);
             }
@@ -524,18 +497,15 @@ public class RenderGlobal
         }
     }
 
-    public String getRendererDebugInfo()
-    {
+    public String getRendererDebugInfo() {
         return "C: " + renderedChunks + "/" + totalChunks + ". F: " + offscreenChunks + ", O: " + occludedChunks + ", E: " + emptyChunks;
     }
 
-    public String getEntityDebugInfo()
-    {
+    public String getEntityDebugInfo() {
         return "E: " + renderedEntities + "/" + totalEntities + ". B: " + culledEntities + ", I: " + (totalEntities - culledEntities - renderedEntities);
     }
 
-    public void resortChunks(int xc, int yc, int zc)
-    {
+    public void resortChunks(int xc, int yc, int zc) {
         xc -= 8;
 //        yc -= 8;
         zc -= 8;
@@ -550,65 +520,53 @@ public class RenderGlobal
         int s2 = xChunks * RENDER_CHUNK_SIZE;
         int s1 = s2 / 2;
 
-        for(int x = 0; x < xChunks; x++)
-        {
+        for (int x = 0; x < xChunks; x++) {
             int xx = x * RENDER_CHUNK_SIZE;
             int xOff = (xx + s1) - xc;
-            if(xOff < 0)
-            {
+            if (xOff < 0) {
                 xOff -= s2 - 1;
             }
 
             xOff /= s2;
             xx -= xOff * s2;
-            if(xx < xMinChunk)
-            {
+            if (xx < xMinChunk) {
                 xMinChunk = xx;
             }
 
-            if(xx > xMaxChunk)
-            {
+            if (xx > xMaxChunk) {
                 xMaxChunk = xx;
             }
 
-            for(int z = 0; z < zChunks; z++)
-            {
+            for (int z = 0; z < zChunks; z++) {
                 int zz = z * RENDER_CHUNK_SIZE;
                 int zOff = (zz + s1) - zc;
-                if(zOff < 0)
-                {
+                if (zOff < 0) {
                     zOff -= s2 - 1;
                 }
 
                 zOff /= s2;
                 zz -= zOff * s2;
-                if(zz < zMinChunk)
-                {
+                if (zz < zMinChunk) {
                     zMinChunk = zz;
                 }
 
-                if(zz > zMaxChunk)
-                {
+                if (zz > zMaxChunk) {
                     zMaxChunk = zz;
                 }
 
-                for(int y = 0; y < yChunks; y++)
-                {
+                for (int y = 0; y < yChunks; y++) {
                     int yy = y * RENDER_CHUNK_SIZE;
-                    if(yy < yMinChunk)
-                    {
+                    if (yy < yMinChunk) {
                         yMinChunk = yy;
                     }
-                    if(yy > yMaxChunk)
-                    {
+                    if (yy > yMaxChunk) {
                         yMaxChunk = yy;
                     }
 
                     ChunkRenderer renderer = chunkRenderers[(z * yChunks + y) * xChunks + x];
                     boolean wasDirty = renderer.dirty;
                     renderer.setPos(xx, yy, zz);
-                    if(!wasDirty && renderer.dirty)
-                    {
+                    if (!wasDirty && renderer.dirty) {
                         dirtyChunks.add(renderer);
                     }
                 }
@@ -618,26 +576,22 @@ public class RenderGlobal
         }
 
     }
-    public int render(ICamera camera, int renderPass, double partialTick)
-    {
+
+    public int render(ICamera camera, int renderPass, double partialTick) {
         // Find which renderers need updating
-        for(int i = 0; i < 10; i++)
-        {
+        for (int i = 0; i < 10; i++) {
             chunkFixOffs = (chunkFixOffs + 1) % chunkRenderers.length;
             ChunkRenderer chunkRenderer = chunkRenderers[chunkFixOffs];
-            if(chunkRenderer.dirty && !dirtyChunks.contains(chunkRenderer))
-            {
+            if (chunkRenderer.dirty && !dirtyChunks.contains(chunkRenderer)) {
                 dirtyChunks.add(chunkRenderer);
             }
         }
 
-        if(mc.gameSettings.renderDistance.value != renderDistance)
-        {
+        if (mc.gameSettings.renderDistance.value != renderDistance) {
             allChanged();
         }
 
-        if(renderPass == 0)
-        {
+        if (renderPass == 0) {
             totalChunks = 0;
             offscreenChunks = 0;
             occludedChunks = 0;
@@ -651,8 +605,7 @@ public class RenderGlobal
         double xd = camera.getX() - xOld;
         double yd = camera.getY() - yOld;
         double zd = camera.getZ() - zOld;
-        if(xd * xd + yd * yd + zd * zd > RENDER_CHUNK_SIZE)
-        {
+        if (xd * xd + yd * yd + zd * zd > RENDER_CHUNK_SIZE) {
             xOld = camera.getX();
             yOld = camera.getY();
             zOld = camera.getZ();
@@ -662,23 +615,19 @@ public class RenderGlobal
 
         Lighting.disable();
         int count = 0;
-        if(occlusionCheck && mc.gameSettings.advancedOpenGL.value && renderPass == 0)
-        {
+        if (occlusionCheck && mc.gameSettings.advancedOpenGL.value && renderPass == 0) {
             int from = 0;
             int to = RENDER_CHUNK_SIZE;
             checkQueryResults(from, to);
-            for(int i = from; i < to; i++)
-            {
+            for (int i = from; i < to; i++) {
                 sortedChunkRenderers[i].occlusionVisible = true;
             }
 
             count += renderChunks(from, to, renderPass, partialTick);
-            do
-            {
+            do {
                 from = to;
                 to *= 2;
-                if(to > sortedChunkRenderers.length)
-                {
+                if (to > sortedChunkRenderers.length) {
                     to = sortedChunkRenderers.length;
                 }
                 GL11.glDisable(GL11.GL_TEXTURE_2D);
@@ -692,36 +641,30 @@ public class RenderGlobal
                 float xo = 0.0F;
                 float yo = 0.0F;
                 float zo = 0.0F;
-                for(int ix = from; ix < to; ix++)
-                {
-                    if(sortedChunkRenderers[ix].isEmpty())
-                    {
+                for (int ix = from; ix < to; ix++) {
+                    if (sortedChunkRenderers[ix].isEmpty()) {
                         sortedChunkRenderers[ix].visible = false;
                         continue;
                     }
-                    if(!sortedChunkRenderers[ix].visible)
-                    {
+                    if (!sortedChunkRenderers[ix].visible) {
                         sortedChunkRenderers[ix].occlusionVisible = true;
                     }
-                    if(!sortedChunkRenderers[ix].visible || sortedChunkRenderers[ix].occlusionQuerying)
-                    {
+                    if (!sortedChunkRenderers[ix].visible || sortedChunkRenderers[ix].occlusionQuerying) {
                         continue;
                     }
                     float dist = MathHelper.sqrt_float(sortedChunkRenderers[ix].distanceToCameraSquared(camera));
-                    int frequency = (int)(1.0F + dist / 128F);
-                    if(ticks % frequency != ix % frequency)
-                    {
+                    int frequency = (int) (1.0F + dist / 128F);
+                    if (ticks % frequency != ix % frequency) {
                         continue;
                     }
                     ChunkRenderer chunkRenderer = sortedChunkRenderers[ix];
-                    float xt = (float)((double)chunkRenderer.xRender - xOff);
-                    float yt = (float)((double)chunkRenderer.yRender - yOff);
-                    float zt = (float)((double)chunkRenderer.zRender - zOff);
+                    float xt = (float) ((double) chunkRenderer.xRender - xOff);
+                    float yt = (float) ((double) chunkRenderer.yRender - yOff);
+                    float zt = (float) ((double) chunkRenderer.zRender - zOff);
                     float xdd = xt - xo;
                     float ydd = yt - yo;
                     float zdd = zt - zo;
-                    if(xdd != 0.0F || ydd != 0.0F || zdd != 0.0F)
-                    {
+                    if (xdd != 0.0F || ydd != 0.0F || zdd != 0.0F) {
                         GL11.glTranslatef(xdd, ydd, zdd);
                         xo += xdd;
                         yo += ydd;
@@ -740,27 +683,21 @@ public class RenderGlobal
                 GL11.glEnable(GL11.GL_ALPHA_TEST);
                 GL11.glEnable(GL11.GL_FOG);
                 count += renderChunks(from, to, renderPass, partialTick);
-            } while(to < sortedChunkRenderers.length);
-        }
-        else
-        {
+            } while (to < sortedChunkRenderers.length);
+        } else {
             count += renderChunks(0, sortedChunkRenderers.length, renderPass, partialTick);
         }
         return count;
     }
 
-    private void checkQueryResults(int from, int to)
-    {
-        for(int i = from; i < to; i++)
-        {
-            if(!sortedChunkRenderers[i].occlusionQuerying)
-            {
+    private void checkQueryResults(int from, int to) {
+        for (int i = from; i < to; i++) {
+            if (!sortedChunkRenderers[i].occlusionQuerying) {
                 continue;
             }
             resultBuffer.clear();
             ARBOcclusionQuery.glGetQueryObjectuivARB(sortedChunkRenderers[i].occlusionId, GL15.GL_QUERY_RESULT_AVAILABLE, resultBuffer);
-            if(resultBuffer.get(0) != 0)
-            {
+            if (resultBuffer.get(0) != 0) {
                 sortedChunkRenderers[i].occlusionQuerying = false;
                 resultBuffer.clear();
                 ARBOcclusionQuery.glGetQueryObjectuivARB(sortedChunkRenderers[i].occlusionId, GL15.GL_QUERY_RESULT, resultBuffer);
@@ -770,40 +707,29 @@ public class RenderGlobal
 
     }
 
-    private int renderChunks(int from, int to, int renderPass, double partialTick)
-    {
+    private int renderChunks(int from, int to, int renderPass, double partialTick) {
         renderChunks.clear();
         int count = 0;
 
-        for(int i = from; i < to; i++)
-        {
-            if(renderPass == 0)
-            {
+        for (int i = from; i < to; i++) {
+            if (renderPass == 0) {
                 totalChunks++;
-                if(sortedChunkRenderers[i].empty[renderPass])
-                {
+                if (sortedChunkRenderers[i].empty[renderPass]) {
                     emptyChunks++;
-                }
-                else if (!sortedChunkRenderers[i].visible)
-                {
+                } else if (!sortedChunkRenderers[i].visible) {
                     offscreenChunks++;
-                }
-                else if (occlusionCheck && !sortedChunkRenderers[i].occlusionVisible)
-                {
+                } else if (occlusionCheck && !sortedChunkRenderers[i].occlusionVisible) {
                     occludedChunks++;
-                } else
-                {
+                } else {
                     renderedChunks++;
                 }
             }
 
-            if(sortedChunkRenderers[i].empty[renderPass] || !sortedChunkRenderers[i].visible || occlusionCheck && !sortedChunkRenderers[i].occlusionVisible)
-            {
+            if (sortedChunkRenderers[i].empty[renderPass] || !sortedChunkRenderers[i].visible || occlusionCheck && !sortedChunkRenderers[i].occlusionVisible) {
                 continue;
             }
             int list = sortedChunkRenderers[i].getList(renderPass);
-            if(list >= 0)
-            {
+            if (list >= 0) {
                 renderChunks.add(sortedChunkRenderers[i]);
                 count++;
             }
@@ -813,53 +739,43 @@ public class RenderGlobal
         double yOff = mc.activeCamera.getY((float) partialTick);
         double zOff = mc.activeCamera.getZ((float) partialTick);
         int lists = 0;
-        for (DisplayList displayList : renderLists)
-        {
+        for (DisplayList displayList : renderLists) {
             displayList.clear();
         }
 
-        for (ChunkRenderer renderer : renderChunks)
-        {
+        for (ChunkRenderer renderer : renderChunks) {
             int list = -1;
-            for (int i = 0; i < lists; i++)
-            {
-                if (renderLists[i].isSetToPos(renderer.xRender, renderer.yRender, renderer.zRender))
-                {
+            for (int i = 0; i < lists; i++) {
+                if (renderLists[i].isSetToPos(renderer.xRender, renderer.yRender, renderer.zRender)) {
                     list = i;
                 }
             }
 
-            if (list < 0)
-            {
+            if (list < 0) {
                 list = lists++;
                 renderLists[list].setToPos(renderer.xRender, renderer.yRender, renderer.zRender, xOff, yOff, zOff);
             }
             renderLists[list].addCallToList(renderer.getList(renderPass));
         }
 
-        if (!mc.gameSettings.fog.value)
-        {
+        if (!mc.gameSettings.fog.value) {
             GL11.glDisable(GL11.GL_FOG);
         }
         renderSameAsLast(renderPass, partialTick);
-        if (!mc.gameSettings.fog.value)
-        {
+        if (!mc.gameSettings.fog.value) {
             GL11.glEnable(GL11.GL_FOG);
         }
         return count;
     }
 
-    public void renderSameAsLast(int renderPass, double partialTick)
-    {
-        for (DisplayList displayList : renderLists)
-        {
+    public void renderSameAsLast(int renderPass, double partialTick) {
+        for (DisplayList displayList : renderLists) {
             displayList.call();
         }
 
     }
 
-    public void tick()
-    {
+    public void tick() {
         float windDirection = world.worldType.getWindManager().getWindDirection(world, 0.0f, 500f, 0.0f);
         float windIntensity = world.worldType.getWindManager().getWindIntensity(world, 0.0f, 500f, 0.0f);
 
@@ -868,7 +784,7 @@ public class RenderGlobal
 
         cloudVelocityX += dx;
         cloudVelocityZ += dz;
-        
+
         float maxVel = 1.5f;
         if (cloudVelocityX > maxVel) cloudVelocityX = maxVel;
         if (cloudVelocityX < -maxVel) cloudVelocityX = -maxVel;
@@ -883,19 +799,17 @@ public class RenderGlobal
         ticks++;
     }
 
-    public void renderSky(float partialTick)
-    {
+    public void renderSky(float partialTick) {
         WorldTypeFX worldTypeFX = WorldTypeFXDispatcher.getInstance().getDispatch(mc.currentWorld.getWorldType());
-        if(!worldTypeFX.hasSky() || mc.currentScreen instanceof ScreenModelViewer)
-        {
+        if (!worldTypeFX.hasSky() || mc.currentScreen instanceof ScreenModelViewer) {
             return;
         }
         float celestialAngle = world.getCelestialAngle(partialTick);
         GL11.glDisable(GL_TEXTURE_2D);
         Vec3 skyColor = world.getSkyColor(mc.activeCamera, partialTick);
-        float r = (float)skyColor.x;
-        float g = (float)skyColor.y;
-        float b = (float)skyColor.z;
+        float r = (float) skyColor.x;
+        float g = (float) skyColor.y;
+        float b = (float) skyColor.z;
         GL11.glColor3f(r, g, b);
         Tessellator t = Tessellator.instance;
         GL11.glDepthMask(false);
@@ -908,8 +822,7 @@ public class RenderGlobal
         GL11.glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
         Lighting.disable();
         float[] sunriseColor = worldTypeFX.getSunriseColor(celestialAngle, partialTick);
-        if(sunriseColor != null)
-        {
+        if (sunriseColor != null) {
             GL11.glDisable(GL_TEXTURE_2D);
             GL11.glShadeModel(GL_SMOOTH);
             GL11.glPushMatrix();
@@ -924,9 +837,8 @@ public class RenderGlobal
             t.addVertex(0.0D, 100D, 0.0D);
             int numVertices = 16;
             t.setColorRGBA_F(sunriseColor[0], sunriseColor[1], sunriseColor[2], 0.0F);
-            for(int i = 0; i <= numVertices; i++)
-            {
-                float theta = ((float)i * MathHelper.PI * 2.0F) / (float)numVertices;
+            for (int i = 0; i <= numVertices; i++) {
+                float theta = ((float) i * MathHelper.PI * 2.0F) / (float) numVertices;
                 float sunriseX = MathHelper.sin(theta);
                 float sunriseYZ = MathHelper.cos(theta);
                 t.addVertex(sunriseX * 120F, sunriseYZ * 120F, -sunriseYZ * 40F * sunriseColor[3]);
@@ -961,15 +873,15 @@ public class RenderGlobal
         t.draw();
 
         // Render Rainbow
-        if (world.rainbowTicks > 0 || (!Double.isNaN(rainbowBrightness) && rainbowBrightness > 0)){
+        if (world.rainbowTicks > 0 || (!Double.isNaN(rainbowBrightness) && rainbowBrightness > 0)) {
             // Calculates the progress through the rainbow, with peak brightness halfway through its lifespawn
-            final float halfRainbowLength = (world.startingRainbowTicks/2f);
+            final float halfRainbowLength = (world.startingRainbowTicks / 2f);
             float rainbowTimeScalar = 1 - (Math.abs((world.rainbowTicks + partialTick) - halfRainbowLength) / halfRainbowLength);
 
             // Calculates the potential max rainbow brightness based on time of day
             float timeScalar;
             float angDeg = celestialAngle * 360;
-            if (angDeg >= 0 && angDeg < 180){
+            if (angDeg >= 0 && angDeg < 180) {
                 double angDiff = MathHelper.deltaAngle(angDeg, 80.0);
                 timeScalar = 1 - (float) (Math.sqrt(angDiff * angDiff) / 90f);
             } else {
@@ -979,21 +891,21 @@ public class RenderGlobal
 
             // Cutoff zeros out part of the range and then rescales it
             final float cutoff = 2.25f;
-            timeScalar -= 1 - (1/cutoff);
+            timeScalar -= 1 - (1 / cutoff);
             if (timeScalar < 0) timeScalar = 0;
             timeScalar *= cutoff;
             timeScalar *= rainbowTimeScalar;
 
             Weather[] blocked = world.getBlockBiome(MathHelper.floor(mc.thePlayer.x), MathHelper.floor(mc.thePlayer.y), MathHelper.floor(mc.thePlayer.z)).blockedWeathers;
             boolean isWeatherBlocked = false;
-            for (Weather w : blocked){
+            for (Weather w : blocked) {
                 if (w.equals(world.weatherManager.getLastWeather())) {
                     isWeatherBlocked = true;
                     break;
                 }
             }
 
-            if (isWeatherBlocked){
+            if (isWeatherBlocked) {
                 targetRainbowBrightness = 0;
             } else {
                 targetRainbowBrightness = timeScalar;
@@ -1013,11 +925,11 @@ public class RenderGlobal
             final int iterations = 10;
             for (int i = 0; i < iterations; i++) {
                 size = 200F - i * 4;
-                int color = java.awt.Color.HSBtoRGB(i/(float)iterations, 1, (float) (0.3f * rainbowBrightness));
-                float colR = ((color >> 16) & 0xFF)/255f;
-                float colG = ((color >>  8) & 0xFF)/255f;
-                float colB = ((color >>  0) & 0xFF)/255f;
-                float rainbowAlpha = (float) ((0.35f - (0.15f * Math.abs(i - iterations/2)/(iterations/2f))) * rainbowBrightness);
+                int color = java.awt.Color.HSBtoRGB(i / (float) iterations, 1, (float) (0.3f * rainbowBrightness));
+                float colR = ((color >> 16) & 0xFF) / 255f;
+                float colG = ((color >> 8) & 0xFF) / 255f;
+                float colB = ((color >> 0) & 0xFF) / 255f;
+                float rainbowAlpha = (float) ((0.35f - (0.15f * Math.abs(i - iterations / 2) / (iterations / 2f))) * rainbowBrightness);
                 t.setColorRGBA_F(colR, colG, colB, rainbowAlpha);
                 t.addVertexWithUV(-size, -100D, size, 1.0D, 1.0D);
                 t.addVertexWithUV(size, -100D, size, 0.0D, 1.0D);
@@ -1043,8 +955,7 @@ public class RenderGlobal
         t.draw();
 
         float f17 = world.getStarBrightness(partialTick) * sunAlpha;
-        if(f17 > 0.0F)
-        {
+        if (f17 > 0.0F) {
             textureManager.loadTexture("/assets/minecraft/textures/colormap/stars/default.png").bind();
             GL11.glColor4f(f17, f17, f17, f17);
             GL11.glCallList(starList);
@@ -1055,11 +966,9 @@ public class RenderGlobal
         GL11.glEnable(GL11.GL_ALPHA_TEST);
         GL11.glEnable(GL11.GL_FOG);
         GL11.glPopMatrix();
-        if(worldTypeFX.hasGround())
-        {
+        if (worldTypeFX.hasGround()) {
             GL11.glColor3f(r * 0.2F + 0.04F, g * 0.2F + 0.04F, b * 0.6F + 0.1F);
-        } else
-        {
+        } else {
             GL11.glColor3f(r, g, b);
         }
         GL11.glEnable(GL11.GL_TEXTURE_2D);
@@ -1070,19 +979,15 @@ public class RenderGlobal
         return mc.gameSettings.cloudHeight.value * 128;
     }
 
-    public void renderClouds(float partialTick)
-    {
+    public void renderClouds(float partialTick) {
         WorldTypeFX worldTypeFX = WorldTypeFXDispatcher.getInstance().getDispatch(mc.currentWorld.getWorldType());
-        if(!worldTypeFX.hasClouds())
-        {
+        if (!worldTypeFX.hasClouds()) {
             return;
         }
-        if (mc.currentScreen instanceof ScreenPhotoMode)
-        {
+        if (mc.currentScreen instanceof ScreenPhotoMode) {
             return;
         }
-        if(mc.gameSettings.fancyGraphics.value == 1)
-        {
+        if (mc.gameSettings.fancyGraphics.value == 1) {
             renderCloudsFancy(partialTick);
             return;
         }
@@ -1095,29 +1000,27 @@ public class RenderGlobal
         GL11.glEnable(GL11.GL_BLEND);
         GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
         Vec3 dimensionColor = world.getDimensionColor(mc.activeCamera, partialTick);
-        float r = (float)dimensionColor.x;
-        float g = (float)dimensionColor.y;
-        float b = (float)dimensionColor.z;
+        float r = (float) dimensionColor.x;
+        float g = (float) dimensionColor.y;
+        float b = (float) dimensionColor.z;
         float f6 = 1f / 2048f;
-        double posX = mc.activeCamera.getX(partialTick) + (double)((lastCloudOffsetX + (cloudOffsetX - lastCloudOffsetX) * partialTick) * 0.03F);
-        double posZ = mc.activeCamera.getZ(partialTick) + (double)((lastCloudOffsetZ + (cloudOffsetZ - lastCloudOffsetZ) * partialTick) * 0.03F);
+        double posX = mc.activeCamera.getX(partialTick) + (double) ((lastCloudOffsetX + (cloudOffsetX - lastCloudOffsetX) * partialTick) * 0.03F);
+        double posZ = mc.activeCamera.getZ(partialTick) + (double) ((lastCloudOffsetZ + (cloudOffsetZ - lastCloudOffsetZ) * partialTick) * 0.03F);
         int j = MathHelper.floor(posX / 2048D);
         int k = MathHelper.floor(posZ / 2048D);
         posX -= j * 2048;
         posZ -= k * 2048;
         float cloudHeight = (worldTypeFX.getCloudHeight() - cameraY) + 0.33F + getCloudHeightModifier();
-        float f10 = (float)(posX * (double)f6);
-        float f11 = (float)(posZ * (double)f6);
+        float f10 = (float) (posX * (double) f6);
+        float f11 = (float) (posZ * (double) f6);
         tessellator.startDrawingQuads();
         tessellator.setColorRGBA_F(r, g, b, 0.8F);
-        for(int cloudX = -cloudRadius * i; cloudX < cloudRadius * i; cloudX += cloudRadius)
-        {
-            for(int cloudZ = -cloudRadius * i; cloudZ < cloudRadius * i; cloudZ += cloudRadius)
-            {
-                tessellator.addVertexWithUV(cloudX,           cloudHeight, cloudZ + cloudRadius, (float)(cloudX)           * f6 + f10, (float)(cloudZ + cloudRadius) * f6 + f11);
-                tessellator.addVertexWithUV(cloudX + cloudRadius, cloudHeight, cloudZ + cloudRadius, (float)(cloudX + cloudRadius) * f6 + f10, (float)(cloudZ + cloudRadius) * f6 + f11);
-                tessellator.addVertexWithUV(cloudX + cloudRadius, cloudHeight, cloudZ,           (float)(cloudX + cloudRadius) * f6 + f10, (float)(cloudZ)           * f6 + f11);
-                tessellator.addVertexWithUV(cloudX,           cloudHeight, cloudZ,           (float)(cloudX)           * f6 + f10, (float)(cloudZ)           * f6 + f11);
+        for (int cloudX = -cloudRadius * i; cloudX < cloudRadius * i; cloudX += cloudRadius) {
+            for (int cloudZ = -cloudRadius * i; cloudZ < cloudRadius * i; cloudZ += cloudRadius) {
+                tessellator.addVertexWithUV(cloudX, cloudHeight, cloudZ + cloudRadius, (float) (cloudX) * f6 + f10, (float) (cloudZ + cloudRadius) * f6 + f11);
+                tessellator.addVertexWithUV(cloudX + cloudRadius, cloudHeight, cloudZ + cloudRadius, (float) (cloudX + cloudRadius) * f6 + f10, (float) (cloudZ + cloudRadius) * f6 + f11);
+                tessellator.addVertexWithUV(cloudX + cloudRadius, cloudHeight, cloudZ, (float) (cloudX + cloudRadius) * f6 + f10, (float) (cloudZ) * f6 + f11);
+                tessellator.addVertexWithUV(cloudX, cloudHeight, cloudZ, (float) (cloudX) * f6 + f10, (float) (cloudZ) * f6 + f11);
             }
 
         }
@@ -1128,11 +1031,10 @@ public class RenderGlobal
         GL11.glEnable(GL11.GL_CULL_FACE);
     }
 
-    public void renderCloudsFancy(float partialTick)
-    {
+    public void renderCloudsFancy(float partialTick) {
         WorldTypeFX worldTypeFX = WorldTypeFXDispatcher.getInstance().getDispatch(mc.currentWorld.getWorldType());
-    	mc.renderer.beginRenderClouds(partialTick);
-    	
+        mc.renderer.beginRenderClouds(partialTick);
+
         float celestialAngle = world.getCelestialAngle(partialTick);
         float[] sunriseColor = worldTypeFX.getSunriseColor(celestialAngle, partialTick);
         float rSun = 0.0f, gSun = 0.0f, bSun = 0.0f, aSun = 0.0f;
@@ -1144,17 +1046,17 @@ public class RenderGlobal
         }
 
         Vec3 dimensionColor = world.getDimensionColor(mc.activeCamera, partialTick);
-        final float rDim = (float)dimensionColor.x;
-        final float gDim = (float)dimensionColor.y;
-        final float bDim = (float)dimensionColor.z;
+        final float rDim = (float) dimensionColor.x;
+        final float gDim = (float) dimensionColor.y;
+        final float bDim = (float) dimensionColor.z;
 
         GL11.glDisable(GL11.GL_CULL_FACE);
         float cameraY = (float) mc.activeCamera.getY(partialTick);
         Tessellator tessellator = Tessellator.instance;
         float cloudWidth = 12F;
         float cloudThickness = 4F;
-        double dx = (mc.activeCamera.getX(partialTick) + (double)((lastCloudOffsetX + (cloudOffsetX - lastCloudOffsetX) * partialTick) * 0.03F)) / (double)cloudWidth;
-        double dz = (mc.activeCamera.getZ(partialTick) + (double)((lastCloudOffsetZ + (cloudOffsetZ - lastCloudOffsetZ) * partialTick) * 0.03F)) / (double)cloudWidth + 0.33D;
+        double dx = (mc.activeCamera.getX(partialTick) + (double) ((lastCloudOffsetX + (cloudOffsetX - lastCloudOffsetX) * partialTick) * 0.03F)) / (double) cloudWidth;
+        double dz = (mc.activeCamera.getZ(partialTick) + (double) ((lastCloudOffsetZ + (cloudOffsetZ - lastCloudOffsetZ) * partialTick) * 0.03F)) / (double) cloudWidth + 0.33D;
         float dy = (worldTypeFX.getCloudHeight() - cameraY) + 0.33F + getCloudHeightModifier();
         int i = MathHelper.floor(dx / 2048D);
         int j = MathHelper.floor(dz / 2048D);
@@ -1166,102 +1068,86 @@ public class RenderGlobal
         float f13 = 1F / 256F;
         float f9 = (float) MathHelper.floor(dx) * f13;
         float f11 = (float) MathHelper.floor(dz) * f13;
-        float f14 = (float)(dx - (double) MathHelper.floor(dx));
-        float f15 = (float)(dz - (double) MathHelper.floor(dz));
+        float f14 = (float) (dx - (double) MathHelper.floor(dx));
+        float f15 = (float) (dz - (double) MathHelper.floor(dz));
         int cloudWidthScale = 8;
         byte radius = 3;
         float f16 = 1F / 1024F;
         GL11.glScalef(cloudWidth, 1.0F, cloudWidth);
-        
+
         float red = rDim + (rSun - rDim) * aSun;
         float green = gDim + (gSun - gDim) * aSun;
         float blue = bDim + (bSun - bDim) * aSun;
-        
-        for(int l = 0; l < 2; l++)
-        {
-            if(l == 0)
-            {
+
+        for (int l = 0; l < 2; l++) {
+            if (l == 0) {
                 GL11.glColorMask(false, false, false, true);
-            } 
-            else
-            {
+            } else {
                 GL11.glColorMask(true, true, true, true);
             }
             tessellator.startDrawingQuads();
-            for(int ix = -radius - 1; ix <= radius; ix++)
-            {
-                for(int iz = -radius - 1; iz <= radius; iz++)
-                {
+            for (int ix = -radius - 1; ix <= radius; ix++) {
+                for (int iz = -radius - 1; iz <= radius; iz++) {
 
                     float f17 = ix * cloudWidthScale;
                     float f18 = iz * cloudWidthScale;
                     float cloudX = f17 - f14;
                     float cloudZ = f18 - f15;
-                    if(dy > -cloudThickness - 1.0F)
-                    {
+                    if (dy > -cloudThickness - 1.0F) {
                         tessellator.setColorRGBA_F(red * 0.7F, green * 0.7F, blue * 0.7F, 0.8F);
                         tessellator.setNormal(0.0F, -1F, 0.0F);
-                        tessellator.addVertexWithUV(cloudX + 0.0F, dy + 0.0F, cloudZ + (float)cloudWidthScale, (f17 + 0.0F) * f13 + f9, (f18 + (float)cloudWidthScale) * f13 + f11);
-                        tessellator.addVertexWithUV(cloudX + (float)cloudWidthScale, dy + 0.0F, cloudZ + (float)cloudWidthScale, (f17 + (float)cloudWidthScale) * f13 + f9, (f18 + (float)cloudWidthScale) * f13 + f11);
-                        tessellator.addVertexWithUV(cloudX + (float)cloudWidthScale, dy + 0.0F, cloudZ + 0.0F, (f17 + (float)cloudWidthScale) * f13 + f9, (f18 + 0.0F) * f13 + f11);
+                        tessellator.addVertexWithUV(cloudX + 0.0F, dy + 0.0F, cloudZ + (float) cloudWidthScale, (f17 + 0.0F) * f13 + f9, (f18 + (float) cloudWidthScale) * f13 + f11);
+                        tessellator.addVertexWithUV(cloudX + (float) cloudWidthScale, dy + 0.0F, cloudZ + (float) cloudWidthScale, (f17 + (float) cloudWidthScale) * f13 + f9, (f18 + (float) cloudWidthScale) * f13 + f11);
+                        tessellator.addVertexWithUV(cloudX + (float) cloudWidthScale, dy + 0.0F, cloudZ + 0.0F, (f17 + (float) cloudWidthScale) * f13 + f9, (f18 + 0.0F) * f13 + f11);
                         tessellator.addVertexWithUV(cloudX + 0.0F, dy + 0.0F, cloudZ + 0.0F, (f17 + 0.0F) * f13 + f9, (f18 + 0.0F) * f13 + f11);
                     }
-                    if(dy <= cloudThickness + 1.0F)
-                    {
+                    if (dy <= cloudThickness + 1.0F) {
                         tessellator.setColorRGBA_F(red, green, blue, 0.8F);
                         tessellator.setNormal(0.0F, 1.0F, 0.0F);
-                        tessellator.addVertexWithUV(cloudX + 0.0F, (dy + cloudThickness) - f16, cloudZ + (float)cloudWidthScale, (f17 + 0.0F) * f13 + f9, (f18 + (float)cloudWidthScale) * f13 + f11);
-                        tessellator.addVertexWithUV(cloudX + (float)cloudWidthScale, (dy + cloudThickness) - f16, cloudZ + (float)cloudWidthScale, (f17 + (float)cloudWidthScale) * f13 + f9, (f18 + (float)cloudWidthScale) * f13 + f11);
-                        tessellator.addVertexWithUV(cloudX + (float)cloudWidthScale, (dy + cloudThickness) - f16, cloudZ + 0.0F, (f17 + (float)cloudWidthScale) * f13 + f9, (f18 + 0.0F) * f13 + f11);
+                        tessellator.addVertexWithUV(cloudX + 0.0F, (dy + cloudThickness) - f16, cloudZ + (float) cloudWidthScale, (f17 + 0.0F) * f13 + f9, (f18 + (float) cloudWidthScale) * f13 + f11);
+                        tessellator.addVertexWithUV(cloudX + (float) cloudWidthScale, (dy + cloudThickness) - f16, cloudZ + (float) cloudWidthScale, (f17 + (float) cloudWidthScale) * f13 + f9, (f18 + (float) cloudWidthScale) * f13 + f11);
+                        tessellator.addVertexWithUV(cloudX + (float) cloudWidthScale, (dy + cloudThickness) - f16, cloudZ + 0.0F, (f17 + (float) cloudWidthScale) * f13 + f9, (f18 + 0.0F) * f13 + f11);
                         tessellator.addVertexWithUV(cloudX + 0.0F, (dy + cloudThickness) - f16, cloudZ + 0.0F, (f17 + 0.0F) * f13 + f9, (f18 + 0.0F) * f13 + f11);
                     }
                     tessellator.setColorRGBA_F(red * 0.9F, green * 0.9F, blue * 0.9F, 0.8F);
-                    if(ix > -1)
-                    {
+                    if (ix > -1) {
                         tessellator.setNormal(-1F, 0.0F, 0.0F);
-                        for(int k1 = 0; k1 < cloudWidthScale; k1++)
-                        {
-                            tessellator.addVertexWithUV(cloudX + (float)k1 + 0.0F, dy + 0.0F, cloudZ + (float)cloudWidthScale, (f17 + (float)k1 + 0.5F) * f13 + f9, (f18 + (float)cloudWidthScale) * f13 + f11);
-                            tessellator.addVertexWithUV(cloudX + (float)k1 + 0.0F, dy + cloudThickness, cloudZ + (float)cloudWidthScale, (f17 + (float)k1 + 0.5F) * f13 + f9, (f18 + (float)cloudWidthScale) * f13 + f11);
-                            tessellator.addVertexWithUV(cloudX + (float)k1 + 0.0F, dy + cloudThickness, cloudZ + 0.0F, (f17 + (float)k1 + 0.5F) * f13 + f9, (f18 + 0.0F) * f13 + f11);
-                            tessellator.addVertexWithUV(cloudX + (float)k1 + 0.0F, dy + 0.0F, cloudZ + 0.0F, (f17 + (float)k1 + 0.5F) * f13 + f9, (f18 + 0.0F) * f13 + f11);
+                        for (int k1 = 0; k1 < cloudWidthScale; k1++) {
+                            tessellator.addVertexWithUV(cloudX + (float) k1 + 0.0F, dy + 0.0F, cloudZ + (float) cloudWidthScale, (f17 + (float) k1 + 0.5F) * f13 + f9, (f18 + (float) cloudWidthScale) * f13 + f11);
+                            tessellator.addVertexWithUV(cloudX + (float) k1 + 0.0F, dy + cloudThickness, cloudZ + (float) cloudWidthScale, (f17 + (float) k1 + 0.5F) * f13 + f9, (f18 + (float) cloudWidthScale) * f13 + f11);
+                            tessellator.addVertexWithUV(cloudX + (float) k1 + 0.0F, dy + cloudThickness, cloudZ + 0.0F, (f17 + (float) k1 + 0.5F) * f13 + f9, (f18 + 0.0F) * f13 + f11);
+                            tessellator.addVertexWithUV(cloudX + (float) k1 + 0.0F, dy + 0.0F, cloudZ + 0.0F, (f17 + (float) k1 + 0.5F) * f13 + f9, (f18 + 0.0F) * f13 + f11);
                         }
 
                     }
-                    if(ix <= 1)
-                    {
+                    if (ix <= 1) {
                         tessellator.setNormal(1.0F, 0.0F, 0.0F);
-                        for(int l1 = 0; l1 < cloudWidthScale; l1++)
-                        {
-                            tessellator.addVertexWithUV((cloudX + (float)l1 + 1.0F) - f16, dy + 0.0F, cloudZ + (float)cloudWidthScale, (f17 + (float)l1 + 0.5F) * f13 + f9, (f18 + (float)cloudWidthScale) * f13 + f11);
-                            tessellator.addVertexWithUV((cloudX + (float)l1 + 1.0F) - f16, dy + cloudThickness, cloudZ + (float)cloudWidthScale, (f17 + (float)l1 + 0.5F) * f13 + f9, (f18 + (float)cloudWidthScale) * f13 + f11);
-                            tessellator.addVertexWithUV((cloudX + (float)l1 + 1.0F) - f16, dy + cloudThickness, cloudZ + 0.0F, (f17 + (float)l1 + 0.5F) * f13 + f9, (f18 + 0.0F) * f13 + f11);
-                            tessellator.addVertexWithUV((cloudX + (float)l1 + 1.0F) - f16, dy + 0.0F, cloudZ + 0.0F, (f17 + (float)l1 + 0.5F) * f13 + f9, (f18 + 0.0F) * f13 + f11);
+                        for (int l1 = 0; l1 < cloudWidthScale; l1++) {
+                            tessellator.addVertexWithUV((cloudX + (float) l1 + 1.0F) - f16, dy + 0.0F, cloudZ + (float) cloudWidthScale, (f17 + (float) l1 + 0.5F) * f13 + f9, (f18 + (float) cloudWidthScale) * f13 + f11);
+                            tessellator.addVertexWithUV((cloudX + (float) l1 + 1.0F) - f16, dy + cloudThickness, cloudZ + (float) cloudWidthScale, (f17 + (float) l1 + 0.5F) * f13 + f9, (f18 + (float) cloudWidthScale) * f13 + f11);
+                            tessellator.addVertexWithUV((cloudX + (float) l1 + 1.0F) - f16, dy + cloudThickness, cloudZ + 0.0F, (f17 + (float) l1 + 0.5F) * f13 + f9, (f18 + 0.0F) * f13 + f11);
+                            tessellator.addVertexWithUV((cloudX + (float) l1 + 1.0F) - f16, dy + 0.0F, cloudZ + 0.0F, (f17 + (float) l1 + 0.5F) * f13 + f9, (f18 + 0.0F) * f13 + f11);
                         }
 
                     }
                     tessellator.setColorRGBA_F(red * 0.8F, green * 0.8F, blue * 0.8F, 0.8F);
-                    if(iz > -1)
-                    {
+                    if (iz > -1) {
                         tessellator.setNormal(0.0F, 0.0F, -1F);
-                        for(int i2 = 0; i2 < cloudWidthScale; i2++)
-                        {
-                            tessellator.addVertexWithUV(cloudX + 0.0F, dy + cloudThickness, cloudZ + (float)i2 + 0.0F, (f17 + 0.0F) * f13 + f9, (f18 + (float)i2 + 0.5F) * f13 + f11);
-                            tessellator.addVertexWithUV(cloudX + (float)cloudWidthScale, dy + cloudThickness, cloudZ + (float)i2 + 0.0F, (f17 + (float)cloudWidthScale) * f13 + f9, (f18 + (float)i2 + 0.5F) * f13 + f11);
-                            tessellator.addVertexWithUV(cloudX + (float)cloudWidthScale, dy + 0.0F, cloudZ + (float)i2 + 0.0F, (f17 + (float)cloudWidthScale) * f13 + f9, (f18 + (float)i2 + 0.5F) * f13 + f11);
-                            tessellator.addVertexWithUV(cloudX + 0.0F, dy + 0.0F, cloudZ + (float)i2 + 0.0F, (f17 + 0.0F) * f13 + f9, (f18 + (float)i2 + 0.5F) * f13 + f11);
+                        for (int i2 = 0; i2 < cloudWidthScale; i2++) {
+                            tessellator.addVertexWithUV(cloudX + 0.0F, dy + cloudThickness, cloudZ + (float) i2 + 0.0F, (f17 + 0.0F) * f13 + f9, (f18 + (float) i2 + 0.5F) * f13 + f11);
+                            tessellator.addVertexWithUV(cloudX + (float) cloudWidthScale, dy + cloudThickness, cloudZ + (float) i2 + 0.0F, (f17 + (float) cloudWidthScale) * f13 + f9, (f18 + (float) i2 + 0.5F) * f13 + f11);
+                            tessellator.addVertexWithUV(cloudX + (float) cloudWidthScale, dy + 0.0F, cloudZ + (float) i2 + 0.0F, (f17 + (float) cloudWidthScale) * f13 + f9, (f18 + (float) i2 + 0.5F) * f13 + f11);
+                            tessellator.addVertexWithUV(cloudX + 0.0F, dy + 0.0F, cloudZ + (float) i2 + 0.0F, (f17 + 0.0F) * f13 + f9, (f18 + (float) i2 + 0.5F) * f13 + f11);
                         }
 
                     }
-                    if(iz <= 1)
-                    {
+                    if (iz <= 1) {
                         tessellator.setNormal(0.0F, 0.0F, 1.0F);
-                        for(int j2 = 0; j2 < cloudWidthScale; j2++)
-                        {
-                            tessellator.addVertexWithUV(cloudX + 0.0F, dy + cloudThickness, (cloudZ + (float)j2 + 1.0F) - f16, (f17 + 0.0F) * f13 + f9, (f18 + (float)j2 + 0.5F) * f13 + f11);
-                            tessellator.addVertexWithUV(cloudX + (float)cloudWidthScale, dy + cloudThickness, (cloudZ + (float)j2 + 1.0F) - f16, (f17 + (float)cloudWidthScale) * f13 + f9, (f18 + (float)j2 + 0.5F) * f13 + f11);
-                            tessellator.addVertexWithUV(cloudX + (float)cloudWidthScale, dy + 0.0F, (cloudZ + (float)j2 + 1.0F) - f16, (f17 + (float)cloudWidthScale) * f13 + f9, (f18 + (float)j2 + 0.5F) * f13 + f11);
-                            tessellator.addVertexWithUV(cloudX + 0.0F, dy + 0.0F, (cloudZ + (float)j2 + 1.0F) - f16, (f17 + 0.0F) * f13 + f9, (f18 + (float)j2 + 0.5F) * f13 + f11);
+                        for (int j2 = 0; j2 < cloudWidthScale; j2++) {
+                            tessellator.addVertexWithUV(cloudX + 0.0F, dy + cloudThickness, (cloudZ + (float) j2 + 1.0F) - f16, (f17 + 0.0F) * f13 + f9, (f18 + (float) j2 + 0.5F) * f13 + f11);
+                            tessellator.addVertexWithUV(cloudX + (float) cloudWidthScale, dy + cloudThickness, (cloudZ + (float) j2 + 1.0F) - f16, (f17 + (float) cloudWidthScale) * f13 + f9, (f18 + (float) j2 + 0.5F) * f13 + f11);
+                            tessellator.addVertexWithUV(cloudX + (float) cloudWidthScale, dy + 0.0F, (cloudZ + (float) j2 + 1.0F) - f16, (f17 + (float) cloudWidthScale) * f13 + f9, (f18 + (float) j2 + 0.5F) * f13 + f11);
+                            tessellator.addVertexWithUV(cloudX + 0.0F, dy + 0.0F, (cloudZ + (float) j2 + 1.0F) - f16, (f17 + 0.0F) * f13 + f9, (f18 + (float) j2 + 0.5F) * f13 + f11);
                         }
 
                     }
@@ -1275,21 +1161,49 @@ public class RenderGlobal
         GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
         GL11.glDisable(GL11.GL_BLEND);
         GL11.glEnable(GL11.GL_CULL_FACE);
-        
-    	mc.renderer.endRenderClouds(partialTick);
+
+        mc.renderer.endRenderClouds(partialTick);
     }
 
-    public boolean updateDirtyChunks(ICamera camera) {
-        final DirtyChunkRendererSorter dirtyChunkRendererSorter = new DirtyChunkRendererSorter(camera);
-        final ChunkRenderer[] toAdd = new ChunkRenderer[MAX_VISIBLE_REBUILDS_PER_FRAME];
-        List<ChunkRenderer> nearChunks = null;
+    private final DirtyChunkRendererSorter dirtyChunkRendererSorter = new DirtyChunkRendererSorter();
+//    private final List<@NotNull ChunkRenderer> dirtyChunks2 = new ArrayList<>();
+//    public boolean updateDirtyChunks(@NotNull ICamera camera) {
+//        this.dirtyChunkRendererSorter.setActiveCamera(camera);
+//
+//        this.dirtyChunks2.clear();
+//        this.dirtyChunks2.addAll(this.dirtyChunks);
+//        this.dirtyChunks2.sort(this.dirtyChunkRendererSorter);
+//        int chunksUpdated = 0;
+//        var chunkItr = this.dirtyChunks2.iterator();
+//        while (chunkItr.hasNext() && chunksUpdated <= MAX_VISIBLE_REBUILDS_PER_FRAME) {
+//            var renderer = chunkItr.next();
+//            if (this.cantBuildRenderers.contains(renderer)) continue;
+//            if (renderer.rebuild(renderer.distanceToCameraSquared(camera) < 2048)) {
+//                chunkItr.remove();
+//                renderer.dirty = false;
+//                chunksUpdated++;
+//            } else {
+//                this.cantBuildRenderers.add(renderer);
+//            }
+//        }
+//        this.dirtyChunks.clear();
+//        this.dirtyChunks.addAll(this.dirtyChunks2);
+//
+//        return this.dirtyChunks.size() <= this.cantBuildRenderers.size(); // Return true if no more dirty renderers
+//    }
+
+    private @Nullable ChunkRenderer @NotNull [] toAdd = new ChunkRenderer[MAX_VISIBLE_REBUILDS_PER_FRAME];
+    private @NotNull List<@NotNull ChunkRenderer> nearChunks = new ArrayList<>();
+    public boolean updateDirtyChunks(@NotNull ICamera camera) {
+        dirtyChunkRendererSorter.setActiveCamera(camera);
+        Arrays.fill(toAdd, null);
+        this.nearChunks.clear();
 
         final int pendingChunkSize = dirtyChunks.size();
-        int pendingChunkRemoved = 0;
 
         for(int i = 0; i < pendingChunkSize; i++) {
             final ChunkRenderer renderer = dirtyChunks.get(i);
-            if(renderer.distanceToCameraSquared(camera) > 1024.0f) {
+            if(renderer.distanceToCameraSquared(camera) > 2048f) {
                 int index = 0;
 
                 while (index < MAX_VISIBLE_REBUILDS_PER_FRAME && (toAdd[index] == null || dirtyChunkRendererSorter.compare(toAdd[index], renderer) <= 0)) {
@@ -1308,26 +1222,21 @@ public class RenderGlobal
                 continue;
             }
 
-            if(nearChunks == null) {
-                nearChunks = new ArrayList<>();
-            }
-
-            pendingChunkRemoved++;
             nearChunks.add(renderer);
-            dirtyChunks.set(i, null);
         }
 
-        if(nearChunks != null) {
+        if(!nearChunks.isEmpty()) {
             if(nearChunks.size() > 1) {
                 nearChunks.sort(dirtyChunkRendererSorter);
             }
             for (ChunkRenderer renderer : nearChunks){
-                renderer.rebuild();
-                renderer.dirty = false;
+                if (renderer.rebuild(true)) {
+                    renderer.dirty = false;
+                    dirtyChunks.remove(renderer);
+                }
             }
         }
 
-        int secondaryRemoved = 0;
         for(int i = MAX_VISIBLE_REBUILDS_PER_FRAME - 1; i >= 0; i--) {
             ChunkRenderer chunkx = toAdd[i];
             if(chunkx == null) { continue; }
@@ -1335,43 +1244,21 @@ public class RenderGlobal
                 toAdd[i] = null;
                 break;
             }
-            chunkx.rebuild();
-            chunkx.dirty = false;
-            secondaryRemoved++;
-        }
-
-        int cursor = 0;
-        int target = 0;
-        outer: for (int size = dirtyChunks.size(); cursor != size; cursor++) {
-            final ChunkRenderer renderer = dirtyChunks.get(cursor);
-            if(renderer == null) { continue; }
-            for(int i = 0; i < MAX_VISIBLE_REBUILDS_PER_FRAME; i++) {
-                if (renderer == toAdd[i]) {
-                    continue outer;
-                }
+            if (chunkx.rebuild(false)) {
+                chunkx.dirty = false;
+                dirtyChunks.remove(chunkx);
             }
-
-            if(target != cursor) {
-                dirtyChunks.set(target, renderer);
-            }
-            target++;
-        }
-
-        while(--cursor >= target) {
-            dirtyChunks.remove(cursor);
         }
-        return pendingChunkSize == (pendingChunkRemoved + secondaryRemoved);
+        return dirtyChunks.isEmpty();
     }
 
-    public void drawBlockBreaking(ICamera camera, HitResult hitResult, float partialTick)
-    {
+    public void drawBlockBreaking(ICamera camera, HitResult hitResult, float partialTick) {
         Tessellator tessellator = Tessellator.instance;
         GL11.glEnable(GL11.GL_BLEND);
         GL11.glEnable(GL11.GL_ALPHA_TEST);
         GL11.glBlendFunc(770, 1);
-        GL11.glColor4f(1.0F, 1.0F, 1.0F, (MathHelper.sin((float)System.currentTimeMillis() / 100F) * 0.2F + 0.4F) * 0.5F);
-        if(destroyProgress > 0.0F)
-        {
+        GL11.glColor4f(1.0F, 1.0F, 1.0F, (MathHelper.sin((float) System.currentTimeMillis() / 100F) * 0.2F + 0.4F) * 0.5F);
+        if (destroyProgress > 0.0F) {
             GL11.glBlendFunc(774, 768);
             TextureRegistry.blockAtlas.bind();
             GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.5F);
@@ -1384,17 +1271,16 @@ public class RenderGlobal
             double x = camera.getX(partialTick);
             double y = camera.getY(partialTick);
             double z = camera.getZ(partialTick);
-            if(block == null)
-            {
+            if (block == null) {
                 block = Blocks.STONE;
             }
             GL11.glEnable(GL11.GL_ALPHA_TEST);
             tessellator.startDrawingQuads();
             tessellator.setTranslation(-x, -y, -z);
             tessellator.lockColor();
-            if(LightmapHelper.isLightmapEnabled()) {
-            	// Make sure it's active to prevent crash if a model doesnt enable it
-            	tessellator.setLightmapCoord(LightmapHelper.getLightmapCoord(15, 0));
+            if (LightmapHelper.isLightmapEnabled()) {
+                // Make sure it's active to prevent crash if a model doesnt enable it
+                tessellator.setLightmapCoord(LightmapHelper.getLightmapCoord(15, 0));
             }
             BlockModelDispatcher.getInstance()
                 .getDispatch(block)
@@ -1404,7 +1290,7 @@ public class RenderGlobal
                     hitResult.x,
                     hitResult.y,
                     hitResult.z,
-                    breakingAnimation[MathHelper.clamp((int)(destroyProgress * 10F), 0, breakingAnimation.length - 1)]);
+                    breakingAnimation[MathHelper.clamp((int) (destroyProgress * 10F), 0, breakingAnimation.length - 1)]);
             tessellator.draw();
             tessellator.setTranslation(0.0D, 0.0D, 0.0D);
             GL11.glDisable(GL11.GL_ALPHA_TEST);
@@ -1418,10 +1304,8 @@ public class RenderGlobal
         GL11.glDisable(GL11.GL_ALPHA_TEST);
     }
 
-    public void drawSelectionBox(ICamera camera, HitResult hitResult, float partialTick)
-    {
-        if (mc.gameSettings.immersiveMode.drawOutline() && mc.gameSettings.blockOutlineWidth.value > 0.01f && !(mc.currentScreen instanceof ScreenModelViewer))
-        {
+    public void drawSelectionBox(ICamera camera, HitResult hitResult, float partialTick) {
+        if (mc.gameSettings.immersiveMode.drawOutline() && mc.gameSettings.blockOutlineWidth.value > 0.01f && !(mc.currentScreen instanceof ScreenModelViewer)) {
             GL11.glEnable(GL11.GL_BLEND);
             GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
             float w = mc.getOutlineWidth();
@@ -1433,19 +1317,14 @@ public class RenderGlobal
             double offsetY = camera.getY(partialTick);
             double offsetZ = camera.getZ(partialTick);
 
-            if(hitResult.hitType == HitResult.HitType.TILE)
-            {
+            if (hitResult.hitType == HitResult.HitType.TILE) {
                 float expand = 0.002F;
                 Block<?> block = world.getBlock(hitResult.x, hitResult.y, hitResult.z);
-                if(block != null)
-                {
+                if (block != null) {
                     BoundingVolume volume = block.getBoundingVolume(world, hitResult.x, hitResult.y, hitResult.z);
-                    if (volume != null)
-                    {
+                    if (volume != null) {
                         drawOutlinedVolume(volume, hitResult.x - offsetX, hitResult.y - offsetY, hitResult.z - offsetZ, expand);
-                    }
-                    else
-                    {
+                    } else {
                         drawOutlinedBoundingBox(block.getSelectedBoundingBoxFromPool(world, hitResult.x, hitResult.y, hitResult.z).grow(expand, expand, expand).cloneMove(-offsetX, -offsetY, -offsetZ));
                     }
                     if (mc.gameSettings.viewSupportMode.value) {
@@ -1782,9 +1661,7 @@ public class RenderGlobal
                         t.draw();
                     }
                 }
-            }
-            else if (hitResult.hitType == HitResult.HitType.ENTITY && hitResult.entity.showBoundingBoxOnHover() && !mc.gameSettings.showCollisionBoxes.value)
-            {
+            } else if (hitResult.hitType == HitResult.HitType.ENTITY && hitResult.entity.showBoundingBoxOnHover() && !mc.gameSettings.showCollisionBoxes.value) {
                 drawInterpolatedEntityBoundingBox(hitResult.entity, hitResult.entity.bb, camera, partialTick);
             }
 
@@ -1793,26 +1670,26 @@ public class RenderGlobal
             GL11.glDisable(GL11.GL_BLEND);
         }
     }
-    
+
     public void drawDebugEntityOutlines(ICamera camera, float partialTicks) {
-		glDisable(GL_TEXTURE_2D);
-		glLineWidth(2.0f);
-		
-		double offsetX = camera.getX(partialTicks);
-		double offsetY = camera.getY(partialTicks);
-		double offsetZ = camera.getZ(partialTicks);
-		float expand = 0.002F;
-		List<AABB> collidingBoundingBoxes = world.getCubes(mc.thePlayer, mc.thePlayer.bb.grow(expand, expand, expand));
+        glDisable(GL_TEXTURE_2D);
+        glLineWidth(2.0f);
+
+        double offsetX = camera.getX(partialTicks);
+        double offsetY = camera.getY(partialTicks);
+        double offsetZ = camera.getZ(partialTicks);
+        float expand = 0.002F;
+        List<AABB> collidingBoundingBoxes = world.getCubes(mc.thePlayer, mc.thePlayer.bb.grow(expand, expand, expand));
         glColor4f(0.0f, 0.0f, 1.0f, 1.0f);
-		for (AABB aabb : collidingBoundingBoxes) {
-			drawOutlinedBoundingBox(aabb.cloneMove(-offsetX, -offsetY, -offsetZ).grow(expand, expand, expand));
-		}
-
-		float entityRadius = 10.0f;
-		if(mc.thePlayer.getGamemode() == Gamemode.creative) {
-			entityRadius = 100.0f;
-		}
-		List<Entity> entitiesNearby = world.getEntitiesWithinAABBExcludingEntity(null, mc.thePlayer.bb.grow(entityRadius, entityRadius, entityRadius));
+        for (AABB aabb : collidingBoundingBoxes) {
+            drawOutlinedBoundingBox(aabb.cloneMove(-offsetX, -offsetY, -offsetZ).grow(expand, expand, expand));
+        }
+
+        float entityRadius = 10.0f;
+        if (mc.thePlayer.getGamemode() == Gamemode.creative) {
+            entityRadius = 100.0f;
+        }
+        List<Entity> entitiesNearby = world.getEntitiesWithinAABBExcludingEntity(null, mc.thePlayer.bb.grow(entityRadius, entityRadius, entityRadius));
         for (Entity e : entitiesNearby) {
             glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
             drawInterpolatedEntityBoundingBox(e, e.bb, camera, partialTicks); // Bounds
@@ -1836,11 +1713,11 @@ public class RenderGlobal
             glDisable(GL_TEXTURE_2D);
             GL11.glLineWidth(2);
         }
-		
-		glEnable(GL_TEXTURE_2D);
-	}
 
-    public static void drawDebugVec(final Tessellator tessellator, final Vec3 pos, final Vec3 vec, final double scale, final float r, final float g, final float b, final float a){
+        glEnable(GL_TEXTURE_2D);
+    }
+
+    public static void drawDebugVec(final Tessellator tessellator, final Vec3 pos, final Vec3 vec, final double scale, final float r, final float g, final float b, final float a) {
         if (pos == null || vec == null) return;
         GL11.glLineWidth(10);
         GL11.glDisable(GL11.GL_TEXTURE_2D);
@@ -1870,96 +1747,95 @@ public class RenderGlobal
         drawOutlinedBoundingBox(boundingBox);
     }
 
-	public void drawDebugChunkBorders(ICamera camera, float partialTicks) {
-		glDisable(GL_TEXTURE_2D);
-		glDisable(GL_FOG);
-
-		double offsetX = camera.getX(partialTicks);
-		double offsetY = camera.getY(partialTicks);
-		double offsetZ = camera.getZ(partialTicks);
-		
-		Tessellator tessellator = Tessellator.instance;
-		tessellator.setTranslation(-offsetX, -offsetY, -offsetZ);
-		
-		int blockX = MathHelper.floor(mc.thePlayer.x);
-		int blockZ = MathHelper.floor(mc.thePlayer.z);
-
-		int chunkX = blockX >> 4;
+    public void drawDebugChunkBorders(ICamera camera, float partialTicks) {
+        glDisable(GL_TEXTURE_2D);
+        glDisable(GL_FOG);
+
+        double offsetX = camera.getX(partialTicks);
+        double offsetY = camera.getY(partialTicks);
+        double offsetZ = camera.getZ(partialTicks);
+
+        Tessellator tessellator = Tessellator.instance;
+        tessellator.setTranslation(-offsetX, -offsetY, -offsetZ);
+
+        int blockX = MathHelper.floor(mc.thePlayer.x);
+        int blockZ = MathHelper.floor(mc.thePlayer.z);
+
+        int chunkX = blockX >> 4;
         int chunkZ = blockZ >> 4;
-        
+
         int x0 = chunkX << 4;
         int z0 = chunkZ << 4;
-        
-		int x1 = x0 + 16;
-		int z1 = z0 + 16;
-		
-		int worldHeight = mc.currentWorld.getHeightBlocks();
 
-		glLineWidth(2.0f);
+        int x1 = x0 + 16;
+        int z1 = z0 + 16;
+
+        int worldHeight = mc.currentWorld.getHeightBlocks();
+
+        glLineWidth(2.0f);
         glColor4f(1.0f, 0.0f, 0.0f, 1.0f);
         tessellator.startDrawing(GL_LINES);
 
-		// Draw vertical red lines
-		for(int i = -1; i <= 2; i++) {
-			for(int j = -1; j <= 2; j++) {
-				int x2 = (chunkX + i) << 4;
-				int z2 = (chunkZ + j) << 4;
-				
-				tessellator.addVertex(x2, 0, z2);
-				tessellator.addVertex(x2, worldHeight, z2);
-			}
-		}
-
-		tessellator.draw();
-		
-		glLineWidth(1.0f);
-		glColor4f(0.0f, 1.0f, 0.0f, 1.0f);
+        // Draw vertical red lines
+        for (int i = -1; i <= 2; i++) {
+            for (int j = -1; j <= 2; j++) {
+                int x2 = (chunkX + i) << 4;
+                int z2 = (chunkZ + j) << 4;
+
+                tessellator.addVertex(x2, 0, z2);
+                tessellator.addVertex(x2, worldHeight, z2);
+            }
+        }
+
+        tessellator.draw();
+
+        glLineWidth(1.0f);
+        glColor4f(0.0f, 1.0f, 0.0f, 1.0f);
         tessellator.startDrawing(GL_LINES);
-		
-		// Draw horizontal green lines
-		for(int y=0; y <= worldHeight; y++) {
-			if(y % 2 == 1) continue;
-			
-			tessellator.addVertex(x0, y, z0);
-			tessellator.addVertex(x1, y, z0);
-			
-			tessellator.addVertex(x0, y, z1);
-			tessellator.addVertex(x1, y, z1);
-			
-			tessellator.addVertex(x0, y, z0);
-			tessellator.addVertex(x0, y, z1);
-			
-			tessellator.addVertex(x1, y, z0);
-			tessellator.addVertex(x1, y, z1);
-		}
-		
-		for(int i = 1; i < 16; i++) {
-			if(i % 2 == 1) continue;
-			
-			tessellator.addVertex(x0 + i, 0, z0);
-			tessellator.addVertex(x0 + i, 256, z0);
-			
-			tessellator.addVertex(x0, 0, z0 + i);
-			tessellator.addVertex(x0, 256, z0 + i);
-			
-			tessellator.addVertex(x0 + i, 0, z1);
-			tessellator.addVertex(x0 + i, 256, z1);
-			
-			tessellator.addVertex(x1, 0, z0 + i);
-			tessellator.addVertex(x1, 256, z0 + i);
-		}
-		
-		// Draw vertical green lines
-		
-		tessellator.draw();
-		
-		tessellator.setTranslation(0.0, 0.0, 0.0);
-		glEnable(GL_TEXTURE_2D);
-		glEnable(GL_FOG);
-	}
-
-    public void drawOutlinedBoundingBox(AABB aabb)
-    {
+
+        // Draw horizontal green lines
+        for (int y = 0; y <= worldHeight; y++) {
+            if (y % 2 == 1) continue;
+
+            tessellator.addVertex(x0, y, z0);
+            tessellator.addVertex(x1, y, z0);
+
+            tessellator.addVertex(x0, y, z1);
+            tessellator.addVertex(x1, y, z1);
+
+            tessellator.addVertex(x0, y, z0);
+            tessellator.addVertex(x0, y, z1);
+
+            tessellator.addVertex(x1, y, z0);
+            tessellator.addVertex(x1, y, z1);
+        }
+
+        for (int i = 1; i < 16; i++) {
+            if (i % 2 == 1) continue;
+
+            tessellator.addVertex(x0 + i, 0, z0);
+            tessellator.addVertex(x0 + i, 256, z0);
+
+            tessellator.addVertex(x0, 0, z0 + i);
+            tessellator.addVertex(x0, 256, z0 + i);
+
+            tessellator.addVertex(x0 + i, 0, z1);
+            tessellator.addVertex(x0 + i, 256, z1);
+
+            tessellator.addVertex(x1, 0, z0 + i);
+            tessellator.addVertex(x1, 256, z0 + i);
+        }
+
+        // Draw vertical green lines
+
+        tessellator.draw();
+
+        tessellator.setTranslation(0.0, 0.0, 0.0);
+        glEnable(GL_TEXTURE_2D);
+        glEnable(GL_FOG);
+    }
+
+    public void drawOutlinedBoundingBox(AABB aabb) {
         Tessellator tessellator = Tessellator.instance;
         tessellator.startDrawing(GL11.GL_LINE_STRIP);
         tessellator.addVertex(aabb.minX, aabb.minY, aabb.minZ);
@@ -1987,13 +1863,11 @@ public class RenderGlobal
         tessellator.draw();
     }
 
-    public void drawOutlinedVolume(BoundingVolume volume, double xOffset, double yOffset, double zOffset, float expand)
-    {
+    public void drawOutlinedVolume(BoundingVolume volume, double xOffset, double yOffset, double zOffset, float expand) {
         Tessellator t = Tessellator.instance;
         t.startDrawing(GL11.GL_LINES);
         Float[] points = volume.getBakedLineCoords();
-        for (int i = 0; i < points.length; i += 3)
-        {
+        for (int i = 0; i < points.length; i += 3) {
             float expand0 = ((points[i] - 0.5f) * 2) * expand;
             float expand1 = ((points[i + 1] - 0.5f) * 2) * expand;
             float expand2 = ((points[i + 2] - 0.5f) * 2) * expand;
@@ -2002,40 +1876,32 @@ public class RenderGlobal
         t.draw();
     }
 
-    public void setDirty(int x0, int y0, int z0, int x1, int y1, int z1)
-    {
+    public void setDirty(int x0, int y0, int z0, int x1, int y1, int z1) {
         int _x0 = MathHelper.bucketInt(x0, RENDER_CHUNK_SIZE);
         int _y0 = MathHelper.bucketInt(y0, RENDER_CHUNK_SIZE);
         int _z0 = MathHelper.bucketInt(z0, RENDER_CHUNK_SIZE);
         int _x1 = MathHelper.bucketInt(x1, RENDER_CHUNK_SIZE);
         int _y1 = MathHelper.bucketInt(y1, RENDER_CHUNK_SIZE);
         int _z1 = MathHelper.bucketInt(z1, RENDER_CHUNK_SIZE);
-        for(int x = _x0; x <= _x1; x++)
-        {
+        for (int x = _x0; x <= _x1; x++) {
             int xx = x % xChunks;
-            if(xx < 0)
-            {
+            if (xx < 0) {
                 xx += xChunks;
             }
-            for(int y = _y0; y <= _y1; y++)
-            {
+            for (int y = _y0; y <= _y1; y++) {
                 int yy = y % yChunks;
-                if(yy < 0)
-                {
+                if (yy < 0) {
                     yy += yChunks;
                 }
-                for(int z = _z0; z <= _z1; z++)
-                {
+                for (int z = _z0; z <= _z1; z++) {
                     int zz = z % zChunks;
-                    if(zz < 0)
-                    {
+                    if (zz < 0) {
                         zz += zChunks;
                     }
                     int p = (zz * yChunks + yy) * xChunks + xx;
 
                     ChunkRenderer renderer = chunkRenderers[p];
-                    if(!renderer.dirty)
-                    {
+                    if (!renderer.dirty) {
                         dirtyChunks.add(renderer);
                         renderer.setDirty();
                     }
@@ -2045,23 +1911,18 @@ public class RenderGlobal
     }
 
     @Override
-    public void blockChanged(int x, int y, int z)
-    {
+    public void blockChanged(int x, int y, int z) {
         setDirty(x - 1, y - 1, z - 1, x + 1, y + 1, z + 1);
     }
 
     @Override
-    public void setBlocksDirty(int x0, int y0, int z0, int x1, int y1, int z1)
-    {
+    public void setBlocksDirty(int x0, int y0, int z0, int x1, int y1, int z1) {
         setDirty(x0 - 1, y0 - 1, z0 - 1, x1 + 1, y1 + 1, z1 + 1);
     }
 
-    public void cull(CameraFrustum frustum, float partialTick)
-    {
-        for(int i = 0; i < chunkRenderers.length; i++)
-        {
-            if(!chunkRenderers[i].isEmpty() && (!chunkRenderers[i].visible || (i + cullStep & 0xf) == 0))
-            {
+    public void cull(CameraFrustum frustum, float partialTick) {
+        for (int i = 0; i < chunkRenderers.length; i++) {
+            if (!chunkRenderers[i].isEmpty() && (!chunkRenderers[i].visible || (i + cullStep & 0xf) == 0)) {
                 chunkRenderers[i].cull(frustum, partialTick);
             }
         }
@@ -2070,11 +1931,9 @@ public class RenderGlobal
     }
 
     @Override
-	public void playStreamingMusic(String soundPath, String author, int x, int y, int z)
-    {
-        if(soundPath != null)
-        {
-            if (author != null && !author.isEmpty()){
+    public void playStreamingMusic(String soundPath, String author, int x, int y, int z) {
+        if (soundPath != null) {
+            if (author != null && !author.isEmpty()) {
                 mc.hudIngame.setRecordPlayingMessage(author + " - " + I18n.getInstance().translateKey(soundPath));
             } else {
                 mc.hudIngame.setRecordPlayingMessage(I18n.getInstance().translateKey(soundPath));
@@ -2084,69 +1943,63 @@ public class RenderGlobal
     }
 
     @Override
-	public void playSound(Entity player, String soundPath, SoundCategory category, double x, double y, double z,
-                          float volume, float pitch)
-    {
-        mc.sndManager.playSoundAt(soundPath, category, (float)x, (float)y, (float)z, volume, pitch);
+    public void playSound(Entity player, String soundPath, SoundCategory category, double x, double y, double z,
+                          float volume, float pitch) {
+        mc.sndManager.playSoundAt(soundPath, category, (float) x, (float) y, (float) z, volume, pitch);
     }
-    
+
     @Override
-	public void addParticle(String particleKey, double x, double y, double z, double motionX, double motionY, double motionZ, int data)
-    {
+    public void addParticle(String particleKey, double x, double y, double z, double motionX, double motionY, double motionZ, int data) {
         addParticle(particleKey, x, y, z, motionX, motionY, motionZ, data, 16D);
     }
 
     @Override
-	public void addParticle(String particleId, double x, double y, double z,
-                            double motionX, double motionY, double motionZ, int data, double maxDistance)
-    {
-        if(mc == null || mc.activeCamera == null || mc.particleEngine == null) {
+    public void addParticle(String particleId, double x, double y, double z,
+                            double motionX, double motionY, double motionZ, int data, double maxDistance) {
+        if (mc == null || mc.activeCamera == null || mc.particleEngine == null) {
             return;
         }
         double d6 = mc.activeCamera.getX() - x;
         double d7 = mc.activeCamera.getY() - y;
         double d8 = mc.activeCamera.getZ() - z;
-        if(d6 * d6 + d7 * d7 + d8 * d8 > maxDistance * maxDistance)
-        {
+        if (d6 * d6 + d7 * d7 + d8 * d8 > maxDistance * maxDistance) {
             return;
         }
         Particle fx = ParticleDispatcher.getInstance().getDispatch(particleId).newParticle(world, x, y, z, motionX, motionY, motionZ, data);
-        if (fx != null){
+        if (fx != null) {
             mc.particleEngine.add(fx);
         }
     }
-    
-	@Override
-	public void allChanged(boolean lightChanged, boolean seasonChanged) {
-		if(seasonChanged) {
-			Colorizers.update(false);
-		}
-		if(seasonChanged || lightChanged && !LightmapHelper.isLightmapEnabled()) {
-			for(ChunkRenderer chunkRenderer : chunkRenderers) {
-				if(chunkRenderer.skyLit && !chunkRenderer.dirty) {
-					dirtyChunks.add(chunkRenderer);
-					chunkRenderer.setDirty();
-				}
-			}
-		}
-	}
 
     @Override
-    public void tileEntityChanged(int x, int y, int z, TileEntity tileEntity)
-    {
+    public void allChanged(boolean lightChanged, boolean seasonChanged) {
+        if (seasonChanged) {
+            Colorizers.update(false);
+        }
+        if (seasonChanged || lightChanged && !LightmapHelper.isLightmapEnabled()) {
+            for (ChunkRenderer chunkRenderer : chunkRenderers) {
+                if (chunkRenderer.skyLit && !chunkRenderer.dirty) {
+                    dirtyChunks.add(chunkRenderer);
+                    chunkRenderer.setDirty();
+                }
+            }
+        }
+    }
+
+    @Override
+    public void tileEntityChanged(int x, int y, int z, TileEntity tileEntity) {
     }
 
-    public void deleteChunkLists()
-    {
+    public void deleteChunkLists() {
         if (chunkLists >= 0) {
             GLAllocation.deleteDisplayList(chunkLists);
         }
     }
+
     @Override
-    public void levelEvent(@Nullable Player player, int id, int x, int y, int z, int data)
-    {
+    public void levelEvent(@Nullable Player player, int id, int x, int y, int z, int data) {
         Random random = world.rand;
-        switch(id) {
+        switch (id) {
             default:
                 break;
 
@@ -2167,66 +2020,66 @@ public class RenderGlobal
                 int xOff = direction.getOffsetX();
                 int yOff = direction.getOffsetY();
                 int zOff = direction.getOffsetZ();
-                double px = (double)x + (double)xOff * 0.6D + 0.5D;
-                double py = (double)y + (double)yOff * 0.6D + 0.5D;
-                double pz = (double)z + (double)zOff * 0.6D + 0.5D;
-                for(int i = 0; i < 10; i++) {
+                double px = (double) x + (double) xOff * 0.6D + 0.5D;
+                double py = (double) y + (double) yOff * 0.6D + 0.5D;
+                double pz = (double) z + (double) zOff * 0.6D + 0.5D;
+                for (int i = 0; i < 10; i++) {
                     double rO = random.nextDouble() * 0.2D + 0.01D;
-                    double fx = px + (double)xOff * 0.01D + (random.nextDouble() - 0.5D) * (double)zOff * 0.5D;
-                    double fy = py + (double)yOff * 0.01D + (random.nextDouble() - 0.5D) * (double)yOff * 0.5D;
-                    double fz = pz + (double)zOff * 0.01D + (random.nextDouble() - 0.5D) * (double)xOff * 0.5D;
-                    double mx = (double)xOff * rO + random.nextGaussian() * 0.01D;
-                    double my = (double)yOff * rO + random.nextGaussian() * 0.01D;
-                    double mz = (double)zOff * rO + random.nextGaussian() * 0.01D;
+                    double fx = px + (double) xOff * 0.01D + (random.nextDouble() - 0.5D) * (double) zOff * 0.5D;
+                    double fy = py + (double) yOff * 0.01D + (random.nextDouble() - 0.5D) * (double) yOff * 0.5D;
+                    double fz = pz + (double) zOff * 0.01D + (random.nextDouble() - 0.5D) * (double) xOff * 0.5D;
+                    double mx = (double) xOff * rO + random.nextGaussian() * 0.01D;
+                    double my = (double) yOff * rO + random.nextGaussian() * 0.01D;
+                    double mz = (double) zOff * rO + random.nextGaussian() * 0.01D;
                     addParticle("smoke", fx, fy, fz, mx, my, mz, 0);
                 }
 
                 break;
 
             case EVENT_BLOCK_BREAK: // Block break effect
-                if(data > 0) {
+                if (data > 0) {
                     Block<?> block = Blocks.blocksList[data];
 
-                    world.playBlockSoundEffect(null, (float)x + 0.5F, (float)y + 0.5F, (float)z + 0.5F, block, EnumBlockSoundEffectType.MINE);
+                    world.playBlockSoundEffect(null, (float) x + 0.5F, (float) y + 0.5F, (float) z + 0.5F, block, EnumBlockSoundEffectType.MINE);
                 }
                 mc.particleEngine.destroy(x, y, z, data, world.getBlockMetadata(x, y, z));
                 break;
 
             case EVENT_DOOR_SOUND: // Door sound
-                if(java.lang.Math.random() < 0.5D) {
-                    world.playSoundEffect(null, SoundCategory.WORLD_SOUNDS, (double)x + 0.5D, (double)y + 0.5D, (double)z + 0.5D, "random.door_open", 1.0F, world.rand.nextFloat() * 0.1F + 0.9F);
+                if (java.lang.Math.random() < 0.5D) {
+                    world.playSoundEffect(null, SoundCategory.WORLD_SOUNDS, (double) x + 0.5D, (double) y + 0.5D, (double) z + 0.5D, "random.door_open", 1.0F, world.rand.nextFloat() * 0.1F + 0.9F);
                 } else {
-                    world.playSoundEffect(null, SoundCategory.WORLD_SOUNDS, (double)x + 0.5D, (double)y + 0.5D, (double)z + 0.5D, "random.door_close", 1.0F, world.rand.nextFloat() * 0.1F + 0.9F);
+                    world.playSoundEffect(null, SoundCategory.WORLD_SOUNDS, (double) x + 0.5D, (double) y + 0.5D, (double) z + 0.5D, "random.door_close", 1.0F, world.rand.nextFloat() * 0.1F + 0.9F);
                 }
                 break;
 
             case EVENT_FIRE_EXTINGUISH: // Fire extinguish sound
-                world.playSoundEffect(null, SoundCategory.WORLD_SOUNDS, (float)x + 0.5F, (float)y + 0.5F, (float)z + 0.5F, "random.fizz", 0.5F, 2.6F + (random.nextFloat() - random.nextFloat()) * 0.8F);
+                world.playSoundEffect(null, SoundCategory.WORLD_SOUNDS, (float) x + 0.5F, (float) y + 0.5F, (float) z + 0.5F, "random.fizz", 0.5F, 2.6F + (random.nextFloat() - random.nextFloat()) * 0.8F);
                 break;
 
             case EVENT_JUKEBOX_TOGGLE: // Jukebox play/stop record
-                if(Item.itemsList[data] instanceof ItemDiscMusic) {
-                    ItemDiscMusic record = ((ItemDiscMusic)Item.itemsList[data]);
+                if (Item.itemsList[data] instanceof ItemDiscMusic) {
+                    ItemDiscMusic record = ((ItemDiscMusic) Item.itemsList[data]);
                     world.playRecord(record.recordName, record.recordAuthor, x, y, z);
                 } else {
                     world.playRecord(null, null, x, y, z);
                 }
                 break;
             case EVENT_PISTON_EXTEND: // Piston extend
-                world.playSoundEffect(null, SoundCategory.WORLD_SOUNDS, (double)x + 0.5F, (double)y + 0.5F, (double)z + 0.5F, "tile.piston.out", 0.5F, world.rand.nextFloat() * 0.25F + 0.6F);
+                world.playSoundEffect(null, SoundCategory.WORLD_SOUNDS, (double) x + 0.5F, (double) y + 0.5F, (double) z + 0.5F, "tile.piston.out", 0.5F, world.rand.nextFloat() * 0.25F + 0.6F);
                 break;
             case EVENT_PISTON_RETRACT: // Piston retract
-                world.playSoundEffect(null, SoundCategory.WORLD_SOUNDS, (double)x + 0.5F, (double)y + 0.5F, (double)z + 0.5F, "tile.piston.in", 0.5F, world.rand.nextFloat() * 0.25F + 0.6F);
+                world.playSoundEffect(null, SoundCategory.WORLD_SOUNDS, (double) x + 0.5F, (double) y + 0.5F, (double) z + 0.5F, "tile.piston.in", 0.5F, world.rand.nextFloat() * 0.25F + 0.6F);
                 break;
         }
     }
-    
-	@Override
-	public void entityAdded(Entity entity) {
-	}
-
-	@Override
-	public void entityRemoved(Entity entity) {
-	}
+
+    @Override
+    public void entityAdded(Entity entity) {
+    }
+
+    @Override
+    public void entityRemoved(Entity entity) {
+    }
 
 }
diff --git a/game/client/src/main/java/net/minecraft/client/render/terrain/ChunkRenderer.java b/game/client/src/main/java/net/minecraft/client/render/terrain/ChunkRenderer.java
index 0fd4bcdfc..17cc19e67 100644
--- a/game/client/src/main/java/net/minecraft/client/render/terrain/ChunkRenderer.java
+++ b/game/client/src/main/java/net/minecraft/client/render/terrain/ChunkRenderer.java
@@ -96,7 +96,7 @@ public abstract class ChunkRenderer
         }
     }
     
-    public abstract void rebuild();
+    public abstract boolean rebuild(boolean priority);
     
     public boolean renderBlock(Tessellator tessellator, WorldSource worldSource, BlockModel<?> model, int x, int y, int z) {
     	boolean rendered = false;
@@ -163,7 +163,7 @@ public abstract class ChunkRenderer
 
     public void cull(CameraFrustum frustum, float partialTick)
     {
-        visible = frustum.isVisible(bb, partialTick);
+        visible = true/*frustum.isVisible(bb, partialTick)*/;
     }
 
     public void renderBB()
diff --git a/game/client/src/main/java/net/minecraft/client/render/terrain/ChunkRendererLegacy.java b/game/client/src/main/java/net/minecraft/client/render/terrain/ChunkRendererLegacy.java
index 9691b5268..0d40a5209 100644
--- a/game/client/src/main/java/net/minecraft/client/render/terrain/ChunkRendererLegacy.java
+++ b/game/client/src/main/java/net/minecraft/client/render/terrain/ChunkRendererLegacy.java
@@ -7,6 +7,7 @@ import java.util.Set;
 import net.minecraft.client.render.block.model.BlockModelDispatcher;
 import net.minecraft.core.block.Blocks;
 import net.minecraft.core.block.entity.TileEntity;
+import net.minecraft.core.world.pos.TilePos;
 import org.lwjgl.opengl.GL11;
 
 import net.minecraft.client.render.TileEntityRenderDispatcher;
@@ -24,23 +25,27 @@ public class ChunkRendererLegacy extends ChunkRenderer {
 	}
 
 	@Override
-    public void rebuild()
+    public boolean rebuild(boolean priority)
     {
-        if(!dirty) { return; }
-        updates++;
+        if(!dirty) { return false; }
         final int minX = posX;
         final int minY = posY;
         final int minZ = posZ;
         final int maxX = posX + sizeX;
         final int maxY = posY + sizeY;
         final int maxZ = posZ + sizeZ;
+
+        final int cacheRadius = 1;
+        final ChunkCache chunkcache = new ChunkCache(world, new TilePos(minX - cacheRadius, minY - cacheRadius, minZ - cacheRadius), new TilePos(maxX + cacheRadius, maxY + cacheRadius, maxZ + cacheRadius), priority);
+        if (!chunkcache.allLoaded()) return false;
+
         for(int i = 0; i < MAX_RENDER_PASSES; i++) { empty[i] = true; }
 
         Chunk.isLit = false;
         final Set<TileEntity> lastSpecialTileEntities = new HashSet<>(renderableBlockEntities);
         renderableBlockEntities.clear();
-        final int cacheRadius = 1;
-        final ChunkCache chunkcache = new ChunkCache(world, minX - cacheRadius, minY - cacheRadius, minZ - cacheRadius, maxX + cacheRadius, maxY + cacheRadius, maxZ + cacheRadius);
+        updates++;
+
         int renderPass = 0;
         Tessellator tessellator = Tessellator.instance;
         do
@@ -125,6 +130,7 @@ public class ChunkRendererLegacy extends ChunkRenderer {
         globalRenderableBlockEntities.removeAll(lastSpecialTileEntities);
         skyLit = Chunk.isLit;
         compiled = true;
+        return true;
     }
 
 }
diff --git a/game/client/src/main/java/net/minecraft/client/render/terrain/ChunkRendererMultiDraw.java b/game/client/src/main/java/net/minecraft/client/render/terrain/ChunkRendererMultiDraw.java
index 183ece731..bd8c5a664 100644
--- a/game/client/src/main/java/net/minecraft/client/render/terrain/ChunkRendererMultiDraw.java
+++ b/game/client/src/main/java/net/minecraft/client/render/terrain/ChunkRendererMultiDraw.java
@@ -17,6 +17,7 @@ import net.minecraft.core.block.entity.TileEntity;
 import net.minecraft.core.world.World;
 import net.minecraft.core.world.chunk.Chunk;
 import net.minecraft.core.world.chunk.ChunkCache;
+import net.minecraft.core.world.pos.TilePos;
 
 public class ChunkRendererMultiDraw extends ChunkRenderer {
 
@@ -35,13 +36,11 @@ public class ChunkRendererMultiDraw extends ChunkRenderer {
 	}
 	
 	@Override
-	public void rebuild() {
+	public boolean rebuild(boolean priority) {
 		if(!dirty) {
-			return;
+			return false;
 		}
 		
-		updates++;
-		
 		final int minX = posX;
 		final int minY = posY;
 		final int minZ = posZ;
@@ -51,15 +50,17 @@ public class ChunkRendererMultiDraw extends ChunkRenderer {
 		final int maxZ = posZ + sizeZ;
 		
 		final int renderPassCount = terrainRenderer.MAX_RENDER_PASSES;
-		
+
+		final int cacheRadius = 1;
+		final ChunkCache chunkCache = new ChunkCache(world, new TilePos(minX - cacheRadius, minY - cacheRadius, minZ - cacheRadius), new TilePos(maxX + cacheRadius, maxY + cacheRadius, maxZ + cacheRadius), priority);
+		if (!chunkCache.allLoaded()) return false;
+
 		terrainRenderer.chunkDeleted(this);
-		
 		Chunk.isLit = false;
 		final Set<TileEntity> lastSpecialTileEntities = new HashSet<>(renderableBlockEntities);
 		renderableBlockEntities.clear();
-		
-		final int cacheRadius = 1;
-		final ChunkCache chunkCache = new ChunkCache(world, minX - cacheRadius, minY - cacheRadius, minZ - cacheRadius, maxX + cacheRadius, maxY + cacheRadius, maxZ + cacheRadius);
+
+		updates++;
 
 		TessellatorStandard tessellator = (TessellatorStandard) Tessellator.instance;
 		for(int renderPass = 0; renderPass < renderPassCount; renderPass++) {
@@ -129,6 +130,7 @@ public class ChunkRendererMultiDraw extends ChunkRenderer {
 		globalRenderableBlockEntities.removeAll(lastSpecialTileEntities);
 		skyLit = Chunk.isLit;
 		compiled = true;
+		return true;
 	}
 	
 	@Override
diff --git a/game/client/src/main/java/net/minecraft/client/render/terrain/RegionBuffer.java b/game/client/src/main/java/net/minecraft/client/render/terrain/RegionBuffer.java
index af39ef45d..5b11603b8 100644
--- a/game/client/src/main/java/net/minecraft/client/render/terrain/RegionBuffer.java
+++ b/game/client/src/main/java/net/minecraft/client/render/terrain/RegionBuffer.java
@@ -2,6 +2,7 @@ package net.minecraft.client.render.terrain;
 
 import it.unimi.dsi.fastutil.ints.Int2ObjectArrayMap;
 import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
+import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
 
 import java.util.ArrayList;
 import java.util.Collections;
@@ -13,7 +14,7 @@ public class RegionBuffer {
 	
 	public final int regionSizeShift;
 	
-	private final Int2ObjectMap<RenderRegion> regionMap = new Int2ObjectArrayMap<>();
+	private final Int2ObjectMap<RenderRegion> regionMap = new Int2ObjectOpenHashMap<>();
 	private final List<RenderRegion> regionList = new ArrayList<>();
 	private final List<RenderRegion> immutableRegionList = Collections.unmodifiableList(regionList);
 	
diff --git a/game/client/src/main/java/net/minecraft/client/util/dispatch/Dispatcher.java b/game/client/src/main/java/net/minecraft/client/util/dispatch/Dispatcher.java
index 9503d913b..59448f612 100644
--- a/game/client/src/main/java/net/minecraft/client/util/dispatch/Dispatcher.java
+++ b/game/client/src/main/java/net/minecraft/client/util/dispatch/Dispatcher.java
@@ -1,5 +1,7 @@
 package net.minecraft.client.util.dispatch;
 
+import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
+
 import java.util.HashMap;
 import java.util.Map;
 
@@ -9,7 +11,7 @@ public abstract class Dispatcher<T, U> {
     protected final Map<T, U> dispatches;
 
     public Dispatcher() {
-        dispatches = new HashMap<>();
+        dispatches = new Object2ObjectOpenHashMap<>();
     }
 
     /**
diff --git a/game/client/src/main/java/net/minecraft/client/world/WorldClient.java b/game/client/src/main/java/net/minecraft/client/world/WorldClient.java
index 3f3239bd4..05b920551 100644
--- a/game/client/src/main/java/net/minecraft/client/world/WorldClient.java
+++ b/game/client/src/main/java/net/minecraft/client/world/WorldClient.java
@@ -1,5 +1,6 @@
 package net.minecraft.client.world;
 
+import net.minecraft.client.Minecraft;
 import net.minecraft.client.render.LightmapHelper;
 import net.minecraft.client.render.camera.ICamera;
 import net.minecraft.client.render.colorizer.Colorizers;
@@ -169,4 +170,9 @@ public class WorldClient extends World {
     public int getLightmapCoord(int skyLight, int blockLight) {
         return LightmapHelper.getLightmapCoord(skyLight, blockLight);
     }
+
+    @Override
+    public int renderDistance() {
+        return Minecraft.getMinecraft().gameSettings.renderDistance.value;
+    }
 }
diff --git a/game/client/src/main/java/net/minecraft/client/world/WorldClientMP.java b/game/client/src/main/java/net/minecraft/client/world/WorldClientMP.java
index 82b9e4d56..275f284d6 100644
--- a/game/client/src/main/java/net/minecraft/client/world/WorldClientMP.java
+++ b/game/client/src/main/java/net/minecraft/client/world/WorldClientMP.java
@@ -12,6 +12,7 @@ import net.minecraft.core.world.Dimension;
 import net.minecraft.core.world.chunk.ChunkCoordinates;
 import net.minecraft.core.world.chunk.provider.IChunkProvider;
 import net.minecraft.client.world.save.SaveHandlerClientMP;
+import net.minecraft.core.world.pos.ChunkPos;
 import net.minecraft.core.world.pos.TilePos;
 import org.jetbrains.annotations.NotNull;
 
@@ -125,7 +126,7 @@ public class WorldClientMP extends WorldClient {
             chunkCache.prepareChunk(chunkX, chunkZ);
         } else
         {
-            chunkCache.dropChunk(chunkX, chunkZ);
+            chunkCache.dropChunk(new ChunkPos(chunkX, chunkZ));
         }
         if(!playerAdded)
         {
diff --git a/game/client/src/main/java/net/minecraft/client/world/chunk/provider/ChunkProviderClient.java b/game/client/src/main/java/net/minecraft/client/world/chunk/provider/ChunkProviderClient.java
index dcf3da443..e8671ca22 100644
--- a/game/client/src/main/java/net/minecraft/client/world/chunk/provider/ChunkProviderClient.java
+++ b/game/client/src/main/java/net/minecraft/client/world/chunk/provider/ChunkProviderClient.java
@@ -3,113 +3,97 @@ package net.minecraft.client.world.chunk.provider;
 import net.minecraft.core.world.ProgressListener;
 import net.minecraft.core.world.World;
 import net.minecraft.core.world.chunk.Chunk;
-import net.minecraft.core.world.chunk.ChunkCoordinate;
 import net.minecraft.core.world.chunk.EmptyChunk;
 import net.minecraft.core.world.chunk.provider.IChunkProvider;
+import net.minecraft.core.world.pos.ChunkPos;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 
 import java.util.*;
 
 public class ChunkProviderClient
-    implements IChunkProvider
-{
-
-    public ChunkProviderClient(World world)
-    {
-        chunkMapping = new HashMap<>();
-        chunks = new ArrayList<>();
-        blankChunk = new EmptyChunk(world, 0, 0);
-        worldObj = world;
+    implements IChunkProvider {
+    private final @NotNull Chunk blankChunk;
+    private final @NotNull Map<ChunkPos, Chunk> chunkMapping;
+    private final @NotNull List<Chunk> chunks;
+    private final @NotNull World worldObj;
+
+
+    public ChunkProviderClient(@NotNull World world) {
+        this.chunkMapping = new HashMap<>();
+        this.chunks = new ArrayList<>();
+        this.blankChunk = new EmptyChunk(world, 0, 0);
+        this.worldObj = world;
     }
 
     @Override
-    public boolean isChunkLoaded(int chunkX, int chunkZ)
-    {
-        return this.chunkMapping.containsKey(new ChunkCoordinate(chunkX, chunkZ));
+    public boolean isChunkLoaded(@NotNull ChunkPos chunkPos) {
+        return this.chunkMapping.containsKey(chunkPos);
     }
 
     @Override
-    public void regenerateChunk(int chunkX, int chunkZ)
-    {
+    public void regenerateChunk(@NotNull ChunkPos chunkPos) {
     }
 
-    public void dropChunk(int chunkX, int chunkZ)
-    {
-        Chunk chunk = provideChunk(chunkX, chunkZ);
-        if(!chunk.isChunkEmpty())
-        {
+    public void dropChunk(@NotNull ChunkPos chunkPos) {
+        Chunk chunk = provideChunk(chunkPos, true);
+        if (!chunk.isChunkEmpty()) {
             chunk.onUnload();
         }
-        chunkMapping.remove(new ChunkCoordinate(chunkX, chunkZ));
-        chunks.remove(chunk);
+        this.chunkMapping.remove(chunkPos);
+        this.chunks.remove(chunk);
     }
 
     @Override
-    public Chunk prepareChunk(int chunkX, int chunkZ)
-    {
-        ChunkCoordinate chunkcoordintpair = new ChunkCoordinate(chunkX, chunkZ);
-        if (chunkMapping.containsKey(chunkcoordintpair)) return chunkMapping.get(chunkcoordintpair);
-        Chunk chunk = new Chunk(worldObj, chunkX, chunkZ);
-        chunkMapping.put(chunkcoordintpair, chunk);
+    public @NotNull Chunk prepareChunk(@NotNull ChunkPos chunkPos, boolean priority) {
+        if (this.chunkMapping.containsKey(chunkPos)) return this.chunkMapping.get(chunkPos);
+        Chunk chunk = new Chunk(this.worldObj, new ChunkPos(chunkPos));
+        this.chunkMapping.put(chunk.pos, chunk);
         chunk.isLoaded = true;
         return chunk;
     }
 
     @Override
-    public Chunk provideChunk(int chunkX, int chunkZ)
-    {
-        ChunkCoordinate coordinate = new ChunkCoordinate(chunkX, chunkZ);
-        Chunk chunk = chunkMapping.get(coordinate);
-        if(chunk == null)
-        {
-            return blankChunk;
-        } else
-        {
+    public @NotNull Chunk provideChunk(@NotNull ChunkPos chunkPos, boolean priority) {
+        Chunk chunk = this.chunkMapping.get(chunkPos);
+        if (chunk == null) {
+            return this.blankChunk;
+        } else {
             return chunk;
         }
     }
 
     @Override
-    public boolean saveChunks(boolean saveImmediately, ProgressListener progressUpdate)
-    {
+    public boolean saveChunks(boolean saveImmediately, @Nullable ProgressListener progressListener) {
 
         return true;
     }
 
     @Override
-    public boolean tick()
-    {
+    public boolean tick() {
         return false;
     }
-    
+
     @Override
-    public void unloadAllChunks()
-	{
-	}
+    public void unloadAllChunks() {
+    }
 
     @Override
-    public boolean canSave()
-    {
+    public boolean canSave() {
         return false;
     }
 
     @Override
-    public void populate(IChunkProvider chunkProvider, int chunkX, int chunkZ)
-    {
+    public void populate(@NotNull ChunkPos chunkPos) {
     }
 
     @Override
-    public String getInfoString()
-    {
-        return "MultiplayerChunkCache: " + chunkMapping.size();
+    public @NotNull String getInfoString() {
+        return "MultiplayerChunkCache: " + this.chunkMapping.size();
     }
 
     @Override
-    public void setCurrentChunkOver(int chunkX, int chunkZ) {
+    public void setCurrentChunkOver(@NotNull ChunkPos chunkPos) {
         // Do nothing
     }
-
-    private final Chunk blankChunk;
-    private final Map<ChunkCoordinate, Chunk> chunkMapping;
-    private final List<Chunk> chunks;
-    private final World worldObj;
 }
diff --git a/game/client/src/main/java/net/minecraft/client/world/chunk/provider/ChunkProviderDynamic.java b/game/client/src/main/java/net/minecraft/client/world/chunk/provider/ChunkProviderDynamic.java
index 840a5abe3..456ce584e 100644
--- a/game/client/src/main/java/net/minecraft/client/world/chunk/provider/ChunkProviderDynamic.java
+++ b/game/client/src/main/java/net/minecraft/client/world/chunk/provider/ChunkProviderDynamic.java
@@ -1,33 +1,30 @@
 package net.minecraft.client.world.chunk.provider;
 
 import com.mojang.logging.LogUtils;
-import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
-import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
-import it.unimi.dsi.fastutil.ints.IntArraySet;
-import it.unimi.dsi.fastutil.ints.IntSet;
-import net.minecraft.client.Minecraft;
 import net.minecraft.core.world.ProgressListener;
 import net.minecraft.core.world.World;
 import net.minecraft.core.world.chunk.*;
 import net.minecraft.core.world.chunk.provider.IChunkProvider;
 import net.minecraft.core.world.generate.chunk.ChunkGenerator;
+import net.minecraft.core.world.pos.ChunkPos;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 import org.slf4j.Logger;
 
 import java.io.IOException;
 import java.util.*;
 
-public class ChunkProviderDynamic implements IChunkProvider
-{
+public class ChunkProviderDynamic implements IChunkProvider {
     public static final int CHUNK_RADIUS = 32;
     private static final Logger LOGGER = LogUtils.getLogger();
-    private final IntSet droppedChunksSet;
+    private final Set<ChunkPos> droppedChunksSet;
     private final Chunk emptyChunk;
-    public ChunkGenerator chunkGenerator;
-    private final IChunkLoader chunkLoader;
-    private final Int2ObjectMap<Chunk> chunkMap;
-    private final Int2ObjectMap<Chunk> forceLoadedChunkMap;
-    private final List<Chunk> forceLoadedChunkList;
-    private final World world;
+    public @Nullable ChunkGenerator chunkGenerator;
+    private final @Nullable IChunkLoader chunkLoader;
+    private final @NotNull Map<@NotNull ChunkPos, @NotNull Chunk> chunkMap;
+    private final @NotNull Map<@NotNull ChunkPos, @NotNull Chunk> forceLoadedChunkMap;
+    private final @NotNull List<Chunk> forceLoadedChunkList;
+    private final @NotNull World world;
     private int currentChunkX;
     private int currentChunkZ;
     public int forceLoadedChunksLimit = 64;
@@ -36,239 +33,207 @@ public class ChunkProviderDynamic implements IChunkProvider
     private int lastQueriedChunkZPos;
     private Chunk lastQueriedChunk;
 
-    public ChunkProviderDynamic(World world, IChunkLoader chunkLoader, ChunkGenerator chunkGenerator)
-    {
-        droppedChunksSet = new IntArraySet();
-        chunkMap = new Int2ObjectOpenHashMap<>();
-        forceLoadedChunkList = new ArrayList<>();
-        forceLoadedChunkMap = new Int2ObjectOpenHashMap<>();
-        emptyChunk = new EmptyChunk(world, 0, 0);
+    public ChunkProviderDynamic(@NotNull World world, @Nullable IChunkLoader chunkLoader, @Nullable ChunkGenerator chunkGenerator) {
+        this.droppedChunksSet = new HashSet<>();
+        this.chunkMap = new HashMap<>();
+        this.forceLoadedChunkList = new ArrayList<>();
+        this.forceLoadedChunkMap = new HashMap<>();
+        this.emptyChunk = new EmptyChunk(world, 0, 0);
         this.world = world;
         this.chunkLoader = chunkLoader;
         this.chunkGenerator = chunkGenerator;
     }
 
     @Override
-    public boolean isChunkLoaded(int chunkX, int chunkZ) {
-        int id = ChunkCoordinate.toInt(chunkX, chunkZ);
-        if(canChunkBeUnloaded(chunkX, chunkZ)) {
-            if(chunkMap.containsKey(id)) droppedChunksSet.add(id);
+    public boolean isChunkLoaded(@NotNull ChunkPos chunkPos) {
+
+        if (canChunkBeUnloaded(chunkPos)) {
+            if (this.chunkMap.containsKey(chunkPos)) this.droppedChunksSet.add(chunkPos);
             return false;
         }
-        Chunk chunk = chunkMap.get(id);
-        return chunk == emptyChunk || (chunk != null && chunk.isAtLocation(chunkX, chunkZ));
+        Chunk chunk = this.chunkMap.get(chunkPos);
+        return chunk == this.emptyChunk || (chunk != null && chunk.isAtLocation(chunkPos));
     }
 
-    public boolean canChunkBeUnloaded(int chunkX, int chunkZ) {
-        int id = ChunkCoordinate.toInt(chunkX, chunkZ);
-        if(forceLoadedChunkMap.containsKey(id)) return false;
+    public boolean canChunkBeUnloaded(@NotNull ChunkPos chunkPos) {
+
+        if (this.forceLoadedChunkMap.containsKey(chunkPos)) return false;
         int renderDistance = CHUNK_RADIUS - 1;
-        return !(chunkX >= currentChunkX - renderDistance && chunkZ >= currentChunkZ - renderDistance && chunkX <= currentChunkX + renderDistance && chunkZ <= currentChunkZ + renderDistance);
+        return !(chunkPos.x >= this.currentChunkX - renderDistance && chunkPos.z >= this.currentChunkZ - renderDistance && chunkPos.x <= this.currentChunkX + renderDistance && chunkPos.z <= this.currentChunkZ + renderDistance);
     }
 
     @Override
-    public Chunk provideChunk(int chunkX, int chunkZ) {
-        if(chunkX == lastQueriedChunkXPos && chunkZ == lastQueriedChunkZPos && lastQueriedChunk != null)
-        {
-            return lastQueriedChunk;
+    public @NotNull Chunk provideChunk(@NotNull ChunkPos chunkPos, boolean priority) {
+        if (chunkPos.x == this.lastQueriedChunkXPos && chunkPos.z == this.lastQueriedChunkZPos && this.lastQueriedChunk != null) {
+            return this.lastQueriedChunk;
         }
-        if(!world.findingSpawnPoint && canChunkBeUnloaded(chunkX, chunkZ)) return emptyChunk;
-        int id = ChunkCoordinate.toInt(chunkX, chunkZ);
-        if(!isChunkLoaded(chunkX, chunkZ)) {
-            if(chunkMap.get(id) != null){
-                Chunk chunk = chunkMap.get(id);
+        if (!this.world.findingSpawnPoint && canChunkBeUnloaded(chunkPos)) return this.emptyChunk;
+
+        if (!isChunkLoaded(chunkPos.x, chunkPos.z)) {
+            if (this.chunkMap.get(chunkPos) != null) {
+                Chunk chunk = this.chunkMap.get(chunkPos);
                 saveChunk(chunk);
                 chunk.onUnload();
             }
-            Chunk chunk = loadChunk(chunkX, chunkZ);
-            if(chunk == null)
-            {
-                if (chunkGenerator != null)
-                {
-                    chunk = chunkGenerator.generate(chunkX, chunkZ);
+            Chunk chunk = loadChunk(chunkPos.x, chunkPos.z);
+            if (chunk == null) {
+                if (this.chunkGenerator != null) {
+                    chunk = this.chunkGenerator.generate(chunkPos.x, chunkPos.z);
                     chunk.fixMissingBlocks();
-                }
-                else
-                {
-                    chunk = emptyChunk;
+                } else {
+                    chunk = this.emptyChunk;
                 }
             }
-            chunkMap.put(id, chunk);
+            this.chunkMap.put(new ChunkPos(chunkPos), chunk);
+            chunk.checkForLightGaps();
             chunk.onLoad();
-            if(chunk.isTerrainPopulated && isChunkLoaded(chunkX + 1, chunkZ + 1) && isChunkLoaded(chunkX, chunkZ + 1) && isChunkLoaded(chunkX + 1, chunkZ))
-            {
-                populate(this, chunkX, chunkZ);
+            if (chunk.isTerrainPopulated && isChunkLoaded(chunkPos.x + 1, chunkPos.z + 1) && isChunkLoaded(chunkPos.x, chunkPos.z + 1) && isChunkLoaded(chunkPos.x + 1, chunkPos.z)) {
+                populate(this, chunkPos.x, chunkPos.z);
             }
-            if(isChunkLoaded(chunkX - 1, chunkZ) && !provideChunk(chunkX - 1, chunkZ).isTerrainPopulated && isChunkLoaded(chunkX - 1, chunkZ + 1) && isChunkLoaded(chunkX, chunkZ + 1) && isChunkLoaded(chunkX - 1, chunkZ))
-            {
-                populate(this, chunkX - 1, chunkZ);
+            if (isChunkLoaded(chunkPos.x - 1, chunkPos.z) && !provideChunk(chunkPos.x - 1, chunkPos.z).isTerrainPopulated && isChunkLoaded(chunkPos.x - 1, chunkPos.z + 1) && isChunkLoaded(chunkPos.x, chunkPos.z + 1) && isChunkLoaded(chunkPos.x - 1, chunkPos.z)) {
+                populate(this, chunkPos.x - 1, chunkPos.z);
             }
-            if(isChunkLoaded(chunkX, chunkZ - 1) && !provideChunk(chunkX, chunkZ - 1).isTerrainPopulated && isChunkLoaded(chunkX + 1, chunkZ - 1) && isChunkLoaded(chunkX, chunkZ - 1) && isChunkLoaded(chunkX + 1, chunkZ))
-            {
-                populate(this, chunkX, chunkZ - 1);
+            if (isChunkLoaded(chunkPos.x, chunkPos.z - 1) && !provideChunk(chunkPos.x, chunkPos.z - 1).isTerrainPopulated && isChunkLoaded(chunkPos.x + 1, chunkPos.z - 1) && isChunkLoaded(chunkPos.x, chunkPos.z - 1) && isChunkLoaded(chunkPos.x + 1, chunkPos.z)) {
+                populate(this, chunkPos.x, chunkPos.z - 1);
             }
-            if(isChunkLoaded(chunkX - 1, chunkZ - 1) && !provideChunk(chunkX - 1, chunkZ - 1).isTerrainPopulated && isChunkLoaded(chunkX - 1, chunkZ - 1) && isChunkLoaded(chunkX, chunkZ - 1) && isChunkLoaded(chunkX - 1, chunkZ))
-            {
-                populate(this, chunkX - 1, chunkZ - 1);
+            if (isChunkLoaded(chunkPos.x - 1, chunkPos.z - 1) && !provideChunk(chunkPos.x - 1, chunkPos.z - 1).isTerrainPopulated && isChunkLoaded(chunkPos.x - 1, chunkPos.z - 1) && isChunkLoaded(chunkPos.x, chunkPos.z - 1) && isChunkLoaded(chunkPos.x - 1, chunkPos.z)) {
+                populate(this, chunkPos.x - 1, chunkPos.z - 1);
             }
-            if (world.getCurrentWeather() != null)
-            {
-                world.getCurrentWeather().doChunkLoadEffect(world, chunk);
+            if (this.world.getCurrentWeather() != null) {
+                this.world.getCurrentWeather().doChunkLoadEffect(this.world, chunk);
             }
         }
-        lastQueriedChunkXPos = chunkX;
-        lastQueriedChunkZPos = chunkZ;
-        lastQueriedChunk = chunkMap.get(id);;
-        return chunkMap.get(id);
+        this.lastQueriedChunkXPos = chunkPos.x;
+        this.lastQueriedChunkZPos = chunkPos.z;
+        this.lastQueriedChunk = this.chunkMap.get(chunkPos);
+        return this.chunkMap.get(chunkPos);
     }
 
     @Override
-    public Chunk prepareChunk(int chunkX, int chunkZ) {
-        return provideChunk(chunkX, chunkZ);
+    public @NotNull Chunk prepareChunk(@NotNull ChunkPos chunkPos, boolean priority) {
+        return provideChunk(chunkPos, true);
     }
 
     @Override
-    public void regenerateChunk(int chunkX, int chunkZ)
-    {
-        int id = ChunkCoordinate.toInt(chunkX, chunkZ);
-        droppedChunksSet.remove(id);
-        chunkMap.remove(id);
+    public void regenerateChunk(@NotNull ChunkPos chunkPos) {
+
+        this.droppedChunksSet.remove(chunkPos);
+        this.chunkMap.remove(chunkPos);
         Chunk chunk;
-        if (chunkGenerator != null)
-        {
-            chunk = chunkGenerator.generate(chunkX, chunkZ);
+        if (this.chunkGenerator != null) {
+            chunk = this.chunkGenerator.generate(chunkPos.x, chunkPos.z);
             chunk.fixMissingBlocks();
+        } else return;
+        this.chunkMap.put(new ChunkPos(chunkPos), chunk);
+        if (!chunk.isTerrainPopulated && isChunkLoaded(chunkPos.x + 1, chunkPos.z + 1) && isChunkLoaded(chunkPos.x, chunkPos.z + 1) && isChunkLoaded(chunkPos.x + 1, chunkPos.z)) {
+            populate(new ChunkPos(chunkPos.x, chunkPos.z));
         }
-        else return;
-        chunkMap.put(id, chunk);
-        if(!chunk.isTerrainPopulated && isChunkLoaded(chunkX + 1, chunkZ + 1) && isChunkLoaded(chunkX, chunkZ + 1) && isChunkLoaded(chunkX + 1, chunkZ))
-        {
-            populate(this, chunkX, chunkZ);
-        }
-        if(isChunkLoaded(chunkX - 1, chunkZ) && !provideChunk(chunkX - 1, chunkZ).isTerrainPopulated && isChunkLoaded(chunkX - 1, chunkZ + 1) && isChunkLoaded(chunkX, chunkZ + 1) && isChunkLoaded(chunkX - 1, chunkZ))
-        {
-            populate(this, chunkX - 1, chunkZ);
+        if (isChunkLoaded(chunkPos.x - 1, chunkPos.z) && !provideChunk(chunkPos.x - 1, chunkPos.z).isTerrainPopulated && isChunkLoaded(chunkPos.x - 1, chunkPos.z + 1) && isChunkLoaded(chunkPos.x, chunkPos.z + 1) && isChunkLoaded(chunkPos.x - 1, chunkPos.z)) {
+            populate(new ChunkPos(chunkPos.x - 1, chunkPos.z));
         }
-        if(isChunkLoaded(chunkX, chunkZ - 1) && !provideChunk(chunkX, chunkZ - 1).isTerrainPopulated && isChunkLoaded(chunkX + 1, chunkZ - 1) && isChunkLoaded(chunkX, chunkZ - 1) && isChunkLoaded(chunkX + 1, chunkZ))
-        {
-            populate(this, chunkX, chunkZ - 1);
+        if (isChunkLoaded(chunkPos.x, chunkPos.z - 1) && !provideChunk(chunkPos.x, chunkPos.z - 1).isTerrainPopulated && isChunkLoaded(chunkPos.x + 1, chunkPos.z - 1) && isChunkLoaded(chunkPos.x, chunkPos.z - 1) && isChunkLoaded(chunkPos.x + 1, chunkPos.z)) {
+            populate(new ChunkPos(chunkPos.x, chunkPos.z - 1));
         }
-        if(isChunkLoaded(chunkX - 1, chunkZ - 1) && !provideChunk(chunkX - 1, chunkZ - 1).isTerrainPopulated && isChunkLoaded(chunkX - 1, chunkZ - 1) && isChunkLoaded(chunkX, chunkZ - 1) && isChunkLoaded(chunkX - 1, chunkZ))
-        {
-            populate(this, chunkX - 1, chunkZ - 1);
+        if (isChunkLoaded(chunkPos.x - 1, chunkPos.z - 1) && !provideChunk(chunkPos.x - 1, chunkPos.z - 1).isTerrainPopulated && isChunkLoaded(chunkPos.x - 1, chunkPos.z - 1) && isChunkLoaded(chunkPos.x, chunkPos.z - 1) && isChunkLoaded(chunkPos.x - 1, chunkPos.z)) {
+            populate(new ChunkPos(chunkPos.x - 1, chunkPos.z - 1));
         }
     }
 
     @Override
-    public void populate(IChunkProvider chunkProvider, int chunkX, int chunkZ)
-    {
-        Chunk chunk = provideChunk(chunkX, chunkZ);
-        if(!chunk.isTerrainPopulated)
-        {
+    public void populate(@NotNull ChunkPos chunkPos) {
+        Chunk chunk = provideChunk(chunkPos, true);
+        if (!chunk.isTerrainPopulated) {
             chunk.isTerrainPopulated = true;
-            if (this.chunkGenerator != null)
-            {
+            if (this.chunkGenerator != null) {
                 this.chunkGenerator.decorate(chunk);
                 chunk.setChunkModified();
             }
         }
     }
 
-    public boolean keepLoaded(int chunkX, int chunkZ) {
-        int id = ChunkCoordinate.toInt(chunkX, chunkZ);
-        Chunk chunk = chunkMap.get(id);
-        if(!forceLoadedChunkMap.containsKey(id) && forceLoadedChunkList.size() < forceLoadedChunksLimit) {
-            forceLoadedChunkMap.put(id, chunk);
-            forceLoadedChunkList.add(chunk);
+    public boolean keepLoaded(@NotNull ChunkPos chunkPos) {
+
+        Chunk chunk = this.chunkMap.get(chunkPos);
+        if (!this.forceLoadedChunkMap.containsKey(chunkPos) && this.forceLoadedChunkList.size() < this.forceLoadedChunksLimit) {
+            this.forceLoadedChunkMap.put(new ChunkPos(chunkPos), chunk);
+            this.forceLoadedChunkList.add(chunk);
             return true;
         }
         return false;
     }
 
-    public boolean removeFromForceLoaded(int chunkX, int chunkZ){
-        int id = ChunkCoordinate.toInt(chunkX, chunkZ);
-        forceLoadedChunkList.remove(forceLoadedChunkMap.get(id));
-        return forceLoadedChunkMap.remove(id) != null;
+    public boolean removeFromForceLoaded(@NotNull ChunkPos chunkPos) {
+        this.forceLoadedChunkList.remove(this.forceLoadedChunkMap.get(chunkPos));
+        return this.forceLoadedChunkMap.remove(chunkPos) != null;
     }
 
     @Override
-    public boolean saveChunks(boolean saveImmediately, ProgressListener progressUpdate)
-    {
+    public boolean saveChunks(boolean saveImmediately, @Nullable ProgressListener progressListener) {
         int attempts = 0;
         int chunksToBeSaved = 0;
-        if(progressUpdate != null)
-        {
-            for (Chunk chunk : chunkMap.values()) {
-                if(chunk != null && chunk.needsSaving(saveImmediately)) chunksToBeSaved++;
+        if (progressListener != null) {
+            for (Chunk chunk : this.chunkMap.values()) {
+                if (chunk.needsSaving(saveImmediately)) chunksToBeSaved++;
             }
         }
         int progress = 0;
-        for (Chunk chunk : chunkMap.values()) {
-            if(chunk == null) continue;
-            if(!chunk.needsSaving(saveImmediately)) continue;
+        for (Chunk chunk : this.chunkMap.values()) {
+            if (!chunk.needsSaving(saveImmediately)) continue;
             saveChunk(chunk);
             chunk.isModified = false;
-            if(++attempts == 2 && !saveImmediately) return false;
-            if(progressUpdate != null && ++progress % 10 == 0) progressUpdate.progressStagePercentage((progress * 100) / chunksToBeSaved);
+            if (++attempts == 2 && !saveImmediately) return false;
+            if (progressListener != null && ++progress % 10 == 0)
+                progressListener.progressStagePercentage((progress * 100) / chunksToBeSaved);
         }
         return true;
     }
 
-    private void saveChunk(Chunk chunk)
-    {
-        if(chunkLoader == null) return;
-        try
-        {
-            chunk.lastSaveTime = world.getWorldTime();
-            chunkLoader.saveChunk(world, chunk);
-        }
-        catch(IOException ioexception)
-        {
+    private void saveChunk(Chunk chunk) {
+        if (this.chunkLoader == null) return;
+        try {
+            chunk.lastSaveTime = this.world.getWorldTime();
+            this.chunkLoader.saveChunk(this.world, chunk);
+        } catch (IOException ioexception) {
             LOGGER.error("Failed to save chunk at {}, {}!", chunk.pos.x, chunk.pos.z, ioexception);
         }
     }
 
-    private Chunk loadChunk(int x, int y)
-    {
-        if(chunkLoader == null) return emptyChunk;
-        try
-        {
-            Chunk chunk = chunkLoader.loadChunk(world, x, y);
-            if(chunk != null)
-            {
-                chunk.lastSaveTime = world.getWorldTime();
+    private Chunk loadChunk(int x, int y) {
+        if (this.chunkLoader == null) return this.emptyChunk;
+        try {
+            Chunk chunk = this.chunkLoader.loadChunk(this.world, x, y);
+            if (chunk != null) {
+                chunk.lastSaveTime = this.world.getWorldTime();
             }
             return chunk;
-        }
-        catch(Exception exception)
-        {
+        } catch (Exception exception) {
             LOGGER.error("Failed to load chunk at {}, {}!", x, y, exception);
         }
-        return emptyChunk;
+        return this.emptyChunk;
     }
 
     @Override
     public boolean tick() {
         int dropped = 0;
-        for (Chunk chunk : chunkMap.values()) {
-            if(dropped >= maxUnloadPerTick) break;
-            isChunkLoaded(chunk.pos.x, chunk.pos.z); //droppedChunksSet gets updated as side-effect
+        for (Chunk chunk : this.chunkMap.values()) {
+            if (dropped >= this.maxUnloadPerTick) break;
+            isChunkLoaded(chunk.pos); //droppedChunksSet gets updated as side-effect
         }
-        if(!droppedChunksSet.isEmpty()){
+        if (!this.droppedChunksSet.isEmpty()) {
             int unloaded = 0;
-            IntSet copy = new IntArraySet(droppedChunksSet);
-            for (int i : copy) {
-                if(unloaded >= maxUnloadPerTick) break;
-                if(forceLoadedChunkMap.containsKey(i)) continue;
-                if(chunkMap.containsKey(i)){
-                    Chunk chunk = chunkMap.get(i);
+            Set<ChunkPos> copy = new HashSet<>(this.droppedChunksSet);
+            for (ChunkPos pos : copy) {
+                if (unloaded >= this.maxUnloadPerTick) break;
+                if (this.forceLoadedChunkMap.containsKey(pos)) continue;
+                if (this.chunkMap.containsKey(pos)) {
+                    Chunk chunk = this.chunkMap.get(pos);
                     chunk.onUnload();
                     saveChunk(chunk);
-                    chunkMap.remove(i);
-                    droppedChunksSet.remove(i);
+                    this.chunkMap.remove(pos);
+                    this.droppedChunksSet.remove(pos);
                     unloaded++;
                 } else {
-                    droppedChunksSet.remove(i);
+                    this.droppedChunksSet.remove(pos);
                 }
             }
         }
@@ -280,35 +245,35 @@ public class ChunkProviderDynamic implements IChunkProvider
         return true;
     }
 
-    public IChunkLoader getChunkLoader() {
-        return chunkLoader;
+    public @Nullable IChunkLoader getChunkLoader() {
+        return this.chunkLoader;
     }
 
     @Override
-    public String getInfoString() {
-        return "Chunks: " + chunkMap.size() + ", " + "Dropped: " + droppedChunksSet.size()+", "+"Chunkloaded: "+forceLoadedChunkMap.size()+"/"+forceLoadedChunksLimit;
+    public @NotNull String getInfoString() {
+        return "Chunks: " + this.chunkMap.size() + ", " + "Dropped: " + this.droppedChunksSet.size() + ", " + "Chunkloaded: " + this.forceLoadedChunkMap.size() + "/" + this.forceLoadedChunksLimit;
     }
 
     public List<Chunk> getForceLoadedChunks() {
-        return Collections.unmodifiableList(forceLoadedChunkList);
+        return Collections.unmodifiableList(this.forceLoadedChunkList);
     }
 
     @Override
     public void unloadAllChunks() {
-        for (Chunk chunk : chunkMap.values()) {
-            if(chunk != null) chunk.onUnload();
+        for (Chunk chunk : this.chunkMap.values()) {
+            chunk.onUnload();
         }
-        chunkMap.clear();
-        droppedChunksSet.clear();
-        forceLoadedChunkMap.clear();
-        forceLoadedChunkList.clear();
-        chunkGenerator = null;
+        this.chunkMap.clear();
+        this.droppedChunksSet.clear();
+        this.forceLoadedChunkMap.clear();
+        this.forceLoadedChunkList.clear();
+        this.chunkGenerator = null;
         System.gc();
     }
 
     @Override
-    public void setCurrentChunkOver(int chunkX, int chunkZ) {
-        currentChunkX = chunkX;
-        currentChunkZ = chunkZ;
+    public void setCurrentChunkOver(@NotNull ChunkPos chunkPos) {
+        this.currentChunkX = chunkPos.x;
+        this.currentChunkZ = chunkPos.z;
     }
 }
\ No newline at end of file
diff --git a/game/client/src/main/java/net/minecraft/client/world/chunk/provider/ChunkProviderStatic.java b/game/client/src/main/java/net/minecraft/client/world/chunk/provider/ChunkProviderStatic.java
index 6d23651e8..f19a55cdd 100644
--- a/game/client/src/main/java/net/minecraft/client/world/chunk/provider/ChunkProviderStatic.java
+++ b/game/client/src/main/java/net/minecraft/client/world/chunk/provider/ChunkProviderStatic.java
@@ -9,14 +9,16 @@ import net.minecraft.core.world.chunk.EmptyChunk;
 import net.minecraft.core.world.chunk.IChunkLoader;
 import net.minecraft.core.world.chunk.provider.IChunkProvider;
 import net.minecraft.core.world.generate.chunk.ChunkGenerator;
+import net.minecraft.core.world.pos.ChunkPos;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 import org.slf4j.Logger;
 
 import java.io.IOException;
 import java.util.Arrays;
 
 public class ChunkProviderStatic
-    implements IChunkProvider
-{
+    implements IChunkProvider {
     public static final int CHUNK_RADIUS = 32; // Radius should *always* be a power of 2!
     public static final int CHUNK_MASK = CHUNK_RADIUS * 2 - 1;
 
@@ -33,205 +35,161 @@ public class ChunkProviderStatic
     private int curChunkY;
 
 
-    public ChunkProviderStatic(World world, IChunkLoader ichunkloader, ChunkGenerator chunkGenerator)
-    {
-        chunks = new Chunk[CHUNK_RADIUS * 2 * CHUNK_RADIUS * 2];
-        lastQueriedChunkXPos = Integer.MIN_VALUE;
-        lastQueriedChunkZPos = Integer.MIN_VALUE;
-        blankChunk = new EmptyChunk(world, 0, 0);
-        worldObj = world;
-        chunkLoader = ichunkloader;
+    public ChunkProviderStatic(World world, IChunkLoader ichunkloader, ChunkGenerator chunkGenerator) {
+        this.chunks = new Chunk[CHUNK_RADIUS * 2 * CHUNK_RADIUS * 2];
+        this.lastQueriedChunkXPos = Integer.MIN_VALUE;
+        this.lastQueriedChunkZPos = Integer.MIN_VALUE;
+        this.blankChunk = new EmptyChunk(world, 0, 0);
+        this.worldObj = world;
+        this.chunkLoader = ichunkloader;
         this.chunkGenerator = chunkGenerator;
 
     }
 
     @Override
-    public void setCurrentChunkOver(int chunkX, int chunkZ)
-    {
-        curChunkX = chunkX;
-        curChunkY = chunkZ;
+    public void setCurrentChunkOver(@NotNull ChunkPos chunkPos) {
+        this.curChunkX = chunkPos.x;
+        this.curChunkY = chunkPos.z;
     }
 
-    public boolean canChunkExist(int chunkX, int chunkZ)
-    {
+    public boolean canChunkExist(@NotNull ChunkPos chunkPos) {
         byte byte0 = CHUNK_RADIUS - 1;
-        return chunkX >= curChunkX - byte0 && chunkZ >= curChunkY - byte0 && chunkX <= curChunkX + byte0 && chunkZ <= curChunkY + byte0;
+        return chunkPos.x >= this.curChunkX - byte0 && chunkPos.z >= this.curChunkY - byte0 && chunkPos.x <= this.curChunkX + byte0 && chunkPos.z <= this.curChunkY + byte0;
     }
 
     @Override
-    public void regenerateChunk(int chunkX, int chunkZ)
-    {
-        int k = chunkX & CHUNK_MASK;
-        int l = chunkZ & CHUNK_MASK;
+    public void regenerateChunk(@NotNull ChunkPos chunkPos) {
+        int k = chunkPos.x & CHUNK_MASK;
+        int l = chunkPos.z & CHUNK_MASK;
         int i1 = k + l * CHUNK_RADIUS * 2;
         Chunk newChunk;
-        if (chunkGenerator != null)
-        {
-            newChunk = chunkGenerator.generate(chunkX, chunkZ);
+        if (this.chunkGenerator != null) {
+            newChunk = this.chunkGenerator.generate(chunkPos.x, chunkPos.z);
             newChunk.fixMissingBlocks();
-        }
-        else
-        {
+        } else {
             return;
         }
-        chunks[i1] = newChunk;
-        if(!chunks[i1].isTerrainPopulated && isChunkLoaded(chunkX + 1, chunkZ + 1) && isChunkLoaded(chunkX, chunkZ + 1) && isChunkLoaded(chunkX + 1, chunkZ))
-        {
-            populate(this, chunkX, chunkZ);
+        this.chunks[i1] = newChunk;
+        if (!this.chunks[i1].isTerrainPopulated && isChunkLoaded(chunkPos.x + 1, chunkPos.z + 1) && isChunkLoaded(chunkPos.x, chunkPos.z + 1) && isChunkLoaded(chunkPos.x + 1, chunkPos.z)) {
+            populate(this, chunkPos.x, chunkPos.z);
         }
-        if(isChunkLoaded(chunkX - 1, chunkZ) && !provideChunk(chunkX - 1, chunkZ).isTerrainPopulated && isChunkLoaded(chunkX - 1, chunkZ + 1) && isChunkLoaded(chunkX, chunkZ + 1) && isChunkLoaded(chunkX - 1, chunkZ))
-        {
-            populate(this, chunkX - 1, chunkZ);
+        if (isChunkLoaded(chunkPos.x - 1, chunkPos.z) && !provideChunk(chunkPos.x - 1, chunkPos.z).isTerrainPopulated && isChunkLoaded(chunkPos.x - 1, chunkPos.z + 1) && isChunkLoaded(chunkPos.x, chunkPos.z + 1) && isChunkLoaded(chunkPos.x - 1, chunkPos.z)) {
+            populate(this, chunkPos.x - 1, chunkPos.z);
         }
-        if(isChunkLoaded(chunkX, chunkZ - 1) && !provideChunk(chunkX, chunkZ - 1).isTerrainPopulated && isChunkLoaded(chunkX + 1, chunkZ - 1) && isChunkLoaded(chunkX, chunkZ - 1) && isChunkLoaded(chunkX + 1, chunkZ))
-        {
-            populate(this, chunkX, chunkZ - 1);
+        if (isChunkLoaded(chunkPos.x, chunkPos.z - 1) && !provideChunk(chunkPos.x, chunkPos.z - 1).isTerrainPopulated && isChunkLoaded(chunkPos.x + 1, chunkPos.z - 1) && isChunkLoaded(chunkPos.x, chunkPos.z - 1) && isChunkLoaded(chunkPos.x + 1, chunkPos.z)) {
+            populate(this, chunkPos.x, chunkPos.z - 1);
         }
-        if(isChunkLoaded(chunkX - 1, chunkZ - 1) && !provideChunk(chunkX - 1, chunkZ - 1).isTerrainPopulated && isChunkLoaded(chunkX - 1, chunkZ - 1) && isChunkLoaded(chunkX, chunkZ - 1) && isChunkLoaded(chunkX - 1, chunkZ))
-        {
-            populate(this, chunkX - 1, chunkZ - 1);
+        if (isChunkLoaded(chunkPos.x - 1, chunkPos.z - 1) && !provideChunk(chunkPos.x - 1, chunkPos.z - 1).isTerrainPopulated && isChunkLoaded(chunkPos.x - 1, chunkPos.z - 1) && isChunkLoaded(chunkPos.x, chunkPos.z - 1) && isChunkLoaded(chunkPos.x - 1, chunkPos.z)) {
+            populate(this, chunkPos.x - 1, chunkPos.z - 1);
         }
     }
 
     @Override
-    public boolean isChunkLoaded(int chunkX, int chunkZ)
-    {
-        if(!canChunkExist(chunkX, chunkZ))
-        {
+    public boolean isChunkLoaded(@NotNull ChunkPos chunkPos) {
+        if (!canChunkExist(chunkPos)) {
             return false;
         }
-        if(chunkX == lastQueriedChunkXPos && chunkZ == lastQueriedChunkZPos && lastQueriedChunk != null)
-        {
+        if (chunkPos.x == this.lastQueriedChunkXPos && chunkPos.z == this.lastQueriedChunkZPos && this.lastQueriedChunk != null) {
             return true;
-        } else
-        {
-            int k = chunkX & CHUNK_MASK;
-            int l = chunkZ & CHUNK_MASK;
+        } else {
+            int k = chunkPos.x & CHUNK_MASK;
+            int l = chunkPos.z & CHUNK_MASK;
             int chunkIndex = k + l * CHUNK_RADIUS * 2;
-            return chunks[chunkIndex] == blankChunk || (chunks[chunkIndex] != null && chunks[chunkIndex].isAtLocation(chunkX, chunkZ));
+            return this.chunks[chunkIndex] == this.blankChunk || (this.chunks[chunkIndex] != null && this.chunks[chunkIndex].isAtLocation(chunkPos.x, chunkPos.z));
         }
     }
 
     @Override
-    public Chunk prepareChunk(int chunkX, int chunkZ)
-    {
-        return provideChunk(chunkX, chunkZ);
+    public @NotNull Chunk prepareChunk(@NotNull ChunkPos chunkPos, boolean priority) {
+        return provideChunk(chunkPos.x, chunkPos.z);
     }
 
     @Override
-    public Chunk provideChunk(int chunkX, int chunkZ)
-    {
-        if(chunkX == lastQueriedChunkXPos && chunkZ == lastQueriedChunkZPos && lastQueriedChunk != null)
-        {
-            return lastQueriedChunk;
+    public @NotNull Chunk provideChunk(@NotNull ChunkPos chunkPos, boolean priority) {
+        if (chunkPos.x == this.lastQueriedChunkXPos && chunkPos.z == this.lastQueriedChunkZPos && this.lastQueriedChunk != null) {
+            return this.lastQueriedChunk;
         }
-        if(!worldObj.findingSpawnPoint && !canChunkExist(chunkX, chunkZ))
-        {
-            return blankChunk;
+        if (!this.worldObj.findingSpawnPoint && !canChunkExist(chunkPos)) {
+            return this.blankChunk;
         }
-        int k = chunkX & CHUNK_MASK;
-        int l = chunkZ & CHUNK_MASK;
+        int k = chunkPos.x & CHUNK_MASK;
+        int l = chunkPos.z & CHUNK_MASK;
         int i1 = k + l * CHUNK_RADIUS * 2;
-        if(!isChunkLoaded(chunkX, chunkZ))
-        {
-            if(chunks[i1] != null)
-            {
-                saveChunk(chunks[i1]);
-                chunks[i1].onUnload();
+        if (!isChunkLoaded(chunkPos.x, chunkPos.z)) {
+            if (this.chunks[i1] != null) {
+                saveChunk(this.chunks[i1]);
+                this.chunks[i1].onUnload();
             }
-            Chunk chunk = loadChunk(chunkX, chunkZ);
-            if(chunk == null)
-            {
-                if (chunkGenerator != null)
-                {
-                    chunk = chunkGenerator.generate(chunkX, chunkZ);
+            Chunk chunk = loadChunk(chunkPos);
+            if (chunk == null) {
+                if (this.chunkGenerator != null) {
+                    chunk = this.chunkGenerator.generate(chunkPos.x, chunkPos.z);
                     chunk.fixMissingBlocks();
-                }
-                else
-                {
-                    chunk = blankChunk;
+                } else {
+                    chunk = this.blankChunk;
                 }
             }
-            chunks[i1] = chunk;
-            if(chunks[i1] != null)
-            {
-                chunks[i1].onLoad();
+            this.chunks[i1] = chunk;
+            if (this.chunks[i1] != null) {
+                this.chunks[i1].checkForLightGaps();
+                this.chunks[i1].onLoad();
             }
-            if(!chunks[i1].isTerrainPopulated && isChunkLoaded(chunkX + 1, chunkZ + 1) && isChunkLoaded(chunkX, chunkZ + 1) && isChunkLoaded(chunkX + 1, chunkZ))
-            {
-                populate(this, chunkX, chunkZ);
+            if (!this.chunks[i1].isTerrainPopulated && isChunkLoaded(chunkPos.x + 1, chunkPos.z + 1) && isChunkLoaded(chunkPos.x, chunkPos.z + 1) && isChunkLoaded(chunkPos.x + 1, chunkPos.z)) {
+                populate(this, chunkPos.x, chunkPos.z);
             }
-            if(isChunkLoaded(chunkX - 1, chunkZ) && !provideChunk(chunkX - 1, chunkZ).isTerrainPopulated && isChunkLoaded(chunkX - 1, chunkZ + 1) && isChunkLoaded(chunkX, chunkZ + 1) && isChunkLoaded(chunkX - 1, chunkZ))
-            {
-                populate(this, chunkX - 1, chunkZ);
+            if (isChunkLoaded(chunkPos.x - 1, chunkPos.z) && !provideChunk(chunkPos.x - 1, chunkPos.z).isTerrainPopulated && isChunkLoaded(chunkPos.x - 1, chunkPos.z + 1) && isChunkLoaded(chunkPos.x, chunkPos.z + 1) && isChunkLoaded(chunkPos.x - 1, chunkPos.z)) {
+                populate(this, chunkPos.x - 1, chunkPos.z);
             }
-            if(isChunkLoaded(chunkX, chunkZ - 1) && !provideChunk(chunkX, chunkZ - 1).isTerrainPopulated && isChunkLoaded(chunkX + 1, chunkZ - 1) && isChunkLoaded(chunkX, chunkZ - 1) && isChunkLoaded(chunkX + 1, chunkZ))
-            {
-                populate(this, chunkX, chunkZ - 1);
+            if (isChunkLoaded(chunkPos.x, chunkPos.z - 1) && !provideChunk(chunkPos.x, chunkPos.z - 1).isTerrainPopulated && isChunkLoaded(chunkPos.x + 1, chunkPos.z - 1) && isChunkLoaded(chunkPos.x, chunkPos.z - 1) && isChunkLoaded(chunkPos.x + 1, chunkPos.z)) {
+                populate(this, chunkPos.x, chunkPos.z - 1);
             }
-            if(isChunkLoaded(chunkX - 1, chunkZ - 1) && !provideChunk(chunkX - 1, chunkZ - 1).isTerrainPopulated && isChunkLoaded(chunkX - 1, chunkZ - 1) && isChunkLoaded(chunkX, chunkZ - 1) && isChunkLoaded(chunkX - 1, chunkZ))
-            {
-                populate(this, chunkX - 1, chunkZ - 1);
+            if (isChunkLoaded(chunkPos.x - 1, chunkPos.z - 1) && !provideChunk(chunkPos.x - 1, chunkPos.z - 1).isTerrainPopulated && isChunkLoaded(chunkPos.x - 1, chunkPos.z - 1) && isChunkLoaded(chunkPos.x, chunkPos.z - 1) && isChunkLoaded(chunkPos.x - 1, chunkPos.z)) {
+                populate(this, chunkPos.x - 1, chunkPos.z - 1);
             }
-            if (worldObj.getCurrentWeather() != null)
-            {
-                worldObj.getCurrentWeather().doChunkLoadEffect(worldObj, chunk);
+            if (this.worldObj.getCurrentWeather() != null) {
+                this.worldObj.getCurrentWeather().doChunkLoadEffect(this.worldObj, chunk);
             }
         }
-        lastQueriedChunkXPos = chunkX;
-        lastQueriedChunkZPos = chunkZ;
-        lastQueriedChunk = chunks[i1];
-        return chunks[i1];
+        this.lastQueriedChunkXPos = chunkPos.x;
+        this.lastQueriedChunkZPos = chunkPos.z;
+        this.lastQueriedChunk = this.chunks[i1];
+        return this.chunks[i1];
     }
 
-    private Chunk loadChunk(int chunkX, int chunkZ)
-    {
-        if(chunkLoader == null)
-        {
-            return blankChunk;
+    private Chunk loadChunk(@NotNull ChunkPos chunkPos) {
+        if (this.chunkLoader == null) {
+            return this.blankChunk;
         }
-        try
-        {
-            Chunk chunk = chunkLoader.loadChunk(worldObj, chunkX, chunkZ);
-            if(chunk != null)
-            {
-                chunk.lastSaveTime = worldObj.getWorldTime();
+        try {
+            Chunk chunk = this.chunkLoader.loadChunk(this.worldObj, chunkPos.x, chunkPos.z);
+            if (chunk != null) {
+                chunk.lastSaveTime = this.worldObj.getWorldTime();
             }
             return chunk;
+        } catch (Exception exception) {
+            LOGGER.error("Error loading chunk at X:{}, Z:{}", chunkPos.x, chunkPos.z, exception);
         }
-        catch(Exception exception)
-        {
-            LOGGER.error("Error loading chunk at X:{}, Z:{}", chunkX, chunkZ, exception);
-        }
-        return blankChunk;
+        return this.blankChunk;
     }
 
-    private void saveChunk(Chunk chunk)
-    {
-        if(chunkLoader == null)
-        {
+    private void saveChunk(Chunk chunk) {
+        if (this.chunkLoader == null) {
             return;
         }
-        try
-        {
-            chunk.lastSaveTime = worldObj.getWorldTime();
-            chunkLoader.saveChunk(worldObj, chunk);
-        }
-        catch(IOException e)
-        {
+        try {
+            chunk.lastSaveTime = this.worldObj.getWorldTime();
+            this.chunkLoader.saveChunk(this.worldObj, chunk);
+        } catch (IOException e) {
             LOGGER.error("Error saving chunk at X:{}, Z:{}", chunk.pos.x, chunk.pos.x, e);
         }
     }
 
     @Override
-    public void populate(IChunkProvider chunkProvider, int chunkX, int chunkZ)
-    {
-        Chunk chunk = provideChunk(chunkX, chunkZ);
-        if(!chunk.isTerrainPopulated)
-        {
+    public void populate(@NotNull ChunkPos chunkPos) {
+        Chunk chunk = provideChunk(chunkPos, true);
+        if (!chunk.isTerrainPopulated) {
             chunk.isTerrainPopulated = true;
-            if (this.chunkGenerator != null)
-            {
+            if (this.chunkGenerator != null) {
                 this.chunkGenerator.decorate(chunk);
                 chunk.setChunkModified();
             }
@@ -239,41 +197,32 @@ public class ChunkProviderStatic
     }
 
     @Override
-    public boolean saveChunks(boolean saveImmediately, ProgressListener progressUpdate)
-    {
+    public boolean saveChunks(boolean saveImmediately, @Nullable ProgressListener progressListener) {
         int i = 0;
         int j = 0;
-        if(progressUpdate != null)
-        {
-            for(int k = 0; k < chunks.length; k++)
-            {
-                if(chunks[k] != null && chunks[k].needsSaving(saveImmediately))
-                {
+        if (progressListener != null) {
+            for (int k = 0; k < this.chunks.length; k++) {
+                if (this.chunks[k] != null && this.chunks[k].needsSaving(saveImmediately)) {
                     j++;
                 }
             }
 
         }
         int l = 0;
-        for(int i1 = 0; i1 < chunks.length; i1++)
-        {
-            if(chunks[i1] == null)
-            {
+        for (int i1 = 0; i1 < this.chunks.length; i1++) {
+            if (this.chunks[i1] == null) {
                 continue;
             }
-            if(!chunks[i1].needsSaving(saveImmediately))
-            {
+            if (!this.chunks[i1].needsSaving(saveImmediately)) {
                 continue;
             }
-            saveChunk(chunks[i1]);
-            chunks[i1].isModified = false;
-            if(++i == 2 && !saveImmediately)
-            {
+            saveChunk(this.chunks[i1]);
+            this.chunks[i1].isModified = false;
+            if (++i == 2 && !saveImmediately) {
                 return false;
             }
-            if(progressUpdate != null && ++l % 10 == 0)
-            {
-                progressUpdate.progressStagePercentage((l * 100) / j);
+            if (progressListener != null && ++l % 10 == 0) {
+                progressListener.progressStagePercentage((l * 100) / j);
             }
         }
 
@@ -281,35 +230,31 @@ public class ChunkProviderStatic
     }
 
     @Override
-    public boolean tick()
-    {
+    public boolean tick() {
         return false;
     }
 
     @Override
-    public void unloadAllChunks()
-    {
-        for (Chunk chunk : chunks) {
+    public void unloadAllChunks() {
+        for (Chunk chunk : this.chunks) {
             if (chunk != null) chunk.onUnload();
         }
-        Arrays.fill(chunks, null);
-        chunkGenerator = null;
-    	System.gc();
+        Arrays.fill(this.chunks, null);
+        this.chunkGenerator = null;
+        System.gc();
     }
 
     @Override
-    public boolean canSave()
-    {
+    public boolean canSave() {
         return true;
     }
 
     @Override
-    public String getInfoString()
-    {
-        return "ChunkCache: " + chunks.length;
+    public @NotNull String getInfoString() {
+        return "ChunkCache: " + this.chunks.length;
     }
 
     public IChunkLoader getChunkLoader() {
-        return chunkLoader;
+        return this.chunkLoader;
     }
 }
diff --git a/game/client/src/main/java/net/minecraft/client/world/chunk/provider/ChunkProviderThreadedClient.java b/game/client/src/main/java/net/minecraft/client/world/chunk/provider/ChunkProviderThreadedClient.java
new file mode 100644
index 000000000..a3466059c
--- /dev/null
+++ b/game/client/src/main/java/net/minecraft/client/world/chunk/provider/ChunkProviderThreadedClient.java
@@ -0,0 +1,39 @@
+package net.minecraft.client.world.chunk.provider;
+
+import net.minecraft.client.Minecraft;
+import net.minecraft.core.entity.player.Player;
+import net.minecraft.core.world.World;
+import net.minecraft.core.world.chunk.IChunkLoader;
+import net.minecraft.core.world.chunk.provider.ChunkProviderThreaded;
+import net.minecraft.core.world.generate.chunk.ChunkGenerator;
+import net.minecraft.core.world.pos.ChunkPos;
+import org.jetbrains.annotations.NotNull;
+
+public class ChunkProviderThreadedClient extends ChunkProviderThreaded {
+    public ChunkProviderThreadedClient(@NotNull World world, @NotNull IChunkLoader chunkLoader, @NotNull ChunkGenerator chunkGenerator) {
+        super(world, chunkLoader, chunkGenerator);
+    }
+
+    @Override
+    protected boolean isChunkValid(@NotNull ChunkPos chunkPos) {
+        Minecraft mc = Minecraft.getMinecraft();
+        int rd = this.world.renderDistance() + 1;
+        if (this.chunkOver != null) {
+            int dx = this.chunkOver.x - chunkPos.x;
+            int dz = this.chunkOver.z - chunkPos.z;
+            if (dx <= 2 && dx >= -2 && dz <= 2 && dz >= -2) {
+                return true;
+            }
+        }
+
+        Player player = mc.thePlayer;
+        if (player != null) {
+            int pCX = ((int) player.x >> 4);
+            int pCZ = ((int) player.z >> 4);
+            int dx = pCX - chunkPos.x;
+            int dz = pCZ - chunkPos.z;
+            return dx <= rd && dx >= -rd && dz <= rd && dz >= -rd;
+        }
+        return false;
+    }
+}
diff --git a/game/client/src/main/java/net/minecraft/client/world/chunk/provider/ChunkProviderViewer.java b/game/client/src/main/java/net/minecraft/client/world/chunk/provider/ChunkProviderViewer.java
index 1819a8502..287109632 100644
--- a/game/client/src/main/java/net/minecraft/client/world/chunk/provider/ChunkProviderViewer.java
+++ b/game/client/src/main/java/net/minecraft/client/world/chunk/provider/ChunkProviderViewer.java
@@ -6,47 +6,52 @@ import net.minecraft.core.world.chunk.Chunk;
 import net.minecraft.core.world.chunk.DisplayChunk;
 import net.minecraft.core.world.chunk.EmptyChunk;
 import net.minecraft.core.world.chunk.provider.IChunkProvider;
+import net.minecraft.core.world.pos.ChunkPos;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 
 public class ChunkProviderViewer implements IChunkProvider {
-    public final Chunk blankChunk;
-    public final Chunk displayChunk;
-    public ChunkProviderViewer(World world){
-        blankChunk = new EmptyChunk(world, 0, 0);
-        displayChunk = new DisplayChunk(world, 0, 0);
+    public final @NotNull Chunk blankChunk;
+    public final @NotNull Chunk displayChunk;
+
+    public ChunkProviderViewer(World world) {
+        this.blankChunk = new EmptyChunk(world, 0, 0);
+        this.displayChunk = new DisplayChunk(world, 0, 0);
     }
+
     @Override
-    public boolean isChunkLoaded(int chunkX, int chunkZ) {
+    public boolean isChunkLoaded(@NotNull ChunkPos chunkPos) {
         return true;
     }
 
     @Override
-    public Chunk provideChunk(int chunkX, int chunkZ) {
-        if (chunkX == 0 && chunkZ == 0){
-            return displayChunk;
+    public @NotNull Chunk provideChunk(@NotNull ChunkPos chunkPos, boolean priority) {
+        if (chunkPos.x == 0 && chunkPos.z == 0) {
+            return this.displayChunk;
         }
-        return blankChunk;
+        return this.blankChunk;
     }
 
     @Override
-    public Chunk prepareChunk(int chunkX, int chunkZ) {
-        if (chunkX == 0 && chunkZ == 0){
-            return displayChunk;
+    public @NotNull Chunk prepareChunk(@NotNull ChunkPos chunkPos, boolean priority) {
+        if (chunkPos.x == 0 && chunkPos.z == 0) {
+            return this.displayChunk;
         }
-        return blankChunk;
+        return this.blankChunk;
     }
 
     @Override
-    public void regenerateChunk(int chunkX, int chunkZ) {
+    public void regenerateChunk(@NotNull ChunkPos chunkPos) {
 
     }
 
     @Override
-    public void populate(IChunkProvider chunkProvider, int chunkX, int chunkZ) {
+    public void populate(@NotNull ChunkPos chunkPos) {
 
     }
 
     @Override
-    public boolean saveChunks(boolean saveImmediately, ProgressListener progressUpdate) {
+    public boolean saveChunks(boolean saveImmediately, @Nullable ProgressListener progressListener) {
         return false;
     }
 
@@ -61,8 +66,8 @@ public class ChunkProviderViewer implements IChunkProvider {
     }
 
     @Override
-    public String getInfoString() {
-        return null;
+    public @NotNull String getInfoString() {
+        return "";
     }
 
     @Override
@@ -71,7 +76,7 @@ public class ChunkProviderViewer implements IChunkProvider {
     }
 
     @Override
-    public void setCurrentChunkOver(int chunkX, int chunkZ) {
+    public void setCurrentChunkOver(@NotNull ChunkPos chunkPos) {
 
     }
 }
diff --git a/game/client/src/main/java/net/minecraft/client/world/chunk/provider/SelectedProvider.java b/game/client/src/main/java/net/minecraft/client/world/chunk/provider/SelectedProvider.java
new file mode 100644
index 000000000..5e05139e2
--- /dev/null
+++ b/game/client/src/main/java/net/minecraft/client/world/chunk/provider/SelectedProvider.java
@@ -0,0 +1,8 @@
+package net.minecraft.client.world.chunk.provider;
+
+public enum SelectedProvider {
+    STATIC,
+    DYNAMIC,
+    THREADED;
+
+}
diff --git a/game/core/src/main/java/net/minecraft/core/world/SpawnerMobs.java b/game/core/src/main/java/net/minecraft/core/world/SpawnerMobs.java
index 7dfac1349..606fb71d5 100644
--- a/game/core/src/main/java/net/minecraft/core/world/SpawnerMobs.java
+++ b/game/core/src/main/java/net/minecraft/core/world/SpawnerMobs.java
@@ -1,6 +1,7 @@
 package net.minecraft.core.world;
 
 import com.mojang.logging.LogUtils;
+import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
 import net.minecraft.core.block.BlockLogicBed;
 import net.minecraft.core.block.material.Material;
 import net.minecraft.core.data.gamerule.GameRules;
@@ -33,7 +34,7 @@ import java.util.Set;
 public final class SpawnerMobs
 {
     private static final Logger LOGGER = LogUtils.getLogger();
-    private static final Set<ChunkCoordinate> ELIGIBLE_CHUNKS_FOR_SPAWNING = new HashSet<>();
+    private static final Set<ChunkCoordinate> ELIGIBLE_CHUNKS_FOR_SPAWNING = new ObjectOpenHashSet<>();
     private static final Class<? extends Mob>[] NIGHT_SPAWN_ENTITIES;
 
     static
diff --git a/game/core/src/main/java/net/minecraft/core/world/World.java b/game/core/src/main/java/net/minecraft/core/world/World.java
index 240f39051..ffe61ad2c 100644
--- a/game/core/src/main/java/net/minecraft/core/world/World.java
+++ b/game/core/src/main/java/net/minecraft/core/world/World.java
@@ -6,6 +6,8 @@ import java.util.*;
 
 import com.mojang.logging.LogUtils;
 
+import it.unimi.dsi.fastutil.objects.ObjectArrayList;
+import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
 import net.minecraft.core.block.entity.TileEntity;
 import net.minecraft.core.block.support.ISupport;
 import net.minecraft.core.block.support.PartialSupport;
@@ -84,17 +86,17 @@ public class World implements MutableWorldSource {
     public static final int MAX_SCHEDULED_TICKS_IN_TICK = 1000;
     public static final int ANIMATION_TICKS_PER_TICK = 1000;
 
-    public final @NotNull List<@NotNull Entity> entities = new ArrayList<>();
-    private final @NotNull List<@NotNull Entity> entitiesToRemove = new ArrayList<>();
+    public final @NotNull List<@NotNull Entity> entities = new ObjectArrayList<>();
+    private final @NotNull List<@NotNull Entity> entitiesToRemove = new ObjectArrayList<>();
     private final @NotNull TreeSet<@NotNull NextTickListEntry> tickNextTickList = new TreeSet<>();
-    public final @NotNull List<@NotNull TileEntity> tileEntityList = new ArrayList<>();
-    public final @NotNull List<@NotNull Player> players = new ArrayList<>();
-    public final @NotNull List<@NotNull Entity> weatherEffects = new ArrayList<>();
+    public final @NotNull List<@NotNull TileEntity> tileEntityList = new ObjectArrayList<>();
+    public final @NotNull List<@NotNull Player> players = new ObjectArrayList<>();
+    public final @NotNull List<@NotNull Entity> weatherEffects = new ObjectArrayList<>();
     public final @NotNull ArrayList<@NotNull AABB> collidingBoundingBoxes = new ArrayList<>();
-    public final @NotNull List<@NotNull LevelListener> listeners = new ArrayList<>();
-    private final @NotNull Set<@NotNull ChunkCoordinate> positionsToUpdate = new HashSet<>();
-    private final @NotNull List<@NotNull Entity> entityBuffer = new ArrayList<>();
-    private final @NotNull Set<@NotNull NextTickListEntry> immediatelyUpdatedPositions = new HashSet<>();
+    public final @NotNull List<@NotNull LevelListener> listeners = new ObjectArrayList<>();
+    private final @NotNull Set<@NotNull ChunkCoordinate> positionsToUpdate = new ObjectOpenHashSet<>();
+    private final @NotNull List<@NotNull Entity> entityBuffer = new ObjectArrayList<>();
+    private final @NotNull Set<@NotNull NextTickListEntry> immediatelyUpdatedPositions = new ObjectOpenHashSet<>();
 
     public boolean scheduledUpdatesAreImmediate = false;
     public int skyDarken = 0;
@@ -126,11 +128,8 @@ public class World implements MutableWorldSource {
     public int dayCountLastTick;
     
     public BiomeProvider biomeProvider;
-
     public AuroraProvider auroraProvider;
-
     public SeasonManager seasonManager;
-
     public WeatherManager weatherManager;
 
     private CommandManager commandManager;
@@ -409,17 +408,14 @@ public class World implements MutableWorldSource {
         savedDataStorage.save();
     }
 
-    public boolean pauseScreenSave(int i)
-    {
-        if(!chunkProvider.canSave())
-        {
+    public boolean pauseScreenSave(int i) {
+        if(!this.chunkProvider.canSave()) {
             return true;
         }
-        if(i == 0)
-        {
+        if(i == 0) {
             saveWorldData();
         }
-        return chunkProvider.saveChunks(false, null);
+        return this.chunkProvider.saveChunks(false, null);
     }
 
     public @Nullable Weather getCurrentWeather()
@@ -634,7 +630,7 @@ public class World implements MutableWorldSource {
     }
 
     public boolean isChunkLoaded(final @NotNull ChunkPos chunkPos) {
-        return this.chunkProvider.isChunkLoaded(chunkPos.x, chunkPos.z);
+        return this.chunkProvider.isChunkLoaded(chunkPos);
     }
 
     @Deprecated
@@ -652,7 +648,11 @@ public class World implements MutableWorldSource {
     }
 
     public @NotNull Chunk getChunk(final @NotNull ChunkPos chunkPos) {
-        return this.chunkProvider.provideChunk(chunkPos.x, chunkPos.z);
+        return this.chunkProvider.provideChunk(chunkPos, true);
+    }
+
+    public @NotNull Chunk getChunk(final @NotNull ChunkPos chunkPos, boolean priority) {
+        return this.chunkProvider.provideChunk(chunkPos, priority);
     }
 
     @Deprecated
@@ -2149,6 +2149,10 @@ public class World implements MutableWorldSource {
         }
     }
 
+    public void close() {
+        this.chunkProvider.close();
+    }
+
     public void saveWorldIndirectly(ProgressListener iprogressupdate)
     {
         saveWorld(true, iprogressupdate, true);
@@ -2175,6 +2179,10 @@ public class World implements MutableWorldSource {
         );
     }
 
+    public LightingEngine getLightingEngine() {
+        return lightingEngine;
+    }
+
     @Deprecated
     public final void scheduleLightingUpdate(final @NotNull LightLayer lightLayer, final int minX, final int minY, final int minZ, final int maxX, final int maxY, final int maxZ) {
         this.scheduleLightingUpdate(lightLayer, new TilePos(minX, minY, minZ), new TilePos(maxX, maxY, maxZ));
@@ -2574,7 +2582,8 @@ public class World implements MutableWorldSource {
         final @NotNull TilePos cacheMin = entityPos.sub(cacheRadius, cacheRadius, cacheRadius);
         final @NotNull TilePos cacheMax = entityPos.add(cacheRadius, cacheRadius, cacheRadius);
 
-        final @NotNull ChunkCache cache = new ChunkCache(this, cacheMin.x, cacheMin.y, cacheMin.z, cacheMax.x, cacheMax.y, cacheMax.z);
+        final @NotNull ChunkCache cache = new ChunkCache(this, cacheMin, cacheMax, false);
+        if (!cache.allLoaded()) return null;
         return new PathFinder(cache).findPath(entity, tilePos.x, tilePos.y, tilePos.z, distance);
     }
 
@@ -3122,4 +3131,8 @@ public class World implements MutableWorldSource {
             player.sendMessage(message);
         }
     }
+
+    public int renderDistance() {
+        return 12;
+    }
 }
diff --git a/game/core/src/main/java/net/minecraft/core/world/chunk/Chunk.java b/game/core/src/main/java/net/minecraft/core/world/chunk/Chunk.java
index e0f5fe519..03893b515 100644
--- a/game/core/src/main/java/net/minecraft/core/world/chunk/Chunk.java
+++ b/game/core/src/main/java/net/minecraft/core/world/chunk/Chunk.java
@@ -134,7 +134,7 @@ public class Chunk
         averageBlockHeight = acc / (CHUNK_SIZE_X * CHUNK_SIZE_Z);
     }
 
-    public void recalcHeightmap()
+    public void recalcHeightmapAndLightmap()
     {
         recalcHeightmapOnly();
 
@@ -155,14 +155,15 @@ public class Chunk
                 }
             }
         }
+        isModified = true;
+    }
 
+    public void checkForLightGaps() {
         for(int x = 0; x < CHUNK_SIZE_X; x++) {
             for(int z = 0; z < CHUNK_SIZE_Z; z++) {
                 lightGaps(x, z);
             }
         }
-
-        isModified = true;
     }
 
     private void lightGaps(int x, int z) {
diff --git a/game/core/src/main/java/net/minecraft/core/world/chunk/ChunkCache.java b/game/core/src/main/java/net/minecraft/core/world/chunk/ChunkCache.java
index 2ab5f7fb7..cdf186f65 100644
--- a/game/core/src/main/java/net/minecraft/core/world/chunk/ChunkCache.java
+++ b/game/core/src/main/java/net/minecraft/core/world/chunk/ChunkCache.java
@@ -21,22 +21,36 @@ public class ChunkCache
     private final @NotNull Chunk @NotNull [] @NotNull [] chunkArray;
     private final @NotNull World world;
 
-    public ChunkCache(final @NotNull World world, final @NotNull TilePos min, final @NotNull TilePos max) {
+    private final int widthX;
+    private final int widthZ;
+
+    public ChunkCache(final @NotNull World world, final @NotNull TilePos min, final @NotNull TilePos max, boolean priority) {
         this.world = world;
         this.origin = min.toChunkPos();
 
         final @NotNull ChunkPos chunkMax = max.toChunkPos();
-        this.chunkArray = new Chunk[(chunkMax.x - this.origin.x) + 1][(chunkMax.z - this.origin.z) + 1];
-        for (int x = this.origin.x; x <= chunkMax.x; x++) {
-            for (int z = this.origin.z; z <= chunkMax.z; z++) {
-                this.chunkArray[x - this.origin.x][z - this.origin.z] = this.world.getChunk(new ChunkPos(x, z));
+        this.widthX = (chunkMax.x - this.origin.x) + 1;
+        this.widthZ = (chunkMax.z - this.origin.z) + 1;
+        this.chunkArray = new Chunk[this.widthX][this.widthZ];
+        for (int x = 0; x < this.widthX; x++) {
+            for (int z = 0; z < this.widthZ; z++) {
+                this.chunkArray[x][z] = this.world.getChunk(new ChunkPos(x + this.origin.x, z + this.origin.z), priority);
             }
         }
     }
 
     @Deprecated
     public ChunkCache(final @NotNull World world, final int minX, final int minY, final int minZ, final int maxX, final int maxY, final int maxZ) {
-        this(world, new TilePos(minX, minY, minZ), new TilePos(maxX, maxY, maxZ));
+        this(world, new TilePos(minX, minY, minZ), new TilePos(maxX, maxY, maxZ), true);
+    }
+
+    public boolean allLoaded() {
+        for (int x = 0; x < this.widthX; x++) {
+            for (int z = 0; z < this.widthZ; z++) {
+                if (!this.world.isChunkLoaded(new ChunkPos(x + this.origin.x, z + this.origin.z))) return false;
+            }
+        }
+        return true;
     }
 
     @Override
diff --git a/game/core/src/main/java/net/minecraft/core/world/chunk/ChunkLoaderLegacy.java b/game/core/src/main/java/net/minecraft/core/world/chunk/ChunkLoaderLegacy.java
index 139b653f5..f716543c3 100644
--- a/game/core/src/main/java/net/minecraft/core/world/chunk/ChunkLoaderLegacy.java
+++ b/game/core/src/main/java/net/minecraft/core/world/chunk/ChunkLoaderLegacy.java
@@ -265,7 +265,7 @@ public class ChunkLoaderLegacy
         if(chunk.heightMap == null)
         {
             chunk.heightMap = new short[Chunk.CHUNK_SIZE_X * Chunk.CHUNK_SIZE_Z];
-            chunk.recalcHeightmap();
+            chunk.recalcHeightmapAndLightmap();
         }
         if (chunk.temperature == null || chunk.temperature.length == 0)
         {
diff --git a/game/core/src/main/java/net/minecraft/core/world/chunk/ChunkLoaderRegionAsync.java b/game/core/src/main/java/net/minecraft/core/world/chunk/ChunkLoaderRegionAsync.java
index 31f4b3456..a55c108ce 100644
--- a/game/core/src/main/java/net/minecraft/core/world/chunk/ChunkLoaderRegionAsync.java
+++ b/game/core/src/main/java/net/minecraft/core/world/chunk/ChunkLoaderRegionAsync.java
@@ -26,6 +26,7 @@ public class ChunkLoaderRegionAsync
     static
     {
         chunkSaveThread = new ChunkSaveThread();
+        chunkSaveThread.setName("Chunk Save Thread");
         chunkSaveThread.start();
         System.out.println("Spawned new chunk save thread!");
     }
diff --git a/game/core/src/main/java/net/minecraft/core/world/chunk/EmptyChunk.java b/game/core/src/main/java/net/minecraft/core/world/chunk/EmptyChunk.java
index 0d16c9da0..f235c6aab 100644
--- a/game/core/src/main/java/net/minecraft/core/world/chunk/EmptyChunk.java
+++ b/game/core/src/main/java/net/minecraft/core/world/chunk/EmptyChunk.java
@@ -35,7 +35,7 @@ public class EmptyChunk extends Chunk {
     public void recalcHeightmapOnly() { }
 
     @Override
-    public void recalcHeightmap() { }
+    public void recalcHeightmapAndLightmap() { }
 
     @Override
     public int getBlockId(final @NotNull ChunkTilePos tilePos) {
diff --git a/game/core/src/main/java/net/minecraft/core/world/chunk/provider/ChunkProviderThreaded.java b/game/core/src/main/java/net/minecraft/core/world/chunk/provider/ChunkProviderThreaded.java
new file mode 100644
index 000000000..e76ccd3ce
--- /dev/null
+++ b/game/core/src/main/java/net/minecraft/core/world/chunk/provider/ChunkProviderThreaded.java
@@ -0,0 +1,438 @@
+package net.minecraft.core.world.chunk.provider;
+
+import com.mojang.logging.LogUtils;
+import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
+import it.unimi.dsi.fastutil.objects.ObjectArrayList;
+import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
+import net.minecraft.core.entity.player.Player;
+import net.minecraft.core.world.ProgressListener;
+import net.minecraft.core.world.World;
+import net.minecraft.core.world.chunk.Chunk;
+import net.minecraft.core.world.chunk.IChunkLoader;
+import net.minecraft.core.world.generate.chunk.ChunkGenerator;
+import net.minecraft.core.world.pos.ChunkPos;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.slf4j.Logger;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+public class ChunkProviderThreaded implements IChunkProvider {
+    protected static final Logger LOGGER = LogUtils.getLogger();
+    protected static final @NotNull ChunkPos MIN_POS = new ChunkPos(Integer.MIN_VALUE, Integer.MIN_VALUE);
+
+    protected final @NotNull Chunk empty;
+    protected final @NotNull World world;
+    protected final @NotNull IChunkLoader chunkLoader;
+    protected final @NotNull ChunkGenerator chunkGenerator;
+    protected final @NotNull ChunkGenThread genThread;
+
+    protected final @NotNull Map<@NotNull ChunkPos, @NotNull Chunk> loadedChunks = new Object2ObjectOpenHashMap<>();
+    protected final @NotNull Map<@NotNull ChunkPos, @NotNull Chunk> preparedUndecoratedChunks = new Object2ObjectOpenHashMap<>();
+    protected final @NotNull Set<@NotNull Chunk> positionsToCheckIfCanDecorate = new ObjectOpenHashSet<>();
+    protected final @NotNull Set<@NotNull Chunk> positionsToCheckIfCanDecorateCopy = new ObjectOpenHashSet<>();
+    protected @Nullable ChunkPos chunkOver;
+
+    protected @NotNull Chunk lastQueriedChunk;
+    protected @NotNull ChunkPos lastQueriedChunkPos = MIN_POS;
+
+    protected int tickCount = 0;
+
+    public ChunkProviderThreaded(@NotNull World world, @NotNull IChunkLoader chunkLoader, @NotNull ChunkGenerator chunkGenerator) {
+        this.world = world;
+        this.chunkLoader = chunkLoader;
+        this.chunkGenerator = chunkGenerator;
+        this.empty = new Chunk(world, new ChunkPos(0, 0));
+        this.lastQueriedChunk = this.empty;
+
+        this.genThread = new ChunkGenThread(this);
+        this.genThread.setName("Chunk Gen Thread");
+        this.genThread.setDaemon(true);
+        this.genThread.setPriority(Math.max(Thread.currentThread().getPriority() - 1, Thread.MIN_PRIORITY));
+        this.genThread.start();
+    }
+
+    @Override
+    public boolean isChunkLoaded(@NotNull ChunkPos chunkPos) {
+        if (chunkPos.equals(this.lastQueriedChunkPos)) return true;
+        synchronized (this.loadedChunks) {
+            return this.loadedChunks.containsKey(chunkPos);
+        }
+    }
+
+    @Override
+    public @NotNull Chunk provideChunk(@NotNull ChunkPos chunkPos, boolean priority) {
+        if (chunkPos.equals(this.lastQueriedChunkPos)) return this.lastQueriedChunk;
+
+        Chunk chunk;
+        synchronized (this.loadedChunks) {
+            chunk = this.loadedChunks.get(chunkPos);
+        }
+        if (chunk != null) {
+            this.lastQueriedChunkPos = chunkPos;
+            this.lastQueriedChunk = chunk;
+            if (!chunk.isTerrainPopulated) {
+                handleDecoration(chunk);
+            }
+            return chunk;
+        }
+        if (isChunkValid(chunkPos) || this.world.findingSpawnPoint) {
+            if (priority || this.world.findingSpawnPoint) {
+                Chunk c = loadChunk(chunkPos);
+                addChunk(c);
+                return c;
+            } else {
+                this.genThread.queueChunk(chunkPos);
+            }
+        }
+        return this.empty;
+    }
+
+    @Override
+    public @NotNull Chunk prepareChunk(@NotNull ChunkPos chunkPos, boolean priority) {
+        return provideChunk(chunkPos, priority);
+    }
+
+    @Override
+    public void regenerateChunk(@NotNull ChunkPos chunkPos) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void populate(@NotNull ChunkPos chunkPos) {
+        Chunk chunk = provideChunk(chunkPos, true);
+        decorate(chunk);
+    }
+
+    public void decorate(@NotNull Chunk chunk) {
+        if (!chunk.isTerrainPopulated) {
+            chunk.isTerrainPopulated = true;
+            this.chunkGenerator.decorate(chunk);
+            chunk.setChunkModified();
+
+            if (this.world.getCurrentWeather() != null) {
+                this.world.getCurrentWeather().doChunkLoadEffect(this.world, chunk);
+            }
+        }
+    }
+
+    @Override
+    public void setCurrentChunkOver(@NotNull ChunkPos chunkPos) {
+        this.chunkOver = chunkPos;
+    }
+
+    @Override
+    public boolean saveChunks(boolean saveImmediately, @Nullable ProgressListener progressListener) {
+        Collection<Chunk> chunks;
+        synchronized (this.loadedChunks) {
+            chunks = this.loadedChunks.values();
+            int totalNeedSaving = 0;
+            for (Chunk chunk : chunks) {
+                if (chunk.needsSaving(saveImmediately)) {
+                    totalNeedSaving++;
+                }
+            }
+            int chunksSaved = 0;
+            for (Chunk chunk : chunks) {
+                if (chunk.needsSaving(saveImmediately)) {
+                    saveChunk(chunk);
+
+                    if (++chunksSaved > 6 && !saveImmediately) {
+                        return false;
+                    }
+
+                    if (progressListener != null && chunksSaved % 10 == 0) {
+                        progressListener.progressStagePercentage((chunksSaved * 100) / totalNeedSaving);
+                    }
+                }
+            }
+        }
+        return true;
+    }
+
+    @Override
+    public boolean tick() {
+        tickCount++;
+        synchronized (this.preparedUndecoratedChunks) {
+            if (!this.preparedUndecoratedChunks.isEmpty()) {
+                int count = 0;
+                for (Iterator<Chunk> iterator = this.preparedUndecoratedChunks.values().iterator(); iterator.hasNext(); ) {
+                    Chunk chunk = iterator.next();
+                    addChunk(chunk);
+                    iterator.remove();
+                    if (count++ > 4) {
+                        break;
+                    }
+                }
+            }
+        }
+        synchronized (this.positionsToCheckIfCanDecorate) {
+            synchronized (this.positionsToCheckIfCanDecorateCopy) {
+                this.positionsToCheckIfCanDecorateCopy.clear();
+                this.positionsToCheckIfCanDecorateCopy.addAll(this.positionsToCheckIfCanDecorate);
+                this.positionsToCheckIfCanDecorate.clear();
+            }
+        }
+        synchronized (this.positionsToCheckIfCanDecorateCopy) {
+            if (!this.positionsToCheckIfCanDecorateCopy.isEmpty()) {
+                for (Chunk chunk : this.positionsToCheckIfCanDecorateCopy) {
+                    handleDecoration(chunk);
+                }
+                this.positionsToCheckIfCanDecorateCopy.clear();
+            }
+        }
+
+        synchronized (this.loadedChunks) {
+            var itr = this.loadedChunks.entrySet().iterator();
+            while (itr.hasNext()) {
+                var entry = itr.next();
+                ChunkPos pos = entry.getKey();
+                Chunk chunk = entry.getValue();
+                if (!isChunkValid(pos)) {
+                    saveChunk(chunk);
+                    chunk.onUnload();
+                    itr.remove();
+                    if (this.lastQueriedChunkPos.equals(pos)) {
+                        this.lastQueriedChunkPos = MIN_POS;
+                        this.lastQueriedChunk = this.empty;
+                    }
+                }
+            }
+        }
+        return false;
+    }
+
+    private void addChunk(@NotNull Chunk chunk) {
+        synchronized (this.loadedChunks) {
+            if (this.loadedChunks.containsKey(chunk.pos)) {
+                return;
+            }
+            this.loadedChunks.put(chunk.pos, chunk);
+        }
+        chunk.checkForLightGaps();
+        chunk.lastSaveTime = this.world.getWorldTime();
+        chunk.onLoad();
+
+        if (!chunk.isTerrainPopulated) {
+            handleDecoration(chunk);
+        }
+        checkForNeighborDecorations(chunk.pos);
+    }
+
+    private boolean handleDecoration(@NotNull Chunk chunk) {
+        ChunkPos pos = chunk.pos;
+        if (!chunk.isTerrainPopulated && isChunkValid(pos)) {
+            synchronized (this.loadedChunks) {
+                ChunkPos northPos       = pos.add( 0, -1);
+                ChunkPos northEastPos   = pos.add( 1, -1);
+                ChunkPos eastPos        = pos.add( 1,  0);
+                ChunkPos southEastPos   = pos.add( 1,  1);
+                ChunkPos southPos       = pos.add( 0,  1);
+                ChunkPos southWestPos   = pos.add(-1,  1);
+                ChunkPos westPos        = pos.add(-1,  0);
+                ChunkPos northWestPos   = pos.add(-1, -1);
+                boolean northLoaded     = this.loadedChunks.containsKey(northPos);
+                boolean northEastLoaded = this.loadedChunks.containsKey(northEastPos);
+                boolean eastLoaded      = this.loadedChunks.containsKey(eastPos);
+                boolean southEastLoaded = this.loadedChunks.containsKey(southEastPos);
+                boolean southLoaded     = this.loadedChunks.containsKey(southPos);
+                boolean southWestLoaded = this.loadedChunks.containsKey(southWestPos);
+                boolean westLoaded      = this.loadedChunks.containsKey(westPos);
+                boolean northWestLoaded = this.loadedChunks.containsKey(northWestPos);
+                if (northLoaded && northEastLoaded && eastLoaded && southEastLoaded && southLoaded && southWestLoaded && westLoaded && northWestLoaded) {
+                    decorate(chunk);
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
+    protected void checkForNeighborDecorations(@NotNull ChunkPos chunkPos) {
+        ChunkPos northPos       = chunkPos.add( 0, -1);
+        ChunkPos northEastPos   = chunkPos.add( 1, -1);
+        ChunkPos eastPos        = chunkPos.add( 1,  0);
+        ChunkPos southEastPos   = chunkPos.add( 1,  1);
+        ChunkPos southPos       = chunkPos.add( 0,  1);
+        ChunkPos southWestPos   = chunkPos.add(-1,  1);
+        ChunkPos westPos        = chunkPos.add(-1,  0);
+        ChunkPos northWestPos   = chunkPos.add(-1, -1);
+        synchronized (this.positionsToCheckIfCanDecorate) {
+            Chunk c;
+            c = this.loadedChunks.get(northPos);
+            if (c != null && !c.isTerrainPopulated) this.positionsToCheckIfCanDecorate.add(c);
+            c = this.loadedChunks.get(northEastPos);
+            if (c != null && !c.isTerrainPopulated) this.positionsToCheckIfCanDecorate.add(c);
+            c = this.loadedChunks.get(eastPos);
+            if (c != null && !c.isTerrainPopulated) this.positionsToCheckIfCanDecorate.add(c);
+            c = this.loadedChunks.get(southEastPos);
+            if (c != null && !c.isTerrainPopulated) this.positionsToCheckIfCanDecorate.add(c);
+            c = this.loadedChunks.get(southPos);
+            if (c != null && !c.isTerrainPopulated) this.positionsToCheckIfCanDecorate.add(c);
+            c = this.loadedChunks.get(southWestPos);
+            if (c != null && !c.isTerrainPopulated) this.positionsToCheckIfCanDecorate.add(c);
+            c = this.loadedChunks.get(westPos);
+            if (c != null && !c.isTerrainPopulated) this.positionsToCheckIfCanDecorate.add(c);
+            c = this.loadedChunks.get(northWestPos);
+            if (c != null && !c.isTerrainPopulated) this.positionsToCheckIfCanDecorate.add(c);
+        }
+    }
+
+    @Override
+    public boolean canSave() {
+        return true;
+    }
+
+    protected boolean isChunkValid(@NotNull ChunkPos chunkPos) {
+        int rd = this.world.renderDistance() + 1;
+        if (this.chunkOver != null) {
+            int dx = this.chunkOver.x - chunkPos.x;
+            int dz = this.chunkOver.z - chunkPos.z;
+            if (dx <= 2 && dx >= -2 && dz <= 2 && dz >= -2) {
+                return true;
+            }
+        }
+        synchronized (this.world.players) {
+            @NotNull List<@NotNull Player> players = this.world.players;
+            int size = players.size();
+            for (int i = 0; i < size; i++) {
+                Player player = players.get(i);
+                int pCX = ((int) player.x >> 4);
+                int pCZ = ((int) player.z >> 4);
+                int dx = pCX - chunkPos.x;
+                int dz = pCZ - chunkPos.z;
+                if (dx <= rd && dx >= -rd && dz <= rd && dz >= -rd) {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
+    private @NotNull Chunk loadChunk(@NotNull ChunkPos chunkPos) {
+        try {
+            Chunk chunk = this.chunkLoader.loadChunk(this.world, chunkPos.x, chunkPos.z);
+            if (chunk == null) {
+                chunk = this.chunkGenerator.generate(chunkPos.x, chunkPos.z);
+                chunk.fixMissingBlocks();
+            }
+            return chunk;
+        } catch (Exception exception) {
+            LOGGER.error("Error loading chunk at X:{}, Z:{}", chunkPos.x, chunkPos.z, exception);
+        }
+        return this.empty;
+    }
+
+    private void saveChunk(@NotNull Chunk chunk) {
+        try {
+            chunk.lastSaveTime = this.world.getWorldTime();
+            this.chunkLoader.saveChunk(this.world, chunk);
+            chunk.isModified = false;
+        } catch (IOException e) {
+            LOGGER.error("Error saving chunk at X:{}, Z:{}", chunk.pos.x, chunk.pos.x, e);
+        }
+    }
+
+    @Override
+    public @NotNull String getInfoString() {
+        return String.format("Loaded: %s, Queued: %s, Undecorated: %s", this.loadedChunks.size(), this.preparedUndecoratedChunks.size(), this.positionsToCheckIfCanDecorate.size());
+    }
+
+    @Override
+    public void unloadAllChunks() {
+        synchronized (this.loadedChunks) {
+            for (Chunk chunk : this.loadedChunks.values()) {
+                chunk.onUnload();
+            }
+            this.loadedChunks.clear();
+        }
+        synchronized (this.preparedUndecoratedChunks) {
+            this.preparedUndecoratedChunks.clear();
+        }
+        System.gc();
+    }
+
+    @Override
+    public void close() {
+        this.genThread.close();
+    }
+
+    public static class ChunkGenThread extends Thread {
+        private boolean running = true;
+        private final AtomicBoolean sleeping = new AtomicBoolean(false);
+
+        private final @NotNull ArrayList<ChunkPos> chunkQueueSet = new ArrayList<>();
+        private final @NotNull ChunkProviderThreaded chunkProvider;
+
+        public ChunkGenThread(@NotNull ChunkProviderThreaded chunkProvider) {
+            this.chunkProvider = chunkProvider;
+        }
+
+        @Override
+        public void run() {
+            while (this.running) {
+                try {
+                    this.sleeping.set(false);
+                    boolean hasWork;
+                    synchronized (this.chunkQueueSet) {
+                        hasWork = !this.chunkQueueSet.isEmpty();
+                    }
+                    if (!hasWork) {
+                        try {
+                            this.sleeping.set(true);
+                            Thread.sleep(Integer.MAX_VALUE);
+                            continue;
+                        } catch (InterruptedException ignored) {
+                        }
+                    }
+                    ChunkPos first = null;
+                    synchronized (this.chunkQueueSet) {
+                        this.chunkQueueSet.removeIf(this.chunkProvider::isChunkLoaded);
+                        if (!this.chunkQueueSet.isEmpty()) {
+                            first = this.chunkQueueSet.remove(0);
+                        }
+                    }
+                    if (first == null) continue;
+                    Chunk chunk = this.chunkProvider.loadChunk(first);
+                    synchronized (this.chunkProvider.preparedUndecoratedChunks) {
+                        this.chunkProvider.preparedUndecoratedChunks.put(chunk.pos, chunk);
+                    }
+                } catch (Exception e) {
+                    LOGGER.error("Error in chunk gen thread!", e);
+                }
+            }
+        }
+
+        public void queueChunk(@NotNull ChunkPos chunkPos) {
+            synchronized (this.chunkProvider.preparedUndecoratedChunks) {
+                if (this.chunkProvider.preparedUndecoratedChunks.containsKey(chunkPos)) return;
+            }
+            synchronized (this.chunkQueueSet) {
+                if (!this.chunkQueueSet.contains(chunkPos)) {
+                    this.chunkQueueSet.add(chunkPos);
+                } else {
+                    return;
+                }
+            }
+            if (this.sleeping.get()) {
+                interrupt();
+            }
+        }
+
+        public void close() {
+            this.running = false;
+            if (this.sleeping.get()) {
+                interrupt();
+            }
+        }
+    }
+}
diff --git a/game/core/src/main/java/net/minecraft/core/world/chunk/provider/IChunkProvider.java b/game/core/src/main/java/net/minecraft/core/world/chunk/provider/IChunkProvider.java
index cc48170c7..5068c601c 100644
--- a/game/core/src/main/java/net/minecraft/core/world/chunk/provider/IChunkProvider.java
+++ b/game/core/src/main/java/net/minecraft/core/world/chunk/provider/IChunkProvider.java
@@ -2,29 +2,59 @@ package net.minecraft.core.world.chunk.provider;
 
 import net.minecraft.core.world.ProgressListener;
 import net.minecraft.core.world.chunk.Chunk;
-
-public interface IChunkProvider
-{
-
-    boolean isChunkLoaded(int chunkX, int chunkZ);
-
-    Chunk provideChunk(int chunkX, int chunkZ);
-
-    Chunk prepareChunk(int chunkX, int chunkZ);
-
-    void regenerateChunk(int chunkX, int chunkZ);
-
-    void populate(IChunkProvider chunkProvider, int chunkX, int chunkZ);
-
-    boolean saveChunks(boolean saveImmediately, ProgressListener progressUpdate);
+import net.minecraft.core.world.pos.ChunkPos;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+public interface IChunkProvider {
+
+    @Deprecated
+    default boolean isChunkLoaded(int chunkX, int chunkZ) {
+        return isChunkLoaded(new ChunkPos(chunkX, chunkZ));
+    }
+    boolean isChunkLoaded(@NotNull ChunkPos chunkPos);
+
+    @Deprecated
+    default @NotNull Chunk provideChunk(int chunkX, int chunkZ) {
+        return provideChunk(new ChunkPos(chunkX, chunkZ), true);
+    }
+    @NotNull Chunk provideChunk(@NotNull ChunkPos chunkPos, boolean priority);
+
+    @Deprecated
+    default @NotNull Chunk prepareChunk(int chunkX, int chunkZ) {
+        return prepareChunk(new ChunkPos(chunkX, chunkZ), true);
+    }
+    @NotNull Chunk prepareChunk(@NotNull ChunkPos chunkPos, boolean priority);
+
+    @Deprecated
+    default void regenerateChunk(int chunkX, int chunkZ) {
+        regenerateChunk(new ChunkPos(chunkX, chunkZ));
+    }
+    void regenerateChunk(@NotNull ChunkPos chunkPos);
+
+    @Deprecated
+    default void populate(IChunkProvider chunkProvider, int chunkX, int chunkZ) {
+        populate(new ChunkPos(chunkX, chunkZ));
+    }
+    void populate(@NotNull ChunkPos chunkPos);
+
+    @Deprecated
+    default void setCurrentChunkOver(int chunkX, int chunkZ) {
+        setCurrentChunkOver(new ChunkPos(chunkX, chunkZ));
+    }
+    void setCurrentChunkOver(@NotNull ChunkPos chunkPos);
+
+    boolean saveChunks(boolean saveImmediately, @Nullable ProgressListener progressListener);
 
     boolean tick();
 
     boolean canSave();
 
-    String getInfoString();
-    
+    @NotNull String getInfoString();
     void unloadAllChunks();
 
-    void setCurrentChunkOver(int chunkX, int chunkZ);
+    default void close() {
+
+    }
+
 }
diff --git a/game/core/src/main/java/net/minecraft/core/world/data/ChunkNibbleArray.java b/game/core/src/main/java/net/minecraft/core/world/data/ChunkNibbleArray.java
index 3bf581205..0f9015968 100644
--- a/game/core/src/main/java/net/minecraft/core/world/data/ChunkNibbleArray.java
+++ b/game/core/src/main/java/net/minecraft/core/world/data/ChunkNibbleArray.java
@@ -1,14 +1,15 @@
 package net.minecraft.core.world.data;
 
 import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 
 /**
  * Models an array of nibbles that is accessible by X, Y and Z coordinates.
  */
 public class ChunkNibbleArray
-    implements ChunkArray<Integer>
+//    implements ChunkArray<Integer>
 {
-    public final byte[] data;
+    public final byte @Nullable [] data;
 
     private final int xSize, ySize, zSize;
 
@@ -17,7 +18,7 @@ public class ChunkNibbleArray
         this.xSize = xSize;
         this.ySize = ySize;
         this.zSize = zSize;
-        data = new byte[(xSize * ySize * zSize) >> 1];
+        this.data = new byte[(xSize * ySize * zSize) >> 1];
     }
 
     public ChunkNibbleArray(int xSize, int ySize, int zSize, byte[] data)
@@ -35,41 +36,41 @@ public class ChunkNibbleArray
         }
     }
 
-    @Override
-    public @NotNull Integer get(int x, int y, int z)
+//    @Override
+    public /*@NotNull Integer*/ int get(int x, int y, int z)
     {
-        int index = (y * zSize * xSize) + (z * xSize) + x;
+        int index = (y * this.zSize * this.xSize) + (z * this.xSize) + x;
         int nibbleIndex = index >> 1;
         int nibblePart = index & 0x01;
         if(nibblePart == 0)
         {
-            return data[nibbleIndex] & 0x0F;
+            return this.data[nibbleIndex] & 0x0F;
         }
         else
         {
-            return data[nibbleIndex] >> 4 & 0x0F;
+            return this.data[nibbleIndex] >> 4 & 0x0F;
         }
     }
 
-    @Override
-    public void set(int x, int y, int z, Integer value)
+//    @Override
+    public void set(int x, int y, int z, /*Integer*/ int value)
     {
-        int index = (y * zSize * xSize) + (z * xSize) + x;
+        int index = (y * this.zSize * this.xSize) + (z * this.xSize) + x;
         int nibbleIndex = index >> 1;
         int nibblePart = index & 0x01;
         if(nibblePart == 0)
         {
-            data[nibbleIndex] = (byte)((data[nibbleIndex] & 0xF0) | (value & 0x0F));
+            this.data[nibbleIndex] = (byte)((this.data[nibbleIndex] & 0xF0) | (value & 0x0F));
         }
         else
         {
-            data[nibbleIndex] = (byte)((data[nibbleIndex] & 0x0F) | ((value & 0x0F) << 4));
+            this.data[nibbleIndex] = (byte)((this.data[nibbleIndex] & 0x0F) | ((value & 0x0F) << 4));
         }
     }
 
-    @Override
+//    @Override
     public boolean isValid()
     {
-        return data != null && data.length == ((xSize * ySize * zSize) >> 1);
+        return this.data != null && this.data.length == ((this.xSize * this.ySize * this.zSize) >> 1);
     }
 }
diff --git a/game/core/src/main/java/net/minecraft/core/world/data/ChunkUnsignedByteArray.java b/game/core/src/main/java/net/minecraft/core/world/data/ChunkUnsignedByteArray.java
index 093a0b00c..54029e819 100644
--- a/game/core/src/main/java/net/minecraft/core/world/data/ChunkUnsignedByteArray.java
+++ b/game/core/src/main/java/net/minecraft/core/world/data/ChunkUnsignedByteArray.java
@@ -2,57 +2,49 @@ package net.minecraft.core.world.data;
 
 
 import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 
 /**
  * Models an array of unsigned bytes that is accessible by X, Y and Z coordinates.
  */
 public class ChunkUnsignedByteArray
-    implements ChunkArray<Integer>
-{
-    public final byte[] data;
+    /*implements ChunkArray<Integer>*/ {
+    public final byte @Nullable [] data;
 
     private final int xSize, ySize, zSize;
 
-    public ChunkUnsignedByteArray(int xSize, int ySize, int zSize)
-    {
+    public ChunkUnsignedByteArray(int xSize, int ySize, int zSize) {
         this.xSize = xSize;
         this.ySize = ySize;
         this.zSize = zSize;
         data = new byte[xSize * ySize * zSize];
     }
 
-    public ChunkUnsignedByteArray(int xSize, int ySize, int zSize, byte[] data)
-    {
+    public ChunkUnsignedByteArray(int xSize, int ySize, int zSize, byte[] data) {
         this.xSize = xSize;
         this.ySize = ySize;
         this.zSize = zSize;
-        if (data.length == (xSize * ySize * zSize))
-        {
+        if (data.length == (xSize * ySize * zSize)) {
             this.data = data;
-        }
-        else
-        {
+        } else {
             this.data = null;
         }
     }
 
-    @Override
-    public @NotNull Integer get(int x, int y, int z)
-    {
+//    @Override
+    public /*@NotNull Integer*/ int get(int x, int y, int z) {
         int index = (y * zSize * xSize) + (z * xSize) + x;
         return Byte.toUnsignedInt(data[index]);
     }
 
-    @Override
-    public void set(int x, int y, int z, Integer value)
-    {
+//    @Override
+    public void set(int x, int y, int z, /*@NotNull Integer*/ int value) {
         int index = (y * zSize * xSize) + (z * xSize) + x;
-        data[index] = value.byteValue();
+        data[index] = (byte) value;
     }
 
-    @Override
-    public boolean isValid()
-    {
+//    @Override
+    public boolean isValid() {
         return data != null && data.length == xSize * ySize * zSize;
     }
 }
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/CavesLargeFeature.java b/game/core/src/main/java/net/minecraft/core/world/generate/CavesLargeFeature.java
index 28edfe195..8595a5bbe 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/CavesLargeFeature.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/CavesLargeFeature.java
@@ -8,6 +8,7 @@ import net.minecraft.core.world.biome.Biome;
 import net.minecraft.core.world.chunk.Chunk;
 import net.minecraft.core.world.chunk.ChunkSection;
 import net.minecraft.core.world.generate.chunk.ChunkGeneratorResult;
+import org.jetbrains.annotations.NotNull;
 
 import java.util.Random;
 
@@ -16,8 +17,8 @@ public class CavesLargeFeature extends LargeFeature {
     private final int maxY;
 
     public CavesLargeFeature() {
-        minY = 0;
-        maxY = Chunk.CHUNK_SECTIONS * ChunkSection.SECTION_SIZE_Y;
+        this.minY = 0;
+        this.maxY = Chunk.CHUNK_SECTIONS * ChunkSection.SECTION_SIZE_Y;
     }
 
     public CavesLargeFeature(int minY, int maxY) {
@@ -25,29 +26,29 @@ public class CavesLargeFeature extends LargeFeature {
         this.maxY = maxY;
     }
 
-    protected void generateHubRoom(long seed, int baseChunkX, int baseChunkZ, ChunkGeneratorResult result, double blockX, double blockY, double blockZ) {
-        generateCave(seed, baseChunkX, baseChunkZ, result, blockX, blockY, blockZ, 1.0F + rand.nextFloat() * 6F, 0.0F, 0.0F, -1, -1, 0.5D);
+    protected void generateHubRoom(@NotNull World world, @NotNull Random random, long seed, int baseChunkX, int baseChunkZ, @NotNull ChunkGeneratorResult result, double blockX, double blockY, double blockZ) {
+        generateCave(world, random, seed, baseChunkX, baseChunkZ, result, blockX, blockY, blockZ, 1.0F + random.nextFloat() * 6F, 0.0F, 0.0F, -1, -1, 0.5D);
     }
 
-    protected void generateCave(long seed, int baseChunkX, int baseChunkZ, ChunkGeneratorResult result, double blockX, double blockY,
+    protected void generateCave(@NotNull World world, @NotNull Random random, long seed, int baseChunkX, int baseChunkZ, @NotNull ChunkGeneratorResult result, double blockX, double blockY,
                                 double blockZ, float initialRadius, float yRot, float xRot, int startPos, int endPos,
                                 double heightMod) {
         double chunkMiddleX = baseChunkX * Chunk.CHUNK_SIZE_X + Chunk.CHUNK_SIZE_X / 2;
         double chunkMiddleZ = baseChunkZ * Chunk.CHUNK_SIZE_Z + Chunk.CHUNK_SIZE_Z / 2;
         float rotHorOffset = 0.0F;
         float rotVerOffset = 0.0F;
-        Random random = new Random(seed);
+        Random r = new Random(seed);
         if (endPos <= 0) {
-            int maxLength = radiusChunk * 16 - 16;
-            endPos = maxLength - random.nextInt(maxLength / 4);
+            int maxLength = this.getRadiusChunk() * 16 - 16;
+            endPos = maxLength - r.nextInt(maxLength / 4);
         }
         boolean noBranches = false;
         if (startPos == -1) {
             startPos = endPos / 2;
             noBranches = true;
         }
-        int branchPos = random.nextInt(endPos / 2) + endPos / 4;
-        boolean sharpRotVer = random.nextInt(6) == 0;
+        int branchPos = r.nextInt(endPos / 2) + endPos / 4;
+        boolean sharpRotVer = r.nextInt(6) == 0;
         for (; startPos < endPos; startPos++) {
             double width = 1.5D + (MathHelper.sin((startPos * MathHelper.PI) / endPos) * initialRadius * 1.0F);
             double height = width * heightMod;
@@ -65,18 +66,18 @@ public class CavesLargeFeature extends LargeFeature {
             yRot += rotHorOffset * 0.1F;
             rotVerOffset *= 0.9F;
             rotHorOffset *= 0.75F;
-            rotVerOffset += (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 2.0F;
-            rotHorOffset += (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 4F;
+            rotVerOffset += (r.nextFloat() - r.nextFloat()) * r.nextFloat() * 2.0F;
+            rotHorOffset += (r.nextFloat() - r.nextFloat()) * r.nextFloat() * 4F;
 
             // Do adjacent branches if necessary
             if (!noBranches && startPos == branchPos && initialRadius > 1.0F) {
-                generateCave(random.nextLong(), baseChunkX, baseChunkZ, result, blockX, blockY, blockZ, random.nextFloat() * 0.5F + 0.5F, yRot - MathHelper.PI / 2F, xRot / 3F, startPos, endPos, 1.0D);
-                generateCave(random.nextLong(), baseChunkX, baseChunkZ, result, blockX, blockY, blockZ, random.nextFloat() * 0.5F + 0.5F, yRot + MathHelper.PI / 2F, xRot / 3F, startPos, endPos, 1.0D);
+                generateCave(world, random, r.nextLong(), baseChunkX, baseChunkZ, result, blockX, blockY, blockZ, r.nextFloat() * 0.5F + 0.5F, yRot - MathHelper.PI / 2F, xRot / 3F, startPos, endPos, 1.0D);
+                generateCave(world, random, r.nextLong(), baseChunkX, baseChunkZ, result, blockX, blockY, blockZ, r.nextFloat() * 0.5F + 0.5F, yRot + MathHelper.PI / 2F, xRot / 3F, startPos, endPos, 1.0D);
                 return;
             }
 
             // Randomly skip a section
-            if (!noBranches && random.nextInt(4) == 0) {
+            if (!noBranches && r.nextInt(4) == 0) {
                 continue;
             }
 
@@ -119,7 +120,7 @@ public class CavesLargeFeature extends LargeFeature {
             }
 
             // Check if we've hit the ocean, and if so, stop generating
-            if (worldObj.getWorldType().getOceanBlockId() != 0) {
+            if (world.getWorldType().getOceanBlockId() != 0) {
                 boolean hasHitOcean = false;
                 for (int x = minX; !hasHitOcean && x < maxX; x++) {
                     for (int z = minZ; !hasHitOcean && z < maxZ; z++) {
@@ -129,7 +130,7 @@ public class CavesLargeFeature extends LargeFeature {
                             if (y < this.minY || y >= this.maxY) {
                                 continue;
                             }
-                            if (blockId == worldObj.getWorldType().getOceanBlockId()) {
+                            if (blockId == world.getWorldType().getOceanBlockId()) {
                                 hasHitOcean = true;
                             }
                             if (y != minY - 1 && x != minX && x != maxX - 1 && z != minZ && z != maxZ - 1) {
@@ -172,7 +173,7 @@ public class CavesLargeFeature extends LargeFeature {
                                     result.setBlock(x, yIndex, z, 0);
 
                                     if (replaceTopBlock) {
-                                        Biome biome = worldObj.getBlockBiome(x, yIndex - 1, z);
+                                        Biome biome = world.getBlockBiome(x, yIndex - 1, z);
                                         int topBlockId = biome.topBlock;
                                         int fillBlockId = biome.fillerBlock;
                                         int id = result.getBlock(x, yIndex - 1, z);
@@ -196,29 +197,29 @@ public class CavesLargeFeature extends LargeFeature {
     }
 
     @Override
-    protected void doGeneration(World world, int chunkX, int chunkZ, int baseChunkX, int baseChunkZ, ChunkGeneratorResult result) {
-        int cavesToGenerate = rand.nextInt(rand.nextInt(rand.nextInt(40) + 1) + 1);
-        if (rand.nextInt(15) != 0) {
+    protected void doGeneration(@NotNull World world, @NotNull Random random, int chunkX, int chunkZ, int baseChunkX, int baseChunkZ, @NotNull ChunkGeneratorResult result) {
+        int cavesToGenerate = random.nextInt(random.nextInt(random.nextInt(40) + 1) + 1);
+        if (random.nextInt(15) != 0) {
             cavesToGenerate = 0;
         }
 
-        final int yRange = maxY - minY;
+        final int yRange = this.maxY - this.minY;
 
         for (int i = 0; i < cavesToGenerate; i++) {
-            double blockX = chunkX * Chunk.CHUNK_SIZE_X + rand.nextInt(Chunk.CHUNK_SIZE_X);
-            double blockY = minY + rand.nextInt(rand.nextInt(yRange - (ChunkSection.SECTION_SIZE_Y / 2)) + (ChunkSection.SECTION_SIZE_Y / 2));
-            double blockZ = chunkZ * Chunk.CHUNK_SIZE_Z + rand.nextInt(Chunk.CHUNK_SIZE_Z);
+            double blockX = chunkX * Chunk.CHUNK_SIZE_X + random.nextInt(Chunk.CHUNK_SIZE_X);
+            double blockY = this.minY + random.nextInt(random.nextInt(yRange - (ChunkSection.SECTION_SIZE_Y / 2)) + (ChunkSection.SECTION_SIZE_Y / 2));
+            double blockZ = chunkZ * Chunk.CHUNK_SIZE_Z + random.nextInt(Chunk.CHUNK_SIZE_Z);
 
             int numBranches = 1;
-            if (rand.nextInt(4) == 0) {
-                generateHubRoom(rand.nextLong(), baseChunkX, baseChunkZ, result, blockX, blockY, blockZ);
-                numBranches += rand.nextInt(4);
+            if (random.nextInt(4) == 0) {
+                generateHubRoom(world, random, random.nextLong(), baseChunkX, baseChunkZ, result, blockX, blockY, blockZ);
+                numBranches += random.nextInt(4);
             }
             for (int l1 = 0; l1 < numBranches; l1++) {
-                float yRot = rand.nextFloat() * MathHelper.PI * 2.0F; // 0 - 2Pi
-                float xRot = ((rand.nextFloat() - 0.5F) * 2.0F) / 8F; // -0.125 - 0.125
-                float initialRadius = rand.nextFloat() * 2.0F + rand.nextFloat(); // 0 - 3
-                generateCave(rand.nextLong(), baseChunkX, baseChunkZ, result, blockX, blockY, blockZ, initialRadius, yRot, xRot, 0, 0, 1.0f);
+                float yRot = random.nextFloat() * MathHelper.PI * 2.0F; // 0 - 2Pi
+                float xRot = ((random.nextFloat() - 0.5F) * 2.0F) / 8F; // -0.125 - 0.125
+                float initialRadius = random.nextFloat() * 2.0F + random.nextFloat(); // 0 - 3
+                generateCave(world, random, random.nextLong(), baseChunkX, baseChunkZ, result, blockX, blockY, blockZ, initialRadius, yRot, xRot, 0, 0, 1.0f);
             }
         }
     }
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/LargeFeature.java b/game/core/src/main/java/net/minecraft/core/world/generate/LargeFeature.java
index 18434c87f..05722cd35 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/LargeFeature.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/LargeFeature.java
@@ -2,40 +2,32 @@ package net.minecraft.core.world.generate;
 
 import net.minecraft.core.world.World;
 import net.minecraft.core.world.generate.chunk.ChunkGeneratorResult;
+import org.jetbrains.annotations.NotNull;
 
 import java.util.Random;
 
-public class LargeFeature
-{
-
-    public LargeFeature()
-    {
-        radiusChunk = 8;
+public class LargeFeature {
+    public LargeFeature() {
     }
 
-    public void generate(World world, int baseChunkX, int baseChunkZ, ChunkGeneratorResult result)
-    {
-        int radius = radiusChunk;
-        rand.setSeed(world.getRandomSeed());
-        worldObj = world;
+    public void generate(@NotNull World world, int baseChunkX, int baseChunkZ, @NotNull ChunkGeneratorResult result) {
+        int radius = getRadiusChunk();
+        Random rand = new Random(world.getRandomSeed());
         long randX = (rand.nextLong() / 2L) * 2L + 1L;
         long randZ = (rand.nextLong() / 2L) * 2L + 1L;
-        for(int chunkX = baseChunkX - radius; chunkX <= baseChunkX + radius; chunkX++)
-        {
-            for(int chunkZ = baseChunkZ - radius; chunkZ <= baseChunkZ + radius; chunkZ++)
-            {
-                rand.setSeed((long)chunkX * randX + (long)chunkZ * randZ ^ world.getRandomSeed());
-                doGeneration(world, chunkX, chunkZ, baseChunkX, baseChunkZ, result);
+        for (int chunkX = baseChunkX - radius; chunkX <= baseChunkX + radius; chunkX++) {
+            for (int chunkZ = baseChunkZ - radius; chunkZ <= baseChunkZ + radius; chunkZ++) {
+                rand.setSeed((long) chunkX * randX + (long) chunkZ * randZ ^ world.getRandomSeed());
+                doGeneration(world, rand, chunkX, chunkZ, baseChunkX, baseChunkZ, result);
             }
 
         }
     }
 
-    protected void doGeneration(World world, int chunkX, int chunkZ, int baseChunkX, int baseChunkZ, ChunkGeneratorResult result)
-    {
+    protected void doGeneration(@NotNull World world, @NotNull Random random, int chunkX, int chunkZ, int baseChunkX, int baseChunkZ, @NotNull ChunkGeneratorResult result) {
     }
 
-    protected int radiusChunk;
-    protected static Random rand = new Random();
-    protected World worldObj;
+    public int getRadiusChunk() {
+        return 8;
+    }
 }
\ No newline at end of file
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/NetherBonesLargeFeature.java b/game/core/src/main/java/net/minecraft/core/world/generate/NetherBonesLargeFeature.java
index 4627c0df3..4d5881d00 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/NetherBonesLargeFeature.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/NetherBonesLargeFeature.java
@@ -1,15 +1,13 @@
 package net.minecraft.core.world.generate;
 
-import net.minecraft.core.block.Block;
 import net.minecraft.core.block.Blocks;
-import net.minecraft.core.block.tag.BlockTags;
 import net.minecraft.core.util.helper.MathHelper;
 import net.minecraft.core.world.World;
-import net.minecraft.core.world.biome.Biome;
 import net.minecraft.core.world.biome.Biomes;
 import net.minecraft.core.world.chunk.Chunk;
 import net.minecraft.core.world.chunk.ChunkSection;
 import net.minecraft.core.world.generate.chunk.ChunkGeneratorResult;
+import org.jetbrains.annotations.NotNull;
 
 import java.util.Random;
 
@@ -18,8 +16,8 @@ public class NetherBonesLargeFeature extends LargeFeature {
     private final int maxY;
 
     public NetherBonesLargeFeature() {
-        minY = 0;
-        maxY = Chunk.CHUNK_SECTIONS * ChunkSection.SECTION_SIZE_Y;
+        this.minY = 0;
+        this.maxY = Chunk.CHUNK_SECTIONS * ChunkSection.SECTION_SIZE_Y;
     }
 
     public NetherBonesLargeFeature(int minY, int maxY) {
@@ -27,29 +25,29 @@ public class NetherBonesLargeFeature extends LargeFeature {
         this.maxY = maxY;
     }
 
-    protected void generateHubRoom(long seed, int baseChunkX, int baseChunkZ, ChunkGeneratorResult result, double blockX, double blockY, double blockZ) {
-        generateCave(seed, baseChunkX, baseChunkZ, result, blockX, blockY, blockZ, 1.0F + rand.nextFloat() * 6F, 0.0F, 0.0F, -1, -1, 0.5D);
+    protected void generateHubRoom(@NotNull World world, @NotNull Random random, long seed, int baseChunkX, int baseChunkZ, ChunkGeneratorResult result, double blockX, double blockY, double blockZ) {
+        generateCave(world, random, seed, baseChunkX, baseChunkZ, result, blockX, blockY, blockZ, 1.0F + random.nextFloat() * 6F, 0.0F, 0.0F, -1, -1, 0.5D);
     }
 
-    protected void generateCave(long seed, int baseChunkX, int baseChunkZ, ChunkGeneratorResult result, double blockX, double blockY,
+    protected void generateCave(@NotNull World world, @NotNull Random random, long seed, int baseChunkX, int baseChunkZ, @NotNull ChunkGeneratorResult result, double blockX, double blockY,
                                 double blockZ, float initialRadius, float yRot, float xRot, int startPos, int endPos,
                                 double heightMod) {
         double chunkMiddleX = baseChunkX * Chunk.CHUNK_SIZE_X + Chunk.CHUNK_SIZE_X / 2;
         double chunkMiddleZ = baseChunkZ * Chunk.CHUNK_SIZE_Z + Chunk.CHUNK_SIZE_Z / 2;
         float rotHorOffset = 0.0F;
         float rotVerOffset = 0.0F;
-        Random random = new Random(seed);
+        Random r = new Random(seed);
         if (endPos <= 0) {
-            int maxLength = radiusChunk * 16 - 16;
-            endPos = maxLength - random.nextInt(maxLength / 4);
+            int maxLength = getRadiusChunk() * 16 - 16;
+            endPos = maxLength - r.nextInt(maxLength / 4);
         }
         boolean noBranches = false;
         if (startPos == -1) {
             startPos = endPos / 2;
             noBranches = true;
         }
-        boolean reversed = random.nextBoolean();
-        int branchPos = random.nextInt(endPos / 2) + endPos / 4;
+        boolean reversed = r.nextBoolean();
+        int branchPos = r.nextInt(endPos / 2) + endPos / 4;
         for (; startPos < endPos; startPos++) {
             double width = 1.5D + (MathHelper.sin((startPos * MathHelper.PI) / endPos) * initialRadius * 1.0F);
             double height = width * heightMod;
@@ -71,11 +69,11 @@ public class NetherBonesLargeFeature extends LargeFeature {
 //            rotHorOffset += (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 4F;
 
             // Do adjacent branches if necessary
-            if (false && !noBranches && startPos == branchPos && initialRadius > 1.0F) {
-                generateCave(random.nextLong(), baseChunkX, baseChunkZ, result, blockX, blockY, blockZ, random.nextFloat() * 0.5F + 0.5F, yRot - MathHelper.PI / 2F, xRot / 3F, startPos, endPos, 1.0D);
-                generateCave(random.nextLong(), baseChunkX, baseChunkZ, result, blockX, blockY, blockZ, random.nextFloat() * 0.5F + 0.5F, yRot + MathHelper.PI / 2F, xRot / 3F, startPos, endPos, 1.0D);
-                return;
-            }
+//            if (false) {
+//                generateCave(world, random.nextLong(), baseChunkX, baseChunkZ, result, blockX, blockY, blockZ, random.nextFloat() * 0.5F + 0.5F, yRot - MathHelper.PI / 2F, xRot / 3F, startPos, endPos, 1.0D);
+//                generateCave(world, random.nextLong(), baseChunkX, baseChunkZ, result, blockX, blockY, blockZ, random.nextFloat() * 0.5F + 0.5F, yRot + MathHelper.PI / 2F, xRot / 3F, startPos, endPos, 1.0D);
+//                return;
+//            }
 
             // Check if we've gone far enough, and stop if so
             double dxFromMiddle = blockX - chunkMiddleX;
@@ -150,27 +148,27 @@ public class NetherBonesLargeFeature extends LargeFeature {
     }
 
     @Override
-    protected void doGeneration(World world, int chunkX, int chunkZ, int baseChunkX, int baseChunkZ, ChunkGeneratorResult result) {
+    protected void doGeneration(@NotNull World world, @NotNull Random random, int chunkX, int chunkZ, int baseChunkX, int baseChunkZ, @NotNull ChunkGeneratorResult result) {
         if (world.getBlockBiome(chunkX * Chunk.CHUNK_SIZE_X, 0, chunkZ * Chunk.CHUNK_SIZE_Z) != Biomes.NETHER_BONEYARD) {
             return;
         }
 
-        int cavesToGenerate = rand.nextInt(rand.nextInt(rand.nextInt(10) + 1) + 1);
+        int cavesToGenerate = random.nextInt(random.nextInt(random.nextInt(10) + 1) + 1);
 //        if (rand.nextInt(12) != 0) {
 //            cavesToGenerate = 0;
 //        }
 
-        final int yRange = maxY - minY;
+        final int yRange = this.maxY - this.minY;
 
         for (int i = 0; i < cavesToGenerate; i++) {
-            double blockX = chunkX * Chunk.CHUNK_SIZE_X + rand.nextInt(Chunk.CHUNK_SIZE_X);
-            double blockY = minY + rand.nextInt(rand.nextInt(yRange - (ChunkSection.SECTION_SIZE_Y / 2)) + (ChunkSection.SECTION_SIZE_Y / 2));
-            double blockZ = chunkZ * Chunk.CHUNK_SIZE_Z + rand.nextInt(Chunk.CHUNK_SIZE_Z);
-
-            float yRot = rand.nextFloat() * MathHelper.PI * 2.0F; // 0 - 2Pi
-            float xRot = ((rand.nextFloat() - 0.5F) * 2.0F) / 8F; // -0.125 - 0.125
-            float initialRadius = rand.nextFloat() + rand.nextFloat(); // 0 - 3
-            generateCave(rand.nextLong(), baseChunkX, baseChunkZ, result, blockX, blockY, blockZ, initialRadius, yRot, xRot, 0, 0, 1.0f);
+            double blockX = chunkX * Chunk.CHUNK_SIZE_X + random.nextInt(Chunk.CHUNK_SIZE_X);
+            double blockY = this.minY + random.nextInt(random.nextInt(yRange - (ChunkSection.SECTION_SIZE_Y / 2)) + (ChunkSection.SECTION_SIZE_Y / 2));
+            double blockZ = chunkZ * Chunk.CHUNK_SIZE_Z + random.nextInt(Chunk.CHUNK_SIZE_Z);
+
+            float yRot = random.nextFloat() * MathHelper.PI * 2.0F; // 0 - 2Pi
+            float xRot = ((random.nextFloat() - 0.5F) * 2.0F) / 8F; // -0.125 - 0.125
+            float initialRadius = random.nextFloat() + random.nextFloat(); // 0 - 3
+            generateCave(world, random, random.nextLong(), baseChunkX, baseChunkZ, result, blockX, blockY, blockZ, initialRadius, yRot, xRot, 0, 0, 1.0f);
         }
     }
 }
\ No newline at end of file
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/RetroCavesLargeFeature.java b/game/core/src/main/java/net/minecraft/core/world/generate/RetroCavesLargeFeature.java
index 90928c9f6..1344d5d89 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/RetroCavesLargeFeature.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/RetroCavesLargeFeature.java
@@ -8,11 +8,11 @@ import net.minecraft.core.world.biome.Biome;
 import net.minecraft.core.world.chunk.Chunk;
 import net.minecraft.core.world.chunk.ChunkSection;
 import net.minecraft.core.world.generate.chunk.ChunkGeneratorResult;
+import org.jetbrains.annotations.NotNull;
 
 import java.util.Random;
 
 public class RetroCavesLargeFeature extends LargeFeature {
-    private Random rand;
     private final int minY;
     private final int maxY;
 
@@ -23,51 +23,46 @@ public class RetroCavesLargeFeature extends LargeFeature {
     public RetroCavesLargeFeature(int minY, int maxY) {
         this.minY = minY;
         this.maxY = maxY;
-        this.rand = new Random();
     }
 
     @Override
-    public void generate(World world, int baseChunkX, int baseChunkZ, ChunkGeneratorResult result)
-    {
-        int radius = radiusChunk;
-        rand.setSeed(world.getRandomSeed());
-        worldObj = world;
-        long randX = (this.rand.nextLong() / 2L) * 2L + 1L;
-        long randZ = (this.rand.nextLong() / 2L) * 2L + 1L;
-        for(int chunkX = baseChunkX - radius; chunkX <= baseChunkX + radius; chunkX++)
-        {
-            for(int chunkZ = baseChunkZ - radius; chunkZ <= baseChunkZ + radius; chunkZ++)
-            {
-                this.rand.setSeed((long)chunkX * randX + (long)chunkZ * randZ ^ world.getRandomSeed());
-                doGeneration(world, chunkX, chunkZ, baseChunkX, baseChunkZ, result);
+    public void generate(@NotNull World world, int baseChunkX, int baseChunkZ, @NotNull ChunkGeneratorResult result) {
+        int radius = getRadiusChunk();
+        Random rand = new Random(world.getRandomSeed());
+        long randX = (rand.nextLong() / 2L) * 2L + 1L;
+        long randZ = (rand.nextLong() / 2L) * 2L + 1L;
+        for (int chunkX = baseChunkX - radius; chunkX <= baseChunkX + radius; chunkX++) {
+            for (int chunkZ = baseChunkZ - radius; chunkZ <= baseChunkZ + radius; chunkZ++) {
+                rand.setSeed((long) chunkX * randX + (long) chunkZ * randZ ^ world.getRandomSeed());
+                doGeneration(world, rand, chunkX, chunkZ, baseChunkX, baseChunkZ, result);
             }
 
         }
     }
 
-    protected void generateHubRoom(int baseChunkX, int baseChunkZ, ChunkGeneratorResult result, double blockX, double blockY, double blockZ) {
-        generateCave(baseChunkX, baseChunkZ, result, blockX, blockY, blockZ, 1.0F + this.rand.nextFloat() * 6F, 0.0F, 0.0F, -1, -1, 0.5D);
+    protected void generateHubRoom(@NotNull World world, @NotNull Random random, int baseChunkX, int baseChunkZ, @NotNull ChunkGeneratorResult result, double blockX, double blockY, double blockZ) {
+        generateCave(world, random, baseChunkX, baseChunkZ, result, blockX, blockY, blockZ, 1.0F + random.nextFloat() * 6F, 0.0F, 0.0F, -1, -1, 0.5D);
     }
 
-    protected void generateCave(int baseChunkX, int baseChunkZ, ChunkGeneratorResult result, double blockX, double blockY,
+    protected void generateCave(@NotNull World world, @NotNull Random random, int baseChunkX, int baseChunkZ, @NotNull ChunkGeneratorResult result, double blockX, double blockY,
                                 double blockZ, float initialRadius, float yRot, float xRot, int startPos, int endPos,
                                 double heightMod) {
         double chunkMiddleX = baseChunkX * Chunk.CHUNK_SIZE_X + Chunk.CHUNK_SIZE_X / 2;
         double chunkMiddleZ = baseChunkZ * Chunk.CHUNK_SIZE_Z + Chunk.CHUNK_SIZE_Z / 2;
         float rotHorOffset = 0.0F;
         float rotVerOffset = 0.0F;
-        Random random = new Random(this.rand.nextLong());
+        Random r = new Random(random.nextLong());
         if (endPos <= 0) {
-            int maxLength = radiusChunk * 16 - 16;
-            endPos = maxLength - random.nextInt(maxLength / 4);
+            int maxLength = getRadiusChunk() * 16 - 16;
+            endPos = maxLength - r.nextInt(maxLength / 4);
         }
         boolean noBranches = false;
         if (startPos == -1) {
             startPos = endPos / 2;
             noBranches = true;
         }
-        int branchPos = random.nextInt(endPos / 2) + endPos / 4;
-        boolean sharpRotVer = random.nextInt(6) == 0;
+        int branchPos = r.nextInt(endPos / 2) + endPos / 4;
+        boolean sharpRotVer = r.nextInt(6) == 0;
         for (; startPos < endPos; startPos++) {
             double width = 1.5D + (MathHelper.sin((startPos * MathHelper.PI) / endPos) * initialRadius * 1.0F);
             double height = width * heightMod;
@@ -85,18 +80,18 @@ public class RetroCavesLargeFeature extends LargeFeature {
             yRot += rotHorOffset * 0.1F;
             rotVerOffset *= 0.9F;
             rotHorOffset *= 0.75F;
-            rotVerOffset += (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 2.0F;
-            rotHorOffset += (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 4F;
+            rotVerOffset += (r.nextFloat() - r.nextFloat()) * r.nextFloat() * 2.0F;
+            rotHorOffset += (r.nextFloat() - r.nextFloat()) * r.nextFloat() * 4F;
 
             // Do adjacent branches if necessary
             if (!noBranches && startPos == branchPos && initialRadius > 1.0F) {
-                generateCave(baseChunkX, baseChunkZ, result, blockX, blockY, blockZ, random.nextFloat() * 0.5F + 0.5F, yRot - MathHelper.PI / 2F, xRot / 3F, startPos, endPos, 1.0D);
-                generateCave(baseChunkX, baseChunkZ, result, blockX, blockY, blockZ, random.nextFloat() * 0.5F + 0.5F, yRot + MathHelper.PI / 2F, xRot / 3F, startPos, endPos, 1.0D);
+                generateCave(world, random, baseChunkX, baseChunkZ, result, blockX, blockY, blockZ, r.nextFloat() * 0.5F + 0.5F, yRot - MathHelper.PI / 2F, xRot / 3F, startPos, endPos, 1.0D);
+                generateCave(world, random, baseChunkX, baseChunkZ, result, blockX, blockY, blockZ, r.nextFloat() * 0.5F + 0.5F, yRot + MathHelper.PI / 2F, xRot / 3F, startPos, endPos, 1.0D);
                 return;
             }
 
             // Randomly skip a section
-            if (!noBranches && random.nextInt(4) == 0) {
+            if (!noBranches && r.nextInt(4) == 0) {
                 continue;
             }
 
@@ -139,7 +134,7 @@ public class RetroCavesLargeFeature extends LargeFeature {
             }
 
             // Check if we've hit the ocean, and if so, stop generating
-            if (worldObj.getWorldType().getOceanBlockId() != 0) {
+            if (world.getWorldType().getOceanBlockId() != 0) {
                 boolean hasHitOcean = false;
                 for (int x = minX; !hasHitOcean && x < maxX; x++) {
                     for (int z = minZ; !hasHitOcean && z < maxZ; z++) {
@@ -149,7 +144,7 @@ public class RetroCavesLargeFeature extends LargeFeature {
                             if (y < this.minY || y >= this.maxY) {
                                 continue;
                             }
-                            if (blockId == worldObj.getWorldType().getOceanBlockId()) {
+                            if (blockId == world.getWorldType().getOceanBlockId()) {
                                 hasHitOcean = true;
                             }
                             if (y != minY - 1 && x != minX && x != maxX - 1 && z != minZ && z != maxZ - 1) {
@@ -185,7 +180,7 @@ public class RetroCavesLargeFeature extends LargeFeature {
                                         result.setBlock(x, yIndex, z, 0);
 
                                         if (replaceTopBlock) {
-                                            Biome biome = worldObj.getBlockBiome(x, yIndex - 1, z);
+                                            Biome biome = world.getBlockBiome(x, yIndex - 1, z);
                                             int topBlockId = biome.topBlock;
                                             int fillBlockId = biome.fillerBlock;
                                             int id = result.getBlock(x, yIndex - 1, z);
@@ -210,29 +205,29 @@ public class RetroCavesLargeFeature extends LargeFeature {
     }
 
     @Override
-    protected void doGeneration(World world, int chunkX, int chunkZ, int baseChunkX, int baseChunkZ, ChunkGeneratorResult result) {
-        int cavesToGenerate = rand.nextInt(rand.nextInt(rand.nextInt(40) + 1) + 1);
-        if (this.rand.nextInt(15) != 0) {
+    protected void doGeneration(@NotNull World world, @NotNull Random random, int chunkX, int chunkZ, int baseChunkX, int baseChunkZ, @NotNull ChunkGeneratorResult result) {
+        int cavesToGenerate = random.nextInt(random.nextInt(random.nextInt(40) + 1) + 1);
+        if (random.nextInt(15) != 0) {
             cavesToGenerate = 0;
         }
 
-        final int yRange = maxY - minY;
+        final int yRange = this.maxY - this.minY;
 
         for (int i = 0; i < cavesToGenerate; i++) {
-            double blockX = chunkX * Chunk.CHUNK_SIZE_X + this.rand.nextInt(Chunk.CHUNK_SIZE_X);
-            double blockY = minY + this.rand.nextInt(this.rand.nextInt(yRange - (ChunkSection.SECTION_SIZE_Y / 2)) + (ChunkSection.SECTION_SIZE_Y / 2));
-            double blockZ = chunkZ * Chunk.CHUNK_SIZE_Z + this.rand.nextInt(Chunk.CHUNK_SIZE_Z);
+            double blockX = chunkX * Chunk.CHUNK_SIZE_X + random.nextInt(Chunk.CHUNK_SIZE_X);
+            double blockY = this.minY + random.nextInt(random.nextInt(yRange - (ChunkSection.SECTION_SIZE_Y / 2)) + (ChunkSection.SECTION_SIZE_Y / 2));
+            double blockZ = chunkZ * Chunk.CHUNK_SIZE_Z + random.nextInt(Chunk.CHUNK_SIZE_Z);
 
             int numBranches = 1;
-            if (rand.nextInt(4) == 0) {
-                generateHubRoom(baseChunkX, baseChunkZ, result, blockX, blockY, blockZ);
-                numBranches += rand.nextInt(4);
+            if (random.nextInt(4) == 0) {
+                generateHubRoom(world, random, baseChunkX, baseChunkZ, result, blockX, blockY, blockZ);
+                numBranches += random.nextInt(4);
             }
             for (int l1 = 0; l1 < numBranches; l1++) {
-                float yRot = this.rand.nextFloat() * MathHelper.PI * 2.0F; // 0 - 2Pi
-                float xRot = ((this.rand.nextFloat() - 0.5F) * 2.0F) / 8F; // -0.125 - 0.125
-                float initialRadius = this.rand.nextFloat() * 2.0F + this.rand.nextFloat(); // 0 - 3
-                generateCave(baseChunkX, baseChunkZ, result, blockX, blockY, blockZ, initialRadius, yRot, xRot, 0, 0, 1.0f);
+                float yRot = random.nextFloat() * MathHelper.PI * 2.0F; // 0 - 2Pi
+                float xRot = ((random.nextFloat() - 0.5F) * 2.0F) / 8F; // -0.125 - 0.125
+                float initialRadius = random.nextFloat() * 2.0F + random.nextFloat(); // 0 - 3
+                generateCave(world, random, baseChunkX, baseChunkZ, result, blockX, blockY, blockZ, initialRadius, yRot, xRot, 0, 0, 1.0f);
             }
         }
     }
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/WarrensCavesLargeFeature.java b/game/core/src/main/java/net/minecraft/core/world/generate/WarrensCavesLargeFeature.java
index b06374ddc..1ecb1eb49 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/WarrensCavesLargeFeature.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/WarrensCavesLargeFeature.java
@@ -7,6 +7,7 @@ import net.minecraft.core.world.World;
 import net.minecraft.core.world.chunk.Chunk;
 import net.minecraft.core.world.chunk.ChunkSection;
 import net.minecraft.core.world.generate.chunk.ChunkGeneratorResult;
+import org.jetbrains.annotations.NotNull;
 
 import java.util.Random;
 
@@ -15,8 +16,8 @@ public class WarrensCavesLargeFeature extends LargeFeature {
     private final int maxY;
 
     public WarrensCavesLargeFeature() {
-        minY = 0;
-        maxY = Chunk.CHUNK_SECTIONS * ChunkSection.SECTION_SIZE_Y;
+        this.minY = 0;
+        this.maxY = Chunk.CHUNK_SECTIONS * ChunkSection.SECTION_SIZE_Y;
     }
 
     public WarrensCavesLargeFeature(int minY, int maxY) {
@@ -24,23 +25,23 @@ public class WarrensCavesLargeFeature extends LargeFeature {
         this.maxY = maxY;
     }
 
-    protected void generateHubRoom(long seed, int baseChunkX, int baseChunkZ, ChunkGeneratorResult result, double blockX, double blockY, double blockZ) {
-        generateCave(seed, baseChunkX, baseChunkZ, result, blockX, blockY, blockZ, 1.0F + rand.nextFloat() * 6F, 0.0F, 0.0F, -1, -1, 0.5D);
+    protected void generateHubRoom(@NotNull World world, @NotNull Random random, long seed, int baseChunkX, int baseChunkZ, ChunkGeneratorResult result, double blockX, double blockY, double blockZ) {
+        generateCave(world, random, seed, baseChunkX, baseChunkZ, result, blockX, blockY, blockZ, 1.0F + random.nextFloat() * 6F, 0.0F, 0.0F, -1, -1, 0.5D);
     }
 
-    protected void generateCave(long seed, int baseChunkX, int baseChunkZ, ChunkGeneratorResult result, double blockX, double blockY,
+    protected void generateCave(@NotNull World world, @NotNull Random random, long seed, int baseChunkX, int baseChunkZ, ChunkGeneratorResult result, double blockX, double blockY,
                                 double blockZ, float initialRadius, float yRot, float xRot, int startPos, int endPos,
                                 double heightMod) {
         double chunkMiddleX = baseChunkX * Chunk.CHUNK_SIZE_X + Chunk.CHUNK_SIZE_X / 2;
         double chunkMiddleZ = baseChunkZ * Chunk.CHUNK_SIZE_Z + Chunk.CHUNK_SIZE_Z / 2;
         float rotHorOffset = 0.0F;
         float rotVerOffset = 0.0F;
-        Random random = new Random(seed);
+        Random r = new Random(seed);
         if (endPos <= 0) {
-            int maxLength = radiusChunk * 24 - 16;
-            endPos = maxLength - random.nextInt(maxLength / 8);
+            int maxLength = getRadiusChunk() * 24 - 16;
+            endPos = maxLength - r.nextInt(maxLength / 8);
         }
-        final boolean noRotate = random.nextInt(32) == 0;
+        final boolean noRotate = r.nextInt(32) == 0;
         if (noRotate) {
             yRot = (yRot / (MathHelper.PI * 2)) * 4;
             yRot = Math.round(yRot);
@@ -49,8 +50,8 @@ public class WarrensCavesLargeFeature extends LargeFeature {
 //            xRot = Math.round(xRot);
 //            xRot = xRot * (MathHelper.PI * 2) / 4;
         }
-        int branchPos = random.nextInt(endPos / 2) + endPos / 4;
-        boolean sharpRotVer = random.nextInt(6) == 0;
+        int branchPos = r.nextInt(endPos / 2) + endPos / 4;
+        boolean sharpRotVer = r.nextInt(6) == 0;
         for (; startPos < endPos; startPos++) {
             double width = 1.5D + (MathHelper.sin((startPos * MathHelper.PI) / endPos) * initialRadius * 1.0F);
             double height = width * heightMod;
@@ -70,19 +71,19 @@ public class WarrensCavesLargeFeature extends LargeFeature {
                 yRot += rotHorOffset * 0.1F;
                 rotVerOffset *= 0.9F;
                 rotHorOffset *= 0.75F;
-                rotVerOffset += (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 2.0F;
-                rotHorOffset += (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 4F;
+                rotVerOffset += (r.nextFloat() - r.nextFloat()) * r.nextFloat() * 2.0F;
+                rotHorOffset += (r.nextFloat() - r.nextFloat()) * r.nextFloat() * 4F;
 
-                final int flip = random.nextInt(5);
+                final int flip = r.nextInt(5);
                 if (flip == 0) {
                     yRot = -yRot;
                 }
 //                } else if (flip == 1) {
 //                    xRot = -xRot;
 //                }
-                final int addRandom = random.nextInt(4);
+                final int addRandom = r.nextInt(4);
                 if (addRandom == 0) {
-                    yRot += random.nextFloat() * MathHelper.PI - MathHelper.PI / 2;
+                    yRot += r.nextFloat() * MathHelper.PI - MathHelper.PI / 2;
                 }
 //                } else if (addRandom == 1) {
 //                    xRot += random.nextFloat() * MathHelper.PI - MathHelper.PI / 2;
@@ -91,13 +92,13 @@ public class WarrensCavesLargeFeature extends LargeFeature {
 
             // Do adjacent branches if necessary
             if (startPos == branchPos && initialRadius > 1.0F) {
-                generateCave(random.nextLong(), baseChunkX, baseChunkZ, result, blockX, blockY, blockZ, random.nextFloat() * 0.5F + 0.5F, yRot - MathHelper.PI / 2F, xRot / 3F, startPos, endPos, 1.0D);
-                generateCave(random.nextLong(), baseChunkX, baseChunkZ, result, blockX, blockY, blockZ, random.nextFloat() * 0.5F + 0.5F, yRot + MathHelper.PI / 2F, xRot / 3F, startPos, endPos, 1.0D);
+                generateCave(world, random, r.nextLong(), baseChunkX, baseChunkZ, result, blockX, blockY, blockZ, r.nextFloat() * 0.5F + 0.5F, yRot - MathHelper.PI / 2F, xRot / 3F, startPos, endPos, 1.0D);
+                generateCave(world, random, r.nextLong(), baseChunkX, baseChunkZ, result, blockX, blockY, blockZ, r.nextFloat() * 0.5F + 0.5F, yRot + MathHelper.PI / 2F, xRot / 3F, startPos, endPos, 1.0D);
                 return;
             }
 
             // Randomly skip a section
-            if (random.nextInt(4) == 0) {
+            if (r.nextInt(4) == 0) {
                 continue;
             }
 
@@ -193,29 +194,29 @@ public class WarrensCavesLargeFeature extends LargeFeature {
     }
 
     @Override
-    protected void doGeneration(World world, int chunkX, int chunkZ, int baseChunkX, int baseChunkZ, ChunkGeneratorResult result) {
-        int cavesToGenerate = rand.nextInt(rand.nextInt(rand.nextInt(100) + 1) + 1);
-        if (rand.nextInt(15) != 0) {
+    protected void doGeneration(@NotNull World world, @NotNull Random random, int chunkX, int chunkZ, int baseChunkX, int baseChunkZ, @NotNull ChunkGeneratorResult result) {
+        int cavesToGenerate = random.nextInt(random.nextInt(random.nextInt(100) + 1) + 1);
+        if (random.nextInt(15) != 0) {
             cavesToGenerate = 0;
         }
 
-        final int yRange = maxY - minY;
+        final int yRange = this.maxY - this.minY;
 
         for (int i = 0; i < cavesToGenerate; i++) {
-            double blockX = chunkX * Chunk.CHUNK_SIZE_X + rand.nextInt(Chunk.CHUNK_SIZE_X);
-            double blockY = minY + rand.nextInt(rand.nextInt(yRange - (ChunkSection.SECTION_SIZE_Y / 2)) + (ChunkSection.SECTION_SIZE_Y / 2));
-            double blockZ = chunkZ * Chunk.CHUNK_SIZE_Z + rand.nextInt(Chunk.CHUNK_SIZE_Z);
+            double blockX = chunkX * Chunk.CHUNK_SIZE_X + random.nextInt(Chunk.CHUNK_SIZE_X);
+            double blockY = this.minY + random.nextInt(random.nextInt(yRange - (ChunkSection.SECTION_SIZE_Y / 2)) + (ChunkSection.SECTION_SIZE_Y / 2));
+            double blockZ = chunkZ * Chunk.CHUNK_SIZE_Z + random.nextInt(Chunk.CHUNK_SIZE_Z);
 
             int numBranches = 1;
-            if (rand.nextInt(4) == 0) {
-                generateHubRoom(rand.nextLong(), baseChunkX, baseChunkZ, result, blockX, blockY, blockZ);
-                numBranches += rand.nextInt(4);
+            if (random.nextInt(4) == 0) {
+                generateHubRoom(world, random, random.nextLong(), baseChunkX, baseChunkZ, result, blockX, blockY, blockZ);
+                numBranches += random.nextInt(4);
             }
             for (int l1 = 0; l1 < numBranches; l1++) {
-                float yRot = rand.nextFloat() * MathHelper.PI * 2.0F; // 0 - 2Pi
-                float xRot = ((rand.nextFloat() - 0.5F) * 2.0F) / 8F; // -0.125 - 0.125
-                float initialRadius = rand.nextFloat() * 1.5f + rand.nextFloat(); // 0 - 3
-                generateCave(rand.nextLong(), baseChunkX, baseChunkZ, result, blockX, blockY, blockZ, initialRadius, yRot, xRot, 0, 0, 1.0f);
+                float yRot = random.nextFloat() * MathHelper.PI * 2.0F; // 0 - 2Pi
+                float xRot = ((random.nextFloat() - 0.5F) * 2.0F) / 8F; // -0.125 - 0.125
+                float initialRadius = random.nextFloat() * 1.5f + random.nextFloat(); // 0 - 3
+                generateCave(world, random, random.nextLong(), baseChunkX, baseChunkZ, result, blockX, blockY, blockZ, initialRadius, yRot, xRot, 0, 0, 1.0f);
             }
         }
     }
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/ChunkDecorator.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/ChunkDecorator.java
index 9ac66e3a6..32b506157 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/ChunkDecorator.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/ChunkDecorator.java
@@ -1,11 +1,12 @@
 package net.minecraft.core.world.generate.chunk;
 
 import net.minecraft.core.world.chunk.Chunk;
+import org.jetbrains.annotations.NotNull;
 
 public interface ChunkDecorator
 {
     /**
      * Places {@link net.minecraft.core.world.generate.feature.WorldFeature world features} on a given chunk.
      */
-    void decorate(Chunk chunk);
+    void decorate(@NotNull Chunk chunk);
 }
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/ChunkFeatureDecorator.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/ChunkFeatureDecorator.java
index ccbdcc2df..e8b77ae80 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/ChunkFeatureDecorator.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/ChunkFeatureDecorator.java
@@ -2,20 +2,15 @@ package net.minecraft.core.world.generate.chunk;
 
 import it.unimi.dsi.fastutil.objects.Object2IntMap;
 import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
-import net.minecraft.core.block.BlockLogic;
 import net.minecraft.core.block.BlockLogicSand;
 import net.minecraft.core.world.World;
 import net.minecraft.core.world.chunk.Chunk;
 import org.jetbrains.annotations.NotNull;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
 import java.util.Random;
 
 public abstract class ChunkFeatureDecorator
-    implements ChunkDecorator
-{
+    implements ChunkDecorator {
     private boolean initialized = false;
     private final @NotNull World world;
     private final @NotNull Object2IntMap<ChunkDecoration> decorations = new Object2IntOpenHashMap<>();
@@ -24,7 +19,8 @@ public abstract class ChunkFeatureDecorator
         this.world = world;
     }
 
-    /* package-private */ final void registerDecorationsSetup() {
+    /* package-private */
+    final void registerDecorationsSetup() {
         if (!this.initialized) {
             this.registerDecorations();
             this.initialized = true;
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/ChunkGenerator.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/ChunkGenerator.java
index 70e0c3e58..d8c6dd59f 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/ChunkGenerator.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/ChunkGenerator.java
@@ -1,14 +1,12 @@
 package net.minecraft.core.world.generate.chunk;
 
-import com.mojang.logging.CategorizedLogger;
-import com.mojang.logging.LogUtils;
 import net.minecraft.core.data.registry.Registries;
 import net.minecraft.core.world.World;
 import net.minecraft.core.world.biome.Biome;
 import net.minecraft.core.world.chunk.Chunk;
 import net.minecraft.core.world.chunk.ChunkSection;
 import net.minecraft.core.world.generate.feature.WorldFeature;
-import org.slf4j.Logger;
+import org.jetbrains.annotations.NotNull;
 
 import static net.minecraft.core.world.chunk.Chunk.CHUNK_SIZE_X;
 import static net.minecraft.core.world.chunk.Chunk.CHUNK_SIZE_Z;
@@ -19,20 +17,17 @@ import static net.minecraft.core.world.chunk.ChunkSection.SECTION_SIZE_Y;
  * coordinates for a particular {@link World world}, and to perform
  * {@link WorldFeature world feature} placement for that chunk.
  */
-public abstract class ChunkGenerator
-{
-    private static final CategorizedLogger LOGGER = LogUtils.getLogger();
-
-    protected final World world;
-    private final ChunkDecorator decorator;
+public abstract class ChunkGenerator {
+    protected final @NotNull World world;
+    private final @NotNull ChunkDecorator decorator;
 
     /**
      * Creates a new instance of {@link ChunkGenerator}.
-     * @param world The world to generate a chunk for.
+     *
+     * @param world     The world to generate a chunk for.
      * @param decorator The decorator to use to decorate the chunk.
      */
-    public ChunkGenerator(World world, ChunkDecorator decorator)
-    {
+    public ChunkGenerator(@NotNull World world, @NotNull ChunkDecorator decorator) {
         this.world = world;
         this.decorator = decorator;
     }
@@ -40,21 +35,21 @@ public abstract class ChunkGenerator
     /**
      * Generates a {@link Chunk chunk} at the specified coordinates chunkX and chunkZ.
      * This does not include placement of {@link WorldFeature world features}.
+     *
      * @return A chunk.
      */
-    public final Chunk generate(int chunkX, int chunkZ)
-    {
+    public final @NotNull Chunk generate(int chunkX, int chunkZ) {
         // Create chunk
-        Chunk chunk = new Chunk(world, chunkX, chunkZ);
+        Chunk chunk = new Chunk(this.world, chunkX, chunkZ);
 
         // Set up chunk temperature, humidity, and biome maps
-        chunk.temperature = world.getBiomeProvider().getTemperatures(null, chunkX * CHUNK_SIZE_X, chunkZ * CHUNK_SIZE_Z, CHUNK_SIZE_X, CHUNK_SIZE_Z);
-        chunk.humidity = world.getBiomeProvider().getHumidities(null, chunkX * CHUNK_SIZE_X, chunkZ * CHUNK_SIZE_Z, CHUNK_SIZE_X, CHUNK_SIZE_Z);
-        chunk.variety = world.getBiomeProvider().getVarieties(null, chunkX * CHUNK_SIZE_X, chunkZ * CHUNK_SIZE_Z, CHUNK_SIZE_X, CHUNK_SIZE_Z);
+        chunk.temperature = this.world.getBiomeProvider().getTemperatures(null, chunkX * CHUNK_SIZE_X, chunkZ * CHUNK_SIZE_Z, CHUNK_SIZE_X, CHUNK_SIZE_Z);
+        chunk.humidity = this.world.getBiomeProvider().getHumidities(null, chunkX * CHUNK_SIZE_X, chunkZ * CHUNK_SIZE_Z, CHUNK_SIZE_X, CHUNK_SIZE_Z);
+        chunk.variety = this.world.getBiomeProvider().getVarieties(null, chunkX * CHUNK_SIZE_X, chunkZ * CHUNK_SIZE_Z, CHUNK_SIZE_X, CHUNK_SIZE_Z);
 
         Biome[] biomes = new Biome[CHUNK_SIZE_X * (SECTION_SIZE_Y >> 3) * CHUNK_SIZE_Z];
         for (int sectionY = 0; sectionY < Chunk.CHUNK_SECTIONS; sectionY++) {
-            world.getBiomeProvider().getBiomes(biomes, chunk.temperature, chunk.humidity, chunk.variety, chunkX * CHUNK_SIZE_X, sectionY * SECTION_SIZE_Y, chunkZ * CHUNK_SIZE_Z, CHUNK_SIZE_X, SECTION_SIZE_Y >> 3, CHUNK_SIZE_Z);
+            this.world.getBiomeProvider().getBiomes(biomes, chunk.temperature, chunk.humidity, chunk.variety, chunkX * CHUNK_SIZE_X, sectionY * SECTION_SIZE_Y, chunkZ * CHUNK_SIZE_Z, CHUNK_SIZE_X, SECTION_SIZE_Y >> 3, CHUNK_SIZE_Z);
             ChunkSection section = chunk.getSection(sectionY);
             for (int i = 0; i < biomes.length; i++) {
                 section.biome[i] = (byte) Registries.BIOMES.getNumericIdOfItem(biomes[i]);
@@ -71,28 +66,29 @@ public abstract class ChunkGenerator
         }
 
         // Generate maps (e.g. height map, sky light map)
-        chunk.recalcHeightmap();
+        chunk.recalcHeightmapAndLightmap();
 
         return chunk;
     }
 
     /**
      * Decorate a chunk using the provided {@link ChunkDecorator}.
+     *
      * @param chunk The chunk to decorate.
      */
-    public final void decorate(Chunk chunk)
-    {
-        if (decorator instanceof ChunkFeatureDecorator) {
-            ((ChunkFeatureDecorator) decorator).registerDecorationsSetup();
+    public final void decorate(@NotNull Chunk chunk) {
+        if (this.decorator instanceof ChunkFeatureDecorator featureDecorator) {
+            featureDecorator.registerDecorationsSetup();
         }
 
-        decorator.decorate(chunk);
+        this.decorator.decorate(chunk);
     }
 
     /**
      * Generates the block array for a given chunk.
+     *
      * @param chunk The chunk to generate the block array for.
      * @return The block array resulting from chunk generation.
      */
-    protected abstract ChunkGeneratorResult doBlockGeneration(Chunk chunk);
+    protected abstract @NotNull ChunkGeneratorResult doBlockGeneration(@NotNull Chunk chunk);
 }
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/ChunkGeneratorResult.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/ChunkGeneratorResult.java
index ca4c9ee54..b40f6644a 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/ChunkGeneratorResult.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/ChunkGeneratorResult.java
@@ -4,17 +4,19 @@ import net.minecraft.core.block.Block;
 import net.minecraft.core.block.Blocks;
 import net.minecraft.core.world.chunk.Chunk;
 import net.minecraft.core.world.chunk.ChunkSection;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 
 import java.util.Arrays;
 
 public class ChunkGeneratorResult {
-    private final short[][] sectionBlocksArray;
-    private final int[] numBlocksInSectionArray;
+    private final short @NotNull [] @Nullable [] sectionBlocksArray;
+    private final int @NotNull [] numBlocksInSectionArray;
 
     public ChunkGeneratorResult() {
-        sectionBlocksArray = new short[Chunk.CHUNK_SECTIONS][];
-        numBlocksInSectionArray = new int[Chunk.CHUNK_SECTIONS];
-        Arrays.fill(numBlocksInSectionArray, 0);
+        this.sectionBlocksArray = new short[Chunk.CHUNK_SECTIONS][];
+        this.numBlocksInSectionArray = new int[Chunk.CHUNK_SECTIONS];
+        Arrays.fill(this.numBlocksInSectionArray, 0);
     }
 
     public void setBlock(int x, int y, int z, int id) {
@@ -29,35 +31,36 @@ public class ChunkGeneratorResult {
         Block<?> newBlock = Blocks.getBlock(id);
 
         // If the array is null and we're only clearing a block, skip creating it; otherwise, create it
-        if (sectionBlocksArray[section] == null) {
+        if (this.sectionBlocksArray[section] == null) {
             if (newBlock == null) {
                 return;
             } else {
-                sectionBlocksArray[section] = new short[Chunk.CHUNK_SIZE_X * ChunkSection.SECTION_SIZE_Y * Chunk.CHUNK_SIZE_Z];
+                this.sectionBlocksArray[section] = new short[Chunk.CHUNK_SIZE_X * ChunkSection.SECTION_SIZE_Y * Chunk.CHUNK_SIZE_Z];
             }
         }
 
         // Increment or decrement numBlocksInSection depending on whether we're setting or clearing a block
         Block<?> currentBlock = Blocks.getBlock(getBlock(x, y, z));
         if (newBlock == null && currentBlock != null) {
-            numBlocksInSectionArray[section]--;
+            this.numBlocksInSectionArray[section]--;
         } else if (newBlock != null && currentBlock == null) {
-            numBlocksInSectionArray[section]++;
+            this.numBlocksInSectionArray[section]++;
         }
 
-        sectionBlocksArray[section][ChunkSection.makeBlockIndex(x, cy, z)] = (short) id;
+        this.sectionBlocksArray[section][ChunkSection.makeBlockIndex(x, cy, z)] = (short) id;
     }
 
     public int getBlock(int x, int y, int z) {
-        if (x < 0 || x >= Chunk.CHUNK_SIZE_X || y < 0 || y >= (Chunk.CHUNK_SECTIONS * ChunkSection.SECTION_SIZE_Y) || z < 0 || z >= Chunk.CHUNK_SIZE_Z) return 0;
+        if (x < 0 || x >= Chunk.CHUNK_SIZE_X || y < 0 || y >= (Chunk.CHUNK_SECTIONS * ChunkSection.SECTION_SIZE_Y) || z < 0 || z >= Chunk.CHUNK_SIZE_Z)
+            return 0;
 
         int section = y / ChunkSection.SECTION_SIZE_Y;
         int cy = y % ChunkSection.SECTION_SIZE_Y;
 
-        if (sectionBlocksArray[section] == null) {
+        if (this.sectionBlocksArray[section] == null) {
             return 0;
         }
-        return sectionBlocksArray[section][ChunkSection.makeBlockIndex(x, cy, z)];
+        return this.sectionBlocksArray[section][ChunkSection.makeBlockIndex(x, cy, z)];
     }
 
     public short[] getSectionBlocks(int ySection) {
@@ -66,10 +69,10 @@ public class ChunkGeneratorResult {
         }
 
         // Check if the array has no non-air blocks, and if so, return null
-        if (numBlocksInSectionArray[ySection] <= 0) {
+        if (this.numBlocksInSectionArray[ySection] <= 0) {
             return null;
         }
 
-        return sectionBlocksArray[ySection];
+        return this.sectionBlocksArray[ySection];
     }
 }
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/classic/ChunkGeneratorClassic.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/classic/ChunkGeneratorClassic.java
index 45986e208..1beacac78 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/classic/ChunkGeneratorClassic.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/classic/ChunkGeneratorClassic.java
@@ -11,40 +11,38 @@ import net.minecraft.core.world.generate.chunk.perlin.overworld.retro.ChunkDecor
 import net.minecraft.core.world.generate.chunk.perlin.overworld.retro.SurfaceGeneratorOverworldRetro;
 import net.minecraft.core.world.noise.CombinedPerlinNoise;
 import net.minecraft.core.world.noise.PerlinNoise;
+import org.jetbrains.annotations.NotNull;
 
 public class ChunkGeneratorClassic
-    extends ChunkGenerator
-{
-    private final CombinedPerlinNoise combinedA;
-    private final CombinedPerlinNoise combinedB;
-    private final CombinedPerlinNoise combinedC;
-    private final CombinedPerlinNoise combinedD;
-    private final PerlinNoise octavesA;
-    private final PerlinNoise octavesB;
-
-    private final SurfaceGenerator sg;
-    private final CavesLargeFeature cg;
-
-    public ChunkGeneratorClassic(World world)
-    {
+    extends ChunkGenerator {
+    private final @NotNull CombinedPerlinNoise combinedA;
+    private final @NotNull CombinedPerlinNoise combinedB;
+    private final @NotNull CombinedPerlinNoise combinedC;
+    private final @NotNull CombinedPerlinNoise combinedD;
+    private final @NotNull PerlinNoise octavesA;
+    private final @NotNull PerlinNoise octavesB;
+
+    private final @NotNull SurfaceGenerator sg;
+    private final @NotNull CavesLargeFeature cg;
+
+    public ChunkGeneratorClassic(@NotNull World world) {
         super(world, new ChunkDecoratorOverworldRetro(world));
         long seed = world.getRandomSeed();
 
-        combinedA = new CombinedPerlinNoise(new PerlinNoise(seed, 8, 0), new PerlinNoise(seed, 8, 8));
-        combinedB = new CombinedPerlinNoise(new PerlinNoise(seed, 8, 16), new PerlinNoise(seed, 8, 24));
-        combinedC = new CombinedPerlinNoise(new PerlinNoise(seed, 8, 32), new PerlinNoise(seed, 8, 40));
-        combinedD = new CombinedPerlinNoise(new PerlinNoise(seed, 8, 48), new PerlinNoise(seed, 8, 56));
+        this.combinedA = new CombinedPerlinNoise(new PerlinNoise(seed, 8, 0), new PerlinNoise(seed, 8, 8));
+        this.combinedB = new CombinedPerlinNoise(new PerlinNoise(seed, 8, 16), new PerlinNoise(seed, 8, 24));
+        this.combinedC = new CombinedPerlinNoise(new PerlinNoise(seed, 8, 32), new PerlinNoise(seed, 8, 40));
+        this.combinedD = new CombinedPerlinNoise(new PerlinNoise(seed, 8, 48), new PerlinNoise(seed, 8, 56));
 
-        octavesA = new PerlinNoise(seed, 6, 64);
-        octavesB = new PerlinNoise(seed, 8, 70);
+        this.octavesA = new PerlinNoise(seed, 6, 64);
+        this.octavesB = new PerlinNoise(seed, 8, 70);
 
-        sg = new SurfaceGeneratorOverworldRetro(world);
-        cg = new CavesLargeFeature();
+        this.sg = new SurfaceGeneratorOverworldRetro(world);
+        this.cg = new CavesLargeFeature();
     }
 
     @Override
-    protected ChunkGeneratorResult doBlockGeneration(Chunk chunk)
-    {
+    protected @NotNull ChunkGeneratorResult doBlockGeneration(@NotNull Chunk chunk) {
         ChunkGeneratorResult result = new ChunkGeneratorResult();
 
         int chunkX = chunk.pos.x;
@@ -55,20 +53,16 @@ public class ChunkGeneratorClassic
         final int[] heightMap = new int[Chunk.CHUNK_SIZE_X * Chunk.CHUNK_SIZE_Z];
 
         // Raising..
-        for (int x = 0; x < Chunk.CHUNK_SIZE_X; x++)
-        {
-            for (int z = 0; z < Chunk.CHUNK_SIZE_Z; z++)
-            {
-                final double noiseA = combinedA.get((chunkX * Chunk.CHUNK_SIZE_X + x) * mod, (chunkZ * Chunk.CHUNK_SIZE_Z + z) * mod) / 6.0D + -4;
-                double noiseB = combinedB.get((chunkX * Chunk.CHUNK_SIZE_X + x) * mod, (chunkZ * Chunk.CHUNK_SIZE_Z + z) * mod) / 5.0D + 10.0D + -4;
-                if (octavesA.get(chunkX * Chunk.CHUNK_SIZE_X + x, chunkZ * Chunk.CHUNK_SIZE_Z + z) / 8.0D > 0.0D)
-                {
+        for (int x = 0; x < Chunk.CHUNK_SIZE_X; x++) {
+            for (int z = 0; z < Chunk.CHUNK_SIZE_Z; z++) {
+                final double noiseA = this.combinedA.get((chunkX * Chunk.CHUNK_SIZE_X + x) * mod, (chunkZ * Chunk.CHUNK_SIZE_Z + z) * mod) / 6.0D + -4;
+                double noiseB = this.combinedB.get((chunkX * Chunk.CHUNK_SIZE_X + x) * mod, (chunkZ * Chunk.CHUNK_SIZE_Z + z) * mod) / 5.0D + 10.0D + -4;
+                if (this.octavesA.get(chunkX * Chunk.CHUNK_SIZE_X + x, chunkZ * Chunk.CHUNK_SIZE_Z + z) / 8.0D > 0.0D) {
                     noiseB = noiseA;
                 }
 
                 double height;
-                if ((height = Math.max(noiseA, noiseB) / 2.0D) < 0.0D)
-                {
+                if ((height = Math.max(noiseA, noiseB) / 2.0D) < 0.0D) {
                     height *= 0.8D;
                 }
 
@@ -78,14 +72,11 @@ public class ChunkGeneratorClassic
 
         // Eroding..
         final int[] newHeightMap = heightMap;
-        for (int x = 0; x < Chunk.CHUNK_SIZE_X; x++)
-        {
-            for (int z = 0; z < Chunk.CHUNK_SIZE_Z; z++)
-            {
-                final double val = combinedC.get((chunkX * Chunk.CHUNK_SIZE_X + x) << 1, (chunkZ * Chunk.CHUNK_SIZE_Z + z) << 1) / 8.0D;
-                final int val2 = combinedD.get((chunkX * Chunk.CHUNK_SIZE_X + x) << 1, (chunkZ * Chunk.CHUNK_SIZE_Z + z) << 1) > 0.0D ? 1 : 0;
-                if (val > 2.0D)
-                {
+        for (int x = 0; x < Chunk.CHUNK_SIZE_X; x++) {
+            for (int z = 0; z < Chunk.CHUNK_SIZE_Z; z++) {
+                final double val = this.combinedC.get((chunkX * Chunk.CHUNK_SIZE_X + x) << 1, (chunkZ * Chunk.CHUNK_SIZE_Z + z) << 1) / 8.0D;
+                final int val2 = this.combinedD.get((chunkX * Chunk.CHUNK_SIZE_X + x) << 1, (chunkZ * Chunk.CHUNK_SIZE_Z + z) << 1) > 0.0D ? 1 : 0;
+                if (val > 2.0D) {
                     final int newHeight = ((newHeightMap[x + z * Chunk.CHUNK_SIZE_X] - val2) / 2 << 1) + val2;
                     newHeightMap[x + z * Chunk.CHUNK_SIZE_X] = newHeight;
                 }
@@ -93,40 +84,31 @@ public class ChunkGeneratorClassic
         }
 
         // Soiling..
-        for (int x = 0; x < Chunk.CHUNK_SIZE_X; x++)
-        {
-            for (int z = 0; z < Chunk.CHUNK_SIZE_Z; z++)
-            {
-                final int val = (int) (octavesB.get(chunkX * Chunk.CHUNK_SIZE_X + x, chunkZ * Chunk.CHUNK_SIZE_Z + z) / 24.0D) - 4;
+        for (int x = 0; x < Chunk.CHUNK_SIZE_X; x++) {
+            for (int z = 0; z < Chunk.CHUNK_SIZE_Z; z++) {
+                final int val = (int) (this.octavesB.get(chunkX * Chunk.CHUNK_SIZE_X + x, chunkZ * Chunk.CHUNK_SIZE_Z + z) / 24.0D) - 4;
                 int newHeight;
-                final int val2 = (newHeight = newHeightMap[x + z * Chunk.CHUNK_SIZE_X] + world.getWorldType().getOceanY()) + val;
+                final int val2 = (newHeight = newHeightMap[x + z * Chunk.CHUNK_SIZE_X] + this.world.getWorldType().getOceanY()) + val;
                 newHeightMap[x + z * Chunk.CHUNK_SIZE_X] = Math.max(newHeight, val2);
-                if (newHeightMap[x + z * Chunk.CHUNK_SIZE_X] > world.getWorldType().getMaxY() - 2)
-                {
-                    newHeightMap[x + z * Chunk.CHUNK_SIZE_X] = world.getWorldType().getMaxY() - 2;
+                if (newHeightMap[x + z * Chunk.CHUNK_SIZE_X] > this.world.getWorldType().getMaxY() - 2) {
+                    newHeightMap[x + z * Chunk.CHUNK_SIZE_X] = this.world.getWorldType().getMaxY() - 2;
                 }
 
-                if (newHeightMap[x + z * Chunk.CHUNK_SIZE_X] < 1)
-                {
+                if (newHeightMap[x + z * Chunk.CHUNK_SIZE_X] < 1) {
                     newHeightMap[x + z * Chunk.CHUNK_SIZE_X] = 1;
                 }
 
-                for (int y = world.getWorldType().getMinY(); y < world.getWorldType().getMaxY(); y++)
-                {
+                for (int y = this.world.getWorldType().getMinY(); y < this.world.getWorldType().getMaxY(); y++) {
                     final int index = Chunk.makeBlockIndex(x, y, z);
                     int blockID = 0;
 
-                    if (y < newHeight)
-                    {
-                        blockID = world.getWorldType().getFillerBlockId();
-                    }
-                    else if (y < world.getWorldType().getOceanY())
-                    {
-                        blockID = world.getWorldType().getOceanBlockId();
+                    if (y < newHeight) {
+                        blockID = this.world.getWorldType().getFillerBlockId();
+                    } else if (y < this.world.getWorldType().getOceanY()) {
+                        blockID = this.world.getWorldType().getOceanBlockId();
                     }
 
-                    if (y == 0)
-                    {
+                    if (y == 0) {
                         blockID = Blocks.BEDROCK.id();
                     }
 
@@ -135,8 +117,8 @@ public class ChunkGeneratorClassic
             }
         }
 
-        sg.generateSurface(chunk, result);
-        cg.generate(world, chunkX, chunkZ, result);
+        this.sg.generateSurface(chunk, result);
+        this.cg.generate(this.world, chunkX, chunkZ, result);
 
         return result;
     }
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/debug/ChunkDecoratorDebug.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/debug/ChunkDecoratorDebug.java
index a052ce914..7fe89a8da 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/debug/ChunkDecoratorDebug.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/debug/ChunkDecoratorDebug.java
@@ -3,32 +3,29 @@ package net.minecraft.core.world.generate.chunk.debug;
 import net.minecraft.core.block.Blocks;
 import net.minecraft.core.world.chunk.Chunk;
 import net.minecraft.core.world.generate.chunk.ChunkDecorator;
+import org.jetbrains.annotations.NotNull;
 
 public class ChunkDecoratorDebug
-    implements ChunkDecorator
-{
+    implements ChunkDecorator {
     @Override
-    public void decorate(Chunk chunk)
-    {
+    public void decorate(@NotNull Chunk chunk) {
         int chunkX = chunk.pos.x;
         int chunkZ = chunk.pos.z;
 
         int chunkBlockOffset = chunkX * (Chunk.CHUNK_SIZE_X / 2);
         int chunkMetaOffset = chunkZ * (Chunk.CHUNK_SIZE_Z / 2);
 
-        for (int x = 0; x < Chunk.CHUNK_SIZE_X; x++)
-        {
-            for (int z =  0; z < Chunk.CHUNK_SIZE_X; z++)
-            {
+        for (int x = 0; x < Chunk.CHUNK_SIZE_X; x++) {
+            for (int z = 0; z < Chunk.CHUNK_SIZE_X; z++) {
                 int blockBlockOffset = x / 2;
                 int blockMetaOffset = z / 2;
 
-                if (x % 2 == 0 && z % 2 == 0)
-                {
+                if (x % 2 == 0 && z % 2 == 0) {
                     int blockId = chunkBlockOffset + blockBlockOffset;
                     int meta = chunkMetaOffset + blockMetaOffset;
 
-                    if (blockId < 0 || blockId >= Blocks.blocksList.length || Blocks.blocksList[blockId] == null) continue;
+                    if (blockId < 0 || blockId >= Blocks.blocksList.length || Blocks.blocksList[blockId] == null)
+                        continue;
 
                     chunk.setBlockIDWithMetadata(x, 0, z, blockId, meta);
                 }
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/debug/ChunkGeneratorDebug.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/debug/ChunkGeneratorDebug.java
index 5fc72a338..3c7243f4c 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/debug/ChunkGeneratorDebug.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/debug/ChunkGeneratorDebug.java
@@ -4,18 +4,16 @@ import net.minecraft.core.world.World;
 import net.minecraft.core.world.chunk.Chunk;
 import net.minecraft.core.world.generate.chunk.ChunkGenerator;
 import net.minecraft.core.world.generate.chunk.ChunkGeneratorResult;
+import org.jetbrains.annotations.NotNull;
 
 public class ChunkGeneratorDebug
-    extends ChunkGenerator
-{
-    public ChunkGeneratorDebug(World world)
-    {
+    extends ChunkGenerator {
+    public ChunkGeneratorDebug(@NotNull World world) {
         super(world, new ChunkDecoratorDebug());
     }
 
     @Override
-    protected ChunkGeneratorResult doBlockGeneration(Chunk chunk)
-    {
+    protected @NotNull ChunkGeneratorResult doBlockGeneration(@NotNull Chunk chunk) {
         return new ChunkGeneratorResult();
     }
 }
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/empty/ChunkDecoratorEmpty.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/empty/ChunkDecoratorEmpty.java
index 8376e7b5f..6d26e3edc 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/empty/ChunkDecoratorEmpty.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/empty/ChunkDecoratorEmpty.java
@@ -3,15 +3,13 @@ package net.minecraft.core.world.generate.chunk.empty;
 import net.minecraft.core.block.Blocks;
 import net.minecraft.core.world.chunk.Chunk;
 import net.minecraft.core.world.generate.chunk.ChunkDecorator;
+import org.jetbrains.annotations.NotNull;
 
 public class ChunkDecoratorEmpty
-    implements ChunkDecorator
-{
+    implements ChunkDecorator {
     @Override
-    public void decorate(Chunk chunk)
-    {
-        if (chunk.pos.x == 0 && chunk.pos.z == 0)
-        {
+    public void decorate(@NotNull Chunk chunk) {
+        if (chunk.pos.x == 0 && chunk.pos.z == 0) {
             chunk.setBlockID(0, 0, 0, Blocks.BEDROCK.id());
         }
     }
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/empty/ChunkGeneratorEmpty.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/empty/ChunkGeneratorEmpty.java
index 48b21c7b1..0d2bba999 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/empty/ChunkGeneratorEmpty.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/empty/ChunkGeneratorEmpty.java
@@ -4,18 +4,16 @@ import net.minecraft.core.world.World;
 import net.minecraft.core.world.chunk.Chunk;
 import net.minecraft.core.world.generate.chunk.ChunkGenerator;
 import net.minecraft.core.world.generate.chunk.ChunkGeneratorResult;
+import org.jetbrains.annotations.NotNull;
 
 public class ChunkGeneratorEmpty
-    extends ChunkGenerator
-{
-    public ChunkGeneratorEmpty(World world)
-    {
+    extends ChunkGenerator {
+    public ChunkGeneratorEmpty(@NotNull World world) {
         super(world, new ChunkDecoratorEmpty());
     }
 
     @Override
-    protected ChunkGeneratorResult doBlockGeneration(Chunk chunk)
-    {
+    protected @NotNull ChunkGeneratorResult doBlockGeneration(@NotNull Chunk chunk) {
         return new ChunkGeneratorResult();
     }
 }
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/flat/ChunkDecoratorFlat.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/flat/ChunkDecoratorFlat.java
index 5527847fa..8968231e1 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/flat/ChunkDecoratorFlat.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/flat/ChunkDecoratorFlat.java
@@ -2,13 +2,12 @@ package net.minecraft.core.world.generate.chunk.flat;
 
 import net.minecraft.core.world.chunk.Chunk;
 import net.minecraft.core.world.generate.chunk.ChunkDecorator;
+import org.jetbrains.annotations.NotNull;
 
 public class ChunkDecoratorFlat
-    implements ChunkDecorator
-{
+    implements ChunkDecorator {
     @Override
-    public void decorate(Chunk chunk)
-    {
+    public void decorate(@NotNull Chunk chunk) {
         // Do nothing lol
     }
 }
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/flat/ChunkGeneratorFlat.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/flat/ChunkGeneratorFlat.java
index 50b6e66cc..20b3cd082 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/flat/ChunkGeneratorFlat.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/flat/ChunkGeneratorFlat.java
@@ -5,18 +5,16 @@ import net.minecraft.core.world.World;
 import net.minecraft.core.world.chunk.Chunk;
 import net.minecraft.core.world.generate.chunk.ChunkGenerator;
 import net.minecraft.core.world.generate.chunk.ChunkGeneratorResult;
+import org.jetbrains.annotations.NotNull;
 
 public class ChunkGeneratorFlat
-    extends ChunkGenerator
-{
-    public ChunkGeneratorFlat(World world)
-    {
+    extends ChunkGenerator {
+    public ChunkGeneratorFlat(@NotNull World world) {
         super(world, new ChunkDecoratorFlat());
     }
 
     @Override
-    protected ChunkGeneratorResult doBlockGeneration(Chunk chunk)
-    {
+    protected @NotNull ChunkGeneratorResult doBlockGeneration(@NotNull Chunk chunk) {
         ChunkGeneratorResult result = new ChunkGeneratorResult();
 
         for (int z = 0; z < Chunk.CHUNK_SIZE_Z; z++) {
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/indev/ChunkGeneratorIndev.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/indev/ChunkGeneratorIndev.java
index 9073d64aa..c939e2f8b 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/indev/ChunkGeneratorIndev.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/indev/ChunkGeneratorIndev.java
@@ -9,32 +9,30 @@ import net.minecraft.core.world.generate.chunk.ChunkGeneratorResult;
 import net.minecraft.core.world.generate.chunk.perlin.SurfaceGenerator;
 import net.minecraft.core.world.generate.chunk.perlin.overworld.retro.ChunkDecoratorOverworldRetro;
 import net.minecraft.core.world.generate.chunk.perlin.overworld.retro.SurfaceGeneratorOverworldRetro;
+import org.jetbrains.annotations.NotNull;
 
 public class ChunkGeneratorIndev
-    extends ChunkGenerator
-{
-    private final LevelGenerator lg;
-    private final SurfaceGenerator sg;
-    private final CavesLargeFeature cg;
-
-    public ChunkGeneratorIndev(World world, int sizeX, int sizeY, int sizeZ, IndevWorldType worldType, IndevWorldTheme worldTheme)
-    {
+    extends ChunkGenerator {
+    private final @NotNull LevelGenerator lg;
+    private final @NotNull SurfaceGenerator sg;
+    private final @NotNull CavesLargeFeature cg;
+
+    public ChunkGeneratorIndev(@NotNull World world, int sizeX, int sizeY, int sizeZ, @NotNull IndevWorldType worldType, @NotNull IndevWorldTheme worldTheme) {
         super(world, new ChunkDecoratorOverworldRetro(world));
 
-        lg = new LevelGenerator(sizeX, sizeY, sizeZ, worldType, worldTheme);
-        sg = new SurfaceGeneratorOverworldRetro(world);
-        cg = new CavesLargeFeature();
+        this.lg = new LevelGenerator(sizeX, sizeY, sizeZ, worldType, worldTheme);
+        this.sg = new SurfaceGeneratorOverworldRetro(world);
+        this.cg = new CavesLargeFeature();
     }
 
     @Override
-    protected ChunkGeneratorResult doBlockGeneration(Chunk chunk)
-    {
+    protected @NotNull ChunkGeneratorResult doBlockGeneration(@NotNull Chunk chunk) {
         ChunkGeneratorResult result = new ChunkGeneratorResult();
 
         int chunkX = chunk.pos.x;
         int chunkZ = chunk.pos.z;
 
-        lg.generate(world, result, chunkX * Chunk.CHUNK_SIZE_X, chunkZ * Chunk.CHUNK_SIZE_Z);
+        this.lg.generate(this.world, result, chunkX * Chunk.CHUNK_SIZE_X, chunkZ * Chunk.CHUNK_SIZE_Z);
 
         // Place bedrock
         for (int x = 0; x < Chunk.CHUNK_SIZE_X; x++) {
@@ -43,8 +41,8 @@ public class ChunkGeneratorIndev
             }
         }
 
-        sg.generateSurface(chunk, result);
-        cg.generate(world, chunkX, chunkZ, result);
+        this.sg.generateSurface(chunk, result);
+        this.cg.generate(this.world, chunkX, chunkZ, result);
 
         return result;
     }
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/indev/LevelGenerator.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/indev/LevelGenerator.java
index 04a27a2b2..a7bd40a6b 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/indev/LevelGenerator.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/indev/LevelGenerator.java
@@ -6,16 +6,17 @@ import net.minecraft.core.world.chunk.Chunk;
 import net.minecraft.core.world.generate.chunk.ChunkGeneratorResult;
 import net.minecraft.core.world.noise.CombinedPerlinNoise;
 import net.minecraft.core.world.noise.RetroPerlinNoise;
+import org.jetbrains.annotations.NotNull;
 
 public final class LevelGenerator {
     private final int sizeX;
     private final int sizeY;
     private final int sizeZ;
 
-    private final IndevWorldType worldType;
-    private final IndevWorldTheme worldTheme;
+    private final @NotNull IndevWorldType worldType;
+    private final @NotNull IndevWorldTheme worldTheme;
 
-    public LevelGenerator(int sizeX, int sizeY, int sizeZ, IndevWorldType worldType, IndevWorldTheme worldTheme) {
+    public LevelGenerator(int sizeX, int sizeY, int sizeZ, @NotNull IndevWorldType worldType, @NotNull IndevWorldTheme worldTheme) {
         this.sizeX = sizeX;
         this.sizeY = sizeY;
         this.sizeZ = sizeZ;
@@ -29,7 +30,7 @@ public final class LevelGenerator {
 
         int layers = 1;
         if (this.worldType == IndevWorldType.FLOATING) {
-            layers = (sizeY - 64) / 48 + 1;
+            layers = (this.sizeY - 64) / 48 + 1;
         }
 
         for (int layer = 0; layer < layers; layer++) {
@@ -49,10 +50,10 @@ public final class LevelGenerator {
                 RetroPerlinNoise edgeNoiseGenerator = new RetroPerlinNoise(seed, 2, 38);
 
                 for (int x = 0; x < Chunk.CHUNK_SIZE_X; x++) {
-                    double xDistanceFromCenter = Math.abs(((double) (x + xOffset) / ((double) sizeX - 1.0) - 0.5) * 2.0);
+                    double xDistanceFromCenter = Math.abs(((double) (x + xOffset) / ((double) this.sizeX - 1.0) - 0.5) * 2.0);
 
                     for (int z = 0; z < Chunk.CHUNK_SIZE_Z; z++) {
-                        double zDistanceFromCenter = Math.abs(((double) (z + zOffset) / ((double) sizeZ - 1.0) - 0.5) * 2.0);
+                        double zDistanceFromCenter = Math.abs(((double) (z + zOffset) / ((double) this.sizeZ - 1.0) - 0.5) * 2.0);
 
                         // Generate noise to use for height
                         double heightNoiseA = heightNoiseGeneratorA.get((float) (x + xOffset) * 1.3F, (float) (z + zOffset) * 1.3F) / 6.0 + -4.0;
@@ -118,10 +119,10 @@ public final class LevelGenerator {
             RetroPerlinNoise floatingLayerNoiseGenerator = new RetroPerlinNoise(seed, 8, 80);
 
             for (int x = 0; x < Chunk.CHUNK_SIZE_X; x++) {
-                double xDistanceFromCenter = Math.abs(((double) (x + xOffset) / ((double) sizeX - 1.0) - 0.5) * 2.0);
+                double xDistanceFromCenter = Math.abs(((double) (x + xOffset) / ((double) this.sizeX - 1.0) - 0.5) * 2.0);
 
                 for (int z = 0; z < Chunk.CHUNK_SIZE_Z; z++) {
-                    double zDistanceFromCenter = Math.abs(((double) (z + zOffset) / ((double) sizeZ - 1.0) - 0.5) * 2.0);
+                    double zDistanceFromCenter = Math.abs(((double) (z + zOffset) / ((double) this.sizeZ - 1.0) - 0.5) * 2.0);
                     double distanceFromCenter = Math.max(xDistanceFromCenter, zDistanceFromCenter);
                     distanceFromCenter = distanceFromCenter * distanceFromCenter * distanceFromCenter;
 
@@ -131,8 +132,8 @@ public final class LevelGenerator {
                     int soilHeight = height + soilNoise;
 
                     heightMap[x + z * Chunk.CHUNK_SIZE_X] = Math.max(height, soilHeight);
-                    if (heightMap[x + z * Chunk.CHUNK_SIZE_X] > sizeY - 2) {
-                        heightMap[x + z * Chunk.CHUNK_SIZE_X] = sizeY - 2;
+                    if (heightMap[x + z * Chunk.CHUNK_SIZE_X] > this.sizeY - 2) {
+                        heightMap[x + z * Chunk.CHUNK_SIZE_X] = this.sizeY - 2;
                     }
 
                     if (heightMap[x + z * Chunk.CHUNK_SIZE_X] <= 0) {
@@ -142,18 +143,18 @@ public final class LevelGenerator {
                     // Determine the minimum height of the layer (only applicable in floating island generation)
                     double floatingLayerNoise = floatingLayerNoiseGenerator.get((double) (x + xOffset) * 2.3, (double) (z + zOffset) * 2.3) / 24.0;
                     int floatingLayerMinY = (int) (Math.sqrt(Math.abs(floatingLayerNoise)) * Math.signum(floatingLayerNoise) * 20.0) + waterLevel;
-                    floatingLayerMinY = (int) ((double) floatingLayerMinY * (1.0 - distanceFromCenter) + distanceFromCenter * (double) sizeY);
+                    floatingLayerMinY = (int) ((double) floatingLayerMinY * (1.0 - distanceFromCenter) + distanceFromCenter * (double) this.sizeY);
                     if (floatingLayerMinY > waterLevel) {
-                        floatingLayerMinY = sizeY;
+                        floatingLayerMinY = this.sizeY;
                     }
 
-                    for (int y = 0; y < sizeY; y++) {
+                    for (int y = 0; y < this.sizeY; y++) {
                         int id = 0;
                         if (y <= height) {
                             id = Blocks.STONE.id();
                         }
 
-                        if (worldType == IndevWorldType.FLOATING && y < floatingLayerMinY) {
+                        if (this.worldType == IndevWorldType.FLOATING && y < floatingLayerMinY) {
                             id = 0;
                         }
 
@@ -169,7 +170,7 @@ public final class LevelGenerator {
             RetroPerlinNoise sandNoiseGenerator = new RetroPerlinNoise(seed, 8, 88);
             RetroPerlinNoise gravelNoiseGenerator = new RetroPerlinNoise(seed, 8, 96);
             int beachHeight = waterLevel - 1;
-            if (worldTheme == IndevWorldTheme.PARADISE) {
+            if (this.worldTheme == IndevWorldTheme.PARADISE) {
                 beachHeight += 2;
             }
 
@@ -178,15 +179,15 @@ public final class LevelGenerator {
                     boolean isSand = sandNoiseGenerator.get(x + xOffset, z + zOffset) > 8.0;
                     boolean isGravel = gravelNoiseGenerator.get(x + xOffset, z + zOffset) > 12.0;
 
-                    if (worldType == IndevWorldType.ISLAND) {
+                    if (this.worldType == IndevWorldType.ISLAND) {
                         isSand = sandNoiseGenerator.get(x + xOffset, z + zOffset) > -8.0;
                     }
 
-                    if (worldTheme == IndevWorldTheme.PARADISE) {
+                    if (this.worldTheme == IndevWorldTheme.PARADISE) {
                         isSand = sandNoiseGenerator.get(x + xOffset, z + zOffset) > -32.0;
                     }
 
-                    if (worldTheme == IndevWorldTheme.HELL || worldTheme == IndevWorldTheme.WOODS) {
+                    if (this.worldTheme == IndevWorldTheme.HELL || this.worldTheme == IndevWorldTheme.WOODS) {
                         isSand = sandNoiseGenerator.get(x + xOffset, z + zOffset) > -8.0;
                     }
 
@@ -201,7 +202,7 @@ public final class LevelGenerator {
                         int id = -1;
                         if (height <= beachHeight && isSand) {
                             id = Blocks.SAND.id();
-                            if (worldTheme == IndevWorldTheme.HELL) {
+                            if (this.worldTheme == IndevWorldTheme.HELL) {
                                 id = Blocks.GRASS.id();
                             }
                         }
@@ -215,10 +216,10 @@ public final class LevelGenerator {
         }
 
         // Watering phase
-        if (worldType != IndevWorldType.FLOATING) {
+        if (this.worldType != IndevWorldType.FLOATING) {
             for (int x = 0; x < Chunk.CHUNK_SIZE_X; x++) {
                 for (int z = 0; z < Chunk.CHUNK_SIZE_Z; z++) {
-                    for (int y = 0; y < sizeY; y++) {
+                    for (int y = 0; y < this.sizeY; y++) {
                         int i = Chunk.makeBlockIndex(x, y, z);
                         int id = result.getBlock(x, y, z);
                         if (id == 0 && y < waterLevel) {
@@ -230,7 +231,7 @@ public final class LevelGenerator {
         }
     }
 
-    public static void generateHouse(World world) {
+    public static void generateHouse(@NotNull World world) {
         int xSpawn = world.getLevelData().getSpawnX();
         int ySpawn = world.getLevelData().getSpawnY();
         int zSpawn = world.getLevelData().getSpawnZ();
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/ChunkGeneratorPerlin.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/ChunkGeneratorPerlin.java
index eccb5ddb1..631bf8df1 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/ChunkGeneratorPerlin.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/ChunkGeneratorPerlin.java
@@ -6,6 +6,7 @@ import net.minecraft.core.world.generate.LargeFeature;
 import net.minecraft.core.world.generate.chunk.ChunkDecorator;
 import net.minecraft.core.world.generate.chunk.ChunkGenerator;
 import net.minecraft.core.world.generate.chunk.ChunkGeneratorResult;
+import org.jetbrains.annotations.NotNull;
 
 import java.util.Arrays;
 import java.util.List;
@@ -14,14 +15,12 @@ import java.util.List;
  * This class provides basic functionality to generate a {@link Chunk chunk} using 3-dimensional Perlin noise.
  */
 public class ChunkGeneratorPerlin
-    extends ChunkGenerator
-{
-    private final TerrainGenerator terrainGenerator;
-    private final SurfaceGenerator surfaceGenerator;
-    private final List<LargeFeature> largeFeatures;
+    extends ChunkGenerator {
+    private final @NotNull TerrainGenerator terrainGenerator;
+    private final @NotNull SurfaceGenerator surfaceGenerator;
+    private final @NotNull List<LargeFeature> largeFeatures;
 
-    protected ChunkGeneratorPerlin(World world, ChunkDecorator decorator, TerrainGenerator terrainGenerator, SurfaceGenerator surfaceGenerator, LargeFeature[] largeFeatures)
-    {
+    protected ChunkGeneratorPerlin(@NotNull World world, @NotNull ChunkDecorator decorator, @NotNull TerrainGenerator terrainGenerator, @NotNull SurfaceGenerator surfaceGenerator, @NotNull LargeFeature @NotNull [] largeFeatures) {
         super(world, decorator);
 
         this.terrainGenerator = terrainGenerator;
@@ -30,13 +29,12 @@ public class ChunkGeneratorPerlin
     }
 
     @Override
-    protected ChunkGeneratorResult doBlockGeneration(Chunk chunk)
-    {
-        double[] densityMap = terrainGenerator.getDensityGenerator().generateDensityMap(chunk);
-        ChunkGeneratorResult result = terrainGenerator.generateTerrain(chunk, densityMap);
-        surfaceGenerator.generateSurface(chunk, result);
-        for (LargeFeature largeFeature : largeFeatures) {
-            largeFeature.generate(world, chunk.pos.x, chunk.pos.z, result);
+    protected @NotNull ChunkGeneratorResult doBlockGeneration(@NotNull Chunk chunk) {
+        double[] densityMap = this.terrainGenerator.getDensityGenerator().generateDensityMap(chunk);
+        ChunkGeneratorResult result = this.terrainGenerator.generateTerrain(chunk, densityMap);
+        this.surfaceGenerator.generateSurface(chunk, result);
+        for (LargeFeature largeFeature : this.largeFeatures) {
+            largeFeature.generate(this.world, chunk.pos.x, chunk.pos.z, result);
         }
 
         return result;
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/DensityGenerator.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/DensityGenerator.java
index 0a82f783d..f09076970 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/DensityGenerator.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/DensityGenerator.java
@@ -2,18 +2,17 @@ package net.minecraft.core.world.generate.chunk.perlin;
 
 import net.minecraft.core.world.World;
 import net.minecraft.core.world.chunk.Chunk;
+import org.jetbrains.annotations.NotNull;
 
 /**
  * This interface provides the ability to generate a 3-dimensional density map, as would be used in a subclass of
  * {@link ChunkGeneratorPerlin} to generate terrain for a {@link Chunk}.
  */
-public interface DensityGenerator
-{
+public interface DensityGenerator {
     /**
      * Reads the density in densities at the given x, y, and z coordinates.
      */
-    static double readDensity(World world, double[] densities, int x, int y, int z)
-    {
+    static double readDensity(@NotNull World world, double @NotNull [] densities, int x, int y, int z) {
         int sizeX = 4 + 1;
         int sizeY = (world.getHeightBlocks() / 8) + 1;
         int sizeZ = 4 + 1;
@@ -23,8 +22,9 @@ public interface DensityGenerator
 
     /**
      * Generates a density map at the given coordinates and of the specified size.
+     *
      * @return A density map with dimensions equal to 5 * 33 * 5, arranged such that a given set of
      * coordinates x, y, z can be accessed by index [(x * 33 * 5) + (z * 33) + y].
      */
-    double[] generateDensityMap(Chunk chunk);
+    double @NotNull [] generateDensityMap(@NotNull Chunk chunk);
 }
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/SurfaceGenerator.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/SurfaceGenerator.java
index d1e2a2820..33c1e33c2 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/SurfaceGenerator.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/SurfaceGenerator.java
@@ -2,8 +2,8 @@ package net.minecraft.core.world.generate.chunk.perlin;
 
 import net.minecraft.core.world.chunk.Chunk;
 import net.minecraft.core.world.generate.chunk.ChunkGeneratorResult;
+import org.jetbrains.annotations.NotNull;
 
-public interface SurfaceGenerator
-{
-    void generateSurface(Chunk chunk, ChunkGeneratorResult result);
+public interface SurfaceGenerator {
+    void generateSurface(@NotNull Chunk chunk, @NotNull ChunkGeneratorResult result);
 }
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/TerrainGenerator.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/TerrainGenerator.java
index 920c8a1da..45df4164d 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/TerrainGenerator.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/TerrainGenerator.java
@@ -2,10 +2,10 @@ package net.minecraft.core.world.generate.chunk.perlin;
 
 import net.minecraft.core.world.chunk.Chunk;
 import net.minecraft.core.world.generate.chunk.ChunkGeneratorResult;
+import org.jetbrains.annotations.NotNull;
 
-public interface TerrainGenerator
-{
-    ChunkGeneratorResult generateTerrain(Chunk chunk, double[] densityMap);
+public interface TerrainGenerator {
+    @NotNull ChunkGeneratorResult generateTerrain(@NotNull Chunk chunk, double @NotNull [] densityMap);
 
-    DensityGenerator getDensityGenerator();
+    @NotNull DensityGenerator getDensityGenerator();
 }
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/TerrainGeneratorLerp.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/TerrainGeneratorLerp.java
index 227e6d6a0..2452ce03e 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/TerrainGeneratorLerp.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/TerrainGeneratorLerp.java
@@ -3,29 +3,27 @@ package net.minecraft.core.world.generate.chunk.perlin;
 import net.minecraft.core.world.World;
 import net.minecraft.core.world.chunk.Chunk;
 import net.minecraft.core.world.generate.chunk.ChunkGeneratorResult;
+import org.jetbrains.annotations.NotNull;
 
 import java.util.Random;
 
 public abstract class TerrainGeneratorLerp
-    implements TerrainGenerator
-{
-    protected final World world;
-    protected final Random rand;
+    implements TerrainGenerator {
+    protected final @NotNull World world;
+    protected final @NotNull Random rand;
 
-    public TerrainGeneratorLerp(World world)
-    {
+    public TerrainGeneratorLerp(@NotNull World world) {
         this.world = world;
         this.rand = new Random();
     }
 
-    protected abstract int getBlockAt(Chunk chunk, int x, int y, int z, double density);
+    protected abstract int getBlockAt(@NotNull Chunk chunk, int x, int y, int z, double density);
 
     @Override
-    public ChunkGeneratorResult generateTerrain(Chunk chunk, double[] densityMap)
-    {
-        int terrainHeight = (world.getWorldType().getMaxY() + 1) - world.getWorldType().getMinY();
+    public @NotNull ChunkGeneratorResult generateTerrain(@NotNull Chunk chunk, double @NotNull [] densityMap) {
+        int terrainHeight = (this.world.getWorldType().getMaxY() + 1) - this.world.getWorldType().getMinY();
 
-        rand.setSeed((long) chunk.pos.x * 0x4F9939F508L + (long) chunk.pos.z * 0x1EF1565BD5L);
+        this.rand.setSeed((long) chunk.pos.x * 0x4F9939F508L + (long) chunk.pos.z * 0x1EF1565BD5L);
 
         // Number of blocks per chunk.
         final int xBlocksPerChunk = Chunk.CHUNK_SIZE_X;
@@ -74,12 +72,9 @@ public abstract class TerrainGeneratorLerp
         ChunkGeneratorResult result = new ChunkGeneratorResult();
 
         // Iterate through each blob in the chunk.
-        for (int blobX = 0; blobX < xBlobsPerChunk; blobX++)
-        {
-            for (int blobZ = 0; blobZ < zBlobsPerChunk; blobZ++)
-            {
-                for (int blobY = 0; blobY < yBlobsPerChunk; blobY++)
-                {
+        for (int blobX = 0; blobX < xBlobsPerChunk; blobX++) {
+            for (int blobZ = 0; blobZ < zBlobsPerChunk; blobZ++) {
+                for (int blobY = 0; blobY < yBlobsPerChunk; blobY++) {
                     // Fetches the densities for each corner of the current blob, so we can interpolate between them.
                     final double densityMinXMinYMinZ = densityMap[(((blobX * zDensitiesPerChunk) + blobZ) * yDensitiesPerChunk) + blobY];
                     final double densityMinXMinYMaxZ = densityMap[(((blobX * zDensitiesPerChunk) + (blobZ + 1)) * yDensitiesPerChunk) + blobY];
@@ -102,8 +97,7 @@ public abstract class TerrainGeneratorLerp
                     double yLerpDensityMaxXMinZ = densityMaxXMinYMinZ;
                     double yLerpDensityMaxXMaxZ = densityMaxXMinYMaxZ;
 
-                    for(int yInBlob = 0; yInBlob < yBlocksPerBlob; yInBlob++)
-                    {
+                    for (int yInBlob = 0; yInBlob < yBlocksPerBlob; yInBlob++) {
                         // Determines for each corner on the X axis how much density to add per lerp interval.
                         double xLerpAmountMinZ = (yLerpDensityMaxXMinZ - yLerpDensityMinXMinZ) * xLerpInterval;
                         double xLerpAmountMaxZ = (yLerpDensityMaxXMaxZ - yLerpDensityMinXMaxZ) * xLerpInterval;
@@ -112,19 +106,17 @@ public abstract class TerrainGeneratorLerp
                         double xLerpDensityMinZ = yLerpDensityMinXMinZ;
                         double xLerpDensityMaxZ = yLerpDensityMinXMaxZ;
 
-                        for(int xInBlob = 0; xInBlob < xBlocksPerBlob; xInBlob++)
-                        {
+                        for (int xInBlob = 0; xInBlob < xBlocksPerBlob; xInBlob++) {
                             // Determines for each corner on the Z axis how much density to add per lerp interval.
                             double zLerpAmount = (xLerpDensityMaxZ - xLerpDensityMinZ) * zLerpInterval;
 
                             // Tracks the current interpolated density for the Z coordinate.
                             double zLerpDensity = xLerpDensityMinZ;
 
-                            for(int zInBlob = 0; zInBlob < zBlocksPerBlob; zInBlob++)
-                            {
+                            for (int zInBlob = 0; zInBlob < zBlocksPerBlob; zInBlob++) {
                                 // Determine the coordinates for the block within the blob.
                                 int blockX = xInBlob + blobX * xBlocksPerBlob;
-                                int blockY = yInBlob + blobY * yBlocksPerBlob + world.worldType.getMinY();
+                                int blockY = yInBlob + blobY * yBlocksPerBlob + this.world.worldType.getMinY();
                                 int blockZ = zInBlob + blobZ * zBlocksPerBlob;
 
                                 int id = getBlockAt(chunk, blockX, blockY, blockZ, zLerpDensity);
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/drift/ChunkGeneratorDrift.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/drift/ChunkGeneratorDrift.java
index aaf56a65f..3382461c3 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/drift/ChunkGeneratorDrift.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/drift/ChunkGeneratorDrift.java
@@ -6,12 +6,11 @@ import net.minecraft.core.world.generate.LargeFeature;
 import net.minecraft.core.world.generate.chunk.perlin.ChunkGeneratorPerlin;
 import net.minecraft.core.world.generate.chunk.perlin.overworld.ChunkDecoratorOverworld;
 import net.minecraft.core.world.generate.chunk.perlin.overworld.SurfaceGeneratorOverworld;
+import org.jetbrains.annotations.NotNull;
 
 public class ChunkGeneratorDrift
-    extends ChunkGeneratorPerlin
-{
-    public ChunkGeneratorDrift(World world)
-    {
-        super(world, new ChunkDecoratorOverworld(world), new TerrainGeneratorDrift(world), new SurfaceGeneratorOverworld(world), new LargeFeature[] { new CavesLargeFeature() });
+    extends ChunkGeneratorPerlin {
+    public ChunkGeneratorDrift(@NotNull World world) {
+        super(world, new ChunkDecoratorOverworld(world), new TerrainGeneratorDrift(world), new SurfaceGeneratorOverworld(world), new LargeFeature[]{new CavesLargeFeature()});
     }
 }
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/drift/DensityGeneratorDrift.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/drift/DensityGeneratorDrift.java
index f379e4f54..38389b6ff 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/drift/DensityGeneratorDrift.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/drift/DensityGeneratorDrift.java
@@ -4,33 +4,31 @@ import net.minecraft.core.world.World;
 import net.minecraft.core.world.chunk.Chunk;
 import net.minecraft.core.world.generate.chunk.perlin.DensityGenerator;
 import net.minecraft.core.world.noise.PerlinNoise;
+import org.jetbrains.annotations.NotNull;
 
 public class DensityGeneratorDrift
-    implements DensityGenerator
-{
-    private final World world;
+    implements DensityGenerator {
+    private final @NotNull World world;
 
-    private final PerlinNoise minLimitNoise;
-    private final PerlinNoise maxLimitNoise;
-    private final PerlinNoise mainNoise;
+    private final @NotNull PerlinNoise minLimitNoise;
+    private final @NotNull PerlinNoise maxLimitNoise;
+    private final @NotNull PerlinNoise mainNoise;
 //    private final PerlinNoise scaleNoise;
 //    private final PerlinNoise depthNoise;
 
-    public DensityGeneratorDrift(World world)
-    {
+    public DensityGeneratorDrift(@NotNull World world) {
         this.world = world;
 
-        minLimitNoise = new PerlinNoise(world.getRandomSeed(), 16, 0);
-        maxLimitNoise = new PerlinNoise(world.getRandomSeed(), 16, 16);
-        mainNoise = new PerlinNoise(world.getRandomSeed(), 8, 32);
+        this.minLimitNoise = new PerlinNoise(world.getRandomSeed(), 16, 0);
+        this.maxLimitNoise = new PerlinNoise(world.getRandomSeed(), 16, 16);
+        this.mainNoise = new PerlinNoise(world.getRandomSeed(), 8, 32);
 //        scaleNoise = new PerlinNoise(world.getRandomSeed(), 10, 48);
 //        depthNoise = new PerlinNoise(world.getRandomSeed(), 16, 58);
     }
 
     @Override
-    public double[] generateDensityMap(Chunk chunk)
-    {
-        int terrainHeight = (world.getWorldType().getMaxY() + 1) - world.getWorldType().getMinY();
+    public double @NotNull [] generateDensityMap(@NotNull Chunk chunk) {
+        int terrainHeight = (this.world.getWorldType().getMaxY() + 1) - this.world.getWorldType().getMinY();
 
         int xSize = 4 + 1;
         int ySize = (terrainHeight / 8) + 1;
@@ -64,17 +62,15 @@ public class DensityGeneratorDrift
         // uses temp and humidity to alter terrain shape.
 //        double[] scaleArray = scaleNoise.get(null, x, z, xSize, zSize, scaleNoiseScaleX, scaleNoiseScaleZ);
 //        double[] depthArray = depthNoise.get(null, x, z, xSize, zSize, depthNoiseScaleX, depthNoiseScaleZ);
-        double[] mainNoiseArray = mainNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale / mainNoiseScaleX, heightScale / mainNoiseScaleY, coordScale / mainNoiseScaleZ);
-        double[] minLimitArray = minLimitNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale, heightScale, coordScale);
-        double[] maxLimitArray = maxLimitNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale, heightScale, coordScale);
+        double[] mainNoiseArray = this.mainNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale / mainNoiseScaleX, heightScale / mainNoiseScaleY, coordScale / mainNoiseScaleZ);
+        double[] minLimitArray = this.minLimitNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale, heightScale, coordScale);
+        double[] maxLimitArray = this.maxLimitNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale, heightScale, coordScale);
         int mainIndex = 0;
 //        int depthScaleIndex = 0;
         int xSizeScale = 16 / xSize;
-        for(int dx = 0; dx < xSize; dx++)
-        {
+        for (int dx = 0; dx < xSize; dx++) {
             int ix = dx * xSizeScale + xSizeScale / 2;
-            for(int dz = 0; dz < zSize; dz++)
-            {
+            for (int dz = 0; dz < zSize; dz++) {
                 int iz = dz * xSizeScale + xSizeScale / 2;
 
                 // used to control temperature based on temp and humid
@@ -118,8 +114,7 @@ public class DensityGeneratorDrift
 //                double offsetY = (double)ySize / 2D;
 //                depthScaleIndex++;
 
-                for(int dy = 0; dy < ySize; dy++)
-                {
+                for (int dy = 0; dy < ySize; dy++) {
                     double density = 0.0D;
 //                    double densityOffset = (((double)dy - offsetY) * heightStretch) / scale;
 //                    if(densityOffset < 0.0D)
@@ -129,32 +124,25 @@ public class DensityGeneratorDrift
                     double minDensity = minLimitArray[mainIndex] / upperLimitScale;
                     double maxDensity = maxLimitArray[mainIndex] / lowerLimitScale;
                     double mainDensity = (mainNoiseArray[mainIndex] / 10D + 1.0D) / 2D;
-                    if(mainDensity < 0.0D)
-                    {
+                    if (mainDensity < 0.0D) {
                         density = minDensity;
-                    }
-                    else if(mainDensity > 1.0D)
-                    {
+                    } else if (mainDensity > 1.0D) {
                         density = maxDensity;
-                    }
-                    else
-                    {
+                    } else {
                         density = minDensity + (maxDensity - minDensity) * mainDensity;
                     }
                     density -= 8D;
 
                     int upperLowerLimit = 8;
                     // Upper cutoff
-                    if(dy > ySize - upperLowerLimit)
-                    {
-                        double densityMod = (float)(dy - (ySize - upperLowerLimit)) / ((float)upperLowerLimit - 1.0F);
+                    if (dy > ySize - upperLowerLimit) {
+                        double densityMod = (float) (dy - (ySize - upperLowerLimit)) / ((float) upperLowerLimit - 1.0F);
                         density = density * (1.0D - densityMod) + -30D * densityMod;
                     }
                     upperLowerLimit = 2;
                     // Lower cutoff
-                    if(dy < upperLowerLimit)
-                    {
-                        double densityMod = (float)(upperLowerLimit - dy) / ((float)upperLowerLimit - 1.0F);
+                    if (dy < upperLowerLimit) {
+                        double densityMod = (float) (upperLowerLimit - dy) / ((float) upperLowerLimit - 1.0F);
                         density = density * (1.0D - densityMod) + -30D * densityMod;
                     }
 
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/drift/TerrainGeneratorDrift.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/drift/TerrainGeneratorDrift.java
index ae40b5199..85453e440 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/drift/TerrainGeneratorDrift.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/drift/TerrainGeneratorDrift.java
@@ -5,32 +5,28 @@ import net.minecraft.core.world.chunk.Chunk;
 import net.minecraft.core.world.generate.chunk.perlin.DensityGenerator;
 import net.minecraft.core.world.generate.chunk.perlin.TerrainGeneratorLerp;
 import net.minecraft.core.world.type.WorldType;
+import org.jetbrains.annotations.NotNull;
 
 public class TerrainGeneratorDrift
-    extends TerrainGeneratorLerp
-{
-    private final DensityGenerator densityGenerator;
+    extends TerrainGeneratorLerp {
+    private final @NotNull DensityGenerator densityGenerator;
 
-    public TerrainGeneratorDrift(World world)
-    {
+    public TerrainGeneratorDrift(@NotNull World world) {
         super(world);
 
         this.densityGenerator = new DensityGeneratorDrift(world);
     }
 
     @Override
-    public DensityGenerator getDensityGenerator()
-    {
-        return densityGenerator;
+    public @NotNull DensityGenerator getDensityGenerator() {
+        return this.densityGenerator;
     }
 
     @Override
-    protected int getBlockAt(Chunk chunk, int x, int y, int z, double density)
-    {
-        WorldType type = world.getWorldType();
+    protected int getBlockAt(@NotNull Chunk chunk, int x, int y, int z, double density) {
+        WorldType type = this.world.getWorldType();
 
-        if (density > 0.0)
-        {
+        if (density > 0.0) {
             return type.getFillerBlockId();
         }
 
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/nether/ChunkDecoratorNether.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/nether/ChunkDecoratorNether.java
index 0dda34cd8..bf6ddec81 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/nether/ChunkDecoratorNether.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/nether/ChunkDecoratorNether.java
@@ -9,29 +9,27 @@ import net.minecraft.core.world.chunk.Chunk;
 import net.minecraft.core.world.generate.chunk.ChunkDecorator;
 import net.minecraft.core.world.generate.feature.*;
 import net.minecraft.core.world.noise.PerlinNoise;
+import org.jetbrains.annotations.NotNull;
 
 import java.util.Random;
 
 public class ChunkDecoratorNether
-    implements ChunkDecorator
-{
-    private final World world;
-    private final PerlinNoise crystalDensityNoise;
+    implements ChunkDecorator {
+    private final @NotNull World world;
+    private final @NotNull PerlinNoise crystalDensityNoise;
 
-    public ChunkDecoratorNether(World world)
-    {
+    public ChunkDecoratorNether(@NotNull World world) {
         this.world = world;
-        crystalDensityNoise = new PerlinNoise(world.getRandomSeed(), 6, 74);
+        this.crystalDensityNoise = new PerlinNoise(world.getRandomSeed(), 6, 74);
     }
 
     @Override
-    public void decorate(Chunk chunk)
-    {
+    public void decorate(@NotNull Chunk chunk) {
         int chunkX = chunk.pos.x;
         int chunkZ = chunk.pos.z;
 
-        int minY = world.getWorldType().getMinY();
-        int maxY = world.getWorldType().getMaxY();
+        int minY = this.world.getWorldType().getMinY();
+        int maxY = this.world.getWorldType().getMaxY();
         int rangeY = (maxY + 1) - minY;
 
         Random rand = new Random((long) chunkX * 0x4f9939f508L + (long) chunkZ * 0x1ef1565bd5L);
@@ -39,43 +37,42 @@ public class ChunkDecoratorNether
         BlockLogicSand.fallInstantly = true;
         int x = chunkX * 16;
         int z = chunkZ * 16;
-        Biome biome = world.getBlockBiome(x + 16, minY, z + 16);
+        Biome biome = this.world.getBlockBiome(x + 16, minY, z + 16);
 
         if (biome == Biomes.NETHER_CRYSTAL_FOREST) {
             double noiseScale = 0.5;
 
-            int density = (int) ((crystalDensityNoise.get(x * noiseScale, z * noiseScale) - 6D + 36D) / 6D);
+            int density = (int) ((this.crystalDensityNoise.get(x * noiseScale, z * noiseScale) - 6D + 36D) / 6D);
 
             for (int i = 0; i < density - 5; i++) {
                 int xf = x + rand.nextInt(16) + 8;
-                int yf = world.getWorldType().getOceanY() + rand.nextInt(5);
+                int yf = this.world.getWorldType().getOceanY() + rand.nextInt(5);
                 int zf = z + rand.nextInt(16) + 8;
                 boolean isCeiling = rand.nextInt(5) == 0;
-                new WorldFeatureCrystalChunk(isCeiling).place(world, rand, xf, yf, zf);
+                new WorldFeatureCrystalChunk(isCeiling).place(this.world, rand, xf, yf, zf);
             }
 
 
             for (int i = 0; i < density - 5; i++) {
                 int xf = x + rand.nextInt(16) + 8;
-                int yf = world.getWorldType().getOceanY() + rand.nextInt(rangeY - 8) + 4;
+                int yf = this.world.getWorldType().getOceanY() + rand.nextInt(rangeY - 8) + 4;
                 int zf = z + rand.nextInt(16) + 8;
-                new WorldFeatureCrystalChunk(false, 15, 30, true).place(world, rand, xf, yf, zf);
+                new WorldFeatureCrystalChunk(false, 15, 30, true).place(this.world, rand, xf, yf, zf);
 
             }
 
             for (int i = 0; i < 40; i++) {
                 int xf = x + rand.nextInt(16) + 8;
-                int yf = world.getWorldType().getOceanY() + rand.nextInt(rangeY - 8) + 4;
+                int yf = this.world.getWorldType().getOceanY() + rand.nextInt(rangeY - 8) + 4;
                 int zf = z + rand.nextInt(16) + 8;
-                (new WorldFeatureDeadBush(Blocks.CRYSTAL_STALK.id())).place(world, rand, xf, yf, zf);
+                (new WorldFeatureDeadBush(Blocks.CRYSTAL_STALK.id())).place(this.world, rand, xf, yf, zf);
             }
 
-            for(int l18 = 0; l18 < 50; l18++)
-            {
+            for (int l18 = 0; l18 < 50; l18++) {
                 int l21 = x + rand.nextInt(16) + 8;
                 int k23 = minY + rand.nextInt(rand.nextInt(rangeY - (rangeY / 16)) + (rangeY / 16));
                 int l24 = z + rand.nextInt(16) + 8;
-                (new WorldFeatureLiquid(Blocks.FLUID_WATER_FLOWING.id())).place(world, rand, l21, k23, l24);
+                (new WorldFeatureLiquid(Blocks.FLUID_WATER_FLOWING.id())).place(this.world, rand, l21, k23, l24);
             }
 
         }
@@ -92,68 +89,62 @@ public class ChunkDecoratorNether
         if (biome == Biomes.NETHER_ASH_PLAINS) {
             if (rand.nextInt(2) == 0) {
                 int xf = x + rand.nextInt(16) + 8;
-                int yf = world.getWorldType().getOceanY() + rand.nextInt(rangeY - 8) + 4;
+                int yf = this.world.getWorldType().getOceanY() + rand.nextInt(rangeY - 8) + 4;
                 int zf = z + rand.nextInt(16) + 8;
-                new WorldFeaturePillar(Blocks.SLATE.id(), false).place(world, rand, xf, yf, zf);
+                new WorldFeaturePillar(Blocks.SLATE.id(), false).place(this.world, rand, xf, yf, zf);
             }
         }
 
         if (biome != Biomes.NETHER_ASH_PLAINS && biome != Biomes.NETHER_BONEYARD) {
-            for(int i = 0; i < 8; i++)
-            {
+            for (int i = 0; i < 8; i++) {
                 int xf = x + rand.nextInt(16) + 8;
                 int yf = rangeY / 2 + rand.nextInt(rangeY - 8) + 4;
                 int zf = z + rand.nextInt(16) + 8;
-                (new WorldFeatureNetherLava(Blocks.FLUID_LAVA_FLOWING.id())).place(world, rand, xf, yf, zf);
+                (new WorldFeatureNetherLava(Blocks.FLUID_LAVA_FLOWING.id())).place(this.world, rand, xf, yf, zf);
             }
         }
 
-        for(int i = 0; i < 10; i++)
-        {
+        for (int i = 0; i < 10; i++) {
             int xf = x + rand.nextInt(16);
             int yf = rangeY / 2 + rand.nextInt(rangeY - 8) + 4;
             int zf = z + rand.nextInt(16);
-            new WorldFeatureOre(Blocks.ORE_NETHERCOAL_NETHERRACK.id(), 12).place(world, rand, xf, yf, zf);
+            new WorldFeatureOre(Blocks.ORE_NETHERCOAL_NETHERRACK.id(), 12).place(this.world, rand, xf, yf, zf);
         }
 
         int max;
         if (biome != Biomes.NETHER_ASH_PLAINS && biome != Biomes.NETHER_BONEYARD) {
             max = rand.nextInt(rand.nextInt(10) + 1);
-            for(int i = 0; i < max; i++)
-            {
+            for (int i = 0; i < max; i++) {
                 int xf = x + rand.nextInt(16) + 8;
-                int yf = world.getWorldType().getOceanY() + rand.nextInt(rangeY - 8) + 4;
+                int yf = this.world.getWorldType().getOceanY() + rand.nextInt(rangeY - 8) + 4;
                 int zf = z + rand.nextInt(16) + 8;
-                (new WorldFeatureFire()).place(world, rand, xf, yf, zf);
+                (new WorldFeatureFire()).place(this.world, rand, xf, yf, zf);
             }
         }
 
         if (biome == Biomes.NETHER_BONEYARD) {
             max = rand.nextInt(20) + 5;
-            for(int i = 0; i < max; i++)
-            {
+            for (int i = 0; i < max; i++) {
                 int xf = x + rand.nextInt(16) + 8;
-                int yf = world.getWorldType().getOceanY() + rand.nextInt(rangeY - 8) + 4;
+                int yf = this.world.getWorldType().getOceanY() + rand.nextInt(rangeY - 8) + 4;
                 int zf = z + rand.nextInt(16) + 8;
-                (new WorldFeatureColdFire()).place(world, rand, xf, yf, zf);
+                (new WorldFeatureColdFire()).place(this.world, rand, xf, yf, zf);
             }
         }
 
         max = rand.nextInt(rand.nextInt(10) + 1);
-        for(int i = 0; i < max; i++)
-        {
+        for (int i = 0; i < max; i++) {
             int xf = x + rand.nextInt(16) + 8;
-            int yf = world.getWorldType().getOceanY() + rand.nextInt(rangeY - 8) + 4;
+            int yf = this.world.getWorldType().getOceanY() + rand.nextInt(rangeY - 8) + 4;
             int zf = z + rand.nextInt(16) + 8;
-            new WorldFeatureGlowstoneA().place(world, rand, xf, yf, zf);
+            new WorldFeatureGlowstoneA().place(this.world, rand, xf, yf, zf);
         }
 
-        for(int i = 0; i < 10; i++)
-        {
+        for (int i = 0; i < 10; i++) {
             int xf = x + rand.nextInt(16) + 8;
-            int yf = world.getWorldType().getOceanY() + rand.nextInt(rangeY - 8) + 4;
+            int yf = this.world.getWorldType().getOceanY() + rand.nextInt(rangeY - 8) + 4;
             int zf = z + rand.nextInt(16) + 8;
-            new WorldFeatureGlowstoneB().place(world, rand, xf, yf, zf);
+            new WorldFeatureGlowstoneB().place(this.world, rand, xf, yf, zf);
         }
 
         if (biome != Biomes.NETHER_ASH_PLAINS && biome != Biomes.NETHER_BONEYARD) {
@@ -161,35 +152,31 @@ public class ChunkDecoratorNether
                 int xf = x + rand.nextInt(16) + 8;
                 int yf = rangeY / 2 + rand.nextInt(rangeY - 16) + 8;
                 int zf = z + rand.nextInt(16) + 8;
-                (new WorldFeatureLake(Blocks.FLUID_LAVA_STILL.id())).place(world, rand, xf, yf, zf);
+                (new WorldFeatureLake(Blocks.FLUID_LAVA_STILL.id())).place(this.world, rand, xf, yf, zf);
             }
 
             for (int i = 0; i < /*20*/80; i++) {
                 int xf = x + rand.nextInt(16);
                 int yf = rangeY / 2 + rand.nextInt(rangeY);
                 int zf = z + rand.nextInt(16);
-                (new WorldFeaturePumice(32)).place(world, rand, xf, yf, zf);
+                (new WorldFeaturePumice(32)).place(this.world, rand, xf, yf, zf);
             }
         }
 
-        int oceanY = world.getWorldType().getOceanY();
-        int midY = oceanY + (world.getWorldType().getMaxY() - oceanY) / 2;
-        for(int dx = x + 8; dx < x + 8 + 16; dx++)
-        {
-            for(int dz = z + 8; dz < z + 8 + 16; dz++)
-            {
+        int oceanY = this.world.getWorldType().getOceanY();
+        int midY = oceanY + (this.world.getWorldType().getMaxY() - oceanY) / 2;
+        for (int dx = x + 8; dx < x + 8 + 16; dx++) {
+            for (int dz = z + 8; dz < z + 8 + 16; dz++) {
                 int dy = midY;
-                while (world.getBlockId(dx, dy, dz) == 0) {
+                while (this.world.getBlockId(dx, dy, dz) == 0) {
                     dy--;
                 }
                 dy++;
-                Biome localBiome = world.getBlockBiome(dx, dy, dz);
+                Biome localBiome = this.world.getBlockBiome(dx, dy, dz);
 
-                if ((localBiome == Biomes.NETHER_ASH_PLAINS || localBiome == Biomes.NETHER_BONEYARD) && dy > 0 && dy < world.getHeightBlocks())
-                {
-                    if (world.isAirBlock(dx, dy, dz) && world.getBlockMaterial(dx, dy - 1, dz).blocksMotion() && world.getBlockId(dx, dy - 1, dz) != Blocks.OBSIDIAN.id())
-                    {
-                        world.setBlockWithNotify(dx, dy, dz, Blocks.LAYER_ASH.id());
+                if ((localBiome == Biomes.NETHER_ASH_PLAINS || localBiome == Biomes.NETHER_BONEYARD) && dy > 0 && dy < this.world.getHeightBlocks()) {
+                    if (this.world.isAirBlock(dx, dy, dz) && this.world.getBlockMaterial(dx, dy - 1, dz).blocksMotion() && this.world.getBlockId(dx, dy - 1, dz) != Blocks.OBSIDIAN.id()) {
+                        this.world.setBlockWithNotify(dx, dy, dz, Blocks.LAYER_ASH.id());
                     }
                 }
             }
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/nether/ChunkGeneratorNether.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/nether/ChunkGeneratorNether.java
index 087267360..5f0a9c863 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/nether/ChunkGeneratorNether.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/nether/ChunkGeneratorNether.java
@@ -6,10 +6,11 @@ import net.minecraft.core.world.generate.LargeFeature;
 import net.minecraft.core.world.generate.NetherBonesLargeFeature;
 import net.minecraft.core.world.generate.WarrensCavesLargeFeature;
 import net.minecraft.core.world.generate.chunk.perlin.ChunkGeneratorPerlin;
+import org.jetbrains.annotations.NotNull;
 
 public class ChunkGeneratorNether
     extends ChunkGeneratorPerlin {
-    public ChunkGeneratorNether(World world) {
+    public ChunkGeneratorNether(@NotNull World world) {
         super(
             world,
             new ChunkDecoratorNether(world),
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/nether/DensityGeneratorNether.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/nether/DensityGeneratorNether.java
index d47ca2b9a..28e430e6d 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/nether/DensityGeneratorNether.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/nether/DensityGeneratorNether.java
@@ -7,41 +7,39 @@ import net.minecraft.core.world.biome.Biomes;
 import net.minecraft.core.world.biome.provider.BiomeProviderNether;
 import net.minecraft.core.world.chunk.Chunk;
 import net.minecraft.core.world.generate.chunk.perlin.DensityGenerator;
-import net.minecraft.core.world.noise.BasePerlinNoise;
 import net.minecraft.core.world.noise.PerlinNoise;
 import net.minecraft.core.world.noise.PerlinSimplexNoise;
 import net.minecraft.core.world.type.WorldType;
+import org.jetbrains.annotations.NotNull;
 
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Random;
 
 public class DensityGeneratorNether
-    implements DensityGenerator
-{
+    implements DensityGenerator {
     private interface BiomeDensityGenerator {
         double[] generateDensityMap(Chunk chunk, int terrainHeight, int xSize, int ySize, int zSize, int x, int y, int z);
     }
 
-    private final World world;
+    private final @NotNull World world;
 
-    private final PerlinNoise minLimitNoise;
-    private final PerlinNoise maxLimitNoise;
-    private final PerlinNoise mainNoise;
-    private final PerlinNoise scaleNoise;
-    private final PerlinNoise depthNoise;
+    private final @NotNull PerlinNoise minLimitNoise;
+    private final @NotNull PerlinNoise maxLimitNoise;
+    private final @NotNull PerlinNoise mainNoise;
+    private final @NotNull PerlinNoise scaleNoise;
+    private final @NotNull PerlinNoise depthNoise;
 
-    private final PerlinSimplexNoise poolNoiseOver;
-    private final PerlinSimplexNoise poolNoiseUnder;
+    private final @NotNull PerlinSimplexNoise poolNoiseOver;
+    private final @NotNull PerlinSimplexNoise poolNoiseUnder;
 
-    private final PerlinSimplexNoise ravineNoise2;
+    private final @NotNull PerlinSimplexNoise ravineNoise2;
 
-    private final PerlinSimplexNoise islandNoise;
+    private final @NotNull PerlinSimplexNoise islandNoise;
 
-    private final Map<Biome, BiomeDensityGenerator> densityGeneratorMap = new HashMap<>();
+    private final @NotNull Map<@NotNull Biome, @NotNull BiomeDensityGenerator> densityGeneratorMap = new HashMap<>();
 
-    public DensityGeneratorNether(World world)
-    {
+    public DensityGeneratorNether(World world) {
         this.world = world;
 
         this.minLimitNoise = new PerlinNoise(world.getRandomSeed(), 16, 0);
@@ -58,18 +56,17 @@ public class DensityGeneratorNether
         this.poolNoiseOver = new PerlinSimplexNoise(rand, 4);
         this.poolNoiseUnder = new PerlinSimplexNoise(rand, 1);
 
-        densityGeneratorMap.put(Biomes.NETHER_NETHER, this::generateDensityMapBiomeNether);
-        densityGeneratorMap.put(Biomes.NETHER_VOLCANIC_ISLANDS, this::generateDensityMapBiomeNether);
-        densityGeneratorMap.put(Biomes.NETHER_SULFUR_POOLS, this::generateDensityMapBiomeNether);
-        densityGeneratorMap.put(Biomes.NETHER_CRYSTAL_FOREST, this::generateDensityMapBiomeNether);
-        densityGeneratorMap.put(Biomes.NETHER_ASH_PLAINS, this::generateDensityMapBiomeNether);
-        densityGeneratorMap.put(Biomes.NETHER_BONEYARD, this::generateDensityMapBiomeNether);
+        this.densityGeneratorMap.put(Biomes.NETHER_NETHER, this::generateDensityMapBiomeNether);
+        this.densityGeneratorMap.put(Biomes.NETHER_VOLCANIC_ISLANDS, this::generateDensityMapBiomeNether);
+        this.densityGeneratorMap.put(Biomes.NETHER_SULFUR_POOLS, this::generateDensityMapBiomeNether);
+        this.densityGeneratorMap.put(Biomes.NETHER_CRYSTAL_FOREST, this::generateDensityMapBiomeNether);
+        this.densityGeneratorMap.put(Biomes.NETHER_ASH_PLAINS, this::generateDensityMapBiomeNether);
+        this.densityGeneratorMap.put(Biomes.NETHER_BONEYARD, this::generateDensityMapBiomeNether);
     }
 
     @Override
-    public double[] generateDensityMap(Chunk chunk)
-    {
-        WorldType worldType = world.getWorldType();
+    public double @NotNull [] generateDensityMap(@NotNull Chunk chunk) {
+        WorldType worldType = this.world.getWorldType();
 
         int terrainHeight = ((worldType.getMaxY() + 1) - worldType.getMinY());
         int xSize = 4 + 1;
@@ -85,7 +82,7 @@ public class DensityGeneratorNether
         double[] densityMapArray = new double[xSize * ySize * zSize];
         Map<Biome, double[]> perBiomeDensityMaps = new HashMap<>();
 
-        BiomeProviderNether biomeProvider = (BiomeProviderNether) world.getBiomeProvider();
+        BiomeProviderNether biomeProvider = (BiomeProviderNether) this.world.getBiomeProvider();
         BiomeProviderNether.BiomeOverlapPair[] overlapPairs = new BiomeProviderNether.BiomeOverlapPair[xSize * zSize];
 
         // Cache density maps for biome(s)
@@ -99,11 +96,11 @@ public class DensityGeneratorNether
                 biomeProvider.getOverlap(temperature, overlapPair);
 
                 if (!perBiomeDensityMaps.containsKey(overlapPair.biomeA)) {
-                    perBiomeDensityMaps.put(overlapPair.biomeA, densityGeneratorMap.get(overlapPair.biomeA).generateDensityMap(chunk, (int) (terrainHeight * 0.75f), xSize, threeQuarterYSize, zSize, x, y, z));
+                    perBiomeDensityMaps.put(overlapPair.biomeA, this.densityGeneratorMap.get(overlapPair.biomeA).generateDensityMap(chunk, (int) (terrainHeight * 0.75f), xSize, threeQuarterYSize, zSize, x, y, z));
                 }
                 if (overlapPair.hasOverlap) {
                     if (!perBiomeDensityMaps.containsKey(overlapPair.biomeB)) {
-                        perBiomeDensityMaps.put(overlapPair.biomeB, densityGeneratorMap.get(overlapPair.biomeB).generateDensityMap(chunk, (int) (terrainHeight * 0.75f), xSize, threeQuarterYSize, zSize, x, y, z));
+                        perBiomeDensityMaps.put(overlapPair.biomeB, this.densityGeneratorMap.get(overlapPair.biomeB).generateDensityMap(chunk, (int) (terrainHeight * 0.75f), xSize, threeQuarterYSize, zSize, x, y, z));
                     }
                 }
             }
@@ -150,32 +147,26 @@ public class DensityGeneratorNether
         final double upperLimitScale = 512.0;
         final double lowerLimitScale = 512.0;
 
-        double[] mainNoiseArray = mainNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale / mainNoiseScaleX, heightScale / mainNoiseScaleY, coordScale / mainNoiseScaleZ);
-        double[] minLimitArray = minLimitNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale, heightScale, coordScale);
-        double[] maxLimitArray = maxLimitNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale, heightScale, coordScale);
+        double[] mainNoiseArray = this.mainNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale / mainNoiseScaleX, heightScale / mainNoiseScaleY, coordScale / mainNoiseScaleZ);
+        double[] minLimitArray = this.minLimitNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale, heightScale, coordScale);
+        double[] maxLimitArray = this.maxLimitNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale, heightScale, coordScale);
         int mainIndex = 0;
         double[] densityOffsetArray = new double[ySize];
-        for(int dy = 0; dy < ySize; dy++)
-        {
-            densityOffsetArray[dy] = Math.cos(((double)dy * Math.PI * 6D) / (double)ySize) * 2D;
+        for (int dy = 0; dy < ySize; dy++) {
+            densityOffsetArray[dy] = Math.cos(((double) dy * Math.PI * 6D) / (double) ySize) * 2D;
             double densityOffset = dy;
-            if(dy > ySize / 2)
-            {
+            if (dy > ySize / 2) {
                 densityOffset = ySize - 1 - dy;
             }
-            if(densityOffset < 4D)
-            {
+            if (densityOffset < 4D) {
                 densityOffset = 4D - densityOffset;
                 densityOffsetArray[dy] -= densityOffset * densityOffset * densityOffset * 10D;
             }
         }
 
-        for(int dx = 0; dx < xSize; dx++)
-        {
-            for(int dz = 0; dz < zSize; dz++)
-            {
-                for(int dy = 0; dy < ySize; dy++)
-                {
+        for (int dx = 0; dx < xSize; dx++) {
+            for (int dz = 0; dz < zSize; dz++) {
+                for (int dy = 0; dy < ySize; dy++) {
                     double density;
                     double densityOffset = densityOffsetArray[dy];
                     double minDensity = minLimitArray[mainIndex] / upperLimitScale;
@@ -183,23 +174,17 @@ public class DensityGeneratorNether
                     double mainDensity = (mainNoiseArray[mainIndex] / 10D + 1.0D) / 2D;
 
                     // Constrain density
-                    if(mainDensity < 0.0D)
-                    {
+                    if (mainDensity < 0.0D) {
                         density = minDensity;
-                    }
-                    else if(mainDensity > 1.0D)
-                    {
+                    } else if (mainDensity > 1.0D) {
                         density = maxDensity;
-                    }
-                    else
-                    {
+                    } else {
                         density = minDensity + (maxDensity - minDensity) * mainDensity;
                     }
                     density -= densityOffset;
 
-                    if(dy > ySize - 4)
-                    {
-                        double densityMod = (float)(dy - (ySize - 4)) / 3F;
+                    if (dy > ySize - 4) {
+                        double densityMod = (float) (dy - (ySize - 4)) / 3F;
                         density = density * (1.0D - densityMod) + -10D * densityMod;
                     }
 
@@ -239,61 +224,51 @@ public class DensityGeneratorNether
 
         double ravineNoiseScale = 0.03D;
 
-        double[] scaleArray = scaleNoise.get(null, x, z, xSize, zSize, scaleNoiseScaleX, scaleNoiseScaleZ);
-        double[] depthArray = depthNoise.get(null, x, z, xSize, zSize, depthNoiseScaleX, depthNoiseScaleZ);
-        double[] mainNoiseArray = mainNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale / mainNoiseScaleX, heightScale / mainNoiseScaleY, coordScale / mainNoiseScaleZ);
-        double[] minLimitArray = minLimitNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale, heightScale, coordScale);
-        double[] maxLimitArray = maxLimitNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale, heightScale, coordScale);
+        double[] scaleArray = this.scaleNoise.get(null, x, z, xSize, zSize, scaleNoiseScaleX, scaleNoiseScaleZ);
+        double[] depthArray = this.depthNoise.get(null, x, z, xSize, zSize, depthNoiseScaleX, depthNoiseScaleZ);
+        double[] mainNoiseArray = this.mainNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale / mainNoiseScaleX, heightScale / mainNoiseScaleY, coordScale / mainNoiseScaleZ);
+        double[] minLimitArray = this.minLimitNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale, heightScale, coordScale);
+        double[] maxLimitArray = this.maxLimitNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale, heightScale, coordScale);
 
-        double[] ravineNoise = ravineNoise2.getValue(null, x, z, xSize, zSize, ravineNoiseScale, ravineNoiseScale, 3.0D, 3.0D);
+        double[] ravineNoise = this.ravineNoise2.getValue(null, x, z, xSize, zSize, ravineNoiseScale, ravineNoiseScale, 3.0D, 3.0D);
 //        double[] ravineMod = ravineNoise2.getValue(null, x, z, xSize, zSize, ravineNoiseScale, ravineNoiseScale, 0.25D, 0.6D);
 
         int mainIndex = 0;
 
         int depthScaleIndex = 0;
-        for(int dx = 0; dx < xSize; dx++)
-        {
-            for(int dz = 0; dz < zSize; dz++)
-            {
+        for (int dx = 0; dx < xSize; dx++) {
+            for (int dz = 0; dz < zSize; dz++) {
 
                 // Calculate scale
                 double scale = (scaleArray[depthScaleIndex] + 256D) / 512D;
                 scale *= 0.5D;
-                if(scale > 1.0D)
-                {
+                if (scale > 1.0D) {
                     scale = 1.0D;
                 }
 
                 // Calculate depth
                 double depth = depthArray[depthScaleIndex] / 2000D;
-                if(depth < 0.0D)
-                {
+                if (depth < 0.0D) {
                     depth = -depth * 0.3D;
                 }
                 depth = depth * 3D - 2D;
 
-                if(depth < 0.0D)
-                {
+                if (depth < 0.0D) {
                     depth /= 2D;
-                    if(depth < -1D)
-                    {
+                    if (depth < -1D) {
                         depth = -1D;
                     }
                     depth /= 1.4D;
                     depth /= 2D;
                     scale = 0.0D;
-                }
-                else
-                {
-                    if(depth > 1.0D)
-                    {
+                } else {
+                    if (depth > 1.0D) {
                         depth = 1.0D;
                     }
                     depth /= 8D;
                 }
 
-                if(scale < 0.0D)
-                {
+                if (scale < 0.0D) {
                     scale = 0.0D;
                 }
 
@@ -303,12 +278,10 @@ public class DensityGeneratorNether
                 double offsetY = depthBaseSize + depth * 4D;
                 depthScaleIndex++;
 
-                for(int dy = 0; dy < ySize; dy++)
-                {
+                for (int dy = 0; dy < ySize; dy++) {
                     double density;
-                    double densityOffset = ((((double)dy - offsetY) * heightStretch) / scale);
-                    if(densityOffset < 0.0D)
-                    {
+                    double densityOffset = ((((double) dy - offsetY) * heightStretch) / scale);
+                    if (densityOffset < 0.0D) {
                         densityOffset *= 4D;
                     }
                     double minDensity = minLimitArray[mainIndex] / upperLimitScale;
@@ -316,16 +289,11 @@ public class DensityGeneratorNether
                     double mainDensity = (mainNoiseArray[mainIndex] / 10D + 1.0D) / 2D;
 
                     // Constrain density
-                    if(mainDensity < 0.0D)
-                    {
+                    if (mainDensity < 0.0D) {
                         density = minDensity;
-                    }
-                    else if(mainDensity > 1.0D)
-                    {
+                    } else if (mainDensity > 1.0D) {
                         density = maxDensity;
-                    }
-                    else
-                    {
+                    } else {
                         density = minDensity + (maxDensity - minDensity) * mainDensity;
                     }
                     density -= densityOffset;
@@ -334,20 +302,19 @@ public class DensityGeneratorNether
 
                     float val = (float) ravineNoise[dx * zSize + dz] * 60;
 //                    float mod = (float) ravineMod[dx * zSize + dz];
-                    if(val < 0.3){
+                    if (val < 0.3) {
                         val = 0;
                     }
 
-                    if(dy > 3) {
+                    if (dy > 3) {
                         density += (val * 6d);
                     } else {
                         density += (val * 4d) * (dy / (ySize / 2d)) * (dy / (ySize / 2d));
 
                     }
 
-                    if(dy > ySize - 7)
-                    {
-                        densityMod = (float)(dy - (ySize - 7)) / 6F;
+                    if (dy > ySize - 7) {
+                        densityMod = (float) (dy - (ySize - 7)) / 6F;
                         density = density * (1.0D - densityMod) + 300D * densityMod;
                     }
 
@@ -384,57 +351,47 @@ public class DensityGeneratorNether
 
         final double noiseScale = 0.02;
 
-        double[] scaleArray = scaleNoise.get(null, x, z, xSize, zSize, scaleNoiseScaleX, scaleNoiseScaleZ);
-        double[] depthArray = depthNoise.get(null, x, z, xSize, zSize, depthNoiseScaleX, depthNoiseScaleZ);
-        double[] mainNoiseArray = mainNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale / mainNoiseScaleX, heightScale / mainNoiseScaleY, coordScale / mainNoiseScaleZ);
-        double[] minLimitArray = minLimitNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale, heightScale, coordScale);
-        double[] maxLimitArray = maxLimitNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale, heightScale, coordScale);
-        double[] islandNoiseArray = islandNoise.getValue(null, x, z, xSize, zSize, noiseScale, noiseScale, 2, 2);
+        double[] scaleArray = this.scaleNoise.get(null, x, z, xSize, zSize, scaleNoiseScaleX, scaleNoiseScaleZ);
+        double[] depthArray = this.depthNoise.get(null, x, z, xSize, zSize, depthNoiseScaleX, depthNoiseScaleZ);
+        double[] mainNoiseArray = this.mainNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale / mainNoiseScaleX, heightScale / mainNoiseScaleY, coordScale / mainNoiseScaleZ);
+        double[] minLimitArray = this.minLimitNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale, heightScale, coordScale);
+        double[] maxLimitArray = this.maxLimitNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale, heightScale, coordScale);
+        double[] islandNoiseArray = this.islandNoise.getValue(null, x, z, xSize, zSize, noiseScale, noiseScale, 2, 2);
 
         int mainIndex = 0;
 
         int depthScaleIndex = 0;
-        for(int dx = 0; dx < xSize; dx++)
-        {
-            for(int dz = 0; dz < zSize; dz++)
-            {
+        for (int dx = 0; dx < xSize; dx++) {
+            for (int dz = 0; dz < zSize; dz++) {
                 // Calculate scale
                 double scale = (scaleArray[depthScaleIndex] + 256D) / 2048D;
-                if(scale > 1.0D)
-                {
+                if (scale > 1.0D) {
                     scale = 1.0D;
                 }
 
                 // Calculate depth
                 double depth = depthArray[depthScaleIndex] / 2000D;
-                if(depth < 0.0D)
-                {
+                if (depth < 0.0D) {
                     depth = -depth * 0.3D;
                 }
                 depth = depth * 3D - 2D;
 
-                if(depth < 0.0D)
-                {
+                if (depth < 0.0D) {
                     depth /= 2D;
-                    if(depth < -1D)
-                    {
+                    if (depth < -1D) {
                         depth = -1D;
                     }
                     depth /= 1.4D;
                     depth /= 2D;
                     scale = 0.0D;
-                }
-                else
-                {
-                    if(depth > 1.0D)
-                    {
+                } else {
+                    if (depth > 1.0D) {
                         depth = 1.0D;
                     }
                     depth /= 8D;
                 }
 
-                if(scale < 0.0D)
-                {
+                if (scale < 0.0D) {
                     scale = 0.0D;
                 }
 
@@ -443,12 +400,10 @@ public class DensityGeneratorNether
 
                 double offsetY = depthBaseSize + depth * 4D;
                 depthScaleIndex++;
-                for(int dy = 0; dy < ySize; dy++)
-                {
+                for (int dy = 0; dy < ySize; dy++) {
                     double density;
-                    double densityOffset = ((((double)dy - offsetY) * heightStretch) / scale);
-                    if(densityOffset < 0.0D)
-                    {
+                    double densityOffset = ((((double) dy - offsetY) * heightStretch) / scale);
+                    if (densityOffset < 0.0D) {
                         densityOffset *= 4D;
                     }
                     double minDensity = minLimitArray[mainIndex] / upperLimitScale;
@@ -456,28 +411,22 @@ public class DensityGeneratorNether
                     double mainDensity = (mainNoiseArray[mainIndex] / 10D + 1.0D) / 2D;
 
                     // Constrain density
-                    if(mainDensity < 0.0D)
-                    {
+                    if (mainDensity < 0.0D) {
                         density = minDensity;
-                    }
-                    else if(mainDensity > 1.0D)
-                    {
+                    } else if (mainDensity > 1.0D) {
                         density = maxDensity;
-                    }
-                    else
-                    {
+                    } else {
                         density = minDensity + (maxDensity - minDensity) * mainDensity;
                     }
                     density -= densityOffset;
 
                     //Generate islands
                     float isl = (float) islandNoiseArray[dx * zSize + dz];
-                    if(isl > 0.5) isl = isl * 100;
-                    if(isl < -0.2) isl = -isl * 100;
+                    if (isl > 0.5) isl = isl * 100;
+                    if (isl < -0.2) isl = -isl * 100;
 
-                    if(dy > ySize - 9)
-                    {
-                        double densityMod = (float)(dy - (ySize - 10)) / 6F;
+                    if (dy > ySize - 9) {
+                        double densityMod = (float) (dy - (ySize - 10)) / 6F;
                         density = density * (1.0D - densityMod) + 100D * densityMod;
                     }
 
@@ -516,55 +465,45 @@ public class DensityGeneratorNether
         final double upperLimitScale = 512;
         final double lowerLimitScale = 512;
 
-        double[] scaleArray = scaleNoise.get(null, x, z, xSize, zSize, scaleNoiseScaleX, scaleNoiseScaleZ);
-        double[] depthArray = depthNoise.get(null, x, z, xSize, zSize, depthNoiseScaleX, depthNoiseScaleZ);
-        double[] mainNoiseArray = mainNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale / mainNoiseScaleX, heightScale / mainNoiseScaleY, coordScale / mainNoiseScaleZ);
-        double[] minLimitArray = minLimitNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale, heightScale, coordScale);
-        double[] maxLimitArray = maxLimitNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale, heightScale, coordScale);
+        double[] scaleArray = this.scaleNoise.get(null, x, z, xSize, zSize, scaleNoiseScaleX, scaleNoiseScaleZ);
+        double[] depthArray = this.depthNoise.get(null, x, z, xSize, zSize, depthNoiseScaleX, depthNoiseScaleZ);
+        double[] mainNoiseArray = this.mainNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale / mainNoiseScaleX, heightScale / mainNoiseScaleY, coordScale / mainNoiseScaleZ);
+        double[] minLimitArray = this.minLimitNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale, heightScale, coordScale);
+        double[] maxLimitArray = this.maxLimitNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale, heightScale, coordScale);
         int mainIndex = 0;
 
         int depthScaleIndex = 0;
-        for(int dx = 0; dx < xSize; dx++)
-        {
-            for(int dz = 0; dz < zSize; dz++)
-            {
+        for (int dx = 0; dx < xSize; dx++) {
+            for (int dz = 0; dz < zSize; dz++) {
                 // Calculate scale
                 double scale = (scaleArray[depthScaleIndex] + 256D) / 2048D;
-                if(scale > 1.0D)
-                {
+                if (scale > 1.0D) {
                     scale = 1.0D;
                 }
 
                 // Calculate depth
                 double depth = depthArray[depthScaleIndex] / 2000D;
-                if(depth < 0.0D)
-                {
+                if (depth < 0.0D) {
                     depth = -depth * 0.3D;
                 }
                 depth = depth * 3D - 2D;
 
-                if(depth < 0.0D)
-                {
+                if (depth < 0.0D) {
                     depth /= 2D;
-                    if(depth < -1D)
-                    {
+                    if (depth < -1D) {
                         depth = -1D;
                     }
                     depth /= 1.4D;
                     depth /= 2D;
                     scale = 0.0D;
-                }
-                else
-                {
-                    if(depth > 1.0D)
-                    {
+                } else {
+                    if (depth > 1.0D) {
                         depth = 1.0D;
                     }
                     depth /= 8D;
                 }
 
-                if(scale < 0.0D)
-                {
+                if (scale < 0.0D) {
                     scale = 0.0D;
                 }
 
@@ -573,12 +512,10 @@ public class DensityGeneratorNether
 
                 double offsetY = depthBaseSize + depth * 4D;
                 depthScaleIndex++;
-                for(int dy = 0; dy < ySize; dy++)
-                {
+                for (int dy = 0; dy < ySize; dy++) {
                     double density;
-                    double densityOffset = ((((double)dy - offsetY) * heightStretch) / scale);
-                    if(densityOffset < 0.0D)
-                    {
+                    double densityOffset = ((((double) dy - offsetY) * heightStretch) / scale);
+                    if (densityOffset < 0.0D) {
                         densityOffset *= 4D;
                     }
                     double minDensity = minLimitArray[mainIndex] / upperLimitScale;
@@ -586,23 +523,17 @@ public class DensityGeneratorNether
                     double mainDensity = (mainNoiseArray[mainIndex] / 10D + 1.0D) / 2D;
 
                     // Constrain density
-                    if(mainDensity < 0.0D)
-                    {
+                    if (mainDensity < 0.0D) {
                         density = minDensity;
-                    }
-                    else if(mainDensity > 1.0D)
-                    {
+                    } else if (mainDensity > 1.0D) {
                         density = maxDensity;
-                    }
-                    else
-                    {
+                    } else {
                         density = minDensity + (maxDensity - minDensity) * mainDensity;
                     }
                     density -= densityOffset;
 
-                    if(dy > ySize - 7)
-                    {
-                        double densityMod = (float)(dy - (ySize - 7)) / 6F;
+                    if (dy > ySize - 7) {
+                        double densityMod = (float) (dy - (ySize - 7)) / 6F;
                         density = density * (1.0D - densityMod) + 300D * densityMod;
                     }
 
@@ -640,57 +571,47 @@ public class DensityGeneratorNether
         final double upperLimitScale = 512;
         final double lowerLimitScale = 512;
 
-        double[] scaleArray = scaleNoise.get(null, x, z, xSize, zSize, scaleNoiseScaleX, scaleNoiseScaleZ);
-        double[] depthArray = depthNoise.get(null, x, z, xSize, zSize, depthNoiseScaleX, depthNoiseScaleZ);
-        double[] mainNoiseArray = mainNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale / mainNoiseScaleX, heightScale / mainNoiseScaleY, coordScale / mainNoiseScaleZ);
-        double[] minLimitArray = minLimitNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale, heightScale, coordScale);
-        double[] maxLimitArray = maxLimitNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale, heightScale, coordScale);
-        double[] poolOverArray = poolNoiseOver.getValue(null, x, z, xSize, zSize, poolNoiseScale, poolNoiseScale, 1, 0.2);
-        double[] poolUnderArray = poolNoiseUnder.getValue(null, x, z, xSize, zSize, poolNoiseScale, poolNoiseScale, 0.01, 1);
+        double[] scaleArray = this.scaleNoise.get(null, x, z, xSize, zSize, scaleNoiseScaleX, scaleNoiseScaleZ);
+        double[] depthArray = this.depthNoise.get(null, x, z, xSize, zSize, depthNoiseScaleX, depthNoiseScaleZ);
+        double[] mainNoiseArray = this.mainNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale / mainNoiseScaleX, heightScale / mainNoiseScaleY, coordScale / mainNoiseScaleZ);
+        double[] minLimitArray = this.minLimitNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale, heightScale, coordScale);
+        double[] maxLimitArray = this.maxLimitNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale, heightScale, coordScale);
+        double[] poolOverArray = this.poolNoiseOver.getValue(null, x, z, xSize, zSize, poolNoiseScale, poolNoiseScale, 1, 0.2);
+        double[] poolUnderArray = this.poolNoiseUnder.getValue(null, x, z, xSize, zSize, poolNoiseScale, poolNoiseScale, 0.01, 1);
         int mainIndex = 0;
 
         int depthScaleIndex = 0;
-        for(int dx = 0; dx < xSize; dx++)
-        {
-            for(int dz = 0; dz < zSize; dz++)
-            {
+        for (int dx = 0; dx < xSize; dx++) {
+            for (int dz = 0; dz < zSize; dz++) {
                 // Calculate scale
                 double scale = (scaleArray[depthScaleIndex] + 256D) / 2048D;
-                if(scale > 1.0D)
-                {
+                if (scale > 1.0D) {
                     scale = 1.0D;
                 }
 
                 // Calculate depth
                 double depth = depthArray[depthScaleIndex] / 2000D;
-                if(depth < 0.0D)
-                {
+                if (depth < 0.0D) {
                     depth = -depth * 0.3D;
                 }
                 depth = depth * 3D - 2D;
 
-                if(depth < 0.0D)
-                {
+                if (depth < 0.0D) {
                     depth /= 2D;
-                    if(depth < -1D)
-                    {
+                    if (depth < -1D) {
                         depth = -1D;
                     }
                     depth /= 1.4D;
                     depth /= 2D;
                     scale = 0.0D;
-                }
-                else
-                {
-                    if(depth > 1.0D)
-                    {
+                } else {
+                    if (depth > 1.0D) {
                         depth = 1.0D;
                     }
                     depth /= 8D;
                 }
 
-                if(scale < 0.0D)
-                {
+                if (scale < 0.0D) {
                     scale = 0.0D;
                 }
 
@@ -699,12 +620,10 @@ public class DensityGeneratorNether
 
                 double offsetY = depthBaseSize + depth * 4D;
                 depthScaleIndex++;
-                for(int dy = 0; dy < ySize; dy++)
-                {
+                for (int dy = 0; dy < ySize; dy++) {
                     double density;
-                    double densityOffset = ((((double)dy - offsetY) * heightStretch) / scale);
-                    if(densityOffset < 0.0D)
-                    {
+                    double densityOffset = ((((double) dy - offsetY) * heightStretch) / scale);
+                    if (densityOffset < 0.0D) {
                         densityOffset *= 4D;
                     }
                     double minDensity = minLimitArray[mainIndex] / upperLimitScale;
@@ -712,23 +631,17 @@ public class DensityGeneratorNether
                     double mainDensity = (mainNoiseArray[mainIndex] / 10D + 1.0D) / 2D;
 
                     // Constrain density
-                    if(mainDensity < 0.0D)
-                    {
+                    if (mainDensity < 0.0D) {
                         density = minDensity;
-                    }
-                    else if(mainDensity > 1.0D)
-                    {
+                    } else if (mainDensity > 1.0D) {
                         density = maxDensity;
-                    }
-                    else
-                    {
+                    } else {
                         density = minDensity + (maxDensity - minDensity) * mainDensity;
                     }
                     density -= densityOffset;
 
-                    if(dy > ySize - 12)
-                    {
-                        double densityMod = (float)(dy - (ySize - 12)) / 11F;
+                    if (dy > ySize - 12) {
+                        double densityMod = (float) (dy - (ySize - 12)) / 11F;
                         density = density * (1.0D - densityMod) + 8000D * densityMod;
                     }
                     if (dy < 5) {
@@ -773,55 +686,45 @@ public class DensityGeneratorNether
         final double upperLimitScale = 512;
         final double lowerLimitScale = 512;
 
-        double[] scaleArray = scaleNoise.get(null, x, z, xSize, zSize, scaleNoiseScaleX, scaleNoiseScaleZ);
-        double[] depthArray = depthNoise.get(null, x, z, xSize, zSize, depthNoiseScaleX, depthNoiseScaleZ);
-        double[] mainNoiseArray = mainNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale / mainNoiseScaleX, heightScale / mainNoiseScaleY, coordScale / mainNoiseScaleZ);
-        double[] minLimitArray = minLimitNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale, heightScale, coordScale);
-        double[] maxLimitArray = maxLimitNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale, heightScale, coordScale);
+        double[] scaleArray = this.scaleNoise.get(null, x, z, xSize, zSize, scaleNoiseScaleX, scaleNoiseScaleZ);
+        double[] depthArray = this.depthNoise.get(null, x, z, xSize, zSize, depthNoiseScaleX, depthNoiseScaleZ);
+        double[] mainNoiseArray = this.mainNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale / mainNoiseScaleX, heightScale / mainNoiseScaleY, coordScale / mainNoiseScaleZ);
+        double[] minLimitArray = this.minLimitNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale, heightScale, coordScale);
+        double[] maxLimitArray = this.maxLimitNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale, heightScale, coordScale);
         int mainIndex = 0;
 
         int depthScaleIndex = 0;
-        for(int dx = 0; dx < xSize; dx++)
-        {
-            for(int dz = 0; dz < zSize; dz++)
-            {
+        for (int dx = 0; dx < xSize; dx++) {
+            for (int dz = 0; dz < zSize; dz++) {
                 // Calculate scale
                 double scale = (scaleArray[depthScaleIndex] + 256D) / 2048D;
-                if(scale > 1.0D)
-                {
+                if (scale > 1.0D) {
                     scale = 1.0D;
                 }
 
                 // Calculate depth
                 double depth = depthArray[depthScaleIndex] / 2000D;
-                if(depth < 0.0D)
-                {
+                if (depth < 0.0D) {
                     depth = -depth * 0.3D;
                 }
                 depth = depth * 3D - 2D;
 
-                if(depth < 0.0D)
-                {
+                if (depth < 0.0D) {
                     depth /= 2D;
-                    if(depth < -1D)
-                    {
+                    if (depth < -1D) {
                         depth = -1D;
                     }
                     depth /= 1.4D;
                     depth /= 2D;
                     scale = 0.0D;
-                }
-                else
-                {
-                    if(depth > 1.0D)
-                    {
+                } else {
+                    if (depth > 1.0D) {
                         depth = 1.0D;
                     }
                     depth /= 8D;
                 }
 
-                if(scale < 0.0D)
-                {
+                if (scale < 0.0D) {
                     scale = 0.0D;
                 }
 
@@ -830,12 +733,10 @@ public class DensityGeneratorNether
 
                 double offsetY = depthBaseSize + depth * 4D;
                 depthScaleIndex++;
-                for(int dy = 0; dy < ySize; dy++)
-                {
+                for (int dy = 0; dy < ySize; dy++) {
                     double density;
-                    double densityOffset = ((((double)dy - offsetY) * heightStretch) / scale);
-                    if(densityOffset < 0.0D)
-                    {
+                    double densityOffset = ((((double) dy - offsetY) * heightStretch) / scale);
+                    if (densityOffset < 0.0D) {
                         densityOffset *= 4D;
                     }
                     double minDensity = minLimitArray[mainIndex] / upperLimitScale;
@@ -843,16 +744,11 @@ public class DensityGeneratorNether
                     double mainDensity = (mainNoiseArray[mainIndex] / 10D + 1.0D) / 2D;
 
                     // Constrain density
-                    if(mainDensity < 0.0D)
-                    {
+                    if (mainDensity < 0.0D) {
                         density = minDensity;
-                    }
-                    else if(mainDensity > 1.0D)
-                    {
+                    } else if (mainDensity > 1.0D) {
                         density = maxDensity;
-                    }
-                    else
-                    {
+                    } else {
                         density = minDensity + (maxDensity - minDensity) * mainDensity;
                     }
                     density -= densityOffset;
@@ -861,9 +757,8 @@ public class DensityGeneratorNether
                         double densityMod = (1.0f - (3 - dy)) / 3f;
                         density = density * (1.0 - densityMod) + scaleArray[dx * zSize + dz] * densityMod;
                     }
-                    if(dy > ySize - 8)
-                    {
-                        double densityMod = (float)(dy - (ySize - 8)) / 7F;
+                    if (dy > ySize - 8) {
+                        double densityMod = (float) (dy - (ySize - 8)) / 7F;
                         density = density * (1.0D - densityMod) + 8000D * densityMod;
                     }
 
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/nether/SurfaceGeneratorNether.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/nether/SurfaceGeneratorNether.java
index 96324187b..4829802d3 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/nether/SurfaceGeneratorNether.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/nether/SurfaceGeneratorNether.java
@@ -8,40 +8,41 @@ import net.minecraft.core.world.chunk.Chunk;
 import net.minecraft.core.world.generate.chunk.ChunkGeneratorResult;
 import net.minecraft.core.world.generate.chunk.perlin.SurfaceGenerator;
 import net.minecraft.core.world.noise.PerlinNoise;
+import org.jetbrains.annotations.NotNull;
 
 import java.util.Random;
 
 public class SurfaceGeneratorNether
     implements SurfaceGenerator {
-    private final World world;
+    private final @NotNull World world;
 
-    private final PerlinNoise beachNoise;
-    private final PerlinNoise soilNoise;
+    private final @NotNull PerlinNoise beachNoise;
+    private final @NotNull PerlinNoise soilNoise;
 
-    public SurfaceGeneratorNether(World world) {
+    public SurfaceGeneratorNether(@NotNull World world) {
         this.world = world;
 
-        beachNoise = new PerlinNoise(world.getRandomSeed(), 4, 40);
-        soilNoise = new PerlinNoise(world.getRandomSeed(), 4, 44);
+        this.beachNoise = new PerlinNoise(world.getRandomSeed(), 4, 40);
+        this.soilNoise = new PerlinNoise(world.getRandomSeed(), 4, 44);
     }
 
     @Override
-    public void generateSurface(Chunk chunk, ChunkGeneratorResult result) {
-        int oceanY = world.getWorldType().getOceanY();
-        int minY = world.getWorldType().getMinY();
-        int maxY = world.getWorldType().getMaxY();
+    public void generateSurface(@NotNull Chunk chunk, @NotNull ChunkGeneratorResult result) {
+        int oceanY = this.world.getWorldType().getOceanY();
+        int minY = this.world.getWorldType().getMinY();
+        int maxY = this.world.getWorldType().getMaxY();
         int chunkX = chunk.pos.x;
         int chunkZ = chunk.pos.z;
 
-        int oceanBlock = world.getWorldType().getOceanBlockId();
-        int worldFillBlock = world.getWorldType().getFillerBlockId();
+        int oceanBlock = this.world.getWorldType().getOceanBlockId();
+        int worldFillBlock = this.world.getWorldType().getFillerBlockId();
 
         Random rand = new Random((long) chunkX * 0x4F9939F508L + (long) chunkZ * 0x1EF1565BD5L);
 
         double beachScale = 0.03125D;
-        double[] sandBeachNoise = beachNoise.get(null, chunkX * 16, chunkZ * 16, 0.0D, 16, 16, 1, beachScale, beachScale, 1.0D);
-        double[] gravelBeachNoise = beachNoise.get(null, chunkX * 16, 109.0134D, chunkZ * 16, 16, 1, 16, beachScale, 1.0D, beachScale);
-        double[] soilThicknessNoise = soilNoise.get(null, chunkX * 16, chunkZ * 16, 0.0D, 16, 16, 1, beachScale * 2D, beachScale * 2D, beachScale * 2D);
+        double[] sandBeachNoise = this.beachNoise.get(null, chunkX * 16, chunkZ * 16, 0.0D, 16, 16, 1, beachScale, beachScale, 1.0D);
+        double[] gravelBeachNoise = this.beachNoise.get(null, chunkX * 16, 109.0134D, chunkZ * 16, 16, 1, 16, beachScale, 1.0D, beachScale);
+        double[] soilThicknessNoise = this.soilNoise.get(null, chunkX * 16, chunkZ * 16, 0.0D, 16, 16, 1, beachScale * 2D, beachScale * 2D, beachScale * 2D);
         for (int z = 0; z < 16; z++) {
             for (int x = 0; x < 16; x++) {
                 boolean generateSandBeach = sandBeachNoise[z + x * 16] + rand.nextDouble() * 0.2D > 0.0D;
@@ -57,7 +58,7 @@ public class SurfaceGeneratorNether
                 for (int y = maxY; y >= minY; y--) {
                     Biome biome = chunk.getBlockBiome(x, y, z);
                     if (biome == null)
-                        biome = world.getBiomeProvider().getBiome(chunkX * Chunk.CHUNK_SIZE_X + x, y >> 3, chunkZ * Chunk.CHUNK_SIZE_Z + z);
+                        biome = this.world.getBiomeProvider().getBiome(chunkX * Chunk.CHUNK_SIZE_X + x, y >> 3, chunkZ * Chunk.CHUNK_SIZE_Z + z);
 
                     int block = result.getBlock(x, y, z);
 
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/nether/TerrainGeneratorNether.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/nether/TerrainGeneratorNether.java
index 38764c185..ce8e73a70 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/nether/TerrainGeneratorNether.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/nether/TerrainGeneratorNether.java
@@ -13,30 +13,26 @@ import net.minecraft.core.world.generate.chunk.perlin.TerrainGeneratorLerp;
 import net.minecraft.core.world.noise.PerlinNoise;
 import net.minecraft.core.world.type.WorldType;
 import org.jetbrains.annotations.NotNull;
-
-import java.util.HashMap;
-import java.util.Map;
+import org.jetbrains.annotations.Nullable;
 
 public class TerrainGeneratorNether
-    extends TerrainGeneratorLerp
-{
+    extends TerrainGeneratorLerp {
     private final DensityGenerator densityGenerator;
 
-    private int lastX = Integer.MIN_VALUE;
-    private int lastZ = Integer.MIN_VALUE;
-    private Biome lastBiome = null;
-    private Biome lastBiomeNegX = null;
-    private Biome lastBiomePosX = null;
-    private Biome lastBiomeNegZ = null;
-    private Biome lastBiomePosZ = null;
-    private Object2IntMap<Biome> fluidLookup = new Object2IntArrayMap<>();
+    private final int lastX = Integer.MIN_VALUE;
+    private final int lastZ = Integer.MIN_VALUE;
+    private @Nullable Biome lastBiome = null;
+    private @Nullable Biome lastBiomeNegX = null;
+    private @Nullable Biome lastBiomePosX = null;
+    private @Nullable Biome lastBiomeNegZ = null;
+    private @Nullable Biome lastBiomePosZ = null;
+    private final Object2IntMap<Biome> fluidLookup = new Object2IntArrayMap<>();
     private int lastChunkX = Integer.MIN_VALUE;
     private int lastChunkZ = Integer.MIN_VALUE;
     private final @NotNull PerlinNoise noise = new PerlinNoise(0L, 4, 0);
     private final double @NotNull [] cache = new double[Chunk.CHUNK_SIZE_X * Chunk.CHUNK_SIZE_Z * (Chunk.CHUNK_SECTIONS * ChunkSection.SECTION_SIZE_Y)];
 
-    public TerrainGeneratorNether(World world)
-    {
+    public TerrainGeneratorNether(@NotNull World world) {
         super(world);
 
         this.densityGenerator = new DensityGeneratorNether(world);
@@ -50,52 +46,48 @@ public class TerrainGeneratorNether
     }
 
     @Override
-    protected int getBlockAt(Chunk chunk, int x, int y, int z, double density)
-    {
-        if (lastX != x || lastZ != z) {
-            lastBiome = chunk.getBlockBiome(x, 0, z);
+    protected int getBlockAt(@NotNull Chunk chunk, int x, int y, int z, double density) {
+        if (this.lastX != x || this.lastZ != z) {
+            this.lastBiome = chunk.getBlockBiome(x, 0, z);
             if (x - 1 < 0) {
-                lastBiomeNegX = lastBiome;
+                this.lastBiomeNegX = this.lastBiome;
             } else {
-                lastBiomeNegX = chunk.getBlockBiome(x - 1, 0, z);
+                this.lastBiomeNegX = chunk.getBlockBiome(x - 1, 0, z);
             }
             if (x + 1 >= Chunk.CHUNK_SIZE_X) {
-                lastBiomePosX = lastBiome;
+                this.lastBiomePosX = this.lastBiome;
             } else {
-                lastBiomePosX = chunk.getBlockBiome(x + 1, 0, z);
+                this.lastBiomePosX = chunk.getBlockBiome(x + 1, 0, z);
             }
             if (z - 1 < 0) {
-                lastBiomeNegZ = lastBiome;
+                this.lastBiomeNegZ = this.lastBiome;
             } else {
-                lastBiomeNegZ = chunk.getBlockBiome(x, 0, z - 1);
+                this.lastBiomeNegZ = chunk.getBlockBiome(x, 0, z - 1);
             }
             if (z + 1 >= Chunk.CHUNK_SIZE_Z) {
-                lastBiomePosZ = lastBiome;
+                this.lastBiomePosZ = this.lastBiome;
             } else {
-                lastBiomePosZ = chunk.getBlockBiome(x, 0, z + 1);
+                this.lastBiomePosZ = chunk.getBlockBiome(x, 0, z + 1);
             }
         }
-        if (lastChunkX != chunk.pos.x || lastChunkZ != chunk.pos.z) {
-            lastChunkX = chunk.pos.x;
-            lastChunkZ = chunk.pos.z;
-            noise.get(cache, chunk.pos.x * Chunk.CHUNK_SIZE_X, 0, chunk.pos.z * Chunk.CHUNK_SIZE_Z, Chunk.CHUNK_SIZE_X, Chunk.CHUNK_SECTIONS * ChunkSection.SECTION_SIZE_Y, Chunk.CHUNK_SIZE_Z, 0.2, 0.2, 0.2);
+        if (this.lastChunkX != chunk.pos.x || this.lastChunkZ != chunk.pos.z) {
+            this.lastChunkX = chunk.pos.x;
+            this.lastChunkZ = chunk.pos.z;
+            this.noise.get(this.cache, chunk.pos.x * Chunk.CHUNK_SIZE_X, 0, chunk.pos.z * Chunk.CHUNK_SIZE_Z, Chunk.CHUNK_SIZE_X, Chunk.CHUNK_SECTIONS * ChunkSection.SECTION_SIZE_Y, Chunk.CHUNK_SIZE_Z, 0.2, 0.2, 0.2);
 
             float avg = 0;
-            for (int i = 0; i < cache.length; i++) {
-                avg += cache[i];
+            for (int i = 0; i < this.cache.length; i++) {
+                avg += this.cache[i];
             }
-            avg /= cache.length;
+            avg /= this.cache.length;
         }
 
-        WorldType type = world.getWorldType();
+        WorldType type = this.world.getWorldType();
         int quarterHeight = type.getMaxY() / 4;
 
-        if (y < quarterHeight)
-        {
+        if (y < quarterHeight) {
             return 0;
-        }
-        else if (y >= type.getMaxY() - rand.nextInt(5))
-        {
+        } else if (y >= type.getMaxY() - this.rand.nextInt(5)) {
             return Blocks.BEDROCK.id();
         }
 //        else if (y >= quarterHeight - rand.nextInt(5) && y <= quarterHeight + 5 - rand.nextInt(5))
@@ -110,16 +102,13 @@ public class TerrainGeneratorNether
 //        {
 //            return Blocks.SOULSCHIST.id();
 //        }
-        else if (y <= quarterHeight + rand.nextInt(5))
-        {
+        else if (y <= quarterHeight + this.rand.nextInt(5)) {
             return Blocks.BEDROCK.id();
-        }
-        else if (density > 0.0)
-        {
-            if (lastBiome == Biomes.NETHER_CRYSTAL_FOREST) {
+        } else if (density > 0.0) {
+            if (this.lastBiome == Biomes.NETHER_CRYSTAL_FOREST) {
                 int sizeY = Chunk.CHUNK_SECTIONS * ChunkSection.SECTION_SIZE_Y;
                 // YZX ordering
-                final double d = ((cache[(x * Chunk.CHUNK_SIZE_Z * sizeY) + (z * sizeY) + y]));
+                final double d = ((this.cache[(x * Chunk.CHUNK_SIZE_Z * sizeY) + (z * sizeY) + y]));
                 if (d > 0 && d < 2) {
                     return Blocks.CRYSTAL.id();
                 } else if (d > -1 && d < 3) {
@@ -127,14 +116,12 @@ public class TerrainGeneratorNether
                 }
             }
             return type.getFillerBlockId();
-        }
-        else if (y >= quarterHeight && y < type.getOceanY())
-        {
-            int biomeFluid = fluidLookup.getOrDefault(lastBiome, 0);
-            int biomeFluidNegX = fluidLookup.getOrDefault(lastBiomeNegX, 0);
-            int biomeFluidPosX = fluidLookup.getOrDefault(lastBiomePosX, 0);
-            int biomeFluidNegZ = fluidLookup.getOrDefault(lastBiomeNegZ, 0);
-            int biomeFluidPosZ = fluidLookup.getOrDefault(lastBiomePosZ, 0);
+        } else if (y >= quarterHeight && y < type.getOceanY()) {
+            int biomeFluid = this.fluidLookup.getOrDefault(this.lastBiome, 0);
+            int biomeFluidNegX = this.fluidLookup.getOrDefault(this.lastBiomeNegX, 0);
+            int biomeFluidPosX = this.fluidLookup.getOrDefault(this.lastBiomePosX, 0);
+            int biomeFluidNegZ = this.fluidLookup.getOrDefault(this.lastBiomeNegZ, 0);
+            int biomeFluidPosZ = this.fluidLookup.getOrDefault(this.lastBiomePosZ, 0);
 
             if (biomeFluid == biomeFluidNegX && biomeFluid == biomeFluidPosX && biomeFluid == biomeFluidNegZ && biomeFluid == biomeFluidPosZ) {
                 return biomeFluid;
@@ -147,8 +134,7 @@ public class TerrainGeneratorNether
     }
 
     @Override
-    public DensityGenerator getDensityGenerator()
-    {
-        return densityGenerator;
+    public @NotNull DensityGenerator getDensityGenerator() {
+        return this.densityGenerator;
     }
 }
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/ChunkDecoratorOverworld.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/ChunkDecoratorOverworld.java
index 0ac0bb076..829bebe08 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/ChunkDecoratorOverworld.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/ChunkDecoratorOverworld.java
@@ -20,38 +20,35 @@ import net.minecraft.core.world.chunk.Chunk;
 import net.minecraft.core.world.generate.chunk.ChunkDecorator;
 import net.minecraft.core.world.generate.feature.*;
 import net.minecraft.core.world.noise.PerlinNoise;
+import org.jetbrains.annotations.NotNull;
 
 import java.util.Random;
 
 public class ChunkDecoratorOverworld
-    implements ChunkDecorator
-{
-    private final World world;
-    private final PerlinNoise treeDensityNoise;
+    implements ChunkDecorator {
+    private final @NotNull World world;
+    private final @NotNull PerlinNoise treeDensityNoise;
     private final int treeDensityOverride;
 
-    protected ChunkDecoratorOverworld(World world, int treeDensityOverride)
-    {
+    protected ChunkDecoratorOverworld(@NotNull World world, int treeDensityOverride) {
         this.world = world;
         this.treeDensityOverride = treeDensityOverride;
 
-        treeDensityNoise = new PerlinNoise(world.getRandomSeed(), 8, 74);
+        this.treeDensityNoise = new PerlinNoise(world.getRandomSeed(), 8, 74);
     }
 
-    public ChunkDecoratorOverworld(World world)
-    {
+    public ChunkDecoratorOverworld(@NotNull World world) {
         this(world, -1);
     }
 
     @Override
-    public void decorate(Chunk chunk)
-    {
-        world.scheduledUpdatesAreImmediate = true;
+    public void decorate(@NotNull Chunk chunk) {
+        this.world.scheduledUpdatesAreImmediate = true;
         int chunkX = chunk.pos.x;
         int chunkZ = chunk.pos.z;
 
-        int minY = world.getWorldType().getMinY();
-        int maxY = world.getWorldType().getMaxY();
+        int minY = this.world.getWorldType().getMinY();
+        int maxY = this.world.getWorldType().getMaxY();
         int rangeY = (maxY + 1) - minY;
 
         float oreHeightModifier = rangeY / 128f;
@@ -59,43 +56,37 @@ public class ChunkDecoratorOverworld
         BlockLogicSand.fallInstantly = true;
         int x = chunkX * 16;
         int z = chunkZ * 16;
-        int y = world.getHeightValue(x + 16, z + 16);
-        Biome biome = world.getBlockBiome(x + 16, y, z + 16);
-        Random rand = new Random(world.getRandomSeed());
+        int y = this.world.getHeightValue(x + 16, z + 16);
+        Biome biome = this.world.getBlockBiome(x + 16, y, z + 16);
+        Random rand = new Random(this.world.getRandomSeed());
         long l1 = (rand.nextLong() / 2L) * 2L + 1L;
         long l2 = (rand.nextLong() / 2L) * 2L + 1L;
-        rand.setSeed((long) chunkX * l1 + (long) chunkZ * l2 ^ world.getRandomSeed());
-        Random swampRand = new Random((long) chunkX * l1 + (long) chunkZ * l2 ^ world.getRandomSeed());
+        rand.setSeed((long) chunkX * l1 + (long) chunkZ * l2 ^ this.world.getRandomSeed());
+        Random swampRand = new Random((long) chunkX * l1 + (long) chunkZ * l2 ^ this.world.getRandomSeed());
 
         // Water pass for swamps
-        if (biome == Biomes.OVERWORLD_SWAMPLAND)
-        {
-            for (int dx = 0; dx < 16; dx++)
-            {
-                for (int dz = 0; dz < 16; dz++)
-                {
-                    int topBlock = world.getHeightValue(x + dx, z + dz);
-                    int id = world.getBlockId(x + dx, topBlock - 1, z + dz);
-                    if (id == Blocks.GRASS.id())
-                    {
+        if (biome == Biomes.OVERWORLD_SWAMPLAND) {
+            for (int dx = 0; dx < 16; dx++) {
+                for (int dz = 0; dz < 16; dz++) {
+                    int topBlock = this.world.getHeightValue(x + dx, z + dz);
+                    int id = this.world.getBlockId(x + dx, topBlock - 1, z + dz);
+                    if (id == Blocks.GRASS.id()) {
                         boolean shouldPlaceWater = swampRand.nextFloat() < 0.5f;
-                        if (shouldPlaceWater)
-                        {
-                            int posXId = world.getBlockId(x + dx + 1, topBlock - 1, z + dz);
-                            int negXId = world.getBlockId(x + dx - 1, topBlock - 1, z + dz);
-                            int posZId = world.getBlockId(x + dx, topBlock - 1, z + dz + 1);
-                            int negZId = world.getBlockId(x + dx, topBlock - 1, z + dz - 1);
-                            int negYId = world.getBlockId(x + dx, topBlock - 2, z + dz);
+                        if (shouldPlaceWater) {
+                            int posXId = this.world.getBlockId(x + dx + 1, topBlock - 1, z + dz);
+                            int negXId = this.world.getBlockId(x + dx - 1, topBlock - 1, z + dz);
+                            int posZId = this.world.getBlockId(x + dx, topBlock - 1, z + dz + 1);
+                            int negZId = this.world.getBlockId(x + dx, topBlock - 1, z + dz - 1);
+                            int negYId = this.world.getBlockId(x + dx, topBlock - 2, z + dz);
                             if (
-                                    posXId != 0 && (Blocks.blocksList[posXId].getMaterial().isSolid() || Blocks.blocksList[posXId].getMaterial() == Material.water) &&
-                                            negXId != 0 && (Blocks.blocksList[negXId].getMaterial().isSolid() || Blocks.blocksList[negXId].getMaterial() == Material.water) &&
-                                            posZId != 0 && (Blocks.blocksList[posZId].getMaterial().isSolid() || Blocks.blocksList[posZId].getMaterial() == Material.water) &&
-                                            negZId != 0 && (Blocks.blocksList[negZId].getMaterial().isSolid() || Blocks.blocksList[negZId].getMaterial() == Material.water) &&
-                                            negYId != 0 && Blocks.blocksList[negYId].getMaterial().isSolid()
-                            )
-                            {
-                                world.setBlock(x + dx, topBlock - 1, z + dz, Blocks.FLUID_WATER_STILL.id());
-                                world.setBlock(x + dx, topBlock, z + dz, 0);
+                                posXId != 0 && (Blocks.blocksList[posXId].getMaterial().isSolid() || Blocks.blocksList[posXId].getMaterial() == Material.water) &&
+                                    negXId != 0 && (Blocks.blocksList[negXId].getMaterial().isSolid() || Blocks.blocksList[negXId].getMaterial() == Material.water) &&
+                                    posZId != 0 && (Blocks.blocksList[posZId].getMaterial().isSolid() || Blocks.blocksList[posZId].getMaterial() == Material.water) &&
+                                    negZId != 0 && (Blocks.blocksList[negZId].getMaterial().isSolid() || Blocks.blocksList[negZId].getMaterial() == Material.water) &&
+                                    negYId != 0 && Blocks.blocksList[negYId].getMaterial().isSolid()
+                            ) {
+                                this.world.setBlock(x + dx, topBlock - 1, z + dz, Blocks.FLUID_WATER_STILL.id());
+                                this.world.setBlock(x + dx, topBlock, z + dz, 0);
                             }
                         }
                     }
@@ -110,21 +101,20 @@ public class ChunkDecoratorOverworld
             lakeChance = 0;
         if (lakeChance != 0 && rand.nextInt(lakeChance) == 0) {
             int fluid = Blocks.FLUID_WATER_STILL.id();
-            if (biome.hasSurfaceSnow())
-            {
+            if (biome.hasSurfaceSnow()) {
                 fluid = Blocks.ICE.id();
             }
             int i1 = x + rand.nextInt(16) + 8;
             int l4 = minY + rand.nextInt(rangeY);
             int i8 = z + rand.nextInt(16) + 8;
-            new WorldFeatureLake(fluid).place(world, rand, i1, l4, i8);
+            new WorldFeatureLake(fluid).place(this.world, rand, i1, l4, i8);
         }
         if (rand.nextInt(8) == 0) {
             int xf = x + rand.nextInt(16) + 8;
             int yf = minY + rand.nextInt(rand.nextInt(rangeY - (rangeY / 16)) + (rangeY / 16));
             int zf = z + rand.nextInt(16) + 8;
             if (yf < minY + rangeY / 2 || rand.nextInt(10) == 0) {
-                new WorldFeatureLake(Blocks.FLUID_LAVA_STILL.id()).place(world, rand, xf, yf, zf);
+                new WorldFeatureLake(Blocks.FLUID_LAVA_STILL.id()).place(this.world, rand, xf, yf, zf);
             }
         }
         for (int k1 = 0; k1 < (8 * oreHeightModifier); k1++) {
@@ -134,7 +124,7 @@ public class ChunkDecoratorOverworld
 
             int design = rand.nextInt(2);
             if (design == 1) {
-                int id = world.getBlockId(j5, k8, j11);
+                int id = this.world.getBlockId(j5, k8, j11);
                 if (id == Blocks.LIMESTONE.id()) {
                     design = 2;
                 } else if (id == Blocks.GRANITE.id()) {
@@ -145,22 +135,22 @@ public class ChunkDecoratorOverworld
             }
 
             if (design == 0) {
-                new WorldFeatureDungeon(Blocks.BRICK_CLAY.id(), Blocks.BRICK_CLAY.id(), null).place(world, rand, j5, k8, j11);
+                new WorldFeatureDungeon(Blocks.BRICK_CLAY.id(), Blocks.BRICK_CLAY.id(), null).place(this.world, rand, j5, k8, j11);
             } else if (design == 1) {
-                new WorldFeatureDungeon(Blocks.COBBLE_STONE.id(), Blocks.COBBLE_STONE_MOSSY.id(), null).place(world, rand, j5, k8, j11);
+                new WorldFeatureDungeon(Blocks.COBBLE_STONE.id(), Blocks.COBBLE_STONE_MOSSY.id(), null).place(this.world, rand, j5, k8, j11);
             } else if (design == 2) {
-                new WorldFeatureDungeon(Blocks.COBBLE_LIMESTONE.id(), Blocks.COBBLE_LIMESTONE_MOSSY.id(), null).place(world, rand, j5, k8, j11);
+                new WorldFeatureDungeon(Blocks.COBBLE_LIMESTONE.id(), Blocks.COBBLE_LIMESTONE_MOSSY.id(), null).place(this.world, rand, j5, k8, j11);
             } else if (design == 3) {
-                new WorldFeatureDungeon(Blocks.COBBLE_GRANITE.id(), Blocks.COBBLE_GRANITE_MOSSY.id(), null).place(world, rand, j5, k8, j11);
+                new WorldFeatureDungeon(Blocks.COBBLE_GRANITE.id(), Blocks.COBBLE_GRANITE_MOSSY.id(), null).place(this.world, rand, j5, k8, j11);
             } else if (design == 4) {
-                new WorldFeatureDungeon(Blocks.COBBLE_BASALT.id(), Blocks.COBBLE_BASALT_MOSSY.id(), null).place(world, rand, j5, k8, j11);
+                new WorldFeatureDungeon(Blocks.COBBLE_BASALT.id(), Blocks.COBBLE_BASALT_MOSSY.id(), null).place(this.world, rand, j5, k8, j11);
             }
         }
 
         for (int k1 = 0; k1 < 1; k1++) {
             int j5 = x + rand.nextInt(16) + 8;
             int j11 = z + rand.nextInt(16) + 8;
-            int k8 = world.getHeightValue(j5, j11) - (rand.nextInt(2) + 2);
+            int k8 = this.world.getHeightValue(j5, j11) - (rand.nextInt(2) + 2);
 
             //chance to sink labyrinth
             if (rand.nextInt(5) == 0) {
@@ -169,7 +159,7 @@ public class ChunkDecoratorOverworld
 
             if (rand.nextInt(700) == 0) {
                 Random lRand = chunk.getChunkRandom(0x4823F58);
-                (new WorldFeatureLabyrinth()).place(world, lRand, j5, k8, j11);
+                (new WorldFeatureLabyrinth()).place(this.world, lRand, j5, k8, j11);
             }
         }
 
@@ -177,21 +167,21 @@ public class ChunkDecoratorOverworld
             int k5 = x + rand.nextInt(16);
             int l8 = minY + rand.nextInt(rangeY);
             int k11 = z + rand.nextInt(16);
-            (new WorldFeatureClay(32)).place(world, rand, k5, l8, k11);
+            (new WorldFeatureClay(32)).place(this.world, rand, k5, l8, k11);
         }
         if (biome instanceof BiomeOutback || biome == Biomes.OVERWORLD_OUTBACK) {
             int l5 = x + rand.nextInt(16);
             int l11 = z + rand.nextInt(16);
-            int i9 = world.getHeightValue(l5, l11);
-            (new WorldFeatureRichScorchedDirt(10)).place(world, rand, l5, i9, l11);
+            int i9 = this.world.getHeightValue(l5, l11);
+            (new WorldFeatureRichScorchedDirt(10)).place(this.world, rand, l5, i9, l11);
         }
 
-        if (biome == Biomes.OVERWORLD_GLACIER || biome == Biomes.OVERWORLD_TUNDRA){
+        if (biome == Biomes.OVERWORLD_GLACIER || biome == Biomes.OVERWORLD_TUNDRA) {
             for (int i4 = 0; i4 < 5 * oreHeightModifier; i4++) {
                 int j7 = x + rand.nextInt(16);
                 int k10 = minY + rand.nextInt(rangeY / 2);
                 int j13 = z + rand.nextInt(16);
-                (new WorldFeaturePermaice(32 + rand.nextInt(32), Blocks.PERMAFROST)).place(world, rand, j7, k10, j13);
+                (new WorldFeaturePermaice(32 + rand.nextInt(32), Blocks.PERMAFROST)).place(this.world, rand, j7, k10, j13);
             }
         }
 
@@ -199,68 +189,68 @@ public class ChunkDecoratorOverworld
             int l5 = x + rand.nextInt(16);
             int i9 = minY + rand.nextInt(rangeY);
             int l11 = z + rand.nextInt(16);
-            (new WorldFeatureOre(Blocks.DIRT.id(), 32)).place(world, rand, l5, i9, l11);
+            (new WorldFeatureOre(Blocks.DIRT.id(), 32)).place(this.world, rand, l5, i9, l11);
         }
 
         for (int k2 = 0; k2 < (10 * oreHeightModifier); k2++) {
             int i6 = x + rand.nextInt(16);
             int j9 = minY + rand.nextInt(rangeY);
             int i12 = z + rand.nextInt(16);
-            (new WorldFeatureOre(Blocks.GRAVEL.id(), 32)).place(world, rand, i6, j9, i12);
+            (new WorldFeatureOre(Blocks.GRAVEL.id(), 32)).place(this.world, rand, i6, j9, i12);
         }
 
         for (int i3 = 0; i3 < (20 * oreHeightModifier); i3++) {
             int j6 = x + rand.nextInt(16);
             int k9 = minY + rand.nextInt(rangeY);
             int j12 = z + rand.nextInt(16);
-            new WorldFeatureOre(BlockLogicOreCoal.variantMap, 16).place(world, rand, j6, k9, j12);
+            new WorldFeatureOre(BlockLogicOreCoal.variantMap, 16).place(this.world, rand, j6, k9, j12);
         }
 
         for (int j3 = 0; j3 < (20 * oreHeightModifier); j3++) {
             int k6 = x + rand.nextInt(16);
             int l9 = minY + rand.nextInt(rangeY / 2);
             int k12 = z + rand.nextInt(16);
-            (new WorldFeatureOre(BlockLogicOreIron.variantMap, 8)).place(world, rand, k6, l9, k12);
+            (new WorldFeatureOre(BlockLogicOreIron.variantMap, 8)).place(this.world, rand, k6, l9, k12);
         }
 
         for (int k3 = 0; k3 < (2 * oreHeightModifier); k3++) {
             int l6 = x + rand.nextInt(16);
             int i10 = minY + rand.nextInt(rangeY / 4);
             int l12 = z + rand.nextInt(16);
-            (new WorldFeatureOre(BlockLogicOreGold.variantMap, 8)).place(world, rand, l6, i10, l12);
+            (new WorldFeatureOre(BlockLogicOreGold.variantMap, 8)).place(this.world, rand, l6, i10, l12);
         }
 
         for (int l3 = 0; l3 < (8 * oreHeightModifier); l3++) {
             int i7 = x + rand.nextInt(16);
             int j10 = minY + rand.nextInt(rangeY / 8);
             int i13 = z + rand.nextInt(16);
-            (new WorldFeatureOre(BlockLogicOreRedstone.variantMap, 7)).place(world, rand, i7, j10, i13);
+            (new WorldFeatureOre(BlockLogicOreRedstone.variantMap, 7)).place(this.world, rand, i7, j10, i13);
         }
 
         for (int i4 = 0; i4 < oreHeightModifier; i4++) {
             int j7 = x + rand.nextInt(16);
             int k10 = minY + rand.nextInt(rangeY / 8);
             int j13 = z + rand.nextInt(16);
-            (new WorldFeatureOre(BlockLogicOreDiamond.variantMap, 7)).place(world, rand, j7, k10, j13);
+            (new WorldFeatureOre(BlockLogicOreDiamond.variantMap, 7)).place(this.world, rand, j7, k10, j13);
         }
 
         for (int i4 = 0; i4 < oreHeightModifier; i4++) {
             int j7 = x + rand.nextInt(16);
             int k10 = minY + rand.nextInt(rangeY / 2);
             int j13 = z + rand.nextInt(16);
-            (new WorldFeatureMoss(BlockLogicMoss.variantMap, 32)).place(world, rand, j7, k10, j13);
+            (new WorldFeatureMoss(BlockLogicMoss.variantMap, 32)).place(this.world, rand, j7, k10, j13);
         }
 
         for (int j4 = 0; j4 < oreHeightModifier; j4++) {
             int k7 = x + rand.nextInt(16);
             int l10 = minY + rand.nextInt(rangeY / 8) + rand.nextInt(rangeY / 8);
             int k13 = z + rand.nextInt(16);
-            (new WorldFeatureOre(BlockLogicOreLapis.variantMap, 6)).place(world, rand, k7, l10, k13);
+            (new WorldFeatureOre(BlockLogicOreLapis.variantMap, 6)).place(this.world, rand, k7, l10, k13);
         }
 
 
         double d = 0.5D;
-        int k4 = (int) ((treeDensityNoise.get((double) x * d, (double) z * d) / 8D + rand.nextDouble() * 4D + 4D) / 3D);
+        int k4 = (int) ((this.treeDensityNoise.get((double) x * d, (double) z * d) / 8D + rand.nextDouble() * 4D + 4D) / 3D);
         int treeDensity = 0;
         if (rand.nextInt(10) == 0) {
             treeDensity++;
@@ -304,17 +294,17 @@ public class ChunkDecoratorOverworld
         if (biome == Biomes.OVERWORLD_OUTBACK_GRASSY) {
             treeDensity += k4;
         }
-        if (treeDensityOverride != -1) treeDensity = treeDensityOverride;
+        if (this.treeDensityOverride != -1) treeDensity = this.treeDensityOverride;
         try {
-        	BlockLogicLeavesBase.enableDecay = false;
+            BlockLogicLeavesBase.enableDecay = false;
             for (int i11 = 0; i11 < treeDensity; i11++) {
                 int l13 = x + rand.nextInt(16) + 8;
                 int j14 = z + rand.nextInt(16) + 8;
                 WorldFeature feature = biome.getRandomWorldGenForTrees(rand);
                 feature.init(1.0D, 1.0D, 1.0D);
-                feature.place(world, rand, l13, world.getHeightValue(l13, j14), j14);
+                feature.place(this.world, rand, l13, this.world.getHeightValue(l13, j14), j14);
             }
-        }finally {
+        } finally {
             BlockLogicLeavesBase.enableDecay = true;
         }
         byte byteReeds = 0;
@@ -324,8 +314,8 @@ public class ChunkDecoratorOverworld
         for (int i11 = 0; i11 < byteReeds; i11++) {
             int i18 = x + rand.nextInt(16) + 8;
             int i23 = z + rand.nextInt(16) + 8;
-            int i21 = world.getHeightValue(i18, i23);
-            (new WorldFeatureSugarCaneTall()).place(world, rand, i18, i21, i23);
+            int i21 = this.world.getHeightValue(i18, i23);
+            (new WorldFeatureSugarCaneTall()).place(this.world, rand, i18, i21, i23);
         }
 
         byte byteOrchid = 0;
@@ -336,12 +326,12 @@ public class ChunkDecoratorOverworld
             byteOrchid = 1;
         }
         for (int l14 = 0; l14 < byteOrchid; l14++) {
-            int[] flowerIds= { Blocks.FLOWER_YELLOW.id(), Blocks.FLOWER_PINK.id(), Blocks.FLOWER_RED.id() };
+            int[] flowerIds = {Blocks.FLOWER_YELLOW.id(), Blocks.FLOWER_PINK.id(), Blocks.FLOWER_RED.id()};
 
             int l19 = x + rand.nextInt(16) + 8;
-            int k22 = rand.nextInt(world.getHeightBlocks());
+            int k22 = rand.nextInt(this.world.getHeightBlocks());
             int j24 = z + rand.nextInt(16) + 8;
-            (new WorldFeatureMeadow(flowerIds)).place(world, rand, l19, k22, j24);
+            (new WorldFeatureMeadow(flowerIds)).place(this.world, rand, l19, k22, j24);
         }
 
         byte byteMeadow = 0;
@@ -367,9 +357,9 @@ public class ChunkDecoratorOverworld
                 blockId = Blocks.FLOWER_YELLOW.id();
             }
             int l19 = x + rand.nextInt(16) + 8;
-            int k22 = rand.nextInt(world.getHeightBlocks());
+            int k22 = rand.nextInt(this.world.getHeightBlocks());
             int j24 = z + rand.nextInt(16) + 8;
-            (new WorldFeatureFlowers(blockId, 128, true)).place(world, rand, l19, k22, j24);
+            (new WorldFeatureFlowers(blockId, 128, true)).place(this.world, rand, l19, k22, j24);
         }
 
         byte byteBluebells = 0;
@@ -390,7 +380,7 @@ public class ChunkDecoratorOverworld
             int k14 = x + rand.nextInt(16) + 8;
             int l16 = minY + rand.nextInt(rangeY);
             int k19 = z + rand.nextInt(16) + 8;
-            (new WorldFeatureFlowers(Blocks.FLOWER_LIGHT_BLUE.id(), 64, true)).place(world, rand, k14, l16, k19);
+            (new WorldFeatureFlowers(Blocks.FLOWER_LIGHT_BLUE.id(), 64, true)).place(this.world, rand, k14, l16, k19);
         }
 
         byte byteMarigold = 0;
@@ -413,7 +403,7 @@ public class ChunkDecoratorOverworld
             int k14 = x + rand.nextInt(16) + 8;
             int l16 = minY + rand.nextInt(rangeY);
             int k19 = z + rand.nextInt(16) + 8;
-            (new WorldFeatureFlowers(Blocks.FLOWER_ORANGE.id(), 64, true)).place(world, rand, k14, l16, k19);
+            (new WorldFeatureFlowers(Blocks.FLOWER_ORANGE.id(), 64, true)).place(this.world, rand, k14, l16, k19);
         }
 
         byte byte0 = 0;
@@ -441,7 +431,7 @@ public class ChunkDecoratorOverworld
             int k14 = x + rand.nextInt(16) + 8;
             int l16 = minY + rand.nextInt(rangeY);
             int k19 = z + rand.nextInt(16) + 8;
-            (new WorldFeatureFlowers(Blocks.FLOWER_YELLOW.id(), 64, true)).place(world, rand, k14, l16, k19);
+            (new WorldFeatureFlowers(Blocks.FLOWER_YELLOW.id(), 64, true)).place(this.world, rand, k14, l16, k19);
         }
 
         byte byte1 = 0;
@@ -483,7 +473,7 @@ public class ChunkDecoratorOverworld
             int l19 = x + rand.nextInt(16) + 8;
             int k22 = minY + rand.nextInt(rangeY);
             int j24 = z + rand.nextInt(16) + 8;
-            (new WorldFeatureTallGrass(type)).place(world, rand, l19, k22, j24);
+            (new WorldFeatureTallGrass(type)).place(this.world, rand, l19, k22, j24);
         }
 
         byte1 = 0;
@@ -494,7 +484,7 @@ public class ChunkDecoratorOverworld
             int i17 = x + rand.nextInt(16) + 8;
             int i20 = minY + rand.nextInt(rangeY);
             int l22 = z + rand.nextInt(16) + 8;
-            (new WorldFeatureSpinifexPatch()).place(world, rand, i17, i20, l22);
+            (new WorldFeatureSpinifexPatch()).place(this.world, rand, i17, i20, l22);
         }
 
         byte1 = 0;
@@ -508,80 +498,73 @@ public class ChunkDecoratorOverworld
             int i17 = x + rand.nextInt(16) + 8;
             int i20 = minY + rand.nextInt(rangeY);
             int l22 = z + rand.nextInt(16) + 8;
-            (new WorldFeatureDeadBush(Blocks.DEADBUSH.id())).place(world, rand, i17, i20, l22);
+            (new WorldFeatureDeadBush(Blocks.DEADBUSH.id())).place(this.world, rand, i17, i20, l22);
         }
 
         if (rand.nextInt(2) == 0) {
             int j15 = x + rand.nextInt(16) + 8;
             int j17 = minY + rand.nextInt(rangeY);
             int j20 = z + rand.nextInt(16) + 8;
-            (new WorldFeatureFlowers(Blocks.FLOWER_RED.id(), 64, true)).place(world, rand, j15, j17, j20);
+            (new WorldFeatureFlowers(Blocks.FLOWER_RED.id(), 64, true)).place(this.world, rand, j15, j17, j20);
         }
         if (rand.nextInt(4) == 0) {
             int k15 = x + rand.nextInt(16) + 8;
             int k17 = minY + rand.nextInt(rangeY);
             int k20 = z + rand.nextInt(16) + 8;
-            (new WorldFeatureFlowers(Blocks.MUSHROOM_BROWN.id(), 64, false)).place(world, rand, k15, k17, k20);
+            (new WorldFeatureFlowers(Blocks.MUSHROOM_BROWN.id(), 64, false)).place(this.world, rand, k15, k17, k20);
         }
         if (rand.nextInt(8) == 0) {
             int l15 = x + rand.nextInt(16) + 8;
             int l17 = minY + rand.nextInt(rangeY);
             int l20 = z + rand.nextInt(16) + 8;
-            (new WorldFeatureFlowers(Blocks.MUSHROOM_RED.id(), 64, false)).place(world, rand, l15, l17, l20);
+            (new WorldFeatureFlowers(Blocks.MUSHROOM_RED.id(), 64, false)).place(this.world, rand, l15, l17, l20);
         }
-        if(rand.nextInt(5) == 0) {
+        if (rand.nextInt(5) == 0) {
             int i18 = x + rand.nextInt(16) + 8;
             int i23 = z + rand.nextInt(16) + 8;
-            int i21 = world.getHeightValue(i18, i23);
-            (new WorldFeatureSugarCane()).place(world, rand, i18, i21, i23);
+            int i21 = this.world.getHeightValue(i18, i23);
+            (new WorldFeatureSugarCane()).place(this.world, rand, i18, i21, i23);
         }
 
-        if(rand.nextInt(128) == 0)
-        {
+        if (rand.nextInt(128) == 0) {
             int j16 = x + rand.nextInt(16) + 8;
             int j21 = z + rand.nextInt(16) + 8;
-            int i22 = world.getHeightValue(j16, j21);
-            (new WorldFeaturePumpkin()).place(world, rand, j16, i22, j21);
+            int i22 = this.world.getHeightValue(j16, j21);
+            (new WorldFeaturePumpkin()).place(this.world, rand, j16, i22, j21);
         }
-        if(rand.nextInt(64) == 0)
-        {
+        if (rand.nextInt(64) == 0) {
             int j16 = x + rand.nextInt(16) + 8;
             int j21 = z + rand.nextInt(16) + 8;
-            int i22 = world.getHeightValue(j16, j21);
-            (new WorldFeatureSponge()).place(world, rand, j16, i22, j21);
+            int i22 = this.world.getHeightValue(j16, j21);
+            (new WorldFeatureSponge()).place(this.world, rand, j16, i22, j21);
         }
 
         int k16 = 0;
-        if(biome == Biomes.OVERWORLD_DESERT)
-        {
+        if (biome == Biomes.OVERWORLD_DESERT) {
             k16 += 10;
         }
-        if(biome == Biomes.OVERWORLD_CAATINGA || biome == Biomes.OVERWORLD_CAATINGA_PLAINS)
-        {
+        if (biome == Biomes.OVERWORLD_CAATINGA || biome == Biomes.OVERWORLD_CAATINGA_PLAINS) {
             k16 += 10;
         }
-        for(int k18 = 0; k18 < k16; k18++)
-        {
+        for (int k18 = 0; k18 < k16; k18++) {
             int k21 = x + rand.nextInt(16) + 8;
             int j23 = minY + rand.nextInt(rangeY);
             int k24 = z + rand.nextInt(16) + 8;
-            (new WorldFeatureCactus()).place(world, rand, k21, j23, k24);
+            (new WorldFeatureCactus()).place(this.world, rand, k21, j23, k24);
         }
 
-        for(int l18 = 0; l18 < 50; l18++)
-        {
+        for (int l18 = 0; l18 < 50; l18++) {
             int l21 = x + rand.nextInt(16) + 8;
             int k23 = minY + rand.nextInt(rand.nextInt(rangeY - (rangeY / 16)) + (rangeY / 16));
             int l24 = z + rand.nextInt(16) + 8;
-            (new WorldFeatureLiquid(Blocks.FLUID_WATER_FLOWING.id())).place(world, rand, l21, k23, l24);
+            (new WorldFeatureLiquid(Blocks.FLUID_WATER_FLOWING.id())).place(this.world, rand, l21, k23, l24);
         }
 
-        for(int i19 = 0; i19 < 20; i19++)
-        {
+        for (int i19 = 0; i19 < 20; i19++) {
             int i22 = x + rand.nextInt(16) + 8;
             int l23 = minY + rand.nextInt(rand.nextInt(rand.nextInt(rangeY - (rangeY / 8)) + (rangeY / 16)) + (rangeY / 16));
             int i25 = z + rand.nextInt(16) + 8;
-            (new WorldFeatureLiquid(Blocks.FLUID_LAVA_FLOWING.id())).place(world, rand, i22, l23, i25);
+            (new WorldFeatureLiquid(Blocks.FLUID_LAVA_FLOWING.id())).place(this.world, rand, i22, l23, i25);
         }
 
         int numPebbles = 0;
@@ -614,24 +597,19 @@ public class ChunkDecoratorOverworld
             (new WorldFeaturePebbles(Blocks.OVERLAY_PEBBLES.id(), 16, true)).place(this.world, rand, xx, yy, zz);
         }
 
-        int oceanY = world.getWorldType().getOceanY();
-        for(int dx = x + 8; dx < x + 8 + 16; dx++)
-        {
-            for(int dz = z + 8; dz < z + 8 + 16; dz++)
-            {
-                int dy = world.getHeightValue(dx, dz);
-                Biome localBiome = world.getBlockBiome(dx, dy, dz);
+        int oceanY = this.world.getWorldType().getOceanY();
+        for (int dx = x + 8; dx < x + 8 + 16; dx++) {
+            for (int dz = z + 8; dz < z + 8 + 16; dz++) {
+                int dy = this.world.getHeightValue(dx, dz);
+                Biome localBiome = this.world.getBlockBiome(dx, dy, dz);
 
-                if ((localBiome.hasSurfaceSnow() || world.worldType == WorldTypes.OVERWORLD_WINTER) && dy > 0 && dy < world.getHeightBlocks())
-                {
-                    if (world.isAirBlock(dx, dy, dz) && world.getBlockMaterial(dx, dy - 1, dz).blocksMotion())
-                    {
-                        world.setBlockWithNotify(dx, dy, dz, Blocks.LAYER_SNOW.id());
+                if ((localBiome.hasSurfaceSnow() || this.world.worldType == WorldTypes.OVERWORLD_WINTER) && dy > 0 && dy < this.world.getHeightBlocks()) {
+                    if (this.world.isAirBlock(dx, dy, dz) && this.world.getBlockMaterial(dx, dy - 1, dz).blocksMotion()) {
+                        this.world.setBlockWithNotify(dx, dy, dz, Blocks.LAYER_SNOW.id());
                     }
                 }
-                if ((localBiome.hasSurfaceSnow() || world.worldType == WorldTypes.OVERWORLD_WINTER) && (world.getBlockId(dx, oceanY - 1, dz) == Blocks.FLUID_WATER_STILL.id() || world.getBlockId(dx, oceanY - 1, dz) == Blocks.FLUID_WATER_FLOWING.id()))
-                {
-                    world.setBlockWithNotify(dx, oceanY - 1, dz, Blocks.ICE.id());
+                if ((localBiome.hasSurfaceSnow() || this.world.worldType == WorldTypes.OVERWORLD_WINTER) && (this.world.getBlockId(dx, oceanY - 1, dz) == Blocks.FLUID_WATER_STILL.id() || this.world.getBlockId(dx, oceanY - 1, dz) == Blocks.FLUID_WATER_FLOWING.id())) {
+                    this.world.setBlockWithNotify(dx, oceanY - 1, dz, Blocks.ICE.id());
                 }
 
             }
@@ -639,6 +617,6 @@ public class ChunkDecoratorOverworld
         }
 
         BlockLogicSand.fallInstantly = false;
-        world.scheduledUpdatesAreImmediate = false;
+        this.world.scheduledUpdatesAreImmediate = false;
     }
 }
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/ChunkGeneratorOverworld.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/ChunkGeneratorOverworld.java
index d95a3dad3..8d2e7df5c 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/ChunkGeneratorOverworld.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/ChunkGeneratorOverworld.java
@@ -4,12 +4,11 @@ import net.minecraft.core.world.World;
 import net.minecraft.core.world.generate.CavesLargeFeature;
 import net.minecraft.core.world.generate.LargeFeature;
 import net.minecraft.core.world.generate.chunk.perlin.ChunkGeneratorPerlin;
+import org.jetbrains.annotations.NotNull;
 
 public class ChunkGeneratorOverworld
-    extends ChunkGeneratorPerlin
-{
-    public ChunkGeneratorOverworld(World world)
-    {
-        super(world, new ChunkDecoratorOverworld(world), new TerrainGeneratorOverworld(world), new SurfaceGeneratorOverworld(world), new LargeFeature[] { new CavesLargeFeature() });
+    extends ChunkGeneratorPerlin {
+    public ChunkGeneratorOverworld(@NotNull World world) {
+        super(world, new ChunkDecoratorOverworld(world), new TerrainGeneratorOverworld(world), new SurfaceGeneratorOverworld(world), new LargeFeature[]{new CavesLargeFeature()});
     }
 }
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/DensityGeneratorOverworld.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/DensityGeneratorOverworld.java
index 3097a4e04..d3bd5f73c 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/DensityGeneratorOverworld.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/DensityGeneratorOverworld.java
@@ -6,24 +6,23 @@ import net.minecraft.core.world.chunk.Chunk;
 import net.minecraft.core.world.generate.chunk.perlin.DensityGenerator;
 import net.minecraft.core.world.noise.BasePerlinNoise;
 import net.minecraft.core.world.noise.PerlinNoise;
+import org.jetbrains.annotations.NotNull;
 
 public class DensityGeneratorOverworld
-    implements DensityGenerator
-{
-    private final World world;
+    implements DensityGenerator {
+    private final @NotNull World world;
 
-    private final BasePerlinNoise<?> minLimitNoise;
-    private final BasePerlinNoise<?> maxLimitNoise;
-    private final BasePerlinNoise<?> mainNoise;
-    private final BasePerlinNoise<?> scaleNoise;
-    private final BasePerlinNoise<?> depthNoise;
+    private final @NotNull BasePerlinNoise<?> minLimitNoise;
+    private final @NotNull BasePerlinNoise<?> maxLimitNoise;
+    private final @NotNull BasePerlinNoise<?> mainNoise;
+    private final @NotNull BasePerlinNoise<?> scaleNoise;
+    private final @NotNull BasePerlinNoise<?> depthNoise;
 
     private final boolean generateRivers;
-    private final BasePerlinNoise<?> smoothingRiverNoise;
-    private final BasePerlinNoise<?> carvingRiverNoise;
+    private final @NotNull BasePerlinNoise<?> smoothingRiverNoise;
+    private final @NotNull BasePerlinNoise<?> carvingRiverNoise;
 
-    protected DensityGeneratorOverworld(World world, BasePerlinNoise<?> minLimitNoise, BasePerlinNoise<?> maxLimitNoise, BasePerlinNoise<?> mainNoise, BasePerlinNoise<?> scaleNoise, BasePerlinNoise<?> depthNoise, boolean generateRivers)
-    {
+    protected DensityGeneratorOverworld(@NotNull World world, @NotNull BasePerlinNoise<?> minLimitNoise, @NotNull BasePerlinNoise<?> maxLimitNoise, @NotNull BasePerlinNoise<?> mainNoise, @NotNull BasePerlinNoise<?> scaleNoise, @NotNull BasePerlinNoise<?> depthNoise, boolean generateRivers) {
         this.world = world;
 
         this.minLimitNoise = minLimitNoise;
@@ -37,20 +36,18 @@ public class DensityGeneratorOverworld
         this.carvingRiverNoise = new PerlinNoise(world.getRandomSeed() + 1, 1);
     }
 
-    public DensityGeneratorOverworld(World world)
-    {
+    public DensityGeneratorOverworld(@NotNull World world) {
         this(world,
-             new PerlinNoise(world.getRandomSeed(), 16, 0),
-             new PerlinNoise(world.getRandomSeed(), 16, 16),
-             new PerlinNoise(world.getRandomSeed(), 8, 32),
-             new PerlinNoise(world.getRandomSeed(), 10, 48),
-             new PerlinNoise(world.getRandomSeed(), 16, 58),
-             true
-         );
+            new PerlinNoise(world.getRandomSeed(), 16, 0),
+            new PerlinNoise(world.getRandomSeed(), 16, 16),
+            new PerlinNoise(world.getRandomSeed(), 8, 32),
+            new PerlinNoise(world.getRandomSeed(), 10, 48),
+            new PerlinNoise(world.getRandomSeed(), 16, 58),
+            true
+        );
     }
 
-    private void modifyDensityMapSmoothingRivers(int chunkX, int chunkZ, int terrainHeight, double[] densityMapArray)
-    {
+    private void modifyDensityMapSmoothingRivers(int chunkX, int chunkZ, int terrainHeight, double @NotNull [] densityMapArray) {
         int xSize = 4 + 1;
         int ySize = (terrainHeight / 8) + 1;
         int zSize = 4 + 1;
@@ -59,22 +56,19 @@ public class DensityGeneratorOverworld
 
         double riverLevel = 0d;
 
-        double[] largeSmoothing = smoothingRiverNoise.get(null, x, z, xSize, zSize, 1 / (1000d / xSize), 1 / (1000d / zSize));
-        double[] mediumSmoothing = smoothingRiverNoise.get(null, x, z, xSize, zSize, 1 / (50d / xSize), 1 / (50d / zSize));
-        double[] smallSmoothing = smoothingRiverNoise.get(null, x, z, xSize, zSize, 1 / (10d / xSize), 1 / (10d / zSize));
+        double[] largeSmoothing = this.smoothingRiverNoise.get(null, x, z, xSize, zSize, 1 / (1000d / xSize), 1 / (1000d / zSize));
+        double[] mediumSmoothing = this.smoothingRiverNoise.get(null, x, z, xSize, zSize, 1 / (50d / xSize), 1 / (50d / zSize));
+        double[] smallSmoothing = this.smoothingRiverNoise.get(null, x, z, xSize, zSize, 1 / (10d / xSize), 1 / (10d / zSize));
 
-        double[] riverRadiuses = new double[] { 0.006, 0.024, 0.036 };
-        double[] riverMults = new double[] { 20, 60, 60 };
+        double[] riverRadiuses = new double[]{0.006, 0.024, 0.036};
+        double[] riverMults = new double[]{20, 60, 60};
 
-        for (int dx = 0; dx < xSize; dx++)
-        {
-            for (int dz = 0; dz < zSize; dz++)
-            {
+        for (int dx = 0; dx < xSize; dx++) {
+            for (int dz = 0; dz < zSize; dz++) {
                 final double sample = largeSmoothing[dx * zSize + dz] + mediumSmoothing[dx * zSize + dz] * 0.04 + smallSmoothing[dx * zSize + dz] * 0.004;
                 double finalSample = 0.0;
 
-                for (int i = 0; i < riverRadiuses.length; i++)
-                {
+                for (int i = 0; i < riverRadiuses.length; i++) {
                     if (sample < riverLevel - riverRadiuses[i] || sample > riverLevel + riverRadiuses[i]) continue;
                     double modSample = sample;
                     modSample -= riverLevel;
@@ -86,14 +80,10 @@ public class DensityGeneratorOverworld
                     finalSample += modSample;
                 }
 
-                for (int dy = 0; dy < ySize; dy++)
-                {
-                    if (dy < ySize / 2)
-                    {
+                for (int dy = 0; dy < ySize; dy++) {
+                    if (dy < ySize / 2) {
                         densityMapArray[(dx * ySize * zSize) + (dz * ySize) + dy] -= finalSample * (dy / (ySize / 2d)) * (dy / (ySize / 2d));
-                    }
-                    else
-                    {
+                    } else {
                         densityMapArray[(dx * ySize * zSize) + (dz * ySize) + dy] -= finalSample;
                     }
                 }
@@ -101,8 +91,7 @@ public class DensityGeneratorOverworld
         }
     }
 
-    private void modifyDensityMapCarvingRivers(int chunkX, int chunkZ, int terrainHeight, double[] densityMapArray)
-    {
+    private void modifyDensityMapCarvingRivers(int chunkX, int chunkZ, int terrainHeight, double @NotNull [] densityMapArray) {
         int xSize = 4 + 1;
         int ySize = (terrainHeight / 8) + 1;
         int zSize = 4 + 1;
@@ -113,22 +102,19 @@ public class DensityGeneratorOverworld
 
         double riverLevel = 0d;
 
-        double[] largeCarving = carvingRiverNoise.get(null, x, z, xSize, zSize, 1 / (1000d / xSize), 1 / (1000d / zSize));
-        double[] mediumCarving = carvingRiverNoise.get(null, x, z, xSize, zSize, 1 / (50d / xSize), 1 / (50d / zSize));
-        double[] smallCarving = carvingRiverNoise.get(null, x, z, xSize, zSize, 1 / (10d / xSize), 1 / (10d / zSize));
+        double[] largeCarving = this.carvingRiverNoise.get(null, x, z, xSize, zSize, 1 / (1000d / xSize), 1 / (1000d / zSize));
+        double[] mediumCarving = this.carvingRiverNoise.get(null, x, z, xSize, zSize, 1 / (50d / xSize), 1 / (50d / zSize));
+        double[] smallCarving = this.carvingRiverNoise.get(null, x, z, xSize, zSize, 1 / (10d / xSize), 1 / (10d / zSize));
 
-        double[] riverRadiuses = new double[] { 0.012, 0.018, 0.024 };
-        double[] riverMults = new double[] { 20, 60, 60 };
+        double[] riverRadiuses = new double[]{0.012, 0.018, 0.024};
+        double[] riverMults = new double[]{20, 60, 60};
 
-        for (int dx = 0; dx < xSize; dx++)
-        {
-            for (int dz = 0; dz < zSize; dz++)
-            {
+        for (int dx = 0; dx < xSize; dx++) {
+            for (int dz = 0; dz < zSize; dz++) {
                 final double sample = largeCarving[dx * zSize + dz] + mediumCarving[dx * zSize + dz] * 0.04 + smallCarving[dx * zSize + dz] * 0.004;
                 double finalSample = 0.0;
 
-                for (int i = 0; i < riverRadiuses.length; i++)
-                {
+                for (int i = 0; i < riverRadiuses.length; i++) {
                     if (sample < riverLevel - riverRadiuses[i] || sample > riverLevel + riverRadiuses[i]) continue;
                     double modSample = sample;
                     modSample -= riverLevel;
@@ -142,10 +128,9 @@ public class DensityGeneratorOverworld
 
                 if (finalSample <= 0.0) continue;
 
-                for (int dy = ySize / 2 - maxUndergroundRiverHeight; dy < ySize / 2 + maxUndergroundRiverHeight; dy++)
-                {
-                    double heightFactor = dy;                                           // Range = ySize / 2 - maxUndergroundRiverHeight to ySize / 2 + maxUndergroundRiverHeight
-                    heightFactor = heightFactor - (int)(ySize / 2);                     // Range = -maxUndergroundRiverHeight to maxUndergroundRiverHeight
+                for (int dy = ySize / 2 - maxUndergroundRiverHeight; dy < ySize / 2 + maxUndergroundRiverHeight; dy++) {
+                    double heightFactor = dy;                   // Range = ySize / 2 - maxUndergroundRiverHeight to ySize / 2 + maxUndergroundRiverHeight
+                    heightFactor = heightFactor - (ySize / 2);  // Range = -maxUndergroundRiverHeight to maxUndergroundRiverHeight
                     heightFactor /= maxUndergroundRiverHeight;
                     heightFactor = Math.abs(heightFactor);
                     heightFactor = -heightFactor;
@@ -158,9 +143,8 @@ public class DensityGeneratorOverworld
     }
 
     @Override
-    public double[] generateDensityMap(Chunk chunk)
-    {
-        int terrainHeight = (world.getWorldType().getMaxY() + 1) - world.getWorldType().getMinY();
+    public double @NotNull [] generateDensityMap(@NotNull Chunk chunk) {
+        int terrainHeight = (this.world.getWorldType().getMaxY() + 1) - this.world.getWorldType().getMinY();
 
         int xSize = 4 + 1;
         int ySize = (terrainHeight / 8) + 1;
@@ -182,7 +166,7 @@ public class DensityGeneratorOverworld
         final double depthNoiseScaleZ = 200;
 
         // This ternary operator business should be replaced properly once world settings are added.
-        final double depthBaseSize = world.getWorldType() == WorldTypes.OVERWORLD_AMPLIFIED ? 8.5D : (terrainHeight / 16D) + 0.5D;
+        final double depthBaseSize = this.world.getWorldType() == WorldTypes.OVERWORLD_AMPLIFIED ? 8.5D : (terrainHeight / 16D) + 0.5D;
 
         final double coordScale = 684.412D;
         final double heightScale = 684.412D;
@@ -190,23 +174,21 @@ public class DensityGeneratorOverworld
         final double heightStretch = 12;
 
         // Ditto to ^
-        final double upperLimitScale = world.getWorldType() == WorldTypes.OVERWORLD_AMPLIFIED ? 128 : 512;
+        final double upperLimitScale = this.world.getWorldType() == WorldTypes.OVERWORLD_AMPLIFIED ? 128 : 512;
         final double lowerLimitScale = 512;
 
         // uses temp and humidity to alter terrain shape.
-        double[] scaleArray = scaleNoise.get(null, x, z, xSize, zSize, scaleNoiseScaleX, scaleNoiseScaleZ);
-        double[] depthArray = depthNoise.get(null, x, z, xSize, zSize, depthNoiseScaleX, depthNoiseScaleZ);
-        double[] mainNoiseArray = mainNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale / mainNoiseScaleX, heightScale / mainNoiseScaleY, coordScale / mainNoiseScaleZ);
-        double[] minLimitArray = minLimitNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale, heightScale, coordScale);
-        double[] maxLimitArray = maxLimitNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale, heightScale, coordScale);
+        double[] scaleArray = this.scaleNoise.get(null, x, z, xSize, zSize, scaleNoiseScaleX, scaleNoiseScaleZ);
+        double[] depthArray = this.depthNoise.get(null, x, z, xSize, zSize, depthNoiseScaleX, depthNoiseScaleZ);
+        double[] mainNoiseArray = this.mainNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale / mainNoiseScaleX, heightScale / mainNoiseScaleY, coordScale / mainNoiseScaleZ);
+        double[] minLimitArray = this.minLimitNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale, heightScale, coordScale);
+        double[] maxLimitArray = this.maxLimitNoise.get(null, x, y, z, xSize, ySize, zSize, coordScale, heightScale, coordScale);
         int mainIndex = 0;
         int depthScaleIndex = 0;
         int xSizeScale = 16 / xSize;
-        for(int dx = 0; dx < xSize; dx++)
-        {
+        for (int dx = 0; dx < xSize; dx++) {
             int ix = dx * xSizeScale + xSizeScale / 2;
-            for(int dz = 0; dz < zSize; dz++)
-            {
+            for (int dz = 0; dz < zSize; dz++) {
                 int iz = dz * xSizeScale + xSizeScale / 2;
 
                 // used to control temperature based on temp and humid
@@ -220,41 +202,33 @@ public class DensityGeneratorOverworld
                 // Calculate scale
                 double scale = (scaleArray[depthScaleIndex] + 256D) / 512D;
                 scale *= humidity;
-                if(scale > 1.0D)
-                {
+                if (scale > 1.0D) {
                     scale = 1.0D;
                 }
 
                 // Calculate depth
                 double depth = depthArray[depthScaleIndex] / 8000D;
-                if(depth < 0.0D)
-                {
+                if (depth < 0.0D) {
                     depth = -depth * 0.3D;
                 }
                 depth = depth * 3D - 2D;
 
-                if(depth < 0.0D)
-                {
+                if (depth < 0.0D) {
                     depth /= 2D;
-                    if(depth < -1D)
-                    {
+                    if (depth < -1D) {
                         depth = -1D;
                     }
                     depth /= 1.4D;
                     depth /= 2D;
                     scale = 0.0D;
-                }
-                else
-                {
-                    if(depth > 1.0D)
-                    {
+                } else {
+                    if (depth > 1.0D) {
                         depth = 1.0D;
                     }
                     depth /= 8D;
                 }
 
-                if(scale < 0.0D)
-                {
+                if (scale < 0.0D) {
                     scale = 0.0D;
                 }
 
@@ -263,12 +237,10 @@ public class DensityGeneratorOverworld
 
                 double offsetY = depthBaseSize + depth * 4D;
                 depthScaleIndex++;
-                for(int dy = 0; dy < ySize; dy++)
-                {
+                for (int dy = 0; dy < ySize; dy++) {
                     double density;
-                    double densityOffset = (((double)dy - offsetY) * heightStretch) / scale;
-                    if(densityOffset < 0.0D)
-                    {
+                    double densityOffset = (((double) dy - offsetY) * heightStretch) / scale;
+                    if (densityOffset < 0.0D) {
                         densityOffset *= 4D;
                     }
                     double minDensity = minLimitArray[mainIndex] / upperLimitScale;
@@ -276,23 +248,17 @@ public class DensityGeneratorOverworld
                     double mainDensity = (mainNoiseArray[mainIndex] / 10D + 1.0D) / 2D;
 
                     // Constrain density
-                    if(mainDensity < 0.0D)
-                    {
+                    if (mainDensity < 0.0D) {
                         density = minDensity;
-                    }
-                    else if(mainDensity > 1.0D)
-                    {
+                    } else if (mainDensity > 1.0D) {
                         density = maxDensity;
-                    }
-                    else
-                    {
+                    } else {
                         density = minDensity + (maxDensity - minDensity) * mainDensity;
                     }
                     density -= densityOffset;
 
-                    if(dy > ySize - 4)
-                    {
-                        double densityMod = (float)(dy - (ySize - 4)) / 3F;
+                    if (dy > ySize - 4) {
+                        double densityMod = (float) (dy - (ySize - 4)) / 3F;
                         density = density * (1.0D - densityMod) + -10D * densityMod;
                     }
 
@@ -302,8 +268,7 @@ public class DensityGeneratorOverworld
             }
         }
 
-        if (generateRivers)
-        {
+        if (this.generateRivers) {
             modifyDensityMapSmoothingRivers(chunk.pos.x, chunk.pos.z, terrainHeight, densityMapArray);
             modifyDensityMapCarvingRivers(chunk.pos.x, chunk.pos.z, terrainHeight, densityMapArray);
         }
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/SurfaceGeneratorOverworld.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/SurfaceGeneratorOverworld.java
index 5b19f7e02..1f1e751d5 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/SurfaceGeneratorOverworld.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/SurfaceGeneratorOverworld.java
@@ -11,6 +11,7 @@ import net.minecraft.core.world.generate.chunk.ChunkGeneratorResult;
 import net.minecraft.core.world.generate.chunk.perlin.SurfaceGenerator;
 import net.minecraft.core.world.noise.BasePerlinNoise;
 import net.minecraft.core.world.noise.PerlinNoise;
+import org.jetbrains.annotations.NotNull;
 
 public class SurfaceGeneratorOverworld
     implements SurfaceGenerator
@@ -43,7 +44,7 @@ public class SurfaceGeneratorOverworld
     }
 
     @Override
-    public void generateSurface(Chunk chunk, ChunkGeneratorResult result)
+    public void generateSurface(@NotNull Chunk chunk, @NotNull ChunkGeneratorResult result)
     {
         int oceanY = world.getWorldType().getOceanY();
         int minY = world.getWorldType().getMinY();
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/TerrainGeneratorOverworld.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/TerrainGeneratorOverworld.java
index 7ad3054d4..2c651ab62 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/TerrainGeneratorOverworld.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/TerrainGeneratorOverworld.java
@@ -6,30 +6,31 @@ import net.minecraft.core.world.chunk.Chunk;
 import net.minecraft.core.world.generate.chunk.perlin.DensityGenerator;
 import net.minecraft.core.world.generate.chunk.perlin.TerrainGeneratorLerp;
 import net.minecraft.core.world.type.WorldType;
+import org.jetbrains.annotations.NotNull;
 
 public class TerrainGeneratorOverworld
     extends TerrainGeneratorLerp
 {
     private final DensityGenerator densityGenerator;
 
-    protected TerrainGeneratorOverworld(World world, DensityGenerator densityGenerator)
+    protected TerrainGeneratorOverworld(@NotNull World world, @NotNull DensityGenerator densityGenerator)
     {
         super(world);
 
         this.densityGenerator = densityGenerator;
     }
 
-    public TerrainGeneratorOverworld(World world)
+    public TerrainGeneratorOverworld(@NotNull World world)
     {
         this(world, new DensityGeneratorOverworld(world));
     }
 
     @Override
-    protected int getBlockAt(Chunk chunk, int x, int y, int z, double density)
+    protected int getBlockAt(@NotNull Chunk chunk, int x, int y, int z, double density)
     {
-        WorldType type = world.getWorldType();
+        WorldType type = this.world.getWorldType();
 
-        if (y <= type.getMinY() + rand.nextInt(5))
+        if (y <= type.getMinY() + this.rand.nextInt(5))
         {
             return Blocks.BEDROCK.id();
         }
@@ -46,8 +47,8 @@ public class TerrainGeneratorOverworld
     }
 
     @Override
-    public DensityGenerator getDensityGenerator()
+    public @NotNull DensityGenerator getDensityGenerator()
     {
-        return densityGenerator;
+        return this.densityGenerator;
     }
 }
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/b173/ChunkDecoratorOverworldB173.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/b173/ChunkDecoratorOverworldB173.java
index 316ad138b..5f0bb0b67 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/b173/ChunkDecoratorOverworldB173.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/b173/ChunkDecoratorOverworldB173.java
@@ -2,7 +2,6 @@ package net.minecraft.core.world.generate.chunk.perlin.overworld.b173;
 
 import net.minecraft.core.block.BlockLogicSand;
 import net.minecraft.core.block.Blocks;
-import net.minecraft.core.block.material.Material;
 import net.minecraft.core.world.World;
 import net.minecraft.core.world.biome.Biome;
 import net.minecraft.core.world.biome.Biomes;
@@ -10,14 +9,12 @@ import net.minecraft.core.world.chunk.Chunk;
 import net.minecraft.core.world.generate.chunk.ChunkDecorator;
 import net.minecraft.core.world.generate.feature.*;
 import net.minecraft.core.world.noise.PerlinNoise;
-import net.minecraft.core.world.type.WorldTypes;
 import org.jetbrains.annotations.NotNull;
 
 import java.util.Random;
 
 public class ChunkDecoratorOverworldB173
-    implements ChunkDecorator
-{
+    implements ChunkDecorator {
     private final @NotNull World world;
     private final @NotNull PerlinNoise forestNoise;
 
@@ -28,7 +25,7 @@ public class ChunkDecoratorOverworldB173
     }
 
     @Override
-    public void decorate(final Chunk chunk) {
+    public void decorate(final @NotNull Chunk chunk) {
         this.world.scheduledUpdatesAreImmediate = true;
         BlockLogicSand.fallInstantly = true;
 
@@ -299,8 +296,8 @@ public class ChunkDecoratorOverworldB173
         }
 
         final int oceanY = this.world.getWorldType().getOceanY();
-        for(int xx = x + 8; xx < x + 8 + 16; xx++) {
-            for(int zz = z + 8; zz < z + 8 + 16; zz++) {
+        for (int xx = x + 8; xx < x + 8 + 16; xx++) {
+            for (int zz = z + 8; zz < z + 8 + 16; zz++) {
                 int yy = this.world.getHeightValue(xx, zz);
                 final Biome localBiome = this.world.getBlockBiome(xx, yy, zz);
 
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/b173/ChunkGeneratorOverworldB173.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/b173/ChunkGeneratorOverworldB173.java
index 47f280c6e..05bee89e7 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/b173/ChunkGeneratorOverworldB173.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/b173/ChunkGeneratorOverworldB173.java
@@ -5,16 +5,16 @@ import net.minecraft.core.world.generate.CavesLargeFeature;
 import net.minecraft.core.world.generate.LargeFeature;
 import net.minecraft.core.world.generate.RetroCavesLargeFeature;
 import net.minecraft.core.world.generate.chunk.perlin.ChunkGeneratorPerlin;
+import org.jetbrains.annotations.NotNull;
 
 public class ChunkGeneratorOverworldB173
-    extends ChunkGeneratorPerlin
-{
-    public ChunkGeneratorOverworldB173(World world) {
+    extends ChunkGeneratorPerlin {
+    public ChunkGeneratorOverworldB173(@NotNull World world) {
         super(world,
-              new ChunkDecoratorOverworldB173(world),
-              new TerrainGeneratorOverworldB173(world),
-              new SurfaceGeneratorOverworldB173(world),
-              new LargeFeature[] { new RetroCavesLargeFeature(world.getWorldType().getMinY(), world.getWorldType().getMaxY() + 1) }
+            new ChunkDecoratorOverworldB173(world),
+            new TerrainGeneratorOverworldB173(world),
+            new SurfaceGeneratorOverworldB173(world),
+            new LargeFeature[]{new RetroCavesLargeFeature(world.getWorldType().getMinY(), world.getWorldType().getMaxY() + 1)}
         );
     }
 }
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/b173/DensityGeneratorOverworldB173.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/b173/DensityGeneratorOverworldB173.java
index 1d8d47db3..c212cec53 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/b173/DensityGeneratorOverworldB173.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/b173/DensityGeneratorOverworldB173.java
@@ -3,12 +3,12 @@ package net.minecraft.core.world.generate.chunk.perlin.overworld.b173;
 import net.minecraft.core.world.World;
 import net.minecraft.core.world.generate.chunk.perlin.overworld.DensityGeneratorOverworld;
 import net.minecraft.core.world.noise.BetaPerlinNoise;
+import org.jetbrains.annotations.NotNull;
 
 public class DensityGeneratorOverworldB173
-    extends DensityGeneratorOverworld
-{
+    extends DensityGeneratorOverworld {
 
-    public DensityGeneratorOverworldB173(final World world) {
+    public DensityGeneratorOverworldB173(final @NotNull World world) {
         super(world,
             new BetaPerlinNoise(world.getRandomSeed(), 16, 0),
             new BetaPerlinNoise(world.getRandomSeed(), 16, 16),
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/b173/SurfaceGeneratorOverworldB173.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/b173/SurfaceGeneratorOverworldB173.java
index dff75eae1..96efed91b 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/b173/SurfaceGeneratorOverworldB173.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/b173/SurfaceGeneratorOverworldB173.java
@@ -3,11 +3,11 @@ package net.minecraft.core.world.generate.chunk.perlin.overworld.b173;
 import net.minecraft.core.world.World;
 import net.minecraft.core.world.generate.chunk.perlin.overworld.SurfaceGeneratorOverworld;
 import net.minecraft.core.world.noise.BetaPerlinNoise;
+import org.jetbrains.annotations.NotNull;
 
 public class SurfaceGeneratorOverworldB173
-    extends SurfaceGeneratorOverworld
-{
-    public SurfaceGeneratorOverworldB173(final World world) {
+    extends SurfaceGeneratorOverworld {
+    public SurfaceGeneratorOverworldB173(final @NotNull World world) {
         super(world,
             new BetaPerlinNoise(world.getRandomSeed(), 4, 40),
             new BetaPerlinNoise(world.getRandomSeed(), 4, 44),
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/b173/TerrainGeneratorOverworldB173.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/b173/TerrainGeneratorOverworldB173.java
index d8de84463..fd8ac4a0d 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/b173/TerrainGeneratorOverworldB173.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/b173/TerrainGeneratorOverworldB173.java
@@ -2,11 +2,11 @@ package net.minecraft.core.world.generate.chunk.perlin.overworld.b173;
 
 import net.minecraft.core.world.World;
 import net.minecraft.core.world.generate.chunk.perlin.overworld.TerrainGeneratorOverworld;
+import org.jetbrains.annotations.NotNull;
 
 public class TerrainGeneratorOverworldB173
-    extends TerrainGeneratorOverworld
-{
-    public TerrainGeneratorOverworldB173(final World world) {
+    extends TerrainGeneratorOverworld {
+    public TerrainGeneratorOverworldB173(final @NotNull World world) {
         super(world,
             new DensityGeneratorOverworldB173(world)
         );
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/floating/ChunkGeneratorOverworldFloating.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/floating/ChunkGeneratorOverworldFloating.java
index 0308cc9ec..18cfe11f4 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/floating/ChunkGeneratorOverworldFloating.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/floating/ChunkGeneratorOverworldFloating.java
@@ -7,12 +7,11 @@ import net.minecraft.core.world.generate.chunk.perlin.ChunkGeneratorPerlin;
 import net.minecraft.core.world.generate.chunk.perlin.overworld.ChunkDecoratorOverworld;
 import net.minecraft.core.world.generate.chunk.perlin.overworld.SurfaceGeneratorOverworld;
 import net.minecraft.core.world.generate.chunk.perlin.drift.TerrainGeneratorDrift;
+import org.jetbrains.annotations.NotNull;
 
 public class ChunkGeneratorOverworldFloating
-    extends ChunkGeneratorPerlin
-{
-    public ChunkGeneratorOverworldFloating(World world)
-    {
-        super(world, new ChunkDecoratorOverworld(world), new TerrainGeneratorDrift(world), new SurfaceGeneratorOverworld(world), new LargeFeature[] { new CavesLargeFeature() });
+    extends ChunkGeneratorPerlin {
+    public ChunkGeneratorOverworldFloating(@NotNull World world) {
+        super(world, new ChunkDecoratorOverworld(world), new TerrainGeneratorDrift(world), new SurfaceGeneratorOverworld(world), new LargeFeature[]{new CavesLargeFeature()});
     }
 }
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/hell/ChunkDecoratorOverworldHell.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/hell/ChunkDecoratorOverworldHell.java
index 367024d93..a0888acfb 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/hell/ChunkDecoratorOverworldHell.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/hell/ChunkDecoratorOverworldHell.java
@@ -22,7 +22,7 @@ import java.util.Random;
 
 public class ChunkDecoratorOverworldHell
     extends ChunkFeatureDecorator {
-    private final PerlinNoise treeDensityNoise;
+    private final @NotNull PerlinNoise treeDensityNoise;
 
     public ChunkDecoratorOverworldHell(final @NotNull World world) {
         super(world);
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/hell/ChunkGeneratorOverworldHell.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/hell/ChunkGeneratorOverworldHell.java
index d73d388be..8489f917e 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/hell/ChunkGeneratorOverworldHell.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/hell/ChunkGeneratorOverworldHell.java
@@ -6,13 +6,12 @@ import net.minecraft.core.world.generate.LargeFeature;
 import net.minecraft.core.world.generate.chunk.perlin.ChunkGeneratorPerlin;
 import net.minecraft.core.world.generate.chunk.perlin.overworld.SurfaceGeneratorOverworld;
 import net.minecraft.core.world.generate.chunk.perlin.overworld.TerrainGeneratorOverworld;
+import org.jetbrains.annotations.NotNull;
 
 public class ChunkGeneratorOverworldHell
-    extends ChunkGeneratorPerlin
-{
+    extends ChunkGeneratorPerlin {
 
-    public ChunkGeneratorOverworldHell(World world)
-    {
-        super(world, new ChunkDecoratorOverworldHell(world), new TerrainGeneratorOverworld(world), new SurfaceGeneratorOverworld(world), new LargeFeature[] { new CavesLargeFeature() });
+    public ChunkGeneratorOverworldHell(@NotNull World world) {
+        super(world, new ChunkDecoratorOverworldHell(world), new TerrainGeneratorOverworld(world), new SurfaceGeneratorOverworld(world), new LargeFeature[]{new CavesLargeFeature()});
     }
 }
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/retro/ChunkDecoratorOverworldRetro.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/retro/ChunkDecoratorOverworldRetro.java
index cbb5bea1e..2522b96fe 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/retro/ChunkDecoratorOverworldRetro.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/retro/ChunkDecoratorOverworldRetro.java
@@ -15,218 +15,191 @@ import net.minecraft.core.world.generate.feature.*;
 import net.minecraft.core.world.generate.feature.tree.WorldFeatureTree;
 import net.minecraft.core.world.generate.feature.tree.WorldFeatureTreeFancy;
 import net.minecraft.core.world.noise.RetroPerlinNoise;
+import org.jetbrains.annotations.NotNull;
 
 import java.util.Random;
 
 public class ChunkDecoratorOverworldRetro
-    implements ChunkDecorator
-{
-    private final World world;
-    private final RetroPerlinNoise treeDensityNoise;
+    implements ChunkDecorator {
+    private final @NotNull World world;
+    private final @NotNull RetroPerlinNoise treeDensityNoise;
 
     private final boolean snowCovered;
 
-    public ChunkDecoratorOverworldRetro(World world)
-    {
+    public ChunkDecoratorOverworldRetro(@NotNull World world) {
         this.world = world;
 
-        treeDensityNoise = new RetroPerlinNoise(world.getRandomSeed(), 8, 74);
+        this.treeDensityNoise = new RetroPerlinNoise(world.getRandomSeed(), 8, 74);
 
-        snowCovered = false;//new Random(world.getRandomSeed()).nextBoolean();
+        this.snowCovered = false;//new Random(world.getRandomSeed()).nextBoolean();
     }
 
     @Override
-    public void decorate(Chunk chunk)
-    {
-        world.scheduledUpdatesAreImmediate = true;
+    public void decorate(@NotNull Chunk chunk) {
+        this.world.scheduledUpdatesAreImmediate = true;
         int chunkX = chunk.pos.x;
         int chunkZ = chunk.pos.z;
 
-        int minY = world.getWorldType().getMinY();
-        int maxY = world.getWorldType().getMaxY();
+        int minY = this.world.getWorldType().getMinY();
+        int maxY = this.world.getWorldType().getMaxY();
         int rangeY = (maxY + 1) - minY;
 
         BlockLogicSand.fallInstantly = true;
         int k = chunkX * 16;
         int l = chunkZ * 16;
-        Random rand = new Random(world.getRandomSeed());
+        Random rand = new Random(this.world.getRandomSeed());
         long l1 = (rand.nextLong() / 2L) * 2L + 1L;
         long l2 = (rand.nextLong() / 2L) * 2L + 1L;
-        rand.setSeed((long) chunkX * l1 + (long) chunkZ * l2 ^ world.getRandomSeed());
-        for (int i1 = 0; i1 < 8; i1++)
-        {
+        rand.setSeed((long) chunkX * l1 + (long) chunkZ * l2 ^ this.world.getRandomSeed());
+        for (int i1 = 0; i1 < 8; i1++) {
             int i4 = k + rand.nextInt(16) + 8;
             int j6 = minY + rand.nextInt(rangeY);
             int i11 = l + rand.nextInt(16) + 8;
-            (new WorldFeatureDungeon(Blocks.COBBLE_STONE.id(), Blocks.COBBLE_STONE_MOSSY.id(), null)).place(world, rand, i4, j6, i11);
+            (new WorldFeatureDungeon(Blocks.COBBLE_STONE.id(), Blocks.COBBLE_STONE_MOSSY.id(), null)).place(this.world, rand, i4, j6, i11);
         }
 
-        for (int j1 = 0; j1 < 10; j1++)
-        {
+        for (int j1 = 0; j1 < 10; j1++) {
             int j4 = k + rand.nextInt(16);
             int k6 = minY + rand.nextInt(rangeY);
             int j11 = l + rand.nextInt(16);
-            (new WorldFeatureClay(32)).place(world, rand, j4, k6, j11);
+            (new WorldFeatureClay(32)).place(this.world, rand, j4, k6, j11);
         }
 
-        for (int k1 = 0; k1 < 20; k1++)
-        {
+        for (int k1 = 0; k1 < 20; k1++) {
             int k4 = k + rand.nextInt(16);
             int l6 = minY + rand.nextInt(rangeY);
             int k11 = l + rand.nextInt(16);
-            (new WorldFeatureOre(Blocks.DIRT.id(), 32)).place(world, rand, k4, l6, k11);
+            (new WorldFeatureOre(Blocks.DIRT.id(), 32)).place(this.world, rand, k4, l6, k11);
         }
 
-        for (int i2 = 0; i2 < 10; i2++)
-        {
+        for (int i2 = 0; i2 < 10; i2++) {
             int l4 = k + rand.nextInt(16);
             int i7 = minY + rand.nextInt(rangeY);
             int l11 = l + rand.nextInt(16);
-            (new WorldFeatureOre(Blocks.GRAVEL.id(), 32)).place(world, rand, l4, i7, l11);
+            (new WorldFeatureOre(Blocks.GRAVEL.id(), 32)).place(this.world, rand, l4, i7, l11);
         }
 
-        for (int j2 = 0; j2 < 20; j2++)
-        {
+        for (int j2 = 0; j2 < 20; j2++) {
             int i5 = k + rand.nextInt(16);
             int j7 = minY + rand.nextInt(rangeY);
             int i12 = l + rand.nextInt(16);
-            (new WorldFeatureOre(BlockLogicOreCoal.variantMap, 16)).place(world, rand, i5, j7, i12);
+            (new WorldFeatureOre(BlockLogicOreCoal.variantMap, 16)).place(this.world, rand, i5, j7, i12);
         }
 
-        for (int k2 = 0; k2 < 20; k2++)
-        {
+        for (int k2 = 0; k2 < 20; k2++) {
             int j5 = k + rand.nextInt(16);
             int k7 = minY + rand.nextInt(rangeY / 2);
             int j12 = l + rand.nextInt(16);
-            (new WorldFeatureOre(BlockLogicOreIron.variantMap, 8)).place(world, rand, j5, k7, j12);
+            (new WorldFeatureOre(BlockLogicOreIron.variantMap, 8)).place(this.world, rand, j5, k7, j12);
         }
 
-        for (int i3 = 0; i3 < 2; i3++)
-        {
+        for (int i3 = 0; i3 < 2; i3++) {
             int k5 = k + rand.nextInt(16);
             int l7 = minY + rand.nextInt(rangeY / 4);
             int k12 = l + rand.nextInt(16);
-            (new WorldFeatureOre(BlockLogicOreGold.variantMap, 8)).place(world, rand, k5, l7, k12);
+            (new WorldFeatureOre(BlockLogicOreGold.variantMap, 8)).place(this.world, rand, k5, l7, k12);
         }
 
-        for (int j3 = 0; j3 < 8; j3++)
-        {
+        for (int j3 = 0; j3 < 8; j3++) {
             int l5 = k + rand.nextInt(16);
             int i8 = minY + rand.nextInt(rangeY / 8);
             int l12 = l + rand.nextInt(16);
-            (new WorldFeatureOre(BlockLogicOreRedstone.variantMap, 7)).place(world, rand, l5, i8, l12);
+            (new WorldFeatureOre(BlockLogicOreRedstone.variantMap, 7)).place(this.world, rand, l5, i8, l12);
         }
 
-        for (int k3 = 0; k3 < 1; k3++)
-        {
+        for (int k3 = 0; k3 < 1; k3++) {
             int i6 = k + rand.nextInt(16);
             int j8 = minY + rand.nextInt(rangeY / 8);
             int i13 = l + rand.nextInt(16);
-            (new WorldFeatureOre(BlockLogicOreDiamond.variantMap, 7)).place(world, rand, i6, j8, i13);
+            (new WorldFeatureOre(BlockLogicOreDiamond.variantMap, 7)).place(this.world, rand, i6, j8, i13);
         }
 
         double d = 0.5D;
-        int l3 = (int)((treeDensityNoise.get((double)k * d, (double)l * d) / 8D + rand.nextDouble() * 4D + 4D) / 3D);
-        if (l3 < 0)
-        {
+        int l3 = (int) ((this.treeDensityNoise.get((double) k * d, (double) l * d) / 8D + rand.nextDouble() * 4D + 4D) / 3D);
+        if (l3 < 0) {
             l3 = 0;
         }
-        if (rand.nextInt(10) == 0)
-        {
+        if (rand.nextInt(10) == 0) {
             l3++;
         }
         WorldFeature tree = new WorldFeatureTree(Blocks.LEAVES_OAK_RETRO.id(), Blocks.LOG_OAK.id(), 4);
-        if (rand.nextInt(10) == 0)
-        {
+        if (rand.nextInt(10) == 0) {
             tree = new WorldFeatureTreeFancy(Blocks.LEAVES_OAK_RETRO.id(), Blocks.LOG_OAK.id());
         }
-        for (int k8 = 0; k8 < l3; k8++)
-        {
+        for (int k8 = 0; k8 < l3; k8++) {
             int j13 = k + rand.nextInt(16) + 8;
             int l15 = l + rand.nextInt(16) + 8;
             tree.init(1.0D, 1.0D, 1.0D);
-            tree.place(world, rand, j13, world.getHeightValue(j13, l15), l15);
+            tree.place(this.world, rand, j13, this.world.getHeightValue(j13, l15), l15);
         }
 
-        for (int l8 = 0; l8 < 2; l8++)
-        {
+        for (int l8 = 0; l8 < 2; l8++) {
             int k13 = k + rand.nextInt(16) + 8;
             int i16 = minY + rand.nextInt(rangeY);
             int j18 = l + rand.nextInt(16) + 8;
-            (new WorldFeatureFlowers(Blocks.FLOWER_YELLOW.id(), 64, false)).place(world, rand, k13, i16, j18);
+            (new WorldFeatureFlowers(Blocks.FLOWER_YELLOW.id(), 64, false)).place(this.world, rand, k13, i16, j18);
         }
 
-        if (rand.nextInt(2) == 0)
-        {
+        if (rand.nextInt(2) == 0) {
             int i9 = k + rand.nextInt(16) + 8;
             int l13 = minY + rand.nextInt(rangeY);
             int j16 = l + rand.nextInt(16) + 8;
-            (new WorldFeatureFlowers(Blocks.FLOWER_RED.id(), 64, false)).place(world, rand, i9, l13, j16);
+            (new WorldFeatureFlowers(Blocks.FLOWER_RED.id(), 64, false)).place(this.world, rand, i9, l13, j16);
         }
-        if (rand.nextInt(4) == 0)
-        {
+        if (rand.nextInt(4) == 0) {
             int j9 = k + rand.nextInt(16) + 8;
             int i14 = minY + rand.nextInt(rangeY);
             int k16 = l + rand.nextInt(16) + 8;
-            (new WorldFeatureFlowers(Blocks.MUSHROOM_BROWN.id(), 64, false)).place(world, rand, j9, i14, k16);
+            (new WorldFeatureFlowers(Blocks.MUSHROOM_BROWN.id(), 64, false)).place(this.world, rand, j9, i14, k16);
         }
-        if (rand.nextInt(8) == 0)
-        {
+        if (rand.nextInt(8) == 0) {
             int k9 = k + rand.nextInt(16) + 8;
             int j14 = minY + rand.nextInt(rangeY);
             int l16 = l + rand.nextInt(16) + 8;
-            (new WorldFeatureFlowers(Blocks.MUSHROOM_RED.id(), 64, false)).place(world, rand, k9, j14, l16);
+            (new WorldFeatureFlowers(Blocks.MUSHROOM_RED.id(), 64, false)).place(this.world, rand, k9, j14, l16);
         }
-        for (int l9 = 0; l9 < 10; l9++)
-        {
+        for (int l9 = 0; l9 < 10; l9++) {
             int k14 = k + rand.nextInt(16) + 8;
             int i17 = minY + rand.nextInt(rangeY);
             int k18 = l + rand.nextInt(16) + 8;
-            (new WorldFeatureSugarCane()).place(world, rand, k14, i17, k18);
+            (new WorldFeatureSugarCane()).place(this.world, rand, k14, i17, k18);
         }
 
-        for (int i10 = 0; i10 < 1; i10++)
-        {
+        for (int i10 = 0; i10 < 1; i10++) {
             int l14 = k + rand.nextInt(16) + 8;
             int j17 = minY + rand.nextInt(rangeY);
             int l18 = l + rand.nextInt(16) + 8;
-            (new WorldFeatureCactus()).place(world, rand, l14, j17, l18);
+            (new WorldFeatureCactus()).place(this.world, rand, l14, j17, l18);
         }
 
-        for (int j10 = 0; j10 < 50; j10++)
-        {
+        for (int j10 = 0; j10 < 50; j10++) {
             int i15 = k + rand.nextInt(16) + 8;
             int k17 = minY + rand.nextInt(rand.nextInt(rangeY - 8) + 8);
             int i19 = l + rand.nextInt(16) + 8;
-            (new WorldFeatureLiquid(Blocks.FLUID_WATER_FLOWING.id())).place(world, rand, i15, k17, i19);
+            (new WorldFeatureLiquid(Blocks.FLUID_WATER_FLOWING.id())).place(this.world, rand, i15, k17, i19);
         }
 
-        for (int k10 = 0; k10 < 20; k10++)
-        {
+        for (int k10 = 0; k10 < 20; k10++) {
             int j15 = k + rand.nextInt(16) + 8;
             int l17 = minY + rand.nextInt(rand.nextInt(rand.nextInt(rangeY / 2 - rangeY / 8) + 8) + 8);
             int j19 = l + rand.nextInt(16) + 8;
-            (new WorldFeatureLiquid(Blocks.FLUID_LAVA_FLOWING.id())).place(world, rand, j15, l17, j19);
+            (new WorldFeatureLiquid(Blocks.FLUID_LAVA_FLOWING.id())).place(this.world, rand, j15, l17, j19);
         }
 
-        for (int l10 = k + 8; l10 < k + 8 + 16; l10++)
-        {
-            for (int k15 = l + 8; k15 < l + 8 + 16; k15++)
-            {
-                int i18 = world.findTopSolidBlock(l10, k15);
-                if (snowCovered && i18 > minY && i18 <= maxY && world.getBlockId(l10, i18, k15) == 0 && world.getBlockMaterial(l10, i18 - 1, k15).blocksMotion() && world.getBlockMaterial(l10, i18 - 1, k15) != Material.ice)
-                {
-                    world.setBlockWithNotify(l10, i18, k15, Blocks.LAYER_SNOW.id());
+        for (int l10 = k + 8; l10 < k + 8 + 16; l10++) {
+            for (int k15 = l + 8; k15 < l + 8 + 16; k15++) {
+                int i18 = this.world.findTopSolidBlock(l10, k15);
+                if (this.snowCovered && i18 > minY && i18 <= maxY && this.world.getBlockId(l10, i18, k15) == 0 && this.world.getBlockMaterial(l10, i18 - 1, k15).blocksMotion() && this.world.getBlockMaterial(l10, i18 - 1, k15) != Material.ice) {
+                    this.world.setBlockWithNotify(l10, i18, k15, Blocks.LAYER_SNOW.id());
                 }
-                if (snowCovered && world.getBlockMaterial(l10, world.getWorldType().getOceanY() - 1, k15) == Material.water)
-                {
-                    world.setBlockWithNotify(l10, world.getWorldType().getOceanY() - 1, k15, Blocks.ICE.id());
+                if (this.snowCovered && this.world.getBlockMaterial(l10, this.world.getWorldType().getOceanY() - 1, k15) == Material.water) {
+                    this.world.setBlockWithNotify(l10, this.world.getWorldType().getOceanY() - 1, k15, Blocks.ICE.id());
                 }
             }
 
         }
 
         BlockLogicSand.fallInstantly = false;
-        world.scheduledUpdatesAreImmediate = false;
+        this.world.scheduledUpdatesAreImmediate = false;
     }
 }
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/retro/ChunkGeneratorOverworldRetro.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/retro/ChunkGeneratorOverworldRetro.java
index 2ec4add36..f94ecf8f1 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/retro/ChunkGeneratorOverworldRetro.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/retro/ChunkGeneratorOverworldRetro.java
@@ -5,18 +5,17 @@ import net.minecraft.core.world.generate.CavesLargeFeature;
 import net.minecraft.core.world.generate.LargeFeature;
 import net.minecraft.core.world.generate.RetroCavesLargeFeature;
 import net.minecraft.core.world.generate.chunk.perlin.ChunkGeneratorPerlin;
+import org.jetbrains.annotations.NotNull;
 
 public class ChunkGeneratorOverworldRetro
-    extends ChunkGeneratorPerlin
-{
+    extends ChunkGeneratorPerlin {
 
-    public ChunkGeneratorOverworldRetro(World world)
-    {
+    public ChunkGeneratorOverworldRetro(@NotNull World world) {
         super(world,
-              new ChunkDecoratorOverworldRetro(world),
-              new TerrainGeneratorOverworldRetro(world),
-              new SurfaceGeneratorOverworldRetro(world),
-              new LargeFeature[] { new RetroCavesLargeFeature(world.getWorldType().getMinY(), world.getWorldType().getMaxY() + 1) }
+            new ChunkDecoratorOverworldRetro(world),
+            new TerrainGeneratorOverworldRetro(world),
+            new SurfaceGeneratorOverworldRetro(world),
+            new LargeFeature[]{new RetroCavesLargeFeature(world.getWorldType().getMinY(), world.getWorldType().getMaxY() + 1)}
         );
     }
 }
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/retro/DensityGeneratorOverworldRetro.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/retro/DensityGeneratorOverworldRetro.java
index c5790fb8e..746c7b494 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/retro/DensityGeneratorOverworldRetro.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/retro/DensityGeneratorOverworldRetro.java
@@ -3,19 +3,18 @@ package net.minecraft.core.world.generate.chunk.perlin.overworld.retro;
 import net.minecraft.core.world.World;
 import net.minecraft.core.world.generate.chunk.perlin.overworld.DensityGeneratorOverworld;
 import net.minecraft.core.world.noise.RetroPerlinNoise;
+import org.jetbrains.annotations.NotNull;
 
 public class DensityGeneratorOverworldRetro
-    extends DensityGeneratorOverworld
-{
-    public DensityGeneratorOverworldRetro(World world)
-    {
+    extends DensityGeneratorOverworld {
+    public DensityGeneratorOverworldRetro(@NotNull World world) {
         super(world,
-              new RetroPerlinNoise(world.getRandomSeed(), 16, 0),
-              new RetroPerlinNoise(world.getRandomSeed(), 16, 16),
-              new RetroPerlinNoise(world.getRandomSeed(), 8, 32),
-              new RetroPerlinNoise(world.getRandomSeed(), 10, 48),
-              new RetroPerlinNoise(world.getRandomSeed(), 16, 58),
-              false
+            new RetroPerlinNoise(world.getRandomSeed(), 16, 0),
+            new RetroPerlinNoise(world.getRandomSeed(), 16, 16),
+            new RetroPerlinNoise(world.getRandomSeed(), 8, 32),
+            new RetroPerlinNoise(world.getRandomSeed(), 10, 48),
+            new RetroPerlinNoise(world.getRandomSeed(), 16, 58),
+            false
         );
     }
 }
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/retro/SurfaceGeneratorOverworldRetro.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/retro/SurfaceGeneratorOverworldRetro.java
index e1b7903ac..6af246763 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/retro/SurfaceGeneratorOverworldRetro.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/retro/SurfaceGeneratorOverworldRetro.java
@@ -3,17 +3,16 @@ package net.minecraft.core.world.generate.chunk.perlin.overworld.retro;
 import net.minecraft.core.world.World;
 import net.minecraft.core.world.generate.chunk.perlin.overworld.SurfaceGeneratorOverworld;
 import net.minecraft.core.world.noise.RetroPerlinNoise;
+import org.jetbrains.annotations.NotNull;
 
 public class SurfaceGeneratorOverworldRetro
-    extends SurfaceGeneratorOverworld
-{
-    public SurfaceGeneratorOverworldRetro(World world)
-    {
+    extends SurfaceGeneratorOverworld {
+    public SurfaceGeneratorOverworldRetro(@NotNull World world) {
         super(world,
-              new RetroPerlinNoise(world.getRandomSeed(), 4, 40),
-              new RetroPerlinNoise(world.getRandomSeed(), 4, 44),
-              new RetroPerlinNoise(world.getRandomSeed(), 8, 32),
-              false
+            new RetroPerlinNoise(world.getRandomSeed(), 4, 40),
+            new RetroPerlinNoise(world.getRandomSeed(), 4, 44),
+            new RetroPerlinNoise(world.getRandomSeed(), 8, 32),
+            false
         );
     }
 }
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/retro/TerrainGeneratorOverworldRetro.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/retro/TerrainGeneratorOverworldRetro.java
index b71100674..479a9f97c 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/retro/TerrainGeneratorOverworldRetro.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/retro/TerrainGeneratorOverworldRetro.java
@@ -2,12 +2,11 @@ package net.minecraft.core.world.generate.chunk.perlin.overworld.retro;
 
 import net.minecraft.core.world.World;
 import net.minecraft.core.world.generate.chunk.perlin.overworld.TerrainGeneratorOverworld;
+import org.jetbrains.annotations.NotNull;
 
 public class TerrainGeneratorOverworldRetro
-    extends TerrainGeneratorOverworld
-{
-    public TerrainGeneratorOverworldRetro(World world)
-    {
+    extends TerrainGeneratorOverworld {
+    public TerrainGeneratorOverworldRetro(@NotNull World world) {
         super(world, new DensityGeneratorOverworldRetro(world));
     }
 }
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/woods/ChunkDecoratorOverworldWoods.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/woods/ChunkDecoratorOverworldWoods.java
index d617ba1d7..815107463 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/woods/ChunkDecoratorOverworldWoods.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/woods/ChunkDecoratorOverworldWoods.java
@@ -2,12 +2,11 @@ package net.minecraft.core.world.generate.chunk.perlin.overworld.woods;
 
 import net.minecraft.core.world.World;
 import net.minecraft.core.world.generate.chunk.perlin.overworld.ChunkDecoratorOverworld;
+import org.jetbrains.annotations.NotNull;
 
 public class ChunkDecoratorOverworldWoods
-    extends ChunkDecoratorOverworld
-{
-    public ChunkDecoratorOverworldWoods(World world)
-    {
+    extends ChunkDecoratorOverworld {
+    public ChunkDecoratorOverworldWoods(@NotNull World world) {
         super(world, 50);
     }
 }
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/woods/ChunkGeneratorOverworldWoods.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/woods/ChunkGeneratorOverworldWoods.java
index f26db10b4..79da8671e 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/woods/ChunkGeneratorOverworldWoods.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/perlin/overworld/woods/ChunkGeneratorOverworldWoods.java
@@ -6,12 +6,11 @@ import net.minecraft.core.world.generate.LargeFeature;
 import net.minecraft.core.world.generate.chunk.perlin.ChunkGeneratorPerlin;
 import net.minecraft.core.world.generate.chunk.perlin.overworld.SurfaceGeneratorOverworld;
 import net.minecraft.core.world.generate.chunk.perlin.overworld.TerrainGeneratorOverworld;
+import org.jetbrains.annotations.NotNull;
 
 public class ChunkGeneratorOverworldWoods
-    extends ChunkGeneratorPerlin
-{
-    public ChunkGeneratorOverworldWoods(World world)
-    {
-        super(world, new ChunkDecoratorOverworldWoods(world), new TerrainGeneratorOverworld(world), new SurfaceGeneratorOverworld(world), new LargeFeature[] { new CavesLargeFeature() });
+    extends ChunkGeneratorPerlin {
+    public ChunkGeneratorOverworldWoods(@NotNull World world) {
+        super(world, new ChunkDecoratorOverworldWoods(world), new TerrainGeneratorOverworld(world), new SurfaceGeneratorOverworld(world), new LargeFeature[]{new CavesLargeFeature()});
     }
 }
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/skyblock/ChunkDecoratorSkyblock.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/skyblock/ChunkDecoratorSkyblock.java
index 2f734c0e9..8ebb9d387 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/skyblock/ChunkDecoratorSkyblock.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/skyblock/ChunkDecoratorSkyblock.java
@@ -8,13 +8,14 @@ import net.minecraft.core.item.Items;
 import net.minecraft.core.world.chunk.Chunk;
 import net.minecraft.core.world.generate.chunk.ChunkDecorator;
 import net.minecraft.core.world.generate.feature.tree.WorldFeatureTree;
+import org.jetbrains.annotations.NotNull;
 
 import java.util.Random;
 
 public class ChunkDecoratorSkyblock
     implements ChunkDecorator {
     @Override
-    public void decorate(Chunk chunk) {
+    public void decorate(@NotNull Chunk chunk) {
         // Starting island
         if (contains(chunk, -1, 1)) {
             new WorldFeatureTree(Blocks.LEAVES_OAK.id(), Blocks.LOG_OAK.id(), 6).place(chunk.world, new Random(0), -1, 67, 1);
@@ -22,10 +23,9 @@ public class ChunkDecoratorSkyblock
         if (contains(chunk, 4, -3)) {
             chunk.setBlockIDWithMetadata(4 & (Chunk.CHUNK_SIZE_X - 1), 67, -3 & (Chunk.CHUNK_SIZE_Z - 1), Blocks.CHEST_PLANKS_OAK.id(), 3);
             TileEntity tileEntity = chunk.getTileEntity(4 & (Chunk.CHUNK_SIZE_X - 1), 67, -3 & (Chunk.CHUNK_SIZE_Z - 1));
-            if (tileEntity instanceof TileEntityChest) {
-                TileEntityChest chestEntity = (TileEntityChest) tileEntity;
-                chestEntity.setItem(0, new ItemStack(Items.BUCKET_LAVA, 1));
-                chestEntity.setItem(1, new ItemStack(Blocks.ICE, 1));
+            if (tileEntity instanceof TileEntityChest chest) {
+                chest.setItem(0, new ItemStack(Items.BUCKET_LAVA, 1));
+                chest.setItem(1, new ItemStack(Blocks.ICE, 1));
             }
         }
 
@@ -33,16 +33,15 @@ public class ChunkDecoratorSkyblock
         if (contains(chunk, -67, 0)) {
             chunk.setBlockIDWithMetadata(-67 & (Chunk.CHUNK_SIZE_X - 1), 67, 0 & (Chunk.CHUNK_SIZE_Z - 1), Blocks.CHEST_PLANKS_OAK.id(), 1);
             TileEntity tileEntity = chunk.getTileEntity(-67 & (Chunk.CHUNK_SIZE_X - 1), 67, 0 & (Chunk.CHUNK_SIZE_Z - 1));
-            if (tileEntity instanceof TileEntityChest) {
-                TileEntityChest chestEntity = (TileEntityChest) tileEntity;
-                chestEntity.setItem(0, new ItemStack(Blocks.OBSIDIAN, 14));
-                chestEntity.setItem(1, new ItemStack(Items.SEEDS_PUMPKIN, 1));
+            if (tileEntity instanceof TileEntityChest chest) {
+                chest.setItem(0, new ItemStack(Blocks.OBSIDIAN, 14));
+                chest.setItem(1, new ItemStack(Items.SEEDS_PUMPKIN, 1));
             }
 
         }
     }
 
-    private boolean contains(Chunk chunk, int xBlock, int zBlock) {
+    private boolean contains(@NotNull Chunk chunk, int xBlock, int zBlock) {
         return chunk.pos.x == xBlock >> 4 && chunk.pos.z == zBlock >> 4;
     }
 
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/skyblock/ChunkDecoratorSkyblockNether.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/skyblock/ChunkDecoratorSkyblockNether.java
index 9ec3ab391..2a7aa8949 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/skyblock/ChunkDecoratorSkyblockNether.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/skyblock/ChunkDecoratorSkyblockNether.java
@@ -7,11 +7,12 @@ import net.minecraft.core.item.ItemStack;
 import net.minecraft.core.item.Items;
 import net.minecraft.core.world.chunk.Chunk;
 import net.minecraft.core.world.generate.chunk.ChunkDecorator;
+import org.jetbrains.annotations.NotNull;
 
 public class ChunkDecoratorSkyblockNether
     implements ChunkDecorator {
     @Override
-    public void decorate(Chunk chunk) {
+    public void decorate(@NotNull Chunk chunk) {
         // Portal
         for (int z = 0; z <= 1; z++) {
             if (contains(chunk, 2, z)) {
@@ -25,11 +26,10 @@ public class ChunkDecoratorSkyblockNether
         if (contains(chunk, 1, -1)) {
             chunk.setBlockIDWithMetadata(1 & (Chunk.CHUNK_SIZE_X - 1), 66, -1 & (Chunk.CHUNK_SIZE_Z - 1), Blocks.CHEST_PLANKS_OAK.id(), 3);
             TileEntity tileEntity = chunk.getTileEntity(1 & (Chunk.CHUNK_SIZE_X - 1), 66, -1 & (Chunk.CHUNK_SIZE_Z - 1));
-            if (tileEntity != null) {
-                TileEntityChest tileEntityChest = (TileEntityChest) tileEntity;
-                tileEntityChest.setItem(0, new ItemStack(Blocks.SAPLING_BIRCH, 1));
-                tileEntityChest.setItem(1, new ItemStack(Items.SUGARCANE, 1));
-                tileEntityChest.setItem(2, new ItemStack(Blocks.ICE, 1));
+            if (tileEntity instanceof TileEntityChest chest) {
+                chest.setItem(0, new ItemStack(Blocks.SAPLING_BIRCH, 1));
+                chest.setItem(1, new ItemStack(Items.SUGARCANE, 1));
+                chest.setItem(2, new ItemStack(Blocks.ICE, 1));
             }
         }
 
@@ -38,11 +38,11 @@ public class ChunkDecoratorSkyblockNether
         tryPlace(chunk, -1, 66, 1, Blocks.MUSHROOM_RED.id());
     }
 
-    private boolean contains(Chunk chunk, int xBlock, int zBlock) {
+    private boolean contains(@NotNull Chunk chunk, int xBlock, int zBlock) {
         return chunk.pos.x == xBlock >> 4 && chunk.pos.z == zBlock >> 4;
     }
 
-    private void tryPlace(Chunk chunk, int xBlock, int yBlock, int zBlock, int blockId) {
+    private void tryPlace(@NotNull Chunk chunk, int xBlock, int yBlock, int zBlock, int blockId) {
         if (contains(chunk, xBlock, zBlock)) {
             chunk.setBlockID(xBlock & (Chunk.CHUNK_SIZE_X - 1), yBlock, zBlock & (Chunk.CHUNK_SIZE_Z - 1), blockId);
         }
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/skyblock/ChunkGeneratorSkyblock.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/skyblock/ChunkGeneratorSkyblock.java
index 559ff5511..8316d0f54 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/skyblock/ChunkGeneratorSkyblock.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/skyblock/ChunkGeneratorSkyblock.java
@@ -5,16 +5,17 @@ import net.minecraft.core.world.World;
 import net.minecraft.core.world.chunk.Chunk;
 import net.minecraft.core.world.generate.chunk.ChunkGenerator;
 import net.minecraft.core.world.generate.chunk.ChunkGeneratorResult;
+import org.jetbrains.annotations.NotNull;
 
 public class ChunkGeneratorSkyblock
     extends ChunkGenerator {
 
-    public ChunkGeneratorSkyblock(World world) {
+    public ChunkGeneratorSkyblock(@NotNull World world) {
         super(world, new ChunkDecoratorSkyblock());
     }
 
     @Override
-    protected ChunkGeneratorResult doBlockGeneration(Chunk chunk) {
+    protected @NotNull ChunkGeneratorResult doBlockGeneration(@NotNull Chunk chunk) {
         ChunkGeneratorResult result = new ChunkGeneratorResult();
 
         // Starting island
@@ -54,11 +55,11 @@ public class ChunkGeneratorSkyblock
         return result;
     }
 
-    private boolean contains(Chunk chunk, int xBlock, int zBlock) {
+    private boolean contains(@NotNull Chunk chunk, int xBlock, int zBlock) {
         return chunk.pos.x == xBlock >> 4 && chunk.pos.z == zBlock >> 4;
     }
 
-    private void tryPlace(Chunk chunk, ChunkGeneratorResult result, int xBlock, int yBlock, int zBlock, int blockId) {
+    private void tryPlace(@NotNull Chunk chunk, @NotNull ChunkGeneratorResult result, int xBlock, int yBlock, int zBlock, int blockId) {
         if (contains(chunk, xBlock, zBlock)) {
             result.setBlock(xBlock & (Chunk.CHUNK_SIZE_X - 1), yBlock, zBlock & (Chunk.CHUNK_SIZE_Z - 1), blockId);
         }
diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/skyblock/ChunkGeneratorSkyblockNether.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/skyblock/ChunkGeneratorSkyblockNether.java
index 5111ca851..939208b22 100644
--- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/skyblock/ChunkGeneratorSkyblockNether.java
+++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/skyblock/ChunkGeneratorSkyblockNether.java
@@ -5,16 +5,17 @@ import net.minecraft.core.world.World;
 import net.minecraft.core.world.chunk.Chunk;
 import net.minecraft.core.world.generate.chunk.ChunkGenerator;
 import net.minecraft.core.world.generate.chunk.ChunkGeneratorResult;
+import org.jetbrains.annotations.NotNull;
 
 public class ChunkGeneratorSkyblockNether
     extends ChunkGenerator {
 
-    public ChunkGeneratorSkyblockNether(World world) {
+    public ChunkGeneratorSkyblockNether(@NotNull World world) {
         super(world, new ChunkDecoratorSkyblockNether());
     }
 
     @Override
-    protected ChunkGeneratorResult doBlockGeneration(Chunk chunk) {
+    protected @NotNull ChunkGeneratorResult doBlockGeneration(@NotNull Chunk chunk) {
         ChunkGeneratorResult result = new ChunkGeneratorResult();
 
         // Main island
@@ -45,11 +46,11 @@ public class ChunkGeneratorSkyblockNether
         return result;
     }
 
-    private boolean contains(Chunk chunk, int xBlock, int zBlock) {
+    private boolean contains(@NotNull Chunk chunk, int xBlock, int zBlock) {
         return chunk.pos.x == xBlock >> 4 && chunk.pos.z == zBlock >> 4;
     }
 
-    private void tryPlace(Chunk chunk, ChunkGeneratorResult result, int xBlock, int yBlock, int zBlock, int blockId) {
+    private void tryPlace(@NotNull Chunk chunk, @NotNull ChunkGeneratorResult result, int xBlock, int yBlock, int zBlock, int blockId) {
         if (contains(chunk, xBlock, zBlock)) {
             result.setBlock(xBlock & (Chunk.CHUNK_SIZE_X - 1), yBlock, zBlock & (Chunk.CHUNK_SIZE_Z - 1), blockId);
         }
diff --git a/game/core/src/main/java/net/minecraft/core/world/lighting/LightingEngine.java b/game/core/src/main/java/net/minecraft/core/world/lighting/LightingEngine.java
index ec7d82e8f..7ed37814b 100644
--- a/game/core/src/main/java/net/minecraft/core/world/lighting/LightingEngine.java
+++ b/game/core/src/main/java/net/minecraft/core/world/lighting/LightingEngine.java
@@ -7,5 +7,7 @@ public interface LightingEngine {
 
     boolean updatingLighting();
 
+    int pendingUpdates();
+
     void scheduleLightingUpdate(LightLayer layer, int minX, int minY, int minZ, int maxX, int maxY, int maxZ);
 }
diff --git a/game/core/src/main/java/net/minecraft/core/world/lighting/LightingEngineLegacy.java b/game/core/src/main/java/net/minecraft/core/world/lighting/LightingEngineLegacy.java
index 1262b50e4..4290a2082 100644
--- a/game/core/src/main/java/net/minecraft/core/world/lighting/LightingEngineLegacy.java
+++ b/game/core/src/main/java/net/minecraft/core/world/lighting/LightingEngineLegacy.java
@@ -1,10 +1,13 @@
 package net.minecraft.core.world.lighting;
 
 import com.mojang.logging.LogUtils;
+import it.unimi.dsi.fastutil.objects.ObjectArrayList;
 import net.minecraft.core.block.Blocks;
 import net.minecraft.core.enums.LightLayer;
 import net.minecraft.core.world.World;
 import net.minecraft.core.world.chunk.Chunk;
+import net.minecraft.core.world.pos.ChunkPos;
+import net.minecraft.core.world.pos.TilePos;
 import org.jetbrains.annotations.NotNull;
 import org.slf4j.Logger;
 
@@ -15,7 +18,7 @@ import static net.minecraft.core.world.World.MAX_BRIGHTNESS;
 
 public class LightingEngineLegacy implements LightingEngine {
     private static final Logger LOGGER = LogUtils.getLogger();
-    private final List<LightUpdate> lightingToUpdate = new LinkedList<>();
+    private final List<LightUpdate> lightingToUpdate = new ObjectArrayList<>();
     private int lightingUpdatesCounter = 0;
     private int lightingUpdatesScheduled = 0;
 
@@ -50,6 +53,11 @@ public class LightingEngineLegacy implements LightingEngine {
         }
     }
 
+    @Override
+    public int pendingUpdates() {
+        return this.lightingToUpdate.size();
+    }
+
     @Override
     public void scheduleLightingUpdate(final LightLayer layer, final int minX, final int minY, final int minZ, final int maxX, final int maxY, final int maxZ) {
         if(this.world.worldType.hasCeiling() && layer == LightLayer.Sky)
diff --git a/game/core/src/main/java/net/minecraft/core/world/pos/ChunkPos.java b/game/core/src/main/java/net/minecraft/core/world/pos/ChunkPos.java
index d3b7d675d..ef403fab2 100644
--- a/game/core/src/main/java/net/minecraft/core/world/pos/ChunkPos.java
+++ b/game/core/src/main/java/net/minecraft/core/world/pos/ChunkPos.java
@@ -6,7 +6,7 @@ import net.minecraft.core.world.chunk.Chunk;
 import org.jetbrains.annotations.NotNull;
 
 public final class ChunkPos
- implements Pos2i<ChunkPos> {
+    implements Pos2i<ChunkPos> {
     public int x;
     public int z;
 
@@ -22,6 +22,13 @@ public final class ChunkPos
         );
     }
 
+    public ChunkPos(final @NotNull ChunkPos chunkPos) {
+        this(
+            chunkPos.x,
+            chunkPos.z
+        );
+    }
+
     public ChunkPos(final @NotNull Entity entity) {
         this(
             MathHelper.floor(entity.x / (double) Chunk.CHUNK_SIZE_X),
diff --git a/game/core/src/main/java/net/minecraft/core/world/pos/ChunkTilePos.java b/game/core/src/main/java/net/minecraft/core/world/pos/ChunkTilePos.java
index 7a8a5571f..c90dfc6c5 100644
--- a/game/core/src/main/java/net/minecraft/core/world/pos/ChunkTilePos.java
+++ b/game/core/src/main/java/net/minecraft/core/world/pos/ChunkTilePos.java
@@ -8,7 +8,7 @@ import net.minecraft.core.world.chunk.ChunkSection;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
-public final class ChunkTilePos
+public class ChunkTilePos
     implements Pos3i<ChunkTilePos> {
     public int x;
     public int y;
diff --git a/game/core/src/main/java/net/minecraft/core/world/season/SeasonManagerCycle.java b/game/core/src/main/java/net/minecraft/core/world/season/SeasonManagerCycle.java
index c2d068a1d..e3a3997c7 100644
--- a/game/core/src/main/java/net/minecraft/core/world/season/SeasonManagerCycle.java
+++ b/game/core/src/main/java/net/minecraft/core/world/season/SeasonManagerCycle.java
@@ -3,6 +3,7 @@ package net.minecraft.core.world.season;
 import net.minecraft.core.Global;
 import net.minecraft.core.world.World;
 import net.minecraft.core.world.config.season.SeasonConfigCycle;
+import org.jetbrains.annotations.NotNull;
 
 import java.util.Collections;
 import java.util.List;
@@ -13,6 +14,9 @@ public final class SeasonManagerCycle
     private final SeasonConfigCycle config;
     private final int yearLengthTicks;
 
+    private long lastQueryTime = Long.MIN_VALUE;
+    private @NotNull Season lastQueredSeason = Seasons.NULL;
+
     public SeasonManagerCycle(World world, SeasonConfigCycle config)
     {
         super(world);
@@ -73,6 +77,7 @@ public final class SeasonManagerCycle
     public Season getCurrentSeason()
     {
         long worldTime = world.getWorldTime();
+        if (worldTime == lastQueryTime) return lastQueredSeason;
         int yearTime = (int)(worldTime % yearLengthTicks);
         int acc = 0;
 
@@ -80,6 +85,8 @@ public final class SeasonManagerCycle
         {
             if (acc + getSeasonLengthTicks(season) > yearTime)
             {
+                lastQueryTime = worldTime;
+                lastQueredSeason = season;
                 return season;
             }
             acc += getSeasonLengthTicks(season);
diff --git a/game/core/src/main/resources/lang/en_US/options.lang b/game/core/src/main/resources/lang/en_US/options.lang
index baf3dd3a3..d718e3486 100644
--- a/game/core/src/main/resources/lang/en_US/options.lang
+++ b/game/core/src/main/resources/lang/en_US/options.lang
@@ -189,6 +189,10 @@ options.enableHolidayTextures=Enable Holiday Textures
 options.dynamicCursor=Dynamic Cursor
 options.enableDevResourceLoading=Developer Resource Loading
 options.enableMultiDrawRendering=Enable Multi-Draw Renderer (experimental!)
+options.enableThreadedChunkProvider=Enable Threaded Chunk Provider (experimental!)
+options.enableThreadedChunkProvider.static=Static
+options.enableThreadedChunkProvider.dynamic=Dynamic
+options.enableThreadedChunkProvider.threaded=Threaded
 options.doJCECheck=Do JCE Check
 options.musicToasts=Music Toasts
 options.musicFrequency=Music Frequency
diff --git a/game/server/src/main/java/net/minecraft/server/MinecraftServer.java b/game/server/src/main/java/net/minecraft/server/MinecraftServer.java
index dc2752fda..19c2e6f32 100644
--- a/game/server/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/game/server/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -161,6 +161,7 @@ public class MinecraftServer
     public String language;
     public int sleepPercentage = 100;
     public int maxPlayers = 20;
+    public int viewDistance = 10;
     public Gamemode defaultGamemode;
     public static String statsToken;
     public static boolean statsStatus;
@@ -268,6 +269,7 @@ public class MinecraftServer
         NetworkManager.PACKET_DELAY = propertyManager.getIntProperty("packet-delay", 1);
         NetworkManager.TIMEOUT_TIME = propertyManager.getIntProperty("login-timeout-time", 1800 * 50);
         maxPlayers = propertyManager.getIntProperty("max-players", 20);
+        viewDistance = propertyManager.getIntProperty("view-distance", 10);
         language = propertyManager.getStringProperty("language", "en_US");
         disablePhotoMode = propertyManager.getBooleanProperty("disable-photomode", false);
         name = propertyManager.getStringProperty("name", "");
@@ -337,7 +339,7 @@ public class MinecraftServer
         int namespaces = Registries.RECIPES.size();
         int itemGroups = Registries.ITEM_GROUPS.size();
         logInfo(String.format("%d item groups.",itemGroups));
-        logInfo(String.format("%d recipes in %d groups in %d namespaces.",recipes,groups,namespaces));
+        logInfo(String.format("%d recipes in %d groups in %d namespaces.", recipes, groups, namespaces));
         
         SoundTypes.registerSounds();
         
@@ -649,6 +651,10 @@ public class MinecraftServer
             playerList.savePlayerStates();
         }
         saveServerWorld();
+        for (WorldServer worldServer : dimensionWorlds.values())
+        {
+            worldServer.close();
+        }
     }
 
     public void initiateShutdown()
diff --git a/game/server/src/main/java/net/minecraft/server/net/PlayerList.java b/game/server/src/main/java/net/minecraft/server/net/PlayerList.java
index 8495a5036..d10f88708 100644
--- a/game/server/src/main/java/net/minecraft/server/net/PlayerList.java
+++ b/game/server/src/main/java/net/minecraft/server/net/PlayerList.java
@@ -64,7 +64,7 @@ public class PlayerList
         ipBansFile = server.getFile("banned-ips.txt");
         opsFile = server.getFile("ops.txt");
         whitelistFile = server.getFile("white-list.txt");
-        int viewDistance = server.propertyManager.getIntProperty("view-distance", 10);
+        int viewDistance = server.viewDistance;
         for (int dim : Dimension.getDimensionList().keySet())
         {
             playerManagers.put(dim, new PlayerManager(server, dim, viewDistance));
diff --git a/game/server/src/main/java/net/minecraft/server/player/PlayerManager.java b/game/server/src/main/java/net/minecraft/server/player/PlayerManager.java
index 700807044..74fb5bb81 100644
--- a/game/server/src/main/java/net/minecraft/server/player/PlayerManager.java
+++ b/game/server/src/main/java/net/minecraft/server/player/PlayerManager.java
@@ -7,6 +7,7 @@ import com.mojang.logging.LogUtils;
 import net.minecraft.core.block.Blocks;
 import net.minecraft.core.block.entity.TileEntity;
 import net.minecraft.core.net.packet.*;
+import net.minecraft.core.world.pos.ChunkPos;
 import net.minecraft.server.entity.player.PlayerServer;
 import net.minecraft.server.net.PlayerHash;
 import net.minecraft.core.world.chunk.Chunk;
@@ -235,7 +236,7 @@ public class PlayerManager
                 if (numBlocksToUpdate > 0) {
                     playerInstancesToUpdate.remove(this);
                 }
-                server.getDimensionWorld(dimension).chunkProviderServer.dropChunk(chunkX, chunkZ);
+                server.getDimensionWorld(dimension).chunkProviderServer.dropChunk(new ChunkPos(chunkX, chunkZ));
             }
             player.loadedChunks.remove(currentChunk);
             if (player.field_420_ah.contains(currentChunk)) {
diff --git a/game/server/src/main/java/net/minecraft/server/world/WorldServer.java b/game/server/src/main/java/net/minecraft/server/world/WorldServer.java
index db87dc28b..c38d8f486 100644
--- a/game/server/src/main/java/net/minecraft/server/world/WorldServer.java
+++ b/game/server/src/main/java/net/minecraft/server/world/WorldServer.java
@@ -24,6 +24,12 @@ import org.jetbrains.annotations.NotNull;
 
 public class WorldServer extends World
 {
+    public ChunkProviderServer chunkProviderServer;
+    public boolean dontSave;
+    public MinecraftServer mcServer;
+    private final Int2ObjectMap<Entity> entityIntHashMap;
+    private long lastWeatherSend = System.currentTimeMillis();
+
 
     public WorldServer(MinecraftServer minecraftserver, LevelStorage isavehandler, String name, int dimensionId, WorldType worldType, long seed)
     {
@@ -212,7 +218,6 @@ public class WorldServer extends World
     {
         saveHandler.checkSessionLock();
     }
-
     @Override
     public void tick() {
         super.tick();
@@ -222,11 +227,11 @@ public class WorldServer extends World
             lastWeatherSend = System.currentTimeMillis();
         }
     }
+
     @Override
     public void sendGlobalMessage(String message){
         mcServer.playerList.sendPacketToAllPlayers(new PacketChat(message));
     }
-
     @Override
     public void addRainbow(int rainbowTicks){
         byte b0 = (byte) ((rainbowTicks >> 24) & 0xFF);
@@ -238,9 +243,9 @@ public class WorldServer extends World
         mcServer.playerList.sendPacketToAllPlayersInDimension(new PacketCustomPayload(PacketCustomPayload.CHANNEL_RAINBOW_START, new byte[]{b0, b1, b2, b3}), dimension.id);
         super.addRainbow(rainbowTicks);
     }
-    public ChunkProviderServer chunkProviderServer;
-    public boolean dontSave;
-    public MinecraftServer mcServer;
-    private final Int2ObjectMap<Entity> entityIntHashMap;
-    private long lastWeatherSend = System.currentTimeMillis();
+
+    @Override
+    public int renderDistance() {
+        return mcServer.viewDistance;
+    }
 }
diff --git a/game/server/src/main/java/net/minecraft/server/world/chunk/provider/ChunkProviderServer.java b/game/server/src/main/java/net/minecraft/server/world/chunk/provider/ChunkProviderServer.java
index 516d5c72b..c5719e892 100644
--- a/game/server/src/main/java/net/minecraft/server/world/chunk/provider/ChunkProviderServer.java
+++ b/game/server/src/main/java/net/minecraft/server/world/chunk/provider/ChunkProviderServer.java
@@ -1,219 +1,170 @@
 package net.minecraft.server.world.chunk.provider;
 
 import com.mojang.logging.LogUtils;
-import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
-import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
-import it.unimi.dsi.fastutil.ints.IntOpenHashSet;
-import it.unimi.dsi.fastutil.ints.IntSet;
 import net.minecraft.core.world.ProgressListener;
 import net.minecraft.core.world.chunk.provider.IChunkProvider;
+import net.minecraft.core.world.pos.ChunkPos;
 import net.minecraft.server.world.WorldServer;
 import net.minecraft.core.world.chunk.*;
 import net.minecraft.core.world.generate.chunk.ChunkGenerator;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 import org.slf4j.Logger;
 
 import java.io.IOException;
 import java.util.*;
 
 public class ChunkProviderServer
-    implements IChunkProvider
-{
+    implements IChunkProvider {
     private static final Logger LOGGER = LogUtils.getLogger();
-    private final IntSet droppedChunksSet;
+    private final Set<ChunkPos> droppedChunksSet;
     private final Chunk emptyChunk;
     public ChunkGenerator chunkGenerator;
     private final IChunkLoader chunkLoader;
     public boolean chunkLoadOverride;
-    private final Int2ObjectMap<Chunk> chunkMap;
+    private final Map<ChunkPos, Chunk> chunkMap;
     private final List<Chunk> chunkList;
     private final WorldServer world;
 
-    public ChunkProviderServer(WorldServer world, IChunkLoader chunkLoader, ChunkGenerator chunkGenerator)
-    {
-        droppedChunksSet = new IntOpenHashSet();
-        chunkLoadOverride = false;
-        chunkMap = new Int2ObjectOpenHashMap<>();
-        chunkList = new ArrayList<>();
-        emptyChunk = new EmptyChunk(world, 0, 0);
+    public ChunkProviderServer(WorldServer world, IChunkLoader chunkLoader, ChunkGenerator chunkGenerator) {
+        this.droppedChunksSet = new HashSet<>();
+        this.chunkLoadOverride = false;
+        this.chunkMap = new HashMap<>();
+        this.chunkList = new ArrayList<>();
+        this.emptyChunk = new EmptyChunk(world, 0, 0);
         this.world = world;
         this.chunkLoader = chunkLoader;
         this.chunkGenerator = chunkGenerator;
     }
 
     @Override
-    public boolean isChunkLoaded(int chunkX, int chunkZ)
-    {
-        return chunkMap.containsKey(ChunkCoordinate.toInt(chunkX, chunkZ));
+    public boolean isChunkLoaded(@NotNull ChunkPos chunkPos) {
+        return this.chunkMap.containsKey(chunkPos);
     }
 
-    public void dropChunk(int chunkX, int chunkZ)
-    {
-        ChunkCoordinates spawnCoords = world.getSpawnPoint();
-        int spawnDistanceX = (chunkX * 16 + 8) - spawnCoords.x;
-        int spawnDistanceZ = (chunkZ * 16 + 8) - spawnCoords.z;
+    public void dropChunk(@NotNull ChunkPos chunkPos) {
+        ChunkCoordinates spawnCoords = this.world.getSpawnPoint();
+        int spawnDistanceX = (chunkPos.x * 16 + 8) - spawnCoords.x;
+        int spawnDistanceZ = (chunkPos.z * 16 + 8) - spawnCoords.z;
         int r = 128; // TODO replace spawn chunk values with a named constant
-        if(spawnDistanceX < -r || spawnDistanceX > r || spawnDistanceZ < -r || spawnDistanceZ > r) // Drop chunk if outside of spawn radius
+        if (spawnDistanceX < -r || spawnDistanceX > r || spawnDistanceZ < -r || spawnDistanceZ > r) // Drop chunk if outside of spawn radius
         {
-            droppedChunksSet.add(ChunkCoordinate.toInt(chunkX, chunkZ));
+            this.droppedChunksSet.add(new ChunkPos(chunkPos));
         }
     }
 
     @Override
-    public Chunk prepareChunk(int chunkX, int chunkZ)
-    {
-        int chunkRefId = ChunkCoordinate.toInt(chunkX, chunkZ);
-        droppedChunksSet.remove(chunkRefId);
-        Chunk chunk = chunkMap.get(chunkRefId);
-        if(chunk == null)
-        {
-            chunk = loadChunkFromFile(chunkX, chunkZ);
-            if(chunk == null)
-            {
-                if (chunkGenerator != null)
-                {
-                    chunk = chunkGenerator.generate(chunkX, chunkZ);
+    public @NotNull Chunk prepareChunk(@NotNull ChunkPos chunkPos, boolean priority) {
+        this.droppedChunksSet.remove(chunkPos);
+        Chunk chunk = this.chunkMap.get(chunkPos);
+        if (chunk == null) {
+            chunk = loadChunkFromFile(chunkPos);
+            if (chunk == null) {
+                if (this.chunkGenerator != null) {
+                    chunk = this.chunkGenerator.generate(chunkPos.x, chunkPos.z);
                     chunk.fixMissingBlocks();
-                }
-                else
-                {
-                    chunk = emptyChunk;
+                } else {
+                    chunk = this.emptyChunk;
                 }
             }
-            chunkMap.put(chunkRefId, chunk);
-            chunkList.add(chunk);
-            if(chunk != null)
-            {
-                chunk.onLoad();
+            this.chunkMap.put(new ChunkPos(chunkPos), chunk);
+            this.chunkList.add(chunk);
+            chunk.checkForLightGaps();
+            chunk.onLoad();
+            if (!chunk.isTerrainPopulated && isChunkLoaded(chunkPos.x + 1, chunkPos.z + 1) && isChunkLoaded(chunkPos.x, chunkPos.z + 1) && isChunkLoaded(chunkPos.x + 1, chunkPos.z)) {
+                populate(this, chunkPos.x, chunkPos.z);
             }
-            if(!chunk.isTerrainPopulated && isChunkLoaded(chunkX + 1, chunkZ + 1) && isChunkLoaded(chunkX, chunkZ + 1) && isChunkLoaded(chunkX + 1, chunkZ))
-            {
-                populate(this, chunkX, chunkZ);
+            if (isChunkLoaded(chunkPos.x - 1, chunkPos.z) && !provideChunk(chunkPos.x - 1, chunkPos.z).isTerrainPopulated && isChunkLoaded(chunkPos.x - 1, chunkPos.z + 1) && isChunkLoaded(chunkPos.x, chunkPos.z + 1) && isChunkLoaded(chunkPos.x - 1, chunkPos.z)) {
+                populate(this, chunkPos.x - 1, chunkPos.z);
             }
-            if(isChunkLoaded(chunkX - 1, chunkZ) && !provideChunk(chunkX - 1, chunkZ).isTerrainPopulated && isChunkLoaded(chunkX - 1, chunkZ + 1) && isChunkLoaded(chunkX, chunkZ + 1) && isChunkLoaded(chunkX - 1, chunkZ))
-            {
-                populate(this, chunkX - 1, chunkZ);
+            if (isChunkLoaded(chunkPos.x, chunkPos.z - 1) && !provideChunk(chunkPos.x, chunkPos.z - 1).isTerrainPopulated && isChunkLoaded(chunkPos.x + 1, chunkPos.z - 1) && isChunkLoaded(chunkPos.x, chunkPos.z - 1) && isChunkLoaded(chunkPos.x + 1, chunkPos.z)) {
+                populate(this, chunkPos.x, chunkPos.z - 1);
             }
-            if(isChunkLoaded(chunkX, chunkZ - 1) && !provideChunk(chunkX, chunkZ - 1).isTerrainPopulated && isChunkLoaded(chunkX + 1, chunkZ - 1) && isChunkLoaded(chunkX, chunkZ - 1) && isChunkLoaded(chunkX + 1, chunkZ))
-            {
-                populate(this, chunkX, chunkZ - 1);
+            if (isChunkLoaded(chunkPos.x - 1, chunkPos.z - 1) && !provideChunk(chunkPos.x - 1, chunkPos.z - 1).isTerrainPopulated && isChunkLoaded(chunkPos.x - 1, chunkPos.z - 1) && isChunkLoaded(chunkPos.x, chunkPos.z - 1) && isChunkLoaded(chunkPos.x - 1, chunkPos.z)) {
+                populate(this, chunkPos.x - 1, chunkPos.z - 1);
             }
-            if(isChunkLoaded(chunkX - 1, chunkZ - 1) && !provideChunk(chunkX - 1, chunkZ - 1).isTerrainPopulated && isChunkLoaded(chunkX - 1, chunkZ - 1) && isChunkLoaded(chunkX, chunkZ - 1) && isChunkLoaded(chunkX - 1, chunkZ))
-            {
-                populate(this, chunkX - 1, chunkZ - 1);
-            }
-            if (world.getCurrentWeather() != null)
-            {
-                world.getCurrentWeather().doChunkLoadEffect(world, chunk);
+            if (this.world.getCurrentWeather() != null) {
+                this.world.getCurrentWeather().doChunkLoadEffect(this.world, chunk);
             }
         }
         return chunk;
     }
 
     @Override
-    public void regenerateChunk(int chunkX, int chunkZ)
-    {
-        int chunkRefId = ChunkCoordinate.toInt(chunkX, chunkZ);
-        droppedChunksSet.remove(chunkRefId);
-        chunkList.remove(chunkMap.get(chunkRefId));
-        chunkMap.remove(chunkRefId);
+    public void regenerateChunk(@NotNull ChunkPos chunkPos) {
+        this.droppedChunksSet.remove(chunkPos);
+        this.chunkList.remove(this.chunkMap.get(chunkPos));
+        this.chunkMap.remove(chunkPos);
         Chunk chunk;
-        if (chunkGenerator != null)
-        {
-            chunk = chunkGenerator.generate(chunkX, chunkZ);
+        if (this.chunkGenerator != null) {
+            chunk = this.chunkGenerator.generate(chunkPos.x, chunkPos.z);
             chunk.fixMissingBlocks();
-        }
-        else
-        {
+        } else {
             return;
         }
-        chunkMap.put(chunkRefId, chunk);
-        if(!chunk.isTerrainPopulated && isChunkLoaded(chunkX + 1, chunkZ + 1) && isChunkLoaded(chunkX, chunkZ + 1) && isChunkLoaded(chunkX + 1, chunkZ))
-        {
-            populate(this, chunkX, chunkZ);
+        this.chunkMap.put(new ChunkPos(chunkPos), chunk);
+        if (!chunk.isTerrainPopulated && isChunkLoaded(chunkPos.x + 1, chunkPos.z + 1) && isChunkLoaded(chunkPos.x, chunkPos.z + 1) && isChunkLoaded(chunkPos.x + 1, chunkPos.z)) {
+            populate(new ChunkPos(chunkPos.x, chunkPos.z));
         }
-        if(isChunkLoaded(chunkX - 1, chunkZ) && !provideChunk(chunkX - 1, chunkZ).isTerrainPopulated && isChunkLoaded(chunkX - 1, chunkZ + 1) && isChunkLoaded(chunkX, chunkZ + 1) && isChunkLoaded(chunkX - 1, chunkZ))
-        {
-            populate(this, chunkX - 1, chunkZ);
+        if (isChunkLoaded(chunkPos.x - 1, chunkPos.z) && !provideChunk(chunkPos.x - 1, chunkPos.z).isTerrainPopulated && isChunkLoaded(chunkPos.x - 1, chunkPos.z + 1) && isChunkLoaded(chunkPos.x, chunkPos.z + 1) && isChunkLoaded(chunkPos.x - 1, chunkPos.z)) {
+            populate(new ChunkPos(chunkPos.x - 1, chunkPos.z));
         }
-        if(isChunkLoaded(chunkX, chunkZ - 1) && !provideChunk(chunkX, chunkZ - 1).isTerrainPopulated && isChunkLoaded(chunkX + 1, chunkZ - 1) && isChunkLoaded(chunkX, chunkZ - 1) && isChunkLoaded(chunkX + 1, chunkZ))
-        {
-            populate(this, chunkX, chunkZ - 1);
+        if (isChunkLoaded(chunkPos.x, chunkPos.z - 1) && !provideChunk(chunkPos.x, chunkPos.z - 1).isTerrainPopulated && isChunkLoaded(chunkPos.x + 1, chunkPos.z - 1) && isChunkLoaded(chunkPos.x, chunkPos.z - 1) && isChunkLoaded(chunkPos.x + 1, chunkPos.z)) {
+            populate(new ChunkPos(chunkPos.x, chunkPos.z - 1));
         }
-        if(isChunkLoaded(chunkX - 1, chunkZ - 1) && !provideChunk(chunkX - 1, chunkZ - 1).isTerrainPopulated && isChunkLoaded(chunkX - 1, chunkZ - 1) && isChunkLoaded(chunkX, chunkZ - 1) && isChunkLoaded(chunkX - 1, chunkZ))
-        {
-            populate(this, chunkX - 1, chunkZ - 1);
+        if (isChunkLoaded(chunkPos.x - 1, chunkPos.z - 1) && !provideChunk(chunkPos.x - 1, chunkPos.z - 1).isTerrainPopulated && isChunkLoaded(chunkPos.x - 1, chunkPos.z - 1) && isChunkLoaded(chunkPos.x, chunkPos.z - 1) && isChunkLoaded(chunkPos.x - 1, chunkPos.z)) {
+            populate(new ChunkPos(chunkPos.x - 1, chunkPos.z - 1));
         }
     }
 
     @Override
-    public Chunk provideChunk(int chunkX, int chunkZ)
-    {
-        Chunk chunk = chunkMap.get(ChunkCoordinate.toInt(chunkX, chunkZ));
-        if(chunk == null)
-        {
-            if(world.findingSpawnPoint || chunkLoadOverride)
-            {
-                return prepareChunk(chunkX, chunkZ);
+    public @NotNull Chunk provideChunk(@NotNull ChunkPos chunkPos, boolean priority) {
+        Chunk chunk = this.chunkMap.get(chunkPos);
+        if (chunk == null) {
+            if (this.world.findingSpawnPoint || this.chunkLoadOverride) {
+                return prepareChunk(chunkPos, true);
+            } else {
+                return this.emptyChunk;
             }
-            else
-            {
-                return emptyChunk;
-            }
-        }
-        else
-        {
+        } else {
             return chunk;
         }
     }
 
-    private Chunk loadChunkFromFile(int chunkX, int chunkZ)
-    {
-        if (chunkLoader == null)
-        {
+    private Chunk loadChunkFromFile(@NotNull ChunkPos chunkPos) {
+        if (this.chunkLoader == null) {
             return null;
         }
-        try
-        {
-            Chunk chunk = chunkLoader.loadChunk(world, chunkX, chunkZ);
-            if (chunk != null)
-            {
-                chunk.lastSaveTime = world.getWorldTime();
+        try {
+            Chunk chunk = this.chunkLoader.loadChunk(this.world, chunkPos.x, chunkPos.z);
+            if (chunk != null) {
+                chunk.lastSaveTime = this.world.getWorldTime();
             }
             return chunk;
-        }
-        catch (Exception exception)
-        {
-            LOGGER.error("Failed to load chunk at X:{}, Z:{} to disk!", chunkX, chunkZ, exception);
+        } catch (Exception exception) {
+            LOGGER.error("Failed to load chunk at X:{}, Z:{} to disk!", chunkPos.x, chunkPos.z, exception);
         }
         return null;
     }
 
-    private void saveChunkToFile(Chunk chunk)
-    {
-        if (chunkLoader == null)
-        {
+    private void saveChunkToFile(Chunk chunk) {
+        if (this.chunkLoader == null) {
             return;
         }
-        try
-        {
-            chunk.lastSaveTime = world.getWorldTime();
-            chunkLoader.saveChunk(world, chunk);
-        }
-        catch (IOException ioexception)
-        {
+        try {
+            chunk.lastSaveTime = this.world.getWorldTime();
+            this.chunkLoader.saveChunk(this.world, chunk);
+        } catch (IOException ioexception) {
             LOGGER.error("Failed to save chunk at X:{}, Z:{} to disk!", chunk.pos.x, chunk.pos.z, ioexception);
         }
     }
 
     @Override
-    public void populate(IChunkProvider chunkProvider, int chunkX, int chunkZ)
-    {
-        Chunk chunk = provideChunk(chunkX, chunkZ);
-        if (!chunk.isTerrainPopulated)
-        {
+    public void populate(@NotNull ChunkPos chunkPos) {
+        Chunk chunk = provideChunk(chunkPos, true);
+        if (!chunk.isTerrainPopulated) {
             chunk.isTerrainPopulated = true;
-            if (this.chunkGenerator != null)
-            {
+            if (this.chunkGenerator != null) {
                 this.chunkGenerator.decorate(chunk);
                 chunk.setChunkModified();
             }
@@ -221,20 +172,16 @@ public class ChunkProviderServer
     }
 
     @Override
-    public boolean saveChunks(boolean saveImmediately, ProgressListener progressUpdate)
-    {
-        saveImmediately |= world.mcServer.forceSaveAllChunksOnAutosave;
+    public boolean saveChunks(boolean saveImmediately, @Nullable ProgressListener progressListener) {
+        saveImmediately |= this.world.mcServer.forceSaveAllChunksOnAutosave;
         int chunksSaved = 0;
-        for (Chunk chunk : chunkList)
-        {
-            if (!chunk.needsSaving(saveImmediately))
-            {
+        for (Chunk chunk : this.chunkList) {
+            if (!chunk.needsSaving(saveImmediately)) {
                 continue;
             }
             saveChunkToFile(chunk);
             chunk.isModified = false;
-            if (++chunksSaved == world.mcServer.chunksSavedPerAutosave && !saveImmediately)
-            {
+            if (++chunksSaved == this.world.mcServer.chunksSavedPerAutosave && !saveImmediately) {
                 return false;
             }
         }
@@ -243,51 +190,44 @@ public class ChunkProviderServer
     }
 
     @Override
-    public boolean tick()
-    {
-        if(!world.dontSave)
-        {
-            for(int i = 0; i < 100; i++)
-            {
-                if(!droppedChunksSet.isEmpty())
-                {
-                    int integer = droppedChunksSet.iterator().nextInt();
-                    Chunk chunk = chunkMap.get(integer);
+    public boolean tick() {
+        if (!this.world.dontSave) {
+            for (int i = 0; i < 100; i++) {
+                if (!this.droppedChunksSet.isEmpty()) {
+                    ChunkPos chunkPos = this.droppedChunksSet.iterator().next();
+                    Chunk chunk = this.chunkMap.get(chunkPos);
                     saveChunkToFile(chunk);
                     chunk.onUnload();
-                    droppedChunksSet.remove(integer);
-                    chunkMap.remove(integer);
-                    chunkList.remove(chunk);
+                    this.droppedChunksSet.remove(chunkPos);
+                    this.chunkMap.remove(chunkPos);
+                    this.chunkList.remove(chunk);
                 }
             }
         }
         return false;
     }
-    
+
     @Override
-    public void unloadAllChunks()
-    {
-    	chunkMap.clear();
-    	chunkList.clear();
-    	droppedChunksSet.clear();
-        chunkGenerator = null;
-    	System.gc();
+    public void unloadAllChunks() {
+        this.chunkMap.clear();
+        this.chunkList.clear();
+        this.droppedChunksSet.clear();
+        this.chunkGenerator = null;
+        System.gc();
     }
 
     @Override
-    public boolean canSave()
-    {
-        return !world.dontSave;
+    public boolean canSave() {
+        return !this.world.dontSave;
     }
-    
+
     @Override
-    public String getInfoString()
-    {
-    	return "";
+    public @NotNull String getInfoString() {
+        return "";
     }
 
     @Override
-    public void setCurrentChunkOver(int chunkX, int chunkZ) {
+    public void setCurrentChunkOver(@NotNull ChunkPos chunkPos) {
         // Do nothing
     }
 }
diff --git a/util/seed-viewer/src/main/java/org/useless/seedviewer/TestChunkProvider.java b/util/seed-viewer/src/main/java/org/useless/seedviewer/TestChunkProvider.java
index dad2553b0..a1b724d2f 100644
--- a/util/seed-viewer/src/main/java/org/useless/seedviewer/TestChunkProvider.java
+++ b/util/seed-viewer/src/main/java/org/useless/seedviewer/TestChunkProvider.java
@@ -1,19 +1,18 @@
 package org.useless.seedviewer;
 
 import net.minecraft.core.util.collection.NamespaceID;
-import org.useless.seedviewer.collections.ChunkLocation;
-import org.useless.seedviewer.collections.ChunkPos2D;
-import org.useless.seedviewer.collections.ChunkPos3D;
+import net.minecraft.core.world.pos.ChunkPos;
+import net.minecraft.core.world.pos.ChunkTilePos;
 import org.useless.seedviewer.data.ViewerBiome;
 import org.useless.seedviewer.data.ViewerChunk;
 import org.useless.seedviewer.gui.ChunkProvider;
 
 public class TestChunkProvider implements ChunkProvider {
     @Override
-    public ViewerChunk getChunk(ChunkLocation location) {
+    public ViewerChunk getChunk(ChunkPos location) {
         return new ViewerChunk() {
             @Override
-            public ViewerBiome getBiome(ChunkPos3D pos) {
+            public ViewerBiome getBiome(ChunkTilePos pos) {
                 return new ViewerBiome() {
                     @Override
                     public String getName() {
@@ -36,17 +35,17 @@ public class TestChunkProvider implements ChunkProvider {
             }
 
             @Override
-            public int getBlockColor(ChunkPos3D pos) {
+            public int getBlockColor(ChunkTilePos pos) {
                 return 0;
             }
 
             @Override
-            public int getHeight(ChunkPos2D pos) {
+            public int getHeight(ChunkTilePos pos) {
                 return 128;
             }
 
             @Override
-            public int getWaterDepth(ChunkPos2D pos) {
+            public int getWaterDepth(ChunkTilePos pos) {
                 return 0;
             }
         };
diff --git a/util/seed-viewer/src/main/java/org/useless/seedviewer/bta/BTABiome.java b/util/seed-viewer/src/main/java/org/useless/seedviewer/bta/BTABiome.java
index a53b39378..cb9b399df 100644
--- a/util/seed-viewer/src/main/java/org/useless/seedviewer/bta/BTABiome.java
+++ b/util/seed-viewer/src/main/java/org/useless/seedviewer/bta/BTABiome.java
@@ -13,14 +13,14 @@ public class BTABiome implements ViewerBiome {
     }
     @Override
     public String getName() {
-        if (biome == null) return "Unknown";
-        return I18n.getInstance().translateKey(biome.translationKey);
+        if (this.biome == null) return "Unknown";
+        return I18n.getInstance().translateKey(this.biome.translationKey);
     }
 
     @Override
     public NamespaceID getID() {
         try {
-            return NamespaceID.fromPool(Registries.BIOMES.getKey(biome)).copyUnpooled();
+            return NamespaceID.fromPool(Registries.BIOMES.getKey(this.biome)).copyUnpooled();
         } catch (HardIllegalArgumentException e) {
             throw new IllegalArgumentException(e);
         }
@@ -28,7 +28,7 @@ public class BTABiome implements ViewerBiome {
 
     @Override
     public int getColor() {
-        if (biome == null) return 0x00000000;
-        return biome.color;
+        if (this.biome == null) return 0x00000000;
+        return this.biome.color;
     }
 }
diff --git a/util/seed-viewer/src/main/java/org/useless/seedviewer/bta/BTAChunkProvider.java b/util/seed-viewer/src/main/java/org/useless/seedviewer/bta/BTAChunkProvider.java
index f6996d8e8..50f0fbfca 100644
--- a/util/seed-viewer/src/main/java/org/useless/seedviewer/bta/BTAChunkProvider.java
+++ b/util/seed-viewer/src/main/java/org/useless/seedviewer/bta/BTAChunkProvider.java
@@ -9,10 +9,10 @@ import net.minecraft.core.lang.I18n;
 import net.minecraft.core.world.biome.Biomes;
 import net.minecraft.core.world.biome.provider.BiomeProvider;
 import net.minecraft.core.world.biome.provider.BiomeProviderOverworld;
+import net.minecraft.core.world.pos.ChunkPos;
 import net.minecraft.core.world.save.LevelData;
 import net.minecraft.core.world.type.WorldTypes;
 import org.useless.seedviewer.bta.worldloader.ChunkLoader;
-import org.useless.seedviewer.collections.ChunkLocation;
 import org.useless.seedviewer.data.ViewerChunk;
 import org.useless.seedviewer.gui.ChunkProvider;
 import org.slf4j.Logger;
@@ -40,26 +40,26 @@ public class BTAChunkProvider implements ChunkProvider {
 
 
     public BTAChunkProvider(long seed) {
-        biomeProvider = new BiomeProviderOverworld(seed, WorldTypes.OVERWORLD_EXTENDED);
+        this.biomeProvider = new BiomeProviderOverworld(seed, WorldTypes.OVERWORLD_EXTENDED);
     }
 
     public BTAChunkProvider(File worldFolder, LevelData data) {
-        biomeProvider = new BiomeProviderOverworld(data.getRandomSeed(), WorldTypes.OVERWORLD_EXTENDED);
-        chunkLoader = new ChunkLoader(worldFolder, 0);
+        this.biomeProvider = new BiomeProviderOverworld(data.getRandomSeed(), WorldTypes.OVERWORLD_EXTENDED);
+        this.chunkLoader = new ChunkLoader(worldFolder, 0);
     }
     @Override
-    public ViewerChunk getChunk(ChunkLocation location) {
-        if (chunkLoader != null) {
+    public ViewerChunk getChunk(ChunkPos location) {
+        if (this.chunkLoader != null) {
             try {
-                net.minecraft.core.world.chunk.Chunk c = chunkLoader.loadChunk(location);
+                net.minecraft.core.world.chunk.Chunk c = this.chunkLoader.loadChunk(location);
                 if (c != null) {
-                    return new BTAComplexChunk(c, biomeProvider);
+                    return new BTAComplexChunk(c, this.biomeProvider);
                 }
             } catch (IOException e) {
                 LOGGER.error("Failed to load chunk data for chunk {}, {}", location.x, location.z, e);
             }
         }
-        return new BTASimpleChunk(location, biomeProvider);
+        return new BTASimpleChunk(location, this.biomeProvider);
     }
 
 }
diff --git a/util/seed-viewer/src/main/java/org/useless/seedviewer/bta/BTAComplexChunk.java b/util/seed-viewer/src/main/java/org/useless/seedviewer/bta/BTAComplexChunk.java
index 5302ec8d9..cde883a99 100644
--- a/util/seed-viewer/src/main/java/org/useless/seedviewer/bta/BTAComplexChunk.java
+++ b/util/seed-viewer/src/main/java/org/useless/seedviewer/bta/BTAComplexChunk.java
@@ -5,9 +5,8 @@ import net.minecraft.core.block.Blocks;
 import net.minecraft.core.block.material.Material;
 import net.minecraft.core.block.material.MaterialColor;
 import net.minecraft.core.world.biome.provider.BiomeProvider;
+import net.minecraft.core.world.pos.ChunkTilePos;
 import org.jetbrains.annotations.NotNull;
-import org.useless.seedviewer.collections.ChunkPos2D;
-import org.useless.seedviewer.collections.ChunkPos3D;
 import org.useless.seedviewer.data.ViewerBiome;
 import org.useless.seedviewer.data.ViewerChunk;
 
@@ -19,33 +18,33 @@ public class BTAComplexChunk implements ViewerChunk {
         this.provider = biomeProvider;
     }
     @Override
-    public ViewerBiome getBiome(ChunkPos3D pos) {
-        net.minecraft.core.world.biome.Biome b = chunk.getBlockBiome(pos.x, pos.y, pos.z);
-        if (b != null) return new BTABiome(b);;
-        return new BTABiome(provider.getBiome(chunk.pos.x * ViewerChunk.CHUNK_SIZE_X + pos.x, pos.y, chunk.pos.z * ViewerChunk.CHUNK_SIZE_Z + pos.z));
+    public ViewerBiome getBiome(ChunkTilePos pos) {
+        net.minecraft.core.world.biome.Biome b = this.chunk.getBlockBiome(pos);
+        if (b != null) return new BTABiome(b);
+        return new BTABiome(this.provider.getBiome(this.chunk.pos.x * ViewerChunk.CHUNK_SIZE_X + pos.x, pos.y, this.chunk.pos.z * ViewerChunk.CHUNK_SIZE_Z + pos.z));
     }
 
     @Override
-    public int getBlockColor(ChunkPos3D pos) {
-        Block<?> b = Blocks.getBlock(chunk.getBlockID(pos.x, pos.y, pos.z));
+    public int getBlockColor(ChunkTilePos pos) {
+        Block<?> b = Blocks.getBlock(this.chunk.getBlockId(pos));
         if (b == null) return 0;
-        int meta = chunk.getBlockMetadata(pos.x, pos.y, pos.z);
+        int meta = this.chunk.getBlockData(pos);
         return MaterialColor.getColorFromIndex(MaterialColor.getColorIndexFromBlock(b, meta)) | 0xFF_00_00_00;
     }
 
     @Override
-    public int getHeight(ChunkPos2D pos) {
-        return chunk.getHeightValue(pos.x, pos.z);
+    public int getHeight(ChunkTilePos pos) {
+        return this.chunk.getHeightValue(pos.x, pos.z);
     }
 
     @Override
-    public int getWaterDepth(ChunkPos2D pos) {
+    public int getWaterDepth(ChunkTilePos pos) {
         int start = getHeight(pos) - 1;
         int depth = 0;
         while (true) {
             int y = start - depth;
             if (y < 0) break;
-            Block<?> b = Blocks.getBlock(chunk.getBlockID(pos.x, y, pos.z));
+            Block<?> b = Blocks.getBlock(this.chunk.getBlockId(new ChunkTilePos(pos.x, y, pos.z)));
             if (b == null) break;
             if (b.getMaterial() != Material.water) break;
             depth++;
diff --git a/util/seed-viewer/src/main/java/org/useless/seedviewer/bta/BTASimpleChunk.java b/util/seed-viewer/src/main/java/org/useless/seedviewer/bta/BTASimpleChunk.java
index 1951905be..b109733f2 100644
--- a/util/seed-viewer/src/main/java/org/useless/seedviewer/bta/BTASimpleChunk.java
+++ b/util/seed-viewer/src/main/java/org/useless/seedviewer/bta/BTASimpleChunk.java
@@ -1,36 +1,35 @@
 package org.useless.seedviewer.bta;
 
 import net.minecraft.core.world.biome.provider.BiomeProvider;
-import org.useless.seedviewer.collections.ChunkLocation;
-import org.useless.seedviewer.collections.ChunkPos2D;
-import org.useless.seedviewer.collections.ChunkPos3D;
+import net.minecraft.core.world.pos.ChunkPos;
+import net.minecraft.core.world.pos.ChunkTilePos;
 import org.useless.seedviewer.data.ViewerBiome;
 import org.useless.seedviewer.data.ViewerChunk;
 
 public class BTASimpleChunk implements ViewerChunk {
-    private final ChunkLocation location;
+    private final ChunkPos location;
     private final BiomeProvider provider;
-    public BTASimpleChunk(ChunkLocation location, BiomeProvider biomeProvider) {
+    public BTASimpleChunk(ChunkPos location, BiomeProvider biomeProvider) {
         this.location = location;
-        provider = biomeProvider;
+        this.provider = biomeProvider;
     }
     @Override
-    public ViewerBiome getBiome(ChunkPos3D pos) {
-        return new BTABiome(provider.getBiome(location.x * ViewerChunk.CHUNK_SIZE_X + pos.x, pos.y, location.z * ViewerChunk.CHUNK_SIZE_Z + pos.z));
+    public ViewerBiome getBiome(ChunkTilePos pos) {
+        return new BTABiome(this.provider.getBiome(this.location.x * ViewerChunk.CHUNK_SIZE_X + pos.x, pos.y, this.location.z * ViewerChunk.CHUNK_SIZE_Z + pos.z));
     }
 
     @Override
-    public int getBlockColor(ChunkPos3D pos) {
+    public int getBlockColor(ChunkTilePos pos) {
         return 0;
     }
 
     @Override
-    public int getHeight(ChunkPos2D pos) {
+    public int getHeight(ChunkTilePos pos) {
         return 128;
     }
 
     @Override
-    public int getWaterDepth(ChunkPos2D pos) {
+    public int getWaterDepth(ChunkTilePos pos) {
         return 0;
     }
 }
diff --git a/util/seed-viewer/src/main/java/org/useless/seedviewer/bta/BTAWorld.java b/util/seed-viewer/src/main/java/org/useless/seedviewer/bta/BTAWorld.java
index f404bcfed..c12cff37d 100644
--- a/util/seed-viewer/src/main/java/org/useless/seedviewer/bta/BTAWorld.java
+++ b/util/seed-viewer/src/main/java/org/useless/seedviewer/bta/BTAWorld.java
@@ -18,26 +18,26 @@ public class BTAWorld implements ViewerWorld {
     }
     @Override
     public File getFolder() {
-        return worldFolder;
+        return this.worldFolder;
     }
 
     @Override
     public long getSeed() {
-        return data.getRandomSeed();
+        return this.data.getRandomSeed();
     }
 
     @Override
     public String getName() {
-        return data.getWorldName();
+        return this.data.getWorldName();
     }
 
     @Override
     public long getLastPlayed() {
-        return data.getLastTimePlayed();
+        return this.data.getLastTimePlayed();
     }
 
     @Override
     public ChunkProvider getChunkProvider() {
-        return new BTAChunkProvider(worldFolder, data);
+        return new BTAChunkProvider(this.worldFolder, this.data);
     }
 }
diff --git a/util/seed-viewer/src/main/java/org/useless/seedviewer/bta/chunk/provider/ChunkProviderSeedViewer.java b/util/seed-viewer/src/main/java/org/useless/seedviewer/bta/chunk/provider/ChunkProviderSeedViewer.java
index 4bb459ef5..1d954c3a1 100644
--- a/util/seed-viewer/src/main/java/org/useless/seedviewer/bta/chunk/provider/ChunkProviderSeedViewer.java
+++ b/util/seed-viewer/src/main/java/org/useless/seedviewer/bta/chunk/provider/ChunkProviderSeedViewer.java
@@ -8,249 +8,191 @@ import net.minecraft.core.world.chunk.EmptyChunk;
 import net.minecraft.core.world.chunk.IChunkLoader;
 import net.minecraft.core.world.chunk.provider.IChunkProvider;
 import net.minecraft.core.world.generate.chunk.ChunkGenerator;
+import net.minecraft.core.world.pos.ChunkPos;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 import org.slf4j.Logger;
 
 import java.util.Arrays;
 
 public class ChunkProviderSeedViewer
-    implements IChunkProvider
-{
+    implements IChunkProvider {
     public static final int CHUNK_RADIUS = 64; // Radius should *always* be a power of 2!
     public static final int CHUNK_MASK = CHUNK_RADIUS * 2 - 1;
 
     private static final Logger LOGGER = LogUtils.getLogger();
-    private final Chunk blankChunk;
-    public ChunkGenerator chunkGenerator;
-    private final IChunkLoader chunkLoader;
+    private final @NotNull Chunk blankChunk;
+    public @Nullable ChunkGenerator chunkGenerator;
+    private final @Nullable IChunkLoader chunkLoader;
     private final Chunk[] chunks;
-    private final World worldObj;
-    int lastQueriedChunkXPos;
-    int lastQueriedChunkZPos;
-    private Chunk lastQueriedChunk;
-    private int curChunkX;
-    private int curChunkY;
+    private final @NotNull World world;
+    private @NotNull ChunkPos lastQueriedChunkPos = new ChunkPos(Integer.MIN_VALUE, Integer.MIN_VALUE);
+    private @Nullable Chunk lastQueriedChunk;
+    private @NotNull ChunkPos curChunkPos = new ChunkPos(0, 0);
 
 
-    public ChunkProviderSeedViewer(World world, IChunkLoader ichunkloader, ChunkGenerator chunkGenerator)
-    {
-        chunks = new Chunk[CHUNK_RADIUS * 2 * CHUNK_RADIUS * 2];
-        lastQueriedChunkXPos = Integer.MIN_VALUE;
-        lastQueriedChunkZPos = Integer.MIN_VALUE;
-        blankChunk = new EmptyChunk(world, 0, 0);
-        worldObj = world;
-        chunkLoader = ichunkloader;
+    public ChunkProviderSeedViewer(@NotNull World world, @Nullable IChunkLoader ichunkloader, @Nullable ChunkGenerator chunkGenerator) {
+        this.chunks = new Chunk[CHUNK_RADIUS * 2 * CHUNK_RADIUS * 2];
+        this.blankChunk = new EmptyChunk(world, new ChunkPos(0, 0));
+        this.world = world;
+        this.chunkLoader = ichunkloader;
         this.chunkGenerator = chunkGenerator;
 
     }
 
     @Override
-    public void setCurrentChunkOver(int chunkX, int chunkZ)
-    {
-        curChunkX = chunkX;
-        curChunkY = chunkZ;
+    public void setCurrentChunkOver(@NotNull ChunkPos chunkPos) {
+        this.curChunkPos = new ChunkPos(chunkPos);
     }
 
-    public boolean canChunkExist(int chunkX, int chunkZ)
-    {
-        byte byte0 = CHUNK_RADIUS - 1;
-        return chunkX >= curChunkX - byte0 && chunkZ >= curChunkY - byte0 && chunkX <= curChunkX + byte0 && chunkZ <= curChunkY + byte0;
+    public boolean canChunkExist(@NotNull ChunkPos chunkPos) {
+        byte r = CHUNK_RADIUS - 1;
+        return chunkPos.x >= this.curChunkPos.x - r && chunkPos.z >= this.curChunkPos.z - r && chunkPos.x <= this.curChunkPos.x + r && chunkPos.z <= this.curChunkPos.z + r;
     }
 
     @Override
-    public void regenerateChunk(int chunkX, int chunkZ)
-    {
-        int k = chunkX & CHUNK_MASK;
-        int l = chunkZ & CHUNK_MASK;
-        int i1 = k + l * CHUNK_RADIUS * 2;
+    public void regenerateChunk(@NotNull ChunkPos chunkPos) {
+        int cx = chunkPos.x & CHUNK_MASK;
+        int cz = chunkPos.z & CHUNK_MASK;
+        int index = cx + cz * CHUNK_RADIUS * 2;
         Chunk newChunk;
-        if (chunkGenerator != null)
-        {
-            newChunk = chunkGenerator.generate(chunkX, chunkZ);
+        if (this.chunkGenerator != null) {
+            newChunk = this.chunkGenerator.generate(chunkPos.x, chunkPos.z);
             newChunk.fixMissingBlocks();
-        }
-        else
-        {
+        } else {
             return;
         }
-        chunks[i1] = newChunk;
-        if(!chunks[i1].isTerrainPopulated && isChunkLoaded(chunkX + 1, chunkZ + 1) && isChunkLoaded(chunkX, chunkZ + 1) && isChunkLoaded(chunkX + 1, chunkZ))
-        {
-            populate(this, chunkX, chunkZ);
+        this.chunks[index] = newChunk;
+        if (!this.chunks[index].isTerrainPopulated && isChunkLoaded(chunkPos.add(1, 1)) && isChunkLoaded(chunkPos.add(0, 1)) && isChunkLoaded(chunkPos.add(1, 0))) {
+            populate(chunkPos);
         }
-        if(isChunkLoaded(chunkX - 1, chunkZ) && !provideChunk(chunkX - 1, chunkZ).isTerrainPopulated && isChunkLoaded(chunkX - 1, chunkZ + 1) && isChunkLoaded(chunkX, chunkZ + 1) && isChunkLoaded(chunkX - 1, chunkZ))
-        {
-            populate(this, chunkX - 1, chunkZ);
+        if (isChunkLoaded(chunkPos.add(-1, 0)) && !provideChunk(chunkPos.add(-1, 0), true).isTerrainPopulated && isChunkLoaded(chunkPos.add(-1, 1)) && isChunkLoaded(chunkPos.add(0, 1)) && isChunkLoaded(chunkPos.add(-1, 0))) {
+            populate(chunkPos.add(-1, 0));
         }
-        if(isChunkLoaded(chunkX, chunkZ - 1) && !provideChunk(chunkX, chunkZ - 1).isTerrainPopulated && isChunkLoaded(chunkX + 1, chunkZ - 1) && isChunkLoaded(chunkX, chunkZ - 1) && isChunkLoaded(chunkX + 1, chunkZ))
-        {
-            populate(this, chunkX, chunkZ - 1);
+        if (isChunkLoaded(chunkPos.add(0, -1)) && !provideChunk(chunkPos.add(0, -1), true).isTerrainPopulated && isChunkLoaded(chunkPos.add(1, -1)) && isChunkLoaded(chunkPos.add(0, -1)) && isChunkLoaded(chunkPos.add(1, 0))) {
+            populate(chunkPos.add(0, -1));
         }
-        if(isChunkLoaded(chunkX - 1, chunkZ - 1) && !provideChunk(chunkX - 1, chunkZ - 1).isTerrainPopulated && isChunkLoaded(chunkX - 1, chunkZ - 1) && isChunkLoaded(chunkX, chunkZ - 1) && isChunkLoaded(chunkX - 1, chunkZ))
-        {
-            populate(this, chunkX - 1, chunkZ - 1);
+        if (isChunkLoaded(chunkPos.add(-1, -1)) && !provideChunk(chunkPos.add(-1, -1), true).isTerrainPopulated && isChunkLoaded(chunkPos.add(-1, -1)) && isChunkLoaded(chunkPos.add(0, -1)) && isChunkLoaded(chunkPos.add(-1, 0))) {
+            populate(chunkPos.add(-1, -1));
         }
     }
 
     @Override
-    public boolean isChunkLoaded(int chunkX, int chunkZ)
-    {
-        if(!canChunkExist(chunkX, chunkZ))
-        {
+    public boolean isChunkLoaded(@NotNull ChunkPos chunkPos) {
+        if (!canChunkExist(chunkPos)) {
             return false;
         }
-        if(chunkX == lastQueriedChunkXPos && chunkZ == lastQueriedChunkZPos && lastQueriedChunk != null)
-        {
+        if (chunkPos.equals(this.lastQueriedChunkPos) && this.lastQueriedChunk != null) {
             return true;
-        } else
-        {
-            int k = chunkX & CHUNK_MASK;
-            int l = chunkZ & CHUNK_MASK;
+        } else {
+            int k = chunkPos.x & CHUNK_MASK;
+            int l = chunkPos.z & CHUNK_MASK;
             int chunkIndex = k + l * CHUNK_RADIUS * 2;
-            return chunks[chunkIndex] == blankChunk || (chunks[chunkIndex] != null && chunks[chunkIndex].isAtLocation(chunkX, chunkZ));
+            return this.chunks[chunkIndex] == this.blankChunk || (this.chunks[chunkIndex] != null && this.chunks[chunkIndex].isAtLocation(chunkPos));
         }
     }
 
     @Override
-    public Chunk prepareChunk(int chunkX, int chunkZ)
-    {
-        return provideChunk(chunkX, chunkZ);
+    public @NotNull Chunk prepareChunk(@NotNull ChunkPos chunkPos, boolean priority) {
+        return provideChunk(chunkPos, true);
     }
 
     @Override
-    public Chunk provideChunk(int chunkX, int chunkZ)
-    {
-        if(chunkX == lastQueriedChunkXPos && chunkZ == lastQueriedChunkZPos && lastQueriedChunk != null)
-        {
-            return lastQueriedChunk;
+    public @NotNull Chunk provideChunk(@NotNull ChunkPos chunkPos, boolean priority) {
+        if (chunkPos.equals(this.lastQueriedChunkPos) && this.lastQueriedChunk != null) {
+            return this.lastQueriedChunk;
         }
-        if(!worldObj.findingSpawnPoint && !canChunkExist(chunkX, chunkZ))
-        {
-            return blankChunk;
+        if (!this.world.findingSpawnPoint && !canChunkExist(chunkPos)) {
+            return this.blankChunk;
         }
-        int k = chunkX & CHUNK_MASK;
-        int l = chunkZ & CHUNK_MASK;
-        int i1 = k + l * CHUNK_RADIUS * 2;
-        if(!isChunkLoaded(chunkX, chunkZ))
-        {
-            if(chunks[i1] != null)
-            {
-                saveChunk(chunks[i1]);
-                chunks[i1].onUnload();
+        int cx = chunkPos.x & CHUNK_MASK;
+        int cz = chunkPos.z & CHUNK_MASK;
+        int index = cx + cz * CHUNK_RADIUS * 2;
+        if (!isChunkLoaded(chunkPos)) {
+            if (this.chunks[index] != null) {
+                this.chunks[index].onUnload();
             }
-            Chunk chunk = loadChunk(chunkX, chunkZ);
-            if(chunk == null)
-            {
-                if (chunkGenerator != null)
-                {
-                    chunk = chunkGenerator.generate(chunkX, chunkZ);
+            Chunk chunk = loadChunk(chunkPos);
+            if (chunk == null) {
+                if (this.chunkGenerator != null) {
+                    chunk = this.chunkGenerator.generate(chunkPos.x, chunkPos.z);
                     chunk.fixMissingBlocks();
+                } else {
+                    chunk = this.blankChunk;
                 }
-                else
-                {
-                    chunk = blankChunk;
-                }
-            }
-            chunks[i1] = chunk;
-            if(chunks[i1] != null)
-            {
-                chunks[i1].onLoad();
             }
-            if(!chunks[i1].isTerrainPopulated && isChunkLoaded(chunkX + 1, chunkZ + 1) && isChunkLoaded(chunkX, chunkZ + 1) && isChunkLoaded(chunkX + 1, chunkZ))
-            {
-                populate(this, chunkX, chunkZ);
+            this.chunks[index] = chunk;
+            chunk.checkForLightGaps();
+            chunk.onLoad();
+            if (!chunk.isTerrainPopulated && isChunkLoaded(chunkPos.add(1, 1)) && isChunkLoaded(chunkPos.add(0, 1)) && isChunkLoaded(chunkPos.add(1, 0))) {
+                populate(chunkPos);
             }
-            if(isChunkLoaded(chunkX - 1, chunkZ) && !provideChunk(chunkX - 1, chunkZ).isTerrainPopulated && isChunkLoaded(chunkX - 1, chunkZ + 1) && isChunkLoaded(chunkX, chunkZ + 1) && isChunkLoaded(chunkX - 1, chunkZ))
-            {
-                populate(this, chunkX - 1, chunkZ);
+            if (isChunkLoaded(chunkPos.add(-1, 0)) && !provideChunk(chunkPos.add(-1, 0), true).isTerrainPopulated && isChunkLoaded(chunkPos.add(-1, 1)) && isChunkLoaded(chunkPos.add(0, 1)) && isChunkLoaded(chunkPos.add(-1, 0))) {
+                populate(chunkPos.add(-1, 0));
             }
-            if(isChunkLoaded(chunkX, chunkZ - 1) && !provideChunk(chunkX, chunkZ - 1).isTerrainPopulated && isChunkLoaded(chunkX + 1, chunkZ - 1) && isChunkLoaded(chunkX, chunkZ - 1) && isChunkLoaded(chunkX + 1, chunkZ))
-            {
-                populate(this, chunkX, chunkZ - 1);
+            if (isChunkLoaded(chunkPos.add(0, -1)) && !provideChunk(chunkPos.add(0, -1), true).isTerrainPopulated && isChunkLoaded(chunkPos.add(1, -1)) && isChunkLoaded(chunkPos.add(0, -1)) && isChunkLoaded(chunkPos.add(1, 0))) {
+                populate(chunkPos.add(0, -1));
             }
-            if(isChunkLoaded(chunkX - 1, chunkZ - 1) && !provideChunk(chunkX - 1, chunkZ - 1).isTerrainPopulated && isChunkLoaded(chunkX - 1, chunkZ - 1) && isChunkLoaded(chunkX, chunkZ - 1) && isChunkLoaded(chunkX - 1, chunkZ))
-            {
-                populate(this, chunkX - 1, chunkZ - 1);
+            if (isChunkLoaded(chunkPos.add(-1, -1)) && !provideChunk(chunkPos.add(-1, -1), true).isTerrainPopulated && isChunkLoaded(chunkPos.add(-1, -1)) && isChunkLoaded(chunkPos.add(0, -1)) && isChunkLoaded(chunkPos.add(-1, 0))) {
+                populate(chunkPos.add(-1, -1));
             }
-            if (worldObj.getCurrentWeather() != null)
-            {
-                worldObj.getCurrentWeather().doChunkLoadEffect(worldObj, chunk);
+            if (this.world.getCurrentWeather() != null) {
+                this.world.getCurrentWeather().doChunkLoadEffect(this.world, chunk);
             }
         }
-        lastQueriedChunkXPos = chunkX;
-        lastQueriedChunkZPos = chunkZ;
-        lastQueriedChunk = chunks[i1];
-        return chunks[i1];
+        this.lastQueriedChunkPos = chunkPos;
+        this.lastQueriedChunk = this.chunks[index];
+        return this.chunks[index];
     }
 
-    private Chunk loadChunk(int chunkX, int chunkZ)
-    {
-        if(chunkLoader == null)
-        {
-            return blankChunk;
+    private Chunk loadChunk(@NotNull ChunkPos chunkPos) {
+        if (this.chunkLoader == null) {
+            return this.blankChunk;
         }
-        try
-        {
-            Chunk chunk = chunkLoader.loadChunk(worldObj, chunkX, chunkZ);
-            if(chunk != null)
-            {
-                chunk.lastSaveTime = worldObj.getWorldTime();
+        try {
+            Chunk chunk = this.chunkLoader.loadChunk(this.world, chunkPos.x, chunkPos.z);
+            if (chunk != null) {
+                chunk.lastSaveTime = this.world.getWorldTime();
             }
             return chunk;
+        } catch (Exception exception) {
+            LOGGER.error("Error loading chunk at X:{}, Z:{}", chunkPos.x, chunkPos.x, exception);
         }
-        catch(Exception exception)
-        {
-            LOGGER.error("Error loading chunk at X:{}, Z:{}", chunkX, chunkZ, exception);
-        }
-        return blankChunk;
-    }
-
-    private void saveChunk(Chunk chunk)
-    {
-
+        return this.blankChunk;
     }
 
     @Override
-    public void populate(IChunkProvider chunkProvider, int chunkX, int chunkZ)
-    {
+    public void populate(@NotNull ChunkPos chunkPos) {
 
     }
 
     @Override
-    public boolean saveChunks(boolean saveImmediately, ProgressListener progressUpdate)
-    {
+    public boolean saveChunks(boolean saveImmediately, @Nullable ProgressListener progressListener) {
         return false;
     }
 
     @Override
-    public boolean tick()
-    {
+    public boolean tick() {
         return false;
     }
 
     @Override
-    public void unloadAllChunks()
-    {
-        for (Chunk chunk : chunks) {
+    public void unloadAllChunks() {
+        for (Chunk chunk : this.chunks) {
             if (chunk != null) chunk.onUnload();
         }
-        Arrays.fill(chunks, null);
-        chunkGenerator = null;
-    	System.gc();
+        Arrays.fill(this.chunks, null);
+        this.chunkGenerator = null;
+        System.gc();
     }
 
     @Override
-    public boolean canSave()
-    {
+    public boolean canSave() {
         return false;
     }
 
     @Override
-    public String getInfoString()
-    {
-        return "ChunkCache: " + chunks.length;
-    }
-
-    public IChunkLoader getChunkLoader() {
-        return chunkLoader;
+    public @NotNull String getInfoString() {
+        return "ChunkCache: " + this.chunks.length;
     }
 }
diff --git a/util/seed-viewer/src/main/java/org/useless/seedviewer/bta/worldloader/ChunkLoader.java b/util/seed-viewer/src/main/java/org/useless/seedviewer/bta/worldloader/ChunkLoader.java
index 63a922170..7b257cfa7 100644
--- a/util/seed-viewer/src/main/java/org/useless/seedviewer/bta/worldloader/ChunkLoader.java
+++ b/util/seed-viewer/src/main/java/org/useless/seedviewer/bta/worldloader/ChunkLoader.java
@@ -12,34 +12,35 @@ import net.minecraft.core.world.chunk.ChunkLoaderLegacy;
 import net.minecraft.core.world.chunk.EmptyChunk;
 import net.minecraft.core.world.chunk.provider.IChunkProvider;
 import net.minecraft.core.world.chunk.reader.*;
+import net.minecraft.core.world.pos.ChunkPos;
 import net.minecraft.core.world.save.mcregion.RegionFileCache;
 import net.minecraft.core.world.type.WorldTypes;
-import org.useless.seedviewer.collections.ChunkLocation;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 import org.slf4j.Logger;
 
 import java.io.DataInputStream;
 import java.io.File;
 import java.io.IOException;
 import java.util.Arrays;
-import java.util.Map;
 
 public class ChunkLoader implements IChunkProvider {
     private static final Logger LOGGER = LogUtils.getLogger();
-    private final World dummyWorld;
-    private final Chunk empty;
+    private final @NotNull World dummyWorld;
+    private final @NotNull Chunk empty;
 
 
     private final File dimensionDir;
     public ChunkLoader(File worldFolder, int dimension) {
         this.dimensionDir = new File(worldFolder, "dimensions/" + dimension);
-        dummyWorld = new World();
-        dummyWorld.worldType = WorldTypes.OVERWORLD_EXTENDED;
-        dummyWorld.chunkProvider = this;
-        empty = new EmptyChunk(dummyWorld, 0, 0);
+        this.dummyWorld = new World();
+        this.dummyWorld.worldType = WorldTypes.OVERWORLD_EXTENDED;
+        this.dummyWorld.chunkProvider = this;
+        this.empty = new EmptyChunk(this.dummyWorld, 0, 0);
     }
 
-    public boolean chunkExists(ChunkLocation location) {
-        DataInputStream regionStream = RegionFileCache.getChunkInputStream(dimensionDir, location.x, location.z);
+    public boolean chunkExists(ChunkPos location) {
+        DataInputStream regionStream = RegionFileCache.getChunkInputStream(this.dimensionDir, location.x, location.z);
         CompoundTag tag;
         if(regionStream != null)
         {
@@ -57,8 +58,8 @@ public class ChunkLoader implements IChunkProvider {
         return tag.containsKey("Level");
     }
 
-    public Chunk loadChunk(ChunkLocation location) throws IOException {
-        DataInputStream regionStream = RegionFileCache.getChunkInputStream(dimensionDir, location.x, location.z);
+    public Chunk loadChunk(ChunkPos location) throws IOException {
+        DataInputStream regionStream = RegionFileCache.getChunkInputStream(this.dimensionDir, location.x, location.z);
         CompoundTag tag;
         if(regionStream != null)
         {
@@ -81,7 +82,7 @@ public class ChunkLoader implements IChunkProvider {
         ChunkReader reader = getChunkReaderByVersion(tag, version);
         int x = reader.getX();
         int z = reader.getZ();
-        Chunk chunk = new Chunk(dummyWorld, x, z);
+        Chunk chunk = new Chunk(this.dummyWorld, x, z);
         chunk.heightMap = reader.getHeightMap();
         chunk.averageBlockHeight = reader.getAverageBlockHeight();
         chunk.isTerrainPopulated = reader.getIsTerrainPopulated();
@@ -96,7 +97,7 @@ public class ChunkLoader implements IChunkProvider {
 
         if (chunk.heightMap == null) {
             chunk.heightMap = new short[256];
-            chunk.recalcHeightmap();
+            chunk.recalcHeightmapAndLightmap();
         }
 
         if (chunk.temperature == null || chunk.temperature.length == 0) {
@@ -129,36 +130,36 @@ public class ChunkLoader implements IChunkProvider {
     }
 
     @Override
-    public boolean isChunkLoaded(int chunkX, int chunkZ) {
+    public boolean isChunkLoaded(@NotNull ChunkPos chunkPos) {
         return false;
     }
 
     @Override
-    public Chunk provideChunk(int chunkX, int chunkZ) {
+    public @NotNull Chunk provideChunk(@NotNull ChunkPos chunkPos, boolean priority) {
         try {
-            return loadChunk(new ChunkLocation(chunkX, chunkZ));
+            return loadChunk(chunkPos);
         } catch (IOException e) {
-            return empty;
+            return this.empty;
         }
     }
 
     @Override
-    public Chunk prepareChunk(int chunkX, int chunkZ) {
-        return provideChunk(chunkX, chunkZ);
+    public @NotNull Chunk prepareChunk(@NotNull ChunkPos chunkPos, boolean priority) {
+        return provideChunk(chunkPos, true);
     }
 
     @Override
-    public void regenerateChunk(int chunkX, int chunkZ) {
+    public void regenerateChunk(@NotNull ChunkPos chunkPos) {
 
     }
 
     @Override
-    public void populate(IChunkProvider chunkProvider, int chunkX, int chunkZ) {
+    public void populate(@NotNull ChunkPos chunkPos) {
 
     }
 
     @Override
-    public boolean saveChunks(boolean saveImmediately, ProgressListener progressUpdate) {
+    public boolean saveChunks(boolean saveImmediately, @Nullable ProgressListener progressListener) {
         return false;
     }
 
@@ -173,7 +174,7 @@ public class ChunkLoader implements IChunkProvider {
     }
 
     @Override
-    public String getInfoString() {
+    public @NotNull String getInfoString() {
         return "";
     }
 
@@ -183,7 +184,7 @@ public class ChunkLoader implements IChunkProvider {
     }
 
     @Override
-    public void setCurrentChunkOver(int chunkX, int chunkZ) {
+    public void setCurrentChunkOver(@NotNull ChunkPos chunkPos) {
 
     }
 }
diff --git a/util/seed-viewer/src/main/java/org/useless/seedviewer/collections/BlockPos2D.java b/util/seed-viewer/src/main/java/org/useless/seedviewer/collections/BlockPos2D.java
deleted file mode 100644
index 20a2bba7b..000000000
--- a/util/seed-viewer/src/main/java/org/useless/seedviewer/collections/BlockPos2D.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package org.useless.seedviewer.collections;
-
-import java.util.Objects;
-
-public class BlockPos2D {
-    public final int x;
-    public final int z;
-
-    public BlockPos2D(int x, int z) {
-        this.x = x;
-        this.z = z;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-        BlockPos2D blockPos2D = (BlockPos2D) o;
-        return x == blockPos2D.x && z == blockPos2D.z;
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hash(x, z);
-    }
-
-    @Override
-    public String toString() {
-        return "BlockPos3D{" +
-            "x=" + x +
-            ", z=" + z +
-            '}';
-    }
-}
diff --git a/util/seed-viewer/src/main/java/org/useless/seedviewer/collections/BlockPos3D.java b/util/seed-viewer/src/main/java/org/useless/seedviewer/collections/BlockPos3D.java
deleted file mode 100644
index 3fcbff2f7..000000000
--- a/util/seed-viewer/src/main/java/org/useless/seedviewer/collections/BlockPos3D.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package org.useless.seedviewer.collections;
-
-import java.util.Objects;
-
-/**
- * Block coordinates of a position relative to the world
- */
-public final class BlockPos3D extends BlockPos2D {
-    public final int y;
-
-    public BlockPos3D(int x, int y, int z) {
-        super(x, z);
-        this.y = y;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-        BlockPos3D blockPos3D = (BlockPos3D) o;
-        return x == blockPos3D.x && y == blockPos3D.y && z == blockPos3D.z;
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hash(x, y, z);
-    }
-
-    @Override
-    public String toString() {
-        return "BlockPos3D{" +
-            "x=" + x +
-            ", y=" + y +
-            ", z=" + z +
-            '}';
-    }
-}
diff --git a/util/seed-viewer/src/main/java/org/useless/seedviewer/collections/ChunkLocation.java b/util/seed-viewer/src/main/java/org/useless/seedviewer/collections/ChunkLocation.java
deleted file mode 100644
index 373ae718c..000000000
--- a/util/seed-viewer/src/main/java/org/useless/seedviewer/collections/ChunkLocation.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package org.useless.seedviewer.collections;
-
-import java.util.Objects;
-
-/**
- * Chunk coordinates of a chunk in the world
- */
-public final class ChunkLocation {
-    public final int x;
-    public final int z;
-
-    public ChunkLocation(int x, int z) {
-        this.x = x;
-        this.z = z;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-        ChunkLocation that = (ChunkLocation) o;
-        return x == that.x && z == that.z;
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hash(x, z);
-    }
-
-    @Override
-    public String toString() {
-        return "ChunkLocation{" +
-            "x=" + x +
-            ", z=" + z +
-            '}';
-    }
-}
diff --git a/util/seed-viewer/src/main/java/org/useless/seedviewer/collections/ChunkPos2D.java b/util/seed-viewer/src/main/java/org/useless/seedviewer/collections/ChunkPos2D.java
deleted file mode 100644
index 1681a4c1c..000000000
--- a/util/seed-viewer/src/main/java/org/useless/seedviewer/collections/ChunkPos2D.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package org.useless.seedviewer.collections;
-
-import org.useless.seedviewer.data.ViewerChunk;
-
-import java.util.Objects;
-
-public class ChunkPos2D {
-    public final int x;
-    public final int z;
-
-    public ChunkPos2D(int x, int z) {
-        if (x < 0) {
-            throw new IllegalArgumentException("X must be between in range [0, " + ViewerChunk.CHUNK_SIZE_X + "]!");
-        }
-        if (x > ViewerChunk.CHUNK_SIZE_X) {
-            throw new IllegalArgumentException("X must be between in range [0, " + ViewerChunk.CHUNK_SIZE_X + "]!");
-        }
-        if (z < 0) {
-            throw new IllegalArgumentException("Z must be between in range [0, " + ViewerChunk.CHUNK_SIZE_Z + "]!");
-        }
-        if (z > ViewerChunk.CHUNK_SIZE_Z) {
-            throw new IllegalArgumentException("Z must be between in range [0, " + ViewerChunk.CHUNK_SIZE_Z + "]!");
-        }
-        this.x = x;
-        this.z = z;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-        ChunkPos2D that = (ChunkPos2D) o;
-        return x == that.x && z == that.z;
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hash(x, z);
-    }
-
-    @Override
-    public String toString() {
-        return "ChunkPos3D{" +
-            "x=" + x +
-            ", z=" + z +
-            '}';
-    }
-}
diff --git a/util/seed-viewer/src/main/java/org/useless/seedviewer/collections/ChunkPos3D.java b/util/seed-viewer/src/main/java/org/useless/seedviewer/collections/ChunkPos3D.java
deleted file mode 100644
index bac228140..000000000
--- a/util/seed-viewer/src/main/java/org/useless/seedviewer/collections/ChunkPos3D.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package org.useless.seedviewer.collections;
-
-import org.useless.seedviewer.data.ViewerChunk;
-
-import java.util.Objects;
-
-/**
- * Block coordinates of a position relative to a chunk
- */
-public final class ChunkPos3D extends ChunkPos2D {
-    public final int y;
-
-    public ChunkPos3D(int x, int y, int z) {
-        super(x, z);
-        if (y < 0) {
-            throw new IllegalArgumentException("Y must be between in range [0, " + ViewerChunk.CHUNK_SIZE_Y + "]!");
-        }
-        if (y > ViewerChunk.CHUNK_SIZE_Y) {
-            throw new IllegalArgumentException("Y must be between in range [0, " + ViewerChunk.CHUNK_SIZE_Y + "]!");
-        }
-        this.y = y;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-        ChunkPos3D that = (ChunkPos3D) o;
-        return x == that.x && y == that.y && z == that.z;
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hash(x, y, z);
-    }
-
-    @Override
-    public String toString() {
-        return "ChunkPos3D{" +
-            "x=" + x +
-            ", y=" + y +
-            ", z=" + z +
-            '}';
-    }
-}
diff --git a/util/seed-viewer/src/main/java/org/useless/seedviewer/data/ViewerChunk.java b/util/seed-viewer/src/main/java/org/useless/seedviewer/data/ViewerChunk.java
index 5ba550a6d..7ed9e6440 100644
--- a/util/seed-viewer/src/main/java/org/useless/seedviewer/data/ViewerChunk.java
+++ b/util/seed-viewer/src/main/java/org/useless/seedviewer/data/ViewerChunk.java
@@ -1,15 +1,14 @@
 package org.useless.seedviewer.data;
 
 import net.minecraft.core.world.chunk.ChunkSection;
-import org.useless.seedviewer.collections.ChunkPos2D;
-import org.useless.seedviewer.collections.ChunkPos3D;
+import net.minecraft.core.world.pos.ChunkTilePos;
 
 public interface ViewerChunk {
     int CHUNK_SIZE_X = net.minecraft.core.world.chunk.Chunk.CHUNK_SIZE_X;
     int CHUNK_SIZE_Y = net.minecraft.core.world.chunk.Chunk.CHUNK_SECTIONS * ChunkSection.SECTION_SIZE_Y;
     int CHUNK_SIZE_Z = net.minecraft.core.world.chunk.Chunk.CHUNK_SIZE_Z;
-    ViewerBiome getBiome(ChunkPos3D pos);
-    int getBlockColor(ChunkPos3D pos);
-    int getHeight(ChunkPos2D pos);
-    int getWaterDepth(ChunkPos2D pos);
+    ViewerBiome getBiome(ChunkTilePos pos);
+    int getBlockColor(ChunkTilePos pos);
+    int getHeight(ChunkTilePos pos);
+    int getWaterDepth(ChunkTilePos pos);
 }
diff --git a/util/seed-viewer/src/main/java/org/useless/seedviewer/gui/ChunkProvider.java b/util/seed-viewer/src/main/java/org/useless/seedviewer/gui/ChunkProvider.java
index 4df3aba89..c5ecf6a34 100644
--- a/util/seed-viewer/src/main/java/org/useless/seedviewer/gui/ChunkProvider.java
+++ b/util/seed-viewer/src/main/java/org/useless/seedviewer/gui/ChunkProvider.java
@@ -1,8 +1,8 @@
 package org.useless.seedviewer.gui;
 
-import org.useless.seedviewer.collections.ChunkLocation;
+import net.minecraft.core.world.pos.ChunkPos;
 import org.useless.seedviewer.data.ViewerChunk;
 
 public interface ChunkProvider {
-    ViewerChunk getChunk(ChunkLocation location);
+    ViewerChunk getChunk(ChunkPos location);
 }
diff --git a/util/seed-viewer/src/main/java/org/useless/seedviewer/gui/ChunkView.java b/util/seed-viewer/src/main/java/org/useless/seedviewer/gui/ChunkView.java
index d4a0bd9fc..9d7ab22b3 100644
--- a/util/seed-viewer/src/main/java/org/useless/seedviewer/gui/ChunkView.java
+++ b/util/seed-viewer/src/main/java/org/useless/seedviewer/gui/ChunkView.java
@@ -1,10 +1,9 @@
 package org.useless.seedviewer.gui;
 
 import com.mojang.logging.LogUtils;
+import net.minecraft.core.world.pos.ChunkPos;
+import net.minecraft.core.world.pos.ChunkTilePos;
 import org.slf4j.Logger;
-import org.useless.seedviewer.collections.ChunkLocation;
-import org.useless.seedviewer.collections.ChunkPos2D;
-import org.useless.seedviewer.collections.ChunkPos3D;
 import org.useless.seedviewer.data.ViewerBiome;
 import org.useless.seedviewer.data.ViewerChunk;
 import org.useless.seedviewer.gui.components.Viewport;
@@ -26,71 +25,71 @@ public class ChunkView {
     private final BufferedImage waterDepthMapImage = new BufferedImage(ViewerChunk.CHUNK_SIZE_X, ViewerChunk.CHUNK_SIZE_Z, BufferedImage.TYPE_INT_ARGB);
 
     private final Rectangle bounds;
-    private final ChunkLocation location;
+    private final ChunkPos location;
     private final ChunkProvider provider;
     private final Viewport viewport;
 
     public long lastSeenTime = System.currentTimeMillis();
 
-    private Future<?> loadTask;
+    private final Future<?> loadTask;
     private Future<?> processTask = null;
 
     private boolean hasInitialized = false;
     private volatile boolean hasPostProcessed = false;
 
-    public ChunkView(Viewport viewport, ChunkLocation location, ChunkProvider provider) {
+    public ChunkView(Viewport viewport, ChunkPos location, ChunkProvider provider) {
         this.viewport = viewport;
         this.location = location;
         this.provider = provider;
         this.bounds = new Rectangle(location.x * ViewerChunk.CHUNK_SIZE_X, location.z * ViewerChunk.CHUNK_SIZE_Z, ViewerChunk.CHUNK_SIZE_X, ViewerChunk.CHUNK_SIZE_Z);
 
-        loadTask = InitializerService.submit(
+        this.loadTask = InitializerService.submit(
             () -> {
                 try {
                     ViewerChunk chunk = provider.getChunk(location);
 
                     for (int x = 0; x < ViewerChunk.CHUNK_SIZE_X; x++) {
                         for (int z = 0; z < ViewerChunk.CHUNK_SIZE_Z; z++) {
-                            ChunkPos2D pos2D = new ChunkPos2D(x, z);
+                            ChunkTilePos pos2D = new ChunkTilePos(x, 0, z);
                             int h = chunk.getHeight(pos2D) - 1;
                             if (h < 0) h = 0;
-                            heightMapImage.setRGB(x, z, h & 0xFF);
+                            this.heightMapImage.setRGB(x, z, h & 0xFF);
 
                             int wd = chunk.getWaterDepth(pos2D) & 0xFF;
-                            waterDepthMapImage.setRGB(x, z, 0xFF_00_00_00 | wd << 16 | wd << 8 | wd);
+                            this.waterDepthMapImage.setRGB(x, z, 0xFF_00_00_00 | wd << 16 | wd << 8 | wd);
 
-                            ViewerBiome b = chunk.getBiome(new ChunkPos3D(x, h, z));
-                            biomeMapImage.setRGB(x, z, b.getColor() | 0x80_00_00_00);
+                            ViewerBiome b = chunk.getBiome(new ChunkTilePos(x, h, z));
+                            this.biomeMapImage.setRGB(x, z, b.getColor() | 0x80_00_00_00);
 
-                            terrainMapImage.setRGB(x, z, chunk.getBlockColor(new ChunkPos3D(x, h, z)));
+                            this.terrainMapImage.setRGB(x, z, chunk.getBlockColor(new ChunkTilePos(x, h, z)));
                         }
                     }
                 } catch (Exception e) {
                     LOGGER.error("Error when initializing chunk {}, {}", location.x, location.z, e);
                 }
                 finally {
-                    hasInitialized = true;
+                    this.hasInitialized = true;
                 }
             }
         );
     }
 
     public boolean hasInit() {
-        return hasInitialized;
+        return this.hasInitialized;
     }
 
     public boolean hasProcessed() {
-        return hasPostProcessed;
+        return this.hasPostProcessed;
     }
 
     public void process(ChunkView posZ) {
         if (hasProcessed()) return;
         synchronized (this) {
-            processTask = PostProcessorService.submit(() -> {
+            this.processTask = PostProcessorService.submit(() -> {
                 try {
                     for (int x = 0; x < ViewerChunk.CHUNK_SIZE_X; x++) {
                         for (int z = 0; z < ViewerChunk.CHUNK_SIZE_Z; z++) {
-                            int depth = waterDepthMapImage.getRGB(x, z) & 0xFF;
+                            int depth = this.waterDepthMapImage.getRGB(x, z) & 0xFF;
 
                             int shade;
                             if (depth == 0) {
@@ -98,9 +97,9 @@ public class ChunkView {
                                 if (z == 0) {
                                     lastHeight = posZ.getHeightMapImage().getRGB(x, z + 15) & 0xFF;
                                 } else {
-                                    lastHeight = heightMapImage.getRGB(x, z - 1) & 0xFF;
+                                    lastHeight = this.heightMapImage.getRGB(x, z - 1) & 0xFF;
                                 }
-                                int height = heightMapImage.getRGB(x, z) & 0xFF;
+                                int height = this.heightMapImage.getRGB(x, z) & 0xFF;
 
                                 if (height == lastHeight) {
                                     shade = 220;
@@ -122,49 +121,49 @@ public class ChunkView {
 
 
                             if (shade != 255) {
-                                final int current = terrainMapImage.getRGB(x, z) ;
+                                final int current = this.terrainMapImage.getRGB(x, z) ;
                                 final int a = (((current >> 24) & 0xFF));
                                 final int r = (((current >> 16) & 0xFF) * shade) / 0xFF;
                                 final int g = (((current >>  8) & 0xFF) * shade) / 0xFF;
                                 final int b = (((current      ) & 0xFF) * shade) / 0xFF;
-                                terrainMapImage.setRGB(x, z, (a << 24 | r << 16 | g << 8 | b));
+                                this.terrainMapImage.setRGB(x, z, (a << 24 | r << 16 | g << 8 | b));
                             }
                         }
                     }
                 } finally {
-                    hasPostProcessed = true;
-                    viewport.repaint();
+                    this.hasPostProcessed = true;
+                    this.viewport.repaint();
                 }
             });
         }
     }
 
-    public ChunkLocation getLocation() {
-        return location;
+    public ChunkPos getLocation() {
+        return this.location;
     }
 
     public BufferedImage getBiomeMapImage() {
-        return biomeMapImage;
+        return this.biomeMapImage;
     }
 
     public BufferedImage getTerrainMapImage() {
-        return terrainMapImage;
+        return this.terrainMapImage;
     }
 
     public BufferedImage getHeightMapImage() {
-        return heightMapImage;
+        return this.heightMapImage;
     }
 
     public Rectangle getWorldBounds() {
-        return bounds;
+        return this.bounds;
     }
 
     public void kill() {
-        if (processTask != null) {
-            processTask.cancel(true);
+        if (this.processTask != null) {
+            this.processTask.cancel(true);
         }
-        if (loadTask != null) {
-            loadTask.cancel(true);
+        if (this.loadTask != null) {
+            this.loadTask.cancel(true);
         }
     }
 }
diff --git a/util/seed-viewer/src/main/java/org/useless/seedviewer/gui/SeedViewer.java b/util/seed-viewer/src/main/java/org/useless/seedviewer/gui/SeedViewer.java
index 895be3f55..075973989 100644
--- a/util/seed-viewer/src/main/java/org/useless/seedviewer/gui/SeedViewer.java
+++ b/util/seed-viewer/src/main/java/org/useless/seedviewer/gui/SeedViewer.java
@@ -1,10 +1,10 @@
 package org.useless.seedviewer.gui;
 
 import com.mojang.logging.LogUtils;
+import net.minecraft.core.world.pos.ChunkPos;
 import org.jetbrains.annotations.NotNull;
 import org.slf4j.Logger;
 import org.useless.seedviewer.SeedViewerMain;
-import org.useless.seedviewer.collections.ChunkLocation;
 import org.useless.seedviewer.gui.components.InfoPanel;
 import org.useless.seedviewer.gui.components.InputPanel;
 import org.useless.seedviewer.gui.components.Viewport;
@@ -41,9 +41,9 @@ public class SeedViewer extends JFrame {
         LOGGER.info("Starting Seed Viewer!");
         this.launchProperties = properties;
 
-        viewport = new Viewport(this);
-        inputPanel = new InputPanel(this);
-        infoPanel = new InfoPanel(this);
+        this.viewport = new Viewport(this);
+        this.inputPanel = new InputPanel(this);
+        this.infoPanel = new InfoPanel(this);
 
 
         initFrame();
@@ -88,8 +88,8 @@ public class SeedViewer extends JFrame {
         this.addComponentListener(new ComponentAdapter() {
             @Override
             public void componentResized(ComponentEvent e) {
-                needsResize = true;
-                viewport.repaint();
+                SeedViewer.this.needsResize = true;
+                SeedViewer.this.viewport.repaint();
             }
         });
         this.setLayout(null); // using no layout managers
@@ -114,23 +114,23 @@ public class SeedViewer extends JFrame {
     public void addComponents() {
         // State labels
         LOGGER.info("Creating Labels");
-        infoPanel.setup();
-        this.add(infoPanel);
+        this.infoPanel.setup();
+        this.add(this.infoPanel);
 
         // Checkboxes
         LOGGER.info("Creating Check boxes");
-        inputPanel.setup();
-        this.add(inputPanel);
+        this.inputPanel.setup();
+        this.add(this.inputPanel);
 
         LOGGER.info("Creating Image frame");
-        viewport.setup();
-        this.add(viewport);
+        this.viewport.setup();
+        this.add(this.viewport);
     }
 
     public void initComponents() {
-        if (!needsResize) return;
+        if (!this.needsResize) return;
         LOGGER.info("Initializing Components");
-        needsResize = false;
+        this.needsResize = false;
         int screenWidth = this.getContentPane().getWidth();
         int screenHeight = this.getContentPane().getHeight();
 
@@ -139,8 +139,8 @@ public class SeedViewer extends JFrame {
             if (inWidth < 100) inWidth = 100;
             if (inWidth > 200) inWidth = 200;
             int inHeight = screenHeight - BEZEL * 2;
-            inputPanel.onResize(new Rectangle(0, BEZEL, inWidth, inHeight/2));
-            inputPanel.setVisible(true);
+            this.inputPanel.onResize(new Rectangle(0, BEZEL, inWidth, inHeight/2));
+            this.inputPanel.setVisible(true);
         }
 
         {
@@ -148,14 +148,14 @@ public class SeedViewer extends JFrame {
             if (inWidth < 100) inWidth = 100;
             if (inWidth > 200) inWidth = 200;
             int inHeight = screenHeight - BEZEL * 2;
-            infoPanel.onResize(new Rectangle(0, inputPanel.getY() + inputPanel.getHeight() - 1, inWidth, inHeight/2));
-            infoPanel.setVisible(true);
+            this.infoPanel.onResize(new Rectangle(0, this.inputPanel.getY() + this.inputPanel.getHeight() - 1, inWidth, inHeight/2));
+            this.infoPanel.setVisible(true);
         }
 
         {
-            int viewWidth = screenWidth - (BEZEL * 2) - (inputPanel.isVisible() ? inputPanel.getWidth() : 0);
-            int viewX = BEZEL + (inputPanel.isVisible() ? inputPanel.getWidth() : 0);
-            viewport.onResize(
+            int viewWidth = screenWidth - (BEZEL * 2) - (this.inputPanel.isVisible() ? this.inputPanel.getWidth() : 0);
+            int viewX = BEZEL + (this.inputPanel.isVisible() ? this.inputPanel.getWidth() : 0);
+            this.viewport.onResize(
                 new Rectangle(
                     viewX,
                     BEZEL,
@@ -165,7 +165,7 @@ public class SeedViewer extends JFrame {
     }
 
     public void queueResize() {
-        needsResize = true;
+        this.needsResize = true;
     }
 
     public void forceResize() {
@@ -175,10 +175,10 @@ public class SeedViewer extends JFrame {
 
     public synchronized void tick() {
         initComponents();
-        viewport.tick();
+        this.viewport.tick();
     }
 
-    public static boolean isSlimeChunk(long worldSeed, @NotNull ChunkLocation location) {
+    public static boolean isSlimeChunk(long worldSeed, @NotNull ChunkPos location) {
         long slimeXOR = 0x3AD8025FL;
         Random slimerandom = new Random(worldSeed + (location.x * location.x * 0x4c1906L) + (location.x * 0x5ac0dbL) + (location.z * location.z * 0x4307a7L) + (location.z * 0x5f24fL) ^ slimeXOR);
         return slimerandom.nextInt(10) == 0;
diff --git a/util/seed-viewer/src/main/java/org/useless/seedviewer/gui/components/InfoPanel.java b/util/seed-viewer/src/main/java/org/useless/seedviewer/gui/components/InfoPanel.java
index 30a7b6bdf..dd0a61738 100644
--- a/util/seed-viewer/src/main/java/org/useless/seedviewer/gui/components/InfoPanel.java
+++ b/util/seed-viewer/src/main/java/org/useless/seedviewer/gui/components/InfoPanel.java
@@ -39,81 +39,81 @@ public class InfoPanel extends JPanel {
     public void setup() {
         final int textHeight = 15;
 
-        titleLabel = new JLabel("Information: ");
-        titleLabel.setSize(0, textHeight);
-        this.add(titleLabel);
+        this.titleLabel = new JLabel("Information: ");
+        this.titleLabel.setSize(0, textHeight);
+        this.add(this.titleLabel);
 
         try {
             Class.forName("net.minecraft.core.Global");
-            btaLabel = new JLabel("BTA Version: " + Global.VERSION);
+            this.btaLabel = new JLabel("BTA Version: " + Global.VERSION);
         } catch (ClassNotFoundException e) {
-            btaLabel = new JLabel("BTA Version: Missing!");
+            this.btaLabel = new JLabel("BTA Version: Missing!");
         }
-        add(btaLabel);
-        resizeList.add(btaLabel);
-
-        seedLabel = new JLabel("Seed: " + seedViewer.viewport.seed);
-        seedLabel.setSize(0, textHeight);
-        seedViewer.viewport.seed.addChangeListener(newValue -> seedLabel.setText("Seed: " + seedViewer.viewport.seed));
-
-        viewLabel = new JLabel(String.format("View: X:%s, Z:%s", seedViewer.viewport.viewX.get(), -seedViewer.viewport.viewZ.get()));
-        viewLabel.setSize(0, textHeight);
-        seedViewer.viewport.viewX.addChangeListener(newValue -> viewLabel.setText(String.format("View: X:%.2f, Z:%.2f", seedViewer.viewport.viewX.get(), -seedViewer.viewport.viewZ.get())));
-        seedViewer.viewport.viewX.addChangeListener(newValue -> {
-            ViewerBiome b = seedViewer.viewport.getHoveredBiome();
+        add(this.btaLabel);
+        this.resizeList.add(this.btaLabel);
+
+        this.seedLabel = new JLabel("Seed: " + this.seedViewer.viewport.seed);
+        this.seedLabel.setSize(0, textHeight);
+        this.seedViewer.viewport.seed.addChangeListener(newValue -> this.seedLabel.setText("Seed: " + this.seedViewer.viewport.seed));
+
+        this.viewLabel = new JLabel(String.format("View: X:%s, Z:%s", this.seedViewer.viewport.viewX.get(), -this.seedViewer.viewport.viewZ.get()));
+        this.viewLabel.setSize(0, textHeight);
+        this.seedViewer.viewport.viewX.addChangeListener(newValue -> this.viewLabel.setText(String.format("View: X:%.2f, Z:%.2f", this.seedViewer.viewport.viewX.get(), -this.seedViewer.viewport.viewZ.get())));
+        this.seedViewer.viewport.viewX.addChangeListener(newValue -> {
+            ViewerBiome b = this.seedViewer.viewport.getHoveredBiome();
             if (b == null) {
-                biomeLabel.setText("Biome: null");
+                this.biomeLabel.setText("Biome: null");
             } else {
-                biomeLabel.setText(String.format("Biome: %s", b.getName()));
+                this.biomeLabel.setText(String.format("Biome: %s", b.getName()));
             }
         });
-        seedViewer.viewport.viewZ.addChangeListener(newValue -> viewLabel.setText(String.format("View: X:%.2f, Z:%.2f", seedViewer.viewport.viewX.get(), -seedViewer.viewport.viewZ.get())));
-        seedViewer.viewport.viewZ.addChangeListener(newValue -> {
-            ViewerBiome b = seedViewer.viewport.getHoveredBiome();
+        this.seedViewer.viewport.viewZ.addChangeListener(newValue -> this.viewLabel.setText(String.format("View: X:%.2f, Z:%.2f", this.seedViewer.viewport.viewX.get(), -this.seedViewer.viewport.viewZ.get())));
+        this.seedViewer.viewport.viewZ.addChangeListener(newValue -> {
+            ViewerBiome b = this.seedViewer.viewport.getHoveredBiome();
             if (b == null) {
-                biomeLabel.setText("Biome: null");
+                this.biomeLabel.setText("Biome: null");
             } else {
-                biomeLabel.setText(String.format("Biome: %s", b.getName()));
+                this.biomeLabel.setText(String.format("Biome: %s", b.getName()));
             }
         });
 
-        zoomLabel = new JLabel("Zoom: " + seedViewer.viewport.zoom);
-        zoomLabel.setSize(0, textHeight);
-        seedViewer.viewport.zoom.addChangeListener(newValue -> zoomLabel.setText("Zoom: " + seedViewer.viewport.zoom));
+        this.zoomLabel = new JLabel("Zoom: " + this.seedViewer.viewport.zoom);
+        this.zoomLabel.setSize(0, textHeight);
+        this.seedViewer.viewport.zoom.addChangeListener(newValue -> this.zoomLabel.setText("Zoom: " + this.seedViewer.viewport.zoom));
 
-        biomeLabel = new JLabel("Biome: None");
-        biomeLabel.setSize(0, textHeight);
+        this.biomeLabel = new JLabel("Biome: None");
+        this.biomeLabel.setSize(0, textHeight);
 
-        worldNameLabel = new JLabel();
-        worldNameLabel.setSize(0, textHeight);
-        seedViewer.viewport.world.addChangeListener(newValue -> worldNameLabel.setText("World: " + (seedViewer.viewport.world.get() == null ? "null" : seedViewer.viewport.world.get().getName())));
-        seedViewer.viewport.world.addChangeListener(newValue -> {
+        this.worldNameLabel = new JLabel();
+        this.worldNameLabel.setSize(0, textHeight);
+        this.seedViewer.viewport.world.addChangeListener(newValue -> this.worldNameLabel.setText("World: " + (this.seedViewer.viewport.world.get() == null ? "null" : this.seedViewer.viewport.world.get().getName())));
+        this.seedViewer.viewport.world.addChangeListener(newValue -> {
             if (newValue != null) {
                 onWorldOpen();
-                seedViewer.queueResize();
+                this.seedViewer.queueResize();
             } else {
                 onWorldClose();
-                seedViewer.queueResize();
+                this.seedViewer.queueResize();
             }
         });
 
-        worldSeedLabel = new JLabel();
-        worldSeedLabel.setSize(0, textHeight);
-        seedViewer.viewport.world.addChangeListener(newValue -> worldSeedLabel.setText("Seed: " + (seedViewer.viewport.world.get() == null ? "null" : seedViewer.viewport.world.get().getSeed())));
+        this.worldSeedLabel = new JLabel();
+        this.worldSeedLabel.setSize(0, textHeight);
+        this.seedViewer.viewport.world.addChangeListener(newValue -> this.worldSeedLabel.setText("Seed: " + (this.seedViewer.viewport.world.get() == null ? "null" : this.seedViewer.viewport.world.get().getSeed())));
 
-        worldPlayedLabel = new JLabel();
-        worldPlayedLabel.setSize(0, textHeight);
-        seedViewer.viewport.world.addChangeListener(newValue -> worldPlayedLabel.setText("Last Played: " + (seedViewer.viewport.world.get() == null ? "?" : DateFormat.getDateTimeInstance().format(new Date(seedViewer.viewport.world.get().getLastPlayed())))));
+        this.worldPlayedLabel = new JLabel();
+        this.worldPlayedLabel.setSize(0, textHeight);
+        this.seedViewer.viewport.world.addChangeListener(newValue -> this.worldPlayedLabel.setText("Last Played: " + (this.seedViewer.viewport.world.get() == null ? "?" : DateFormat.getDateTimeInstance().format(new Date(this.seedViewer.viewport.world.get().getLastPlayed())))));
 
-        addManaged(seedLabel);
-        addManaged(viewLabel);
-        addManaged(zoomLabel);
-        addManaged(biomeLabel);
-        addManaged(worldNameLabel);
-        addManaged(worldSeedLabel);
-        addManaged(worldPlayedLabel);
+        addManaged(this.seedLabel);
+        addManaged(this.viewLabel);
+        addManaged(this.zoomLabel);
+        addManaged(this.biomeLabel);
+        addManaged(this.worldNameLabel);
+        addManaged(this.worldSeedLabel);
+        addManaged(this.worldPlayedLabel);
 
-        if (seedViewer.viewport.world.get() == null) {
+        if (this.seedViewer.viewport.world.get() == null) {
             onWorldClose();
         } else {
             onWorldOpen();
@@ -122,31 +122,31 @@ public class InfoPanel extends JPanel {
 
     public void addManaged(Component c) {
         add(c);
-        resizeList.add(c);
+        this.resizeList.add(c);
     }
 
     public void onWorldOpen() {
-        worldNameLabel.setEnabled(true);
-        worldNameLabel.setVisible(true);
-        worldSeedLabel.setEnabled(true);
-        worldSeedLabel.setVisible(true);
-        worldPlayedLabel.setEnabled(true);
-        worldPlayedLabel.setVisible(true);
-
-        seedLabel.setEnabled(false);
-        seedLabel.setVisible(false);
+        this.worldNameLabel.setEnabled(true);
+        this.worldNameLabel.setVisible(true);
+        this.worldSeedLabel.setEnabled(true);
+        this.worldSeedLabel.setVisible(true);
+        this.worldPlayedLabel.setEnabled(true);
+        this.worldPlayedLabel.setVisible(true);
+
+        this.seedLabel.setEnabled(false);
+        this.seedLabel.setVisible(false);
     }
 
     public void onWorldClose() {
-        worldNameLabel.setEnabled(false);
-        worldNameLabel.setVisible(false);
-        worldSeedLabel.setEnabled(false);
-        worldSeedLabel.setVisible(false);
-        worldPlayedLabel.setEnabled(false);
-        worldPlayedLabel.setVisible(false);
-
-        seedLabel.setEnabled(true);
-        seedLabel.setVisible(true);
+        this.worldNameLabel.setEnabled(false);
+        this.worldNameLabel.setVisible(false);
+        this.worldSeedLabel.setEnabled(false);
+        this.worldSeedLabel.setVisible(false);
+        this.worldPlayedLabel.setEnabled(false);
+        this.worldPlayedLabel.setVisible(false);
+
+        this.seedLabel.setEnabled(true);
+        this.seedLabel.setVisible(true);
     }
 
     public void onResize(Rectangle newDimensions) {
@@ -154,10 +154,10 @@ public class InfoPanel extends JPanel {
 
         final int edgePad = 5;
         final int elementPad = 2;
-        titleLabel.setBounds(edgePad, edgePad, newDimensions.width - edgePad * 2, titleLabel.getHeight());
+        this.titleLabel.setBounds(edgePad, edgePad, newDimensions.width - edgePad * 2, this.titleLabel.getHeight());
 
-        int lastY = titleLabel.getY() + titleLabel.getHeight() + edgePad * 2;
-        for (Component c : resizeList) {
+        int lastY = this.titleLabel.getY() + this.titleLabel.getHeight() + edgePad * 2;
+        for (Component c : this.resizeList) {
             if (!c.isVisible()) continue;
             c.setBounds(edgePad, lastY, newDimensions.width - edgePad * 2, c.getHeight());
             lastY += c.getHeight() + elementPad;
diff --git a/util/seed-viewer/src/main/java/org/useless/seedviewer/gui/components/InputPanel.java b/util/seed-viewer/src/main/java/org/useless/seedviewer/gui/components/InputPanel.java
index 7d461c6cd..ad0befb86 100644
--- a/util/seed-viewer/src/main/java/org/useless/seedviewer/gui/components/InputPanel.java
+++ b/util/seed-viewer/src/main/java/org/useless/seedviewer/gui/components/InputPanel.java
@@ -51,67 +51,67 @@ public class InputPanel extends JPanel {
         final int textFieldHeight = 30;
         final int button = 30;
 
-        titleLabel = new JLabel("User Controls: ");
-        titleLabel.setSize(0, textHeight);
-        this.add(titleLabel);
-
-        slimeChunksBox = new JCheckBox("Slime Chunks");
-        slimeChunksBox.setSize(0, boxHeight);
-        slimeChunksBox.setSelected(seedViewer.viewport.showSlimeChunks.get());
-        slimeChunksBox.addChangeListener(e -> seedViewer.viewport.showSlimeChunks.set(slimeChunksBox.isSelected()));
-        slimeChunksBox.addChangeListener(e -> seedViewer.viewport.repaint());
-
-        showBordersBox = new JCheckBox("Chunk Borders");
-        showBordersBox.setSize(0, boxHeight);
-        showBordersBox.setSelected(seedViewer.viewport.showChunkBorders.get());
-        showBordersBox.addChangeListener(e -> seedViewer.viewport.showChunkBorders.set(showBordersBox.isSelected()));
-        showBordersBox.addChangeListener(e -> seedViewer.viewport.repaint());
-
-        showBiomesBox = new JCheckBox("Show Biomes");
-        showBiomesBox.setSize(0, boxHeight);
-        showBiomesBox.setSelected(seedViewer.viewport.showBiomes.get());
-        showBiomesBox.addChangeListener(e -> seedViewer.viewport.showBiomes.set(showBiomesBox.isSelected()));
-        showBiomesBox.addChangeListener(e -> seedViewer.viewport.repaint());
-
-        showTerrainBox = new JCheckBox("Show Terrain");
-        showTerrainBox.setSize(0, boxHeight);
-        showTerrainBox.setSelected(seedViewer.viewport.showTerrain.get());
-        showTerrainBox.addChangeListener(e -> seedViewer.viewport.showTerrain.set(showTerrainBox.isSelected()));
-        showTerrainBox.addChangeListener(e -> seedViewer.viewport.repaint());
-
-        showCrosshairBox = new JCheckBox("Enable Cross-hair");
-        showCrosshairBox.setSize(0, boxHeight);
-        showCrosshairBox.setSelected(seedViewer.viewport.showCrosshair.get());
-        showCrosshairBox.addChangeListener(e -> seedViewer.viewport.showCrosshair.set(showCrosshairBox.isSelected()));
-        showCrosshairBox.addChangeListener(e -> seedViewer.viewport.repaint());
-
-        addManaged(slimeChunksBox);
-        addManaged(showBordersBox);
-        addManaged(showBiomesBox);
-        addManaged(showTerrainBox);
-        addManaged(showCrosshairBox);
-
-        seedInputBox = new JTextField(seedViewer.viewport.seed.toString());
-        seedInputBox.setSize(0, textFieldHeight);
-        seedInputBox.addActionListener(new AbstractAction() {
+        this.titleLabel = new JLabel("User Controls: ");
+        this.titleLabel.setSize(0, textHeight);
+        this.add(this.titleLabel);
+
+        this.slimeChunksBox = new JCheckBox("Slime Chunks");
+        this.slimeChunksBox.setSize(0, boxHeight);
+        this.slimeChunksBox.setSelected(this.seedViewer.viewport.showSlimeChunks.get());
+        this.slimeChunksBox.addChangeListener(e -> this.seedViewer.viewport.showSlimeChunks.set(this.slimeChunksBox.isSelected()));
+        this.slimeChunksBox.addChangeListener(e -> this.seedViewer.viewport.repaint());
+
+        this.showBordersBox = new JCheckBox("Chunk Borders");
+        this.showBordersBox.setSize(0, boxHeight);
+        this.showBordersBox.setSelected(this.seedViewer.viewport.showChunkBorders.get());
+        this.showBordersBox.addChangeListener(e -> this.seedViewer.viewport.showChunkBorders.set(this.showBordersBox.isSelected()));
+        this.showBordersBox.addChangeListener(e -> this.seedViewer.viewport.repaint());
+
+        this.showBiomesBox = new JCheckBox("Show Biomes");
+        this.showBiomesBox.setSize(0, boxHeight);
+        this.showBiomesBox.setSelected(this.seedViewer.viewport.showBiomes.get());
+        this.showBiomesBox.addChangeListener(e -> this.seedViewer.viewport.showBiomes.set(this.showBiomesBox.isSelected()));
+        this.showBiomesBox.addChangeListener(e -> this.seedViewer.viewport.repaint());
+
+        this.showTerrainBox = new JCheckBox("Show Terrain");
+        this.showTerrainBox.setSize(0, boxHeight);
+        this.showTerrainBox.setSelected(this.seedViewer.viewport.showTerrain.get());
+        this.showTerrainBox.addChangeListener(e -> this.seedViewer.viewport.showTerrain.set(this.showTerrainBox.isSelected()));
+        this.showTerrainBox.addChangeListener(e -> this.seedViewer.viewport.repaint());
+
+        this.showCrosshairBox = new JCheckBox("Enable Cross-hair");
+        this.showCrosshairBox.setSize(0, boxHeight);
+        this.showCrosshairBox.setSelected(this.seedViewer.viewport.showCrosshair.get());
+        this.showCrosshairBox.addChangeListener(e -> this.seedViewer.viewport.showCrosshair.set(this.showCrosshairBox.isSelected()));
+        this.showCrosshairBox.addChangeListener(e -> this.seedViewer.viewport.repaint());
+
+        addManaged(this.slimeChunksBox);
+        addManaged(this.showBordersBox);
+        addManaged(this.showBiomesBox);
+        addManaged(this.showTerrainBox);
+        addManaged(this.showCrosshairBox);
+
+        this.seedInputBox = new JTextField(this.seedViewer.viewport.seed.toString());
+        this.seedInputBox.setSize(0, textFieldHeight);
+        this.seedInputBox.addActionListener(new AbstractAction() {
             @Override
             public void actionPerformed(ActionEvent e) {
                 long boxSeed;
                 try {
-                    boxSeed = Long.parseLong(seedInputBox.getText());
+                    boxSeed = Long.parseLong(InputPanel.this.seedInputBox.getText());
                 } catch (NumberFormatException exception) {
-                    boxSeed = seedInputBox.getText().hashCode();
+                    boxSeed = InputPanel.this.seedInputBox.getText().hashCode();
                 }
-                if (boxSeed != seedViewer.viewport.seed.get()) {
-                    seedViewer.viewport.setSeed(boxSeed);
+                if (boxSeed != InputPanel.this.seedViewer.viewport.seed.get()) {
+                    InputPanel.this.seedViewer.viewport.setSeed(boxSeed);
                 }
             }
         });
-        addManaged(seedInputBox);
+        addManaged(this.seedInputBox);
 
-        screenshot = new JButton("Save Screenshot");
-        screenshot.setSize(0, button);
-        screenshot.addActionListener(new AbstractAction() {
+        this.screenshot = new JButton("Save Screenshot");
+        this.screenshot.setSize(0, button);
+        this.screenshot.addActionListener(new AbstractAction() {
             @Override
             public void actionPerformed(ActionEvent e) {
                 final File screenShotFolder = new File(Global.accessor.getMinecraftDir(), "screenshots");
@@ -134,14 +134,14 @@ public class InputPanel extends JPanel {
 
                 screenShotSelect.setAcceptAllFileFilterUsed(true);
 
-                int result = screenShotSelect.showOpenDialog(seedViewer);
+                int result = screenShotSelect.showOpenDialog(InputPanel.this.seedViewer);
                 if (result == JFileChooser.APPROVE_OPTION) {
                     File destFile = screenShotSelect.getSelectedFile();
                     LOGGER.info("Selected file: {}", destFile.getAbsolutePath());
 
-                    BufferedImage viewportImage = new BufferedImage(seedViewer.viewport.getWidth(), seedViewer.viewport.getHeight(), BufferedImage.TYPE_INT_ARGB);
+                    BufferedImage viewportImage = new BufferedImage(InputPanel.this.seedViewer.viewport.getWidth(), InputPanel.this.seedViewer.viewport.getHeight(), BufferedImage.TYPE_INT_ARGB);
                     Graphics g = viewportImage.getGraphics();
-                    seedViewer.viewport.paintToGraphics(g);
+                    InputPanel.this.seedViewer.viewport.paintToGraphics(g);
                     g.dispose();
 
                     LOGGER.info("Attempting to save screenshot to '{}'!", destFile);
@@ -156,11 +156,11 @@ public class InputPanel extends JPanel {
                 }
             }
         });
-        addManaged(screenshot);
+        addManaged(this.screenshot);
 
-        openWorld = new JButton("Open World");
-        openWorld.setSize(0, button);
-        openWorld.addActionListener(new AbstractAction() {
+        this.openWorld = new JButton("Open World");
+        this.openWorld.setSize(0, button);
+        this.openWorld.addActionListener(new AbstractAction() {
             @Override
             public void actionPerformed(ActionEvent e) {
                 JFileChooser worldSelector = new JFileChooser(new File(Global.accessor.getMinecraftDir(), "saves/"));
@@ -169,39 +169,39 @@ public class InputPanel extends JPanel {
                 worldSelector.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
                 worldSelector.setAcceptAllFileFilterUsed(false);
 
-                int result = worldSelector.showOpenDialog(seedViewer);
+                int result = worldSelector.showOpenDialog(InputPanel.this.seedViewer);
                 if (result == JFileChooser.APPROVE_OPTION) {
                     File selectedFile = worldSelector.getSelectedFile();
                     LOGGER.info("Selected file: {}", selectedFile.getAbsolutePath());
-                    seedViewer.viewport.setWorld(selectedFile);
+                    InputPanel.this.seedViewer.viewport.setWorld(selectedFile);
 
                 } else {
-                    seedViewer.viewport.setWorld(null);
+                    InputPanel.this.seedViewer.viewport.setWorld(null);
                 }
             }
         });
-        seedViewer.viewport.world.addChangeListener(newValue -> {
+        this.seedViewer.viewport.world.addChangeListener(newValue -> {
             if (newValue != null) {
                 onWorldOpen();
-                seedViewer.queueResize();
+                this.seedViewer.queueResize();
             } else {
                 onWorldClose();
-                seedViewer.queueResize();
+                this.seedViewer.queueResize();
             }
         });
-        addManaged(openWorld);
+        addManaged(this.openWorld);
 
-        closeWorld = new JButton("Close World");
-        closeWorld.setSize(0, button);
-        closeWorld.addActionListener(new AbstractAction() {
+        this.closeWorld = new JButton("Close World");
+        this.closeWorld.setSize(0, button);
+        this.closeWorld.addActionListener(new AbstractAction() {
             @Override
             public void actionPerformed(ActionEvent e) {
-                seedViewer.viewport.setWorld(null);
+                InputPanel.this.seedViewer.viewport.setWorld(null);
             }
         });
-        addManaged(closeWorld);
+        addManaged(this.closeWorld);
 
-        if (seedViewer.viewport.world.get() == null) {
+        if (this.seedViewer.viewport.world.get() == null) {
             onWorldClose();
         } else {
             onWorldOpen();
@@ -209,28 +209,28 @@ public class InputPanel extends JPanel {
     }
 
     public void onWorldOpen() {
-        seedInputBox.setEnabled(false);
-        seedInputBox.setVisible(false);
+        this.seedInputBox.setEnabled(false);
+        this.seedInputBox.setVisible(false);
 
-        closeWorld.setEnabled(true);
-        closeWorld.setVisible(true);
-        showTerrainBox.setEnabled(true);
-        showTerrainBox.setVisible(true);
+        this.closeWorld.setEnabled(true);
+        this.closeWorld.setVisible(true);
+        this.showTerrainBox.setEnabled(true);
+        this.showTerrainBox.setVisible(true);
     }
 
     public void onWorldClose() {
-        seedInputBox.setEnabled(true);
-        seedInputBox.setVisible(true);
+        this.seedInputBox.setEnabled(true);
+        this.seedInputBox.setVisible(true);
 
-        closeWorld.setEnabled(false);
-        closeWorld.setVisible(false);
-        showTerrainBox.setEnabled(false);
-        showTerrainBox.setVisible(false);
+        this.closeWorld.setEnabled(false);
+        this.closeWorld.setVisible(false);
+        this.showTerrainBox.setEnabled(false);
+        this.showTerrainBox.setVisible(false);
     }
 
     public void addManaged(Component c) {
         add(c);
-        resizeList.add(c);
+        this.resizeList.add(c);
     }
 
     public void onResize(Rectangle newDimensions) {
@@ -238,10 +238,10 @@ public class InputPanel extends JPanel {
 
         final int edgePad = 5;
         final int elementPad = 2;
-        titleLabel.setBounds(edgePad, edgePad, newDimensions.width - edgePad * 2, titleLabel.getHeight());
+        this.titleLabel.setBounds(edgePad, edgePad, newDimensions.width - edgePad * 2, this.titleLabel.getHeight());
 
-        int lastY = titleLabel.getY() + titleLabel.getHeight() + edgePad * 2;
-        for (Component c : resizeList) {
+        int lastY = this.titleLabel.getY() + this.titleLabel.getHeight() + edgePad * 2;
+        for (Component c : this.resizeList) {
             if (!c.isVisible()) continue;
             c.setBounds(edgePad, lastY, newDimensions.width - edgePad * 2, c.getHeight());
             lastY += c.getHeight() + elementPad;
diff --git a/util/seed-viewer/src/main/java/org/useless/seedviewer/gui/components/Viewport.java b/util/seed-viewer/src/main/java/org/useless/seedviewer/gui/components/Viewport.java
index 89ef13929..9805540c4 100644
--- a/util/seed-viewer/src/main/java/org/useless/seedviewer/gui/components/Viewport.java
+++ b/util/seed-viewer/src/main/java/org/useless/seedviewer/gui/components/Viewport.java
@@ -1,12 +1,11 @@
 package org.useless.seedviewer.gui.components;
 
 import com.mojang.logging.LogUtils;
+import net.minecraft.core.world.pos.ChunkPos;
+import net.minecraft.core.world.pos.ChunkTilePos;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 import org.useless.seedviewer.bta.BTAWorld;
-import org.useless.seedviewer.collections.ChunkLocation;
-import org.useless.seedviewer.collections.ChunkPos2D;
-import org.useless.seedviewer.collections.ChunkPos3D;
 import org.useless.seedviewer.collections.ObjectWrapper;
 import org.useless.seedviewer.data.ViewerBiome;
 import org.useless.seedviewer.data.ViewerChunk;
@@ -48,7 +47,7 @@ public class Viewport extends JLabel {
     public static final float ZOOM_MIN = 1f;
     public static final float ZOOM_MAX = 16f;
 
-    private final Map<ChunkLocation, ChunkView> chunkViewMap = new HashMap<>();
+    private final Map<ChunkPos, ChunkView> chunkViewMap = new HashMap<>();
     private final Set<ChunkView> chunksPendingPostProcess = new HashSet<>();
     private final BufferedImage slimeVignette;
 
@@ -84,7 +83,7 @@ public class Viewport extends JLabel {
         } catch (IOException e) {
             LOGGER.error("Failed to load slime vignette!");
         }
-        slimeVignette = _vignette;
+        this.slimeVignette = _vignette;
 
         try {
             setSeed(Long.parseLong(seedViewer.launchProperties.getProperty("seed", "100")));
@@ -103,17 +102,17 @@ public class Viewport extends JLabel {
             @Override
             public void mousePressed(MouseEvent e) {
                 if (e.getButton() == MouseEvent.BUTTON1) {
-                    lastLeftClickPoint = e.getPoint();
+                    Viewport.this.lastLeftClickPoint = e.getPoint();
                 }
             }
         });
         addMouseMotionListener(new MouseMotionAdapter() {
             @Override
             public void mouseDragged(MouseEvent e) {
-                if (lastLeftClickPoint != null) {
-                    int dx = e.getX() - lastLeftClickPoint.x;
-                    int dy = e.getY() - lastLeftClickPoint.y;
-                    lastLeftClickPoint = e.getPoint();
+                if (Viewport.this.lastLeftClickPoint != null) {
+                    int dx = e.getX() - Viewport.this.lastLeftClickPoint.x;
+                    int dy = e.getY() - Viewport.this.lastLeftClickPoint.y;
+                    Viewport.this.lastLeftClickPoint = e.getPoint();
 
                     offsetView(-dx, dy);
                 }
@@ -130,8 +129,8 @@ public class Viewport extends JLabel {
     public synchronized void tick() {
         Rectangle viewportBounds = getViewportBounds();
         Rectangle unloadBounds = new Rectangle(viewportBounds.x - VIEWPORT_UNLOAD_OVERSCAN, viewportBounds.y - VIEWPORT_UNLOAD_OVERSCAN, viewportBounds.width + VIEWPORT_UNLOAD_OVERSCAN * 2, viewportBounds.height + VIEWPORT_UNLOAD_OVERSCAN * 2);
-        Set<ChunkLocation> removalQueue = new HashSet<>();
-        for (ChunkView view : chunkViewMap.values()) {
+        Set<ChunkPos> removalQueue = new HashSet<>();
+        for (ChunkView view : this.chunkViewMap.values()) {
             if (unloadBounds.intersects(view.getWorldBounds())) {
                 view.lastSeenTime = System.currentTimeMillis();
             }
@@ -139,24 +138,24 @@ public class Viewport extends JLabel {
                 removalQueue.add(view.getLocation());
             }
         }
-        for (ChunkLocation location : removalQueue) {
+        for (ChunkPos location : removalQueue) {
             removeChunkView(location);
         }
 
         addMissingViewers(viewportBounds);
 
-        if (showTerrain.get() && world.get() != null) {
+        if (this.showTerrain.get() && this.world.get() != null) {
             List<ChunkView> unpendedChunks = new ArrayList<>();
-            for (ChunkView view : chunksPendingPostProcess) {
+            for (ChunkView view : this.chunksPendingPostProcess) {
                 if (!view.hasInit()) continue;
                 if (view.hasProcessed()) continue;
-                ChunkLocation up = new ChunkLocation(view.getLocation().x, view.getLocation().z - 1);
-                if (chunkViewMap.containsKey(up) && chunkViewMap.get(up).hasInit()) {
-                    view.process(chunkViewMap.get(up));
+                ChunkPos up = new ChunkPos(view.getLocation().x, view.getLocation().z - 1);
+                if (this.chunkViewMap.containsKey(up) && this.chunkViewMap.get(up).hasInit()) {
+                    view.process(this.chunkViewMap.get(up));
                     unpendedChunks.add(view);
                 }
             }
-            unpendedChunks.forEach(chunksPendingPostProcess::remove);
+            unpendedChunks.forEach(this.chunksPendingPostProcess::remove);
         }
         repaint();
 
@@ -168,22 +167,22 @@ public class Viewport extends JLabel {
     }
 
     public synchronized void addMissingViewers(Rectangle viewportBounds) {
-        ChunkLocation topLeftLocation =
-            new ChunkLocation(viewportBounds.x/ ViewerChunk.CHUNK_SIZE_X,
+        ChunkPos topLeftLocation =
+            new ChunkPos(viewportBounds.x/ ViewerChunk.CHUNK_SIZE_X,
                 viewportBounds.y/ ViewerChunk.CHUNK_SIZE_Z);
         int chunksX = viewportBounds.width/ ViewerChunk.CHUNK_SIZE_X;
         int chunksZ = viewportBounds.height/ ViewerChunk.CHUNK_SIZE_Z;
 
-        List<ChunkLocation> pendingLocation = new ArrayList<>();
+        List<ChunkPos> pendingLocation = new ArrayList<>();
         for (int _x = topLeftLocation.x; _x < topLeftLocation.x + chunksX; _x++) {
             for (int _z = topLeftLocation.z; _z < topLeftLocation.z + chunksZ; _z++) {
-                ChunkLocation location = new ChunkLocation(_x, _z);
-                if (chunkViewMap.containsKey(location)) continue;
+                ChunkPos location = new ChunkPos(_x, _z);
+                if (this.chunkViewMap.containsKey(location)) continue;
                 pendingLocation.add(location);
             }
         }
         pendingLocation.sort((o1, o2) -> {
-            ChunkLocation viewLoc = new ChunkLocation((int) Math.floor(viewX.get()/ ViewerChunk.CHUNK_SIZE_X), (int) Math.floor(-viewZ.get()/ ViewerChunk.CHUNK_SIZE_Z));
+            ChunkPos viewLoc = new ChunkPos((int) Math.floor(this.viewX.get()/ ViewerChunk.CHUNK_SIZE_X), (int) Math.floor(-this.viewZ.get()/ ViewerChunk.CHUNK_SIZE_Z));
             int d1;
             {
                 int dx = o1.x - viewLoc.x;
@@ -204,96 +203,96 @@ public class Viewport extends JLabel {
     public synchronized void setSeed(long seed) {
         this.seed.set(seed);
         clearChunkViews();
-        viewX.set(0F);
-        viewZ.set(0F);
-        chunkProvider = new BTAChunkProvider(this.seed.get());
-        seedViewer.queueResize();
+        this.viewX.set(0F);
+        this.viewZ.set(0F);
+        this.chunkProvider = new BTAChunkProvider(this.seed.get());
+        this.seedViewer.queueResize();
     }
 
     public synchronized void setWorld(@Nullable File file) {
         if (file != null) {
             try {
-                world.set(new BTAWorld(file));
-                chunkProvider = Objects.requireNonNull(world.get()).getChunkProvider();
+                this.world.set(new BTAWorld(file));
+                this.chunkProvider = Objects.requireNonNull(this.world.get()).getChunkProvider();
             } catch (Exception e) {
                 LOGGER.error("", e);
-                world.set(null);
-                chunkProvider = new BTAChunkProvider(seed.get());
+                this.world.set(null);
+                this.chunkProvider = new BTAChunkProvider(this.seed.get());
             }
         } else {
-            world.set(null);
-            chunkProvider = new BTAChunkProvider(seed.get());
+            this.world.set(null);
+            this.chunkProvider = new BTAChunkProvider(this.seed.get());
         }
 
         clearChunkViews();
-        viewX.set(0F);
-        viewZ.set(0F);
-        seedViewer.queueResize();
+        this.viewX.set(0F);
+        this.viewZ.set(0F);
+        this.seedViewer.queueResize();
     }
 
     public Rectangle getViewportBounds() {
-        final int blockX = (int) Math.floor((viewX.get() - (getWidth()/(zoom.get() * 2))));
-        final int blockZ = (int) Math.floor((-viewZ.get() - (getHeight()/(zoom.get() * 2))));
-        final int widthBlocks = (int) Math.ceil((getWidth()/zoom.get()));
-        final int heightBlocks = (int) Math.ceil((getHeight()/zoom.get()));
+        final int blockX = (int) Math.floor((this.viewX.get() - (getWidth()/(this.zoom.get() * 2))));
+        final int blockZ = (int) Math.floor((-this.viewZ.get() - (getHeight()/(this.zoom.get() * 2))));
+        final int widthBlocks = (int) Math.ceil((getWidth()/ this.zoom.get()));
+        final int heightBlocks = (int) Math.ceil((getHeight()/ this.zoom.get()));
         return new Rectangle(blockX - (ViewerChunk.CHUNK_SIZE_X * VIEWPORT_CHUNKS_OVERSCAN), blockZ - (ViewerChunk.CHUNK_SIZE_Z * VIEWPORT_CHUNKS_OVERSCAN), widthBlocks + ViewerChunk.CHUNK_SIZE_X * (VIEWPORT_CHUNKS_OVERSCAN * 2 + 1), heightBlocks + ViewerChunk.CHUNK_SIZE_Z * (VIEWPORT_CHUNKS_OVERSCAN * 2 + 1));
     }
 
     public synchronized void offsetZoom(float delta) {
-        setZoom(zoom.get() + delta);
+        setZoom(this.zoom.get() + delta);
     }
 
     public synchronized void setZoom(float newZoom) {
         if (newZoom < Viewport.ZOOM_MIN) newZoom = Viewport.ZOOM_MIN;
         if (newZoom > Viewport.ZOOM_MAX) newZoom = Viewport.ZOOM_MAX;
-        zoom.set(newZoom);
+        this.zoom.set(newZoom);
         repaint();
     }
 
     public synchronized void offsetView(float deltaX, float deltaZ) {
-        setOffsetView(viewX.get() + (deltaX / zoom.get()), viewZ.get() + (deltaZ / zoom.get()));
+        setOffsetView(this.viewX.get() + (deltaX / this.zoom.get()), this.viewZ.get() + (deltaZ / this.zoom.get()));
     }
 
     public synchronized void setOffsetView(float newX, float newZ) {
-        viewX.set(newX);
-        viewZ.set(newZ);
+        this.viewX.set(newX);
+        this.viewZ.set(newZ);
         repaint();
     }
 
-    public synchronized void addChunkView(ChunkLocation location) {
-        ChunkView view = new ChunkView(this, location, chunkProvider);
-        chunkViewMap.put(location, view);
-        chunksPendingPostProcess.add(view);
+    public synchronized void addChunkView(ChunkPos location) {
+        ChunkView view = new ChunkView(this, location, this.chunkProvider);
+        this.chunkViewMap.put(location, view);
+        this.chunksPendingPostProcess.add(view);
     }
 
-    public synchronized void removeChunkView(ChunkLocation location) {
-        ChunkView view = chunkViewMap.remove(location);
+    public synchronized void removeChunkView(ChunkPos location) {
+        ChunkView view = this.chunkViewMap.remove(location);
         if (view != null) {
             view.kill();
-            chunksPendingPostProcess.remove(view);
+            this.chunksPendingPostProcess.remove(view);
         }
     }
 
     public synchronized void clearChunkViews() {
-        chunkViewMap.forEach((l, c) -> c.kill());
-        chunkViewMap.clear();
-        chunksPendingPostProcess.clear();
+        this.chunkViewMap.forEach((l, c) -> c.kill());
+        this.chunkViewMap.clear();
+        this.chunksPendingPostProcess.clear();
     }
 
-    private ChunkLocation lastHoveredLocation = null;
+    private ChunkPos lastHoveredLocation = null;
     private ViewerChunk lastHoveredChunk = null;
     public synchronized ViewerBiome getHoveredBiome() {
-        ChunkLocation chunkLocation = new ChunkLocation((int) Math.floor(viewX.get()/ ViewerChunk.CHUNK_SIZE_X), (int) Math.floor(-viewZ.get()/ ViewerChunk.CHUNK_SIZE_Z));
+        ChunkPos chunkLocation = new ChunkPos((int) Math.floor(this.viewX.get()/ ViewerChunk.CHUNK_SIZE_X), (int) Math.floor(-this.viewZ.get()/ ViewerChunk.CHUNK_SIZE_Z));
         ViewerChunk chunk;
-        if (lastHoveredLocation != null && lastHoveredChunk != null && lastHoveredLocation.equals(chunkLocation)) {
-            chunk = lastHoveredChunk;
+        if (this.lastHoveredLocation != null && this.lastHoveredChunk != null && this.lastHoveredLocation.equals(chunkLocation)) {
+            chunk = this.lastHoveredChunk;
         } else {
-            chunk = chunkProvider.getChunk(chunkLocation);
-            lastHoveredChunk = chunk;
-            lastHoveredLocation = chunkLocation;
+            chunk = this.chunkProvider.getChunk(chunkLocation);
+            this.lastHoveredChunk = chunk;
+            this.lastHoveredLocation = chunkLocation;
         }
-        ChunkPos2D c2D = new ChunkPos2D(((int) Math.floor(viewX.get())) - chunkLocation.x * ViewerChunk.CHUNK_SIZE_X, ((int) Math.floor(-viewZ.get())) - chunkLocation.z * ViewerChunk.CHUNK_SIZE_Z);
-        return chunk.getBiome(new ChunkPos3D(c2D.x, chunk.getHeight(c2D), c2D.z));
+        ChunkTilePos c2D = new ChunkTilePos(((int) Math.floor(this.viewX.get())) - chunkLocation.x * ViewerChunk.CHUNK_SIZE_X, 0, ((int) Math.floor(-this.viewZ.get())) - chunkLocation.z * ViewerChunk.CHUNK_SIZE_Z);
+        return chunk.getBiome(new ChunkTilePos(c2D.x, chunk.getHeight(c2D), c2D.z));
     }
 
     @Override
@@ -308,17 +307,17 @@ public class Viewport extends JLabel {
         synchronized (this) {
 //            long start = System.nanoTime();
             Rectangle viewportBounds = getViewportBounds();
-            long seed = world.get() == null ? this.seed.get() : world.get().getSeed();
-            for (ChunkView view : chunkViewMap.values()) {
+            long seed = this.world.get() == null ? this.seed.get() : this.world.get().getSeed();
+            for (ChunkView view : this.chunkViewMap.values()) {
                 if (!viewportBounds.intersects(view.getWorldBounds())) continue;
                 int blockX = view.getLocation().x * ViewerChunk.CHUNK_SIZE_X;
                 int blockZ = view.getLocation().z * ViewerChunk.CHUNK_SIZE_Z;
 
-                int subImgX = (int) Math.floor((blockX - viewX.get()) * zoom.get() + getWidth()/2d);
-                int subImgZ = (int) Math.floor((blockZ + viewZ.get()) * zoom.get() + getHeight()/2d);
-                int subImgWidth = (int) Math.floor(ViewerChunk.CHUNK_SIZE_X * zoom.get());
-                int subImgHeight = (int) Math.floor(ViewerChunk.CHUNK_SIZE_Z * zoom.get());
-                if (showTerrain.get() && world.get() != null) {
+                int subImgX = (int) Math.floor((blockX - this.viewX.get()) * this.zoom.get() + getWidth()/2d);
+                int subImgZ = (int) Math.floor((blockZ + this.viewZ.get()) * this.zoom.get() + getHeight()/2d);
+                int subImgWidth = (int) Math.floor(ViewerChunk.CHUNK_SIZE_X * this.zoom.get());
+                int subImgHeight = (int) Math.floor(ViewerChunk.CHUNK_SIZE_Z * this.zoom.get());
+                if (this.showTerrain.get() && this.world.get() != null) {
                     g.drawImage(view.getTerrainMapImage(),
                         subImgX,
                         subImgZ,
@@ -327,7 +326,7 @@ public class Viewport extends JLabel {
                         null,
                         null);
                 }
-                if (showBiomes.get()) {
+                if (this.showBiomes.get()) {
                     g.drawImage(view.getBiomeMapImage(),
                         subImgX,
                         subImgZ,
@@ -336,9 +335,9 @@ public class Viewport extends JLabel {
                         null,
                         null);
                 }
-                if (showSlimeChunks.get() && SeedViewer.isSlimeChunk(seed, view.getLocation())) {
+                if (this.showSlimeChunks.get() && SeedViewer.isSlimeChunk(seed, view.getLocation())) {
                     Graphics gSlime = g.create();
-                    if (slimeVignette == null) {
+                    if (this.slimeVignette == null) {
                         gSlime.setColor(new Color(64, 255, 120, 128));
                         gSlime.fillRect(
                             subImgX,
@@ -346,7 +345,7 @@ public class Viewport extends JLabel {
                             subImgWidth,
                             subImgHeight);
                     } else {
-                        gSlime.drawImage(slimeVignette,
+                        gSlime.drawImage(this.slimeVignette,
                             subImgX,
                             subImgZ,
                             subImgWidth,
@@ -356,7 +355,7 @@ public class Viewport extends JLabel {
                     gSlime.dispose();
                 }
             }
-            if (showChunkBorders.get()) {
+            if (this.showChunkBorders.get()) {
                 int leftChunk = viewportBounds.x / ViewerChunk.CHUNK_SIZE_X;
                 int widthChunks = viewportBounds.width / ViewerChunk.CHUNK_SIZE_X;
                 int topChunk = viewportBounds.y / ViewerChunk.CHUNK_SIZE_Z;
@@ -366,19 +365,19 @@ public class Viewport extends JLabel {
                 gBorders.setColor(new Color(0, 0, 0, 64));
                 for (int _x = leftChunk; _x <= leftChunk + widthChunks; _x++) {
                     float blockX = (_x * ViewerChunk.CHUNK_SIZE_X);
-                    int subImgX = (int) Math.floor((blockX - viewX.get()) * zoom.get() + getWidth()/2d);
+                    int subImgX = (int) Math.floor((blockX - this.viewX.get()) * this.zoom.get() + getWidth()/2d);
 
                     gBorders.drawLine(subImgX, 0, subImgX, getHeight());
                 }
                 for (int _z = topChunk; _z < topChunk + heightChunks; _z++) {
                     float blockZ = (_z * ViewerChunk.CHUNK_SIZE_Z);
-                    int subImgZ = (int) Math.floor((blockZ + viewZ.get()) * zoom.get() + getHeight()/2d);
+                    int subImgZ = (int) Math.floor((blockZ + this.viewZ.get()) * this.zoom.get() + getHeight()/2d);
 
                     gBorders.drawLine(0, subImgZ, getWidth(), subImgZ);
                 }
                 gBorders.dispose();
             }
-            if (showCrosshair.get()) {
+            if (this.showCrosshair.get()) {
                 Graphics gCrosshair = g.create();
                 int centX = getWidth()/2;
                 int centZ = getHeight()/2;
diff --git a/util/seed-viewer/src/test/java/SeedViewerTest.java b/util/seed-viewer/src/test/java/SeedViewerTest.java
index cd25fefb4..e81ab71c3 100644
--- a/util/seed-viewer/src/test/java/SeedViewerTest.java
+++ b/util/seed-viewer/src/test/java/SeedViewerTest.java
@@ -1,7 +1,7 @@
+import net.minecraft.core.world.pos.ChunkPos;
 import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.DisplayName;
 import org.junit.jupiter.api.Test;
-import org.useless.seedviewer.collections.ChunkLocation;
 import org.useless.seedviewer.gui.SeedViewer;
 
 public class SeedViewerTest {
@@ -12,34 +12,34 @@ public class SeedViewerTest {
         {
             long seed = 100;
             Assertions.assertAll(
-                () -> Assertions.assertTrue(SeedViewer.isSlimeChunk(seed, new ChunkLocation(3, -4))),
-                () -> Assertions.assertTrue(SeedViewer.isSlimeChunk(seed, new ChunkLocation(8, -7))),
-                () -> Assertions.assertTrue(SeedViewer.isSlimeChunk(seed, new ChunkLocation(15, 0))));
+                () -> Assertions.assertTrue(SeedViewer.isSlimeChunk(seed, new ChunkPos(3, -4))),
+                () -> Assertions.assertTrue(SeedViewer.isSlimeChunk(seed, new ChunkPos(8, -7))),
+                () -> Assertions.assertTrue(SeedViewer.isSlimeChunk(seed, new ChunkPos(15, 0))));
             Assertions.assertAll(
-                () -> Assertions.assertFalse(SeedViewer.isSlimeChunk(seed, new ChunkLocation(11, -5))),
-                () -> Assertions.assertFalse(SeedViewer.isSlimeChunk(seed, new ChunkLocation(12, -8))),
-                () -> Assertions.assertFalse(SeedViewer.isSlimeChunk(seed, new ChunkLocation(12, -11))),
-                () -> Assertions.assertFalse(SeedViewer.isSlimeChunk(seed, new ChunkLocation(0, -17))),
-                () -> Assertions.assertFalse(SeedViewer.isSlimeChunk(seed, new ChunkLocation(-4, -11))));
+                () -> Assertions.assertFalse(SeedViewer.isSlimeChunk(seed, new ChunkPos(11, -5))),
+                () -> Assertions.assertFalse(SeedViewer.isSlimeChunk(seed, new ChunkPos(12, -8))),
+                () -> Assertions.assertFalse(SeedViewer.isSlimeChunk(seed, new ChunkPos(12, -11))),
+                () -> Assertions.assertFalse(SeedViewer.isSlimeChunk(seed, new ChunkPos(0, -17))),
+                () -> Assertions.assertFalse(SeedViewer.isSlimeChunk(seed, new ChunkPos(-4, -11))));
         }
         {
             long seed = 10000;
             Assertions.assertAll(
-                () -> Assertions.assertTrue(SeedViewer.isSlimeChunk(seed, new ChunkLocation(2, 0))),
-                () -> Assertions.assertTrue(SeedViewer.isSlimeChunk(seed, new ChunkLocation(6, -4))),
-                () -> Assertions.assertTrue(SeedViewer.isSlimeChunk(seed, new ChunkLocation(0, -6))),
-                () -> Assertions.assertTrue(SeedViewer.isSlimeChunk(seed, new ChunkLocation(5, 3))),
-                () -> Assertions.assertTrue(SeedViewer.isSlimeChunk(seed, new ChunkLocation(7, 7))),
-                () -> Assertions.assertTrue(SeedViewer.isSlimeChunk(seed, new ChunkLocation(6, 7))),
-                () -> Assertions.assertTrue(SeedViewer.isSlimeChunk(seed, new ChunkLocation(3, 11))),
-                () -> Assertions.assertTrue(SeedViewer.isSlimeChunk(seed, new ChunkLocation(8, 13))),
-                () -> Assertions.assertTrue(SeedViewer.isSlimeChunk(seed, new ChunkLocation(10, 3))));
+                () -> Assertions.assertTrue(SeedViewer.isSlimeChunk(seed, new ChunkPos(2, 0))),
+                () -> Assertions.assertTrue(SeedViewer.isSlimeChunk(seed, new ChunkPos(6, -4))),
+                () -> Assertions.assertTrue(SeedViewer.isSlimeChunk(seed, new ChunkPos(0, -6))),
+                () -> Assertions.assertTrue(SeedViewer.isSlimeChunk(seed, new ChunkPos(5, 3))),
+                () -> Assertions.assertTrue(SeedViewer.isSlimeChunk(seed, new ChunkPos(7, 7))),
+                () -> Assertions.assertTrue(SeedViewer.isSlimeChunk(seed, new ChunkPos(6, 7))),
+                () -> Assertions.assertTrue(SeedViewer.isSlimeChunk(seed, new ChunkPos(3, 11))),
+                () -> Assertions.assertTrue(SeedViewer.isSlimeChunk(seed, new ChunkPos(8, 13))),
+                () -> Assertions.assertTrue(SeedViewer.isSlimeChunk(seed, new ChunkPos(10, 3))));
             Assertions.assertAll(
-                () -> Assertions.assertFalse(SeedViewer.isSlimeChunk(seed, new ChunkLocation(10, -1))),
-                () -> Assertions.assertFalse(SeedViewer.isSlimeChunk(seed, new ChunkLocation(12, -4))),
-                () -> Assertions.assertFalse(SeedViewer.isSlimeChunk(seed, new ChunkLocation(8, -10))),
-                () -> Assertions.assertFalse(SeedViewer.isSlimeChunk(seed, new ChunkLocation(5, -14))),
-                () -> Assertions.assertFalse(SeedViewer.isSlimeChunk(seed, new ChunkLocation(0, -11))));
+                () -> Assertions.assertFalse(SeedViewer.isSlimeChunk(seed, new ChunkPos(10, -1))),
+                () -> Assertions.assertFalse(SeedViewer.isSlimeChunk(seed, new ChunkPos(12, -4))),
+                () -> Assertions.assertFalse(SeedViewer.isSlimeChunk(seed, new ChunkPos(8, -10))),
+                () -> Assertions.assertFalse(SeedViewer.isSlimeChunk(seed, new ChunkPos(5, -14))),
+                () -> Assertions.assertFalse(SeedViewer.isSlimeChunk(seed, new ChunkPos(0, -11))));
         }
 
     }
diff --git a/util/seed-viewer/src/test/java/collections/BlockPosTest.java b/util/seed-viewer/src/test/java/collections/BlockPosTest.java
deleted file mode 100644
index 8b101eec9..000000000
--- a/util/seed-viewer/src/test/java/collections/BlockPosTest.java
+++ /dev/null
@@ -1,72 +0,0 @@
-package collections;
-
-import org.junit.jupiter.api.Assertions;
-import org.junit.jupiter.api.DisplayName;
-import org.junit.jupiter.api.Test;
-import org.useless.seedviewer.collections.BlockPos2D;
-import org.useless.seedviewer.collections.BlockPos3D;
-
-public class BlockPosTest {
-    @Test
-    @DisplayName("Test BlockPos2D Creation")
-    void blockPos2DCreate() {
-        // Test valid inputs
-        final short range = 8192;
-        final short targetAttempts = 128;
-        final byte scalar = range/targetAttempts;
-        for (int x = -range; x <= range; x += scalar) {
-            for (int z = -range; z <= range; z += scalar) {
-                BlockPos2D blockPos2D_1 = new BlockPos2D(x, z);
-                Assertions.assertEquals(blockPos2D_1.x, x);
-                Assertions.assertEquals(blockPos2D_1.z, z);
-
-                BlockPos2D blockPos2D_2 = new BlockPos2D(x, z);
-                Assertions.assertEquals(blockPos2D_2.x, x);
-                Assertions.assertEquals(blockPos2D_2.z, z);
-
-                Assertions.assertEquals(blockPos2D_1.x, blockPos2D_2.x);
-                Assertions.assertEquals(blockPos2D_1.z, blockPos2D_2.z);
-                Assertions.assertEquals(blockPos2D_1, blockPos2D_2);
-
-                BlockPos2D blockPos2D_3 = new BlockPos2D(x + 1, z + 17);
-                BlockPos3D blockPos3D_3 = new BlockPos3D(x + 1, 128, z + 17);
-                Assertions.assertNotEquals(blockPos2D_3, blockPos2D_1);
-                Assertions.assertNotEquals(blockPos3D_3, blockPos2D_1);
-            }
-        }
-    }
-
-    @Test
-    @DisplayName("Test BlockPos3D Creation")
-    void blockPos3DCreate() {
-        // Test valid inputs
-        final short range = 8192;
-        final short targetAttempts = 128;
-        final byte scalar = range/targetAttempts;
-        for (int x = -range; x <= range; x += scalar) {
-            for (int y = -range; y < range; y += scalar) {
-                for (int z = -range; z <= range; z += scalar) {
-                    BlockPos3D blockPos3D_1 = new BlockPos3D(x, y, z);
-                    Assertions.assertEquals(blockPos3D_1.x, x);
-                    Assertions.assertEquals(blockPos3D_1.y, y);
-                    Assertions.assertEquals(blockPos3D_1.z, z);
-
-                    BlockPos3D blockPos3D_2 = new BlockPos3D(x, y, z);
-                    Assertions.assertEquals(blockPos3D_2.x, x);
-                    Assertions.assertEquals(blockPos3D_2.y, y);
-                    Assertions.assertEquals(blockPos3D_2.z, z);
-
-                    Assertions.assertEquals(blockPos3D_1.x, blockPos3D_2.x);
-                    Assertions.assertEquals(blockPos3D_1.y, blockPos3D_2.y);
-                    Assertions.assertEquals(blockPos3D_1.z, blockPos3D_2.z);
-                    Assertions.assertEquals(blockPos3D_1, blockPos3D_2);
-
-                    BlockPos2D blockPos2D_3 = new BlockPos2D(x + 1, z + 17);
-                    BlockPos3D blockPos3D_3 = new BlockPos3D(x + 1, y - 2, z + 17);
-                    Assertions.assertNotEquals(blockPos3D_3, blockPos3D_1);
-                    Assertions.assertNotEquals(blockPos2D_3, blockPos3D_1);
-                }
-            }
-        }
-    }
-}
diff --git a/util/seed-viewer/src/test/java/collections/ChunkLocationTest.java b/util/seed-viewer/src/test/java/collections/ChunkLocationTest.java
deleted file mode 100644
index 3f4cc6f07..000000000
--- a/util/seed-viewer/src/test/java/collections/ChunkLocationTest.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package collections;
-
-import org.junit.jupiter.api.Assertions;
-import org.junit.jupiter.api.DisplayName;
-import org.junit.jupiter.api.Test;
-import org.useless.seedviewer.collections.ChunkLocation;
-
-public class ChunkLocationTest {
-    @Test
-    @DisplayName("Test ChunkLocation Creation")
-    void blockPos2DCreate() {
-        // Test valid inputs
-        final short range = 8192;
-        final short targetAttempts = 128;
-        final byte scalar = range/targetAttempts;
-        for (int x = -range; x <= range; x += scalar) {
-            for (int z = -range; z <= range; z += scalar) {
-                ChunkLocation chunkLocation_1 = new ChunkLocation(x, z);
-                Assertions.assertEquals(chunkLocation_1.x, x);
-                Assertions.assertEquals(chunkLocation_1.z, z);
-
-                ChunkLocation chunkLocation_2 = new ChunkLocation(x, z);
-                Assertions.assertEquals(chunkLocation_2.x, x);
-                Assertions.assertEquals(chunkLocation_2.z, z);
-
-                Assertions.assertEquals(chunkLocation_1.x, chunkLocation_2.x);
-                Assertions.assertEquals(chunkLocation_1.z, chunkLocation_2.z);
-                Assertions.assertEquals(chunkLocation_1, chunkLocation_2);
-
-                ChunkLocation chunkLocation_3 = new ChunkLocation(x + 1, z + 17);
-                Assertions.assertNotEquals(chunkLocation_3, chunkLocation_1);
-            }
-        }
-    }
-}
diff --git a/util/seed-viewer/src/test/java/collections/ChunkPosTest.java b/util/seed-viewer/src/test/java/collections/ChunkPosTest.java
deleted file mode 100644
index 8b5755cde..000000000
--- a/util/seed-viewer/src/test/java/collections/ChunkPosTest.java
+++ /dev/null
@@ -1,81 +0,0 @@
-package collections;
-
-import org.junit.jupiter.api.Assertions;
-import org.junit.jupiter.api.DisplayName;
-import org.junit.jupiter.api.Test;
-import org.useless.seedviewer.collections.ChunkPos2D;
-import org.useless.seedviewer.collections.ChunkPos3D;
-import org.useless.seedviewer.data.ViewerChunk;
-
-public class ChunkPosTest {
-    @Test
-    @DisplayName("Test Valid ChunkPos2D")
-    void validChunkPos2D() {
-        for (int x = 0; x < ViewerChunk.CHUNK_SIZE_X; x++) {
-            for (int z = 0; z < ViewerChunk.CHUNK_SIZE_Z; z++) {
-                ChunkPos2D chunkPos2D_1 = new ChunkPos2D(x, z);
-                Assertions.assertEquals(chunkPos2D_1.x, x);
-                Assertions.assertEquals(chunkPos2D_1.z, z);
-
-                ChunkPos2D chunkPos2D_2 = new ChunkPos2D(x, z);
-                Assertions.assertEquals(chunkPos2D_2.x, x);
-                Assertions.assertEquals(chunkPos2D_2.z, z);
-
-                Assertions.assertEquals(chunkPos2D_1.x, chunkPos2D_2.x);
-                Assertions.assertEquals(chunkPos2D_1.z, chunkPos2D_2.z);
-                Assertions.assertEquals(chunkPos2D_1, chunkPos2D_2);
-            }
-        }
-    }
-
-    @Test
-    @DisplayName("Test Invalid ChunkPos2D")
-    void invalidChunkPos2D() {
-        Assertions.assertThrowsExactly(IllegalArgumentException.class, () -> new ChunkPos2D(-10, -10));
-        Assertions.assertThrowsExactly(IllegalArgumentException.class, () -> new ChunkPos2D(0, -10));
-        Assertions.assertThrowsExactly(IllegalArgumentException.class, () -> new ChunkPos2D(-10, 0));
-        Assertions.assertThrowsExactly(IllegalArgumentException.class, () -> new ChunkPos2D(20, 0));
-        Assertions.assertThrowsExactly(IllegalArgumentException.class, () -> new ChunkPos2D(0, 20));
-        Assertions.assertThrowsExactly(IllegalArgumentException.class, () -> new ChunkPos2D(20, 20));
-    }
-
-    @Test
-    @DisplayName("Test Valid ChunkPos3D")
-    void validChunkPos3D() {
-        for (int x = 0; x < ViewerChunk.CHUNK_SIZE_X; x++) {
-            for (int y = 0; y < ViewerChunk.CHUNK_SIZE_Y; y++) {
-                for (int z = 0; z < ViewerChunk.CHUNK_SIZE_Z; z++) {
-                    ChunkPos3D chunkPos3D_1 = new ChunkPos3D(x, y, z);
-                    Assertions.assertEquals(chunkPos3D_1.x, x);
-                    Assertions.assertEquals(chunkPos3D_1.y, y);
-                    Assertions.assertEquals(chunkPos3D_1.z, z);
-
-                    ChunkPos3D chunkPos3D_2 = new ChunkPos3D(x, y, z);
-                    Assertions.assertEquals(chunkPos3D_2.x, x);
-                    Assertions.assertEquals(chunkPos3D_2.y, y);
-                    Assertions.assertEquals(chunkPos3D_2.z, z);
-
-                    Assertions.assertEquals(chunkPos3D_1.x, chunkPos3D_2.x);
-                    Assertions.assertEquals(chunkPos3D_1.y, chunkPos3D_2.y);
-                    Assertions.assertEquals(chunkPos3D_1.z, chunkPos3D_2.z);
-                    Assertions.assertEquals(chunkPos3D_1, chunkPos3D_2);
-                }
-            }
-        }
-    }
-
-    @Test
-    @DisplayName("Test Invalid ChunkPos3D")
-    void invalidChunkPos3D() {
-        Assertions.assertThrowsExactly(IllegalArgumentException.class, () -> new ChunkPos3D(-10, -10, -10));
-        Assertions.assertThrowsExactly(IllegalArgumentException.class, () -> new ChunkPos3D(0, -10, -10));
-        Assertions.assertThrowsExactly(IllegalArgumentException.class, () -> new ChunkPos3D(0, 0, -10));
-        Assertions.assertThrowsExactly(IllegalArgumentException.class, () -> new ChunkPos3D(-10, 0, -10));
-        Assertions.assertThrowsExactly(IllegalArgumentException.class, () -> new ChunkPos3D(-10, 0, 0));
-        Assertions.assertThrowsExactly(IllegalArgumentException.class, () -> new ChunkPos3D(20, 20, 20));
-        Assertions.assertThrowsExactly(IllegalArgumentException.class, () -> new ChunkPos3D(0, 20, 20));
-        Assertions.assertThrowsExactly(IllegalArgumentException.class, () -> new ChunkPos3D(0, 0, 20));
-        Assertions.assertThrowsExactly(IllegalArgumentException.class, () -> new ChunkPos3D(20, 0, 20));
-        Assertions.assertThrowsExactly(IllegalArgumentException.class, () -> new ChunkPos3D(20, 0, 0));
-    }
-}
diff --git a/util/seed-viewer/src/test/java/collections/NamespaceTest.java b/util/seed-viewer/src/test/java/collections/NamespaceTest.java
deleted file mode 100644
index 95c71a96c..000000000
--- a/util/seed-viewer/src/test/java/collections/NamespaceTest.java
+++ /dev/null
@@ -1,87 +0,0 @@
-package collections;
-
-import net.minecraft.core.util.HardIllegalArgumentException;
-import net.minecraft.core.util.collection.NamespaceID;
-import org.junit.jupiter.api.Assertions;
-import org.junit.jupiter.api.DisplayName;
-import org.junit.jupiter.api.Test;
-
-public class NamespaceTest {
-    @Test
-    @DisplayName("Test Namespace 2String Constructor")
-    void namespaceCreation1() {
-        // Valid creation
-        NamespaceID namespaceID_1 = NamespaceID.fromPool("minecraft", "value1");
-        Assertions.assertEquals(namespaceID_1.namespace(), "minecraft");
-        Assertions.assertEquals(namespaceID_1.value(), "value1");
-        Assertions.assertEquals(namespaceID_1.toString(), "minecraft:value1");
-
-        NamespaceID namespaceID_2 = NamespaceID.fromPool("minecraft", "value1");
-        Assertions.assertEquals(namespaceID_2.namespace(), "minecraft");
-        Assertions.assertEquals(namespaceID_2.value(), "value1");
-        Assertions.assertEquals(namespaceID_2.toString(), "minecraft:value1");
-
-        Assertions.assertEquals(namespaceID_1.namespace(), namespaceID_2.namespace());
-        Assertions.assertEquals(namespaceID_1.value(), namespaceID_2.value());
-        Assertions.assertEquals(namespaceID_1, namespaceID_2);
-        Assertions.assertEquals(namespaceID_1.toString(), namespaceID_2.toString());
-
-        NamespaceID namespaceID_3 = NamespaceID.fromPool("bta", "value2");
-        Assertions.assertEquals(namespaceID_3.namespace(), "bta");
-        Assertions.assertEquals(namespaceID_3.value(), "value2");
-        Assertions.assertEquals(namespaceID_3.toString(), "bta:value2");
-
-        Assertions.assertNotEquals(namespaceID_3.namespace(), "minecraft");
-        Assertions.assertNotEquals(namespaceID_3.value(), "value1");
-        Assertions.assertNotEquals(namespaceID_3.toString(), "minecraft:value1");
-
-        Assertions.assertNotEquals(namespaceID_3, namespaceID_1);
-        Assertions.assertNotEquals(namespaceID_3.value(), namespaceID_1.value());
-        Assertions.assertNotEquals(namespaceID_3.namespace(), namespaceID_1.namespace());
-        Assertions.assertNotEquals(namespaceID_3.toString(), namespaceID_1.toString());
-
-        Assertions.assertNotEquals(namespaceID_3, namespaceID_2);
-        Assertions.assertNotEquals(namespaceID_3.value(), namespaceID_2.value());
-        Assertions.assertNotEquals(namespaceID_3.namespace(), namespaceID_2.namespace());
-        Assertions.assertNotEquals(namespaceID_3.toString(), namespaceID_2.toString());
-
-        // Invalid creation
-        Assertions.assertThrowsExactly(NullPointerException.class, () -> NamespaceID.fromPool(null, null));
-        Assertions.assertThrowsExactly(NullPointerException.class, () -> NamespaceID.fromPool("minecraft", null));
-        Assertions.assertThrowsExactly(NullPointerException.class, () -> NamespaceID.fromPool(null, "value1"));
-
-        Assertions.assertThrowsExactly(IllegalArgumentException.class, () -> NamespaceID.fromPool("minecraft:", "value1"));
-        Assertions.assertThrowsExactly(IllegalArgumentException.class, () -> NamespaceID.fromPool("minecraft", "value1:"));
-        Assertions.assertThrowsExactly(IllegalArgumentException.class, () -> NamespaceID.fromPool("minecraft:", "value1:"));
-    }
-
-    @Test
-    @DisplayName("Test Namespace 1String Constructor")
-    void namespaceCreation2() throws HardIllegalArgumentException {
-        String formatted_1 = "minecraft:value1";
-        NamespaceID namespaceID_1 = NamespaceID.fromPool(formatted_1);
-        Assertions.assertEquals(namespaceID_1.namespace(), "minecraft");
-        Assertions.assertEquals(namespaceID_1.value(), "value1");
-        Assertions.assertEquals(namespaceID_1.toString(), formatted_1);
-        Assertions.assertEquals(namespaceID_1.namespace() + ":" + namespaceID_1.value(), formatted_1);
-
-        NamespaceID namespaceID_2 = NamespaceID.fromPool(formatted_1);
-        Assertions.assertEquals(namespaceID_2.namespace(), "minecraft");
-        Assertions.assertEquals(namespaceID_2.value(), "value1");
-        Assertions.assertEquals(namespaceID_2.toString(), formatted_1);
-        Assertions.assertEquals(namespaceID_2.namespace() + ":" + namespaceID_2.value(), formatted_1);
-
-        Assertions.assertEquals(namespaceID_1.namespace(), namespaceID_2.namespace());
-        Assertions.assertEquals(namespaceID_1.value(), namespaceID_2.value());
-        Assertions.assertEquals(namespaceID_1, namespaceID_2);
-        Assertions.assertEquals(namespaceID_1.toString(), namespaceID_2.toString());
-
-        Assertions.assertThrowsExactly(NullPointerException.class, () -> NamespaceID.fromPool(null));
-        Assertions.assertThrowsExactly(HardIllegalArgumentException.class, () -> NamespaceID.fromPool("minecraft::value1"));
-        Assertions.assertThrowsExactly(HardIllegalArgumentException.class, () -> NamespaceID.fromPool("minecraft:value1:"));
-        Assertions.assertThrowsExactly(HardIllegalArgumentException.class, () -> NamespaceID.fromPool(":value1"));
-        Assertions.assertDoesNotThrow(() -> NamespaceID.fromPool("minecraft:value"));
-        Assertions.assertThrowsExactly(HardIllegalArgumentException.class, () -> NamespaceID.fromPool("minecraft value"));
-        Assertions.assertThrowsExactly(HardIllegalArgumentException.class, () -> NamespaceID.fromPool("minecraft|value"));
-    }
-}
