diff --git a/src/main/java/com/seibel/lod/builders/bufferBuilding/LodBufferBuilder.java b/src/main/java/com/seibel/lod/builders/bufferBuilding/LodBufferBuilder.java index e4baaa2da..8567fd514 100644 --- a/src/main/java/com/seibel/lod/builders/bufferBuilding/LodBufferBuilder.java +++ b/src/main/java/com/seibel/lod/builders/bufferBuilding/LodBufferBuilder.java @@ -61,9 +61,7 @@ import com.seibel.lod.wrappers.MinecraftWrapper; import net.minecraft.client.renderer.BufferBuilder; import net.minecraft.client.renderer.vertex.VertexBuffer; -import net.minecraft.client.world.ClientWorld; import net.minecraft.util.Direction; -import net.minecraft.world.LightType; /** * This object is used to create NearFarBuffer objects. @@ -72,7 +70,6 @@ import net.minecraft.world.LightType; */ public class LodBufferBuilder { - private static final MinecraftWrapper mc = MinecraftWrapper.INSTANCE; /** The thread used to generate new LODs off the main thread. */ public static final ExecutorService mainGenThread = Executors.newSingleThreadExecutor(new LodThreadFactory(LodBufferBuilder.class.getSimpleName() + " - main")); @@ -232,8 +229,7 @@ public class LodBufferBuilder // create the nodeToRenderThreads // //================================// - ClientWorld world = mc.getClientWorld(); - skyLightPlayer = world.getBrightness(LightType.SKY, playerBlockPos.getBlockPos()); + skyLightPlayer = MinecraftWrapper.INSTANCE.getWrappedClientWorld().getSkyLight(playerBlockPos); for (int xRegion = 0; xRegion < lodDim.getWidth(); xRegion++) { diff --git a/src/main/java/com/seibel/lod/handlers/ChunkLoader.java b/src/main/java/com/seibel/lod/handlers/ChunkLoader.java index 3c1b858ac..fab020bdd 100644 --- a/src/main/java/com/seibel/lod/handlers/ChunkLoader.java +++ b/src/main/java/com/seibel/lod/handlers/ChunkLoader.java @@ -24,7 +24,7 @@ import java.io.File; import com.seibel.lod.util.LodUtil; import com.seibel.lod.wrappers.MinecraftWrapper; -import net.minecraft.client.world.ClientWorld; +import com.seibel.lod.wrappers.World.WorldWrapper; import net.minecraft.util.math.ChunkPos; import net.minecraft.world.chunk.IChunk; import net.minecraft.world.chunk.storage.ChunkSerializer; @@ -39,10 +39,10 @@ public class ChunkLoader { public static IChunk getChunkFromFile(ChunkPos pos){ - ClientWorld clientWorld = MinecraftWrapper.INSTANCE.getClientWorld(); - if (clientWorld == null) + WorldWrapper clientLevel = MinecraftWrapper.INSTANCE.getWrappedClientWorld(); + if (clientLevel == null) return null; - ServerWorld serverWorld = LodUtil.getServerWorldFromDimension(clientWorld.dimensionType()); + ServerWorld serverWorld = LodUtil.getServerWorldFromDimension(clientLevel.getWorld().dimensionType()); try { File file = new File(serverWorld.getChunkSource().getDataStorage().dataFolder.getParent() + File.separatorChar + "region", "r." + (pos.x >> 5) + "." + (pos.z >> 5) + ".mca"); diff --git a/src/main/java/com/seibel/lod/handlers/ReflectionHandler.java b/src/main/java/com/seibel/lod/handlers/ReflectionHandler.java index 1eb0a5bdb..9ed3373c5 100644 --- a/src/main/java/com/seibel/lod/handlers/ReflectionHandler.java +++ b/src/main/java/com/seibel/lod/handlers/ReflectionHandler.java @@ -37,7 +37,6 @@ import java.lang.reflect.Method; public class ReflectionHandler { public static final ReflectionHandler INSTANCE = new ReflectionHandler(); - private final MinecraftWrapper mc = MinecraftWrapper.INSTANCE; public Field ofFogField = null; public Method vertexBufferUploadMethod = null; @@ -56,7 +55,7 @@ public class ReflectionHandler private void setupFogField() { // get every variable from the entity renderer - Field[] optionFields = mc.getOptions().getClass().getDeclaredFields(); + Field[] optionFields = MinecraftWrapper.INSTANCE.getOptions().getClass().getDeclaredFields(); // try and find the ofFogType variable in gameSettings for (Field field : optionFields) @@ -93,7 +92,7 @@ public class ReflectionHandler try { - returnNum = (int) ofFogField.get(mc.getOptions()); + returnNum = (int) ofFogField.get(MinecraftWrapper.INSTANCE.getOptions()); } catch (IllegalArgumentException | IllegalAccessException e) {