removed client world dependency in buffer builder; minor changes
This commit is contained in:
@@ -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++)
|
||||
{
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user