changed world to level in minecraft wrapper for consistency with other versions
This commit is contained in:
@@ -229,7 +229,7 @@ public class LodBufferBuilder
|
||||
// create the nodeToRenderThreads //
|
||||
//================================//
|
||||
|
||||
skyLightPlayer = MinecraftWrapper.INSTANCE.getWrappedClientWorld().getSkyLight(playerBlockPos);
|
||||
skyLightPlayer = MinecraftWrapper.INSTANCE.getWrappedClientLevel().getSkyLight(playerBlockPos);
|
||||
|
||||
for (int xRegion = 0; xRegion < lodDim.getWidth(); xRegion++)
|
||||
{
|
||||
|
||||
@@ -226,7 +226,7 @@ public class Box
|
||||
for (Direction direction : DIRECTIONS)
|
||||
{
|
||||
if (!adjShadeDisabled[DIRECTION_INDEX.get(direction)])
|
||||
colorMap[DIRECTION_INDEX.get(direction)] = ColorUtil.applyShade(color, MinecraftWrapper.INSTANCE.getClientWorld().getShade(direction, true));
|
||||
colorMap[DIRECTION_INDEX.get(direction)] = ColorUtil.applyShade(color, MinecraftWrapper.INSTANCE.getClientLevel().getShade(direction, true));
|
||||
else
|
||||
colorMap[DIRECTION_INDEX.get(direction)] = color;
|
||||
}
|
||||
@@ -241,7 +241,7 @@ public class Box
|
||||
if (LodConfig.CLIENT.advancedModOptions.debugging.debugMode.get() != DebugMode.SHOW_DETAIL)
|
||||
return colorMap[DIRECTION_INDEX.get(direction)];
|
||||
else
|
||||
return ColorUtil.applyShade(color, MinecraftWrapper.INSTANCE.getClientWorld().getShade(direction, true));
|
||||
return ColorUtil.applyShade(color, MinecraftWrapper.INSTANCE.getClientLevel().getShade(direction, true));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -108,7 +108,7 @@ public class LodBuilder
|
||||
{
|
||||
// we need a loaded client world in order to
|
||||
// get the textures for blocks
|
||||
if (mc.getClientWorld() == null)
|
||||
if (mc.getClientLevel() == null)
|
||||
return;
|
||||
|
||||
// don't try to generate LODs if the user isn't in the world anymore
|
||||
@@ -170,7 +170,7 @@ public class LodBuilder
|
||||
return;
|
||||
|
||||
// this happens if a LOD is generated after the user leaves the world.
|
||||
if (MinecraftWrapper.INSTANCE.getWrappedClientWorld() == null)
|
||||
if (MinecraftWrapper.INSTANCE.getWrappedClientLevel() == null)
|
||||
return;
|
||||
|
||||
// determine how many LODs to generate horizontally
|
||||
@@ -230,8 +230,8 @@ public class LodBuilder
|
||||
int xAbs;
|
||||
int yAbs;
|
||||
int zAbs;
|
||||
boolean hasCeiling = mc.getClientWorld().dimensionType().hasCeiling();
|
||||
boolean hasSkyLight = mc.getClientWorld().dimensionType().hasSkyLight();
|
||||
boolean hasCeiling = mc.getClientLevel().dimensionType().hasCeiling();
|
||||
boolean hasSkyLight = mc.getClientLevel().dimensionType().hasSkyLight();
|
||||
boolean isDefault;
|
||||
BlockPosWrapper blockPos = new BlockPosWrapper();
|
||||
int index;
|
||||
@@ -386,7 +386,7 @@ public class LodBuilder
|
||||
// 1 means the lighting is a guess
|
||||
int isDefault = 0;
|
||||
|
||||
WorldWrapper world = MinecraftWrapper.INSTANCE.getWrappedServerWorld();
|
||||
WorldWrapper world = MinecraftWrapper.INSTANCE.getWrappedServerLevel();
|
||||
|
||||
int blockBrightness = chunk.getEmittedBrightness(blockPos);
|
||||
// get the air block above or below this block
|
||||
@@ -414,7 +414,7 @@ public class LodBuilder
|
||||
{
|
||||
// we are on predicted terrain, and we don't know what the light here is,
|
||||
// lets just take a guess
|
||||
if (blockPos.getY() >= mc.getClientWorld().getSeaLevel() - 5)
|
||||
if (blockPos.getY() >= mc.getClientLevel().getSeaLevel() - 5)
|
||||
{
|
||||
skyLight = 12;
|
||||
isDefault = 1;
|
||||
@@ -425,7 +425,7 @@ public class LodBuilder
|
||||
}
|
||||
else
|
||||
{
|
||||
world = MinecraftWrapper.INSTANCE.getWrappedClientWorld();
|
||||
world = MinecraftWrapper.INSTANCE.getWrappedClientLevel();
|
||||
if (world.isEmpty())
|
||||
return 0;
|
||||
// client world sky light (almost never accurate)
|
||||
@@ -447,7 +447,7 @@ public class LodBuilder
|
||||
{
|
||||
// we don't know what the light here is,
|
||||
// lets just take a guess
|
||||
if (blockPos.getY() >= mc.getClientWorld().getSeaLevel() - 5)
|
||||
if (blockPos.getY() >= mc.getClientLevel().getSeaLevel() - 5)
|
||||
{
|
||||
skyLight = 12;
|
||||
isDefault = 1;
|
||||
|
||||
@@ -39,7 +39,7 @@ public class ChunkLoader
|
||||
{
|
||||
public static IChunk getChunkFromFile(ChunkPos pos){
|
||||
|
||||
WorldWrapper clientLevel = MinecraftWrapper.INSTANCE.getWrappedClientWorld();
|
||||
WorldWrapper clientLevel = MinecraftWrapper.INSTANCE.getWrappedClientLevel();
|
||||
if (clientLevel == null)
|
||||
return null;
|
||||
ServerWorld serverWorld = LodUtil.getServerWorldFromDimension(clientLevel.getWorld().dimensionType());
|
||||
|
||||
@@ -330,7 +330,7 @@ public class ClientProxy
|
||||
{
|
||||
// calculate how wide the dimension(s) should be in regions
|
||||
int chunksWide;
|
||||
if (mc.getClientWorld().dimensionType().hasCeiling())
|
||||
if (mc.getClientLevel().dimensionType().hasCeiling())
|
||||
chunksWide = Math.min(LodConfig.CLIENT.graphics.qualityOption.lodChunkRenderDistance.get(), LodUtil.CEILED_DIMENSION_MAX_RENDER_DISTANCE) * 2 + 1;
|
||||
else
|
||||
chunksWide = LodConfig.CLIENT.graphics.qualityOption.lodChunkRenderDistance.get() * 2 + 1;
|
||||
@@ -347,7 +347,7 @@ public class ClientProxy
|
||||
// update the dimensions to fit the new width
|
||||
lodWorld.resizeDimensionRegionWidth(newWidth);
|
||||
lodBuilder.defaultDimensionWidthInRegions = newWidth;
|
||||
renderer.setupBuffers(lodWorld.getLodDimension(mc.getClientWorld().dimensionType()));
|
||||
renderer.setupBuffers(lodWorld.getLodDimension(mc.getClientLevel().dimensionType()));
|
||||
|
||||
recalculateWidths = false;
|
||||
//LOGGER.info("new dimension width in regions: " + newWidth + "\t potential: " + newWidth );
|
||||
|
||||
@@ -262,7 +262,7 @@ public class LodRenderer
|
||||
Matrix4f modelViewMatrix = offsetTheModelViewMatrix(mcMatrixStack, partialTicks);
|
||||
vanillaBlockRenderedDistance = mc.getRenderDistance() * LodUtil.CHUNK_WIDTH;
|
||||
// required for setupFog and setupProjectionMatrix
|
||||
if (mc.getClientWorld().dimensionType().hasCeiling())
|
||||
if (mc.getClientLevel().dimensionType().hasCeiling())
|
||||
farPlaneBlockDistance = Math.min(LodConfig.CLIENT.graphics.qualityOption.lodChunkRenderDistance.get(), LodUtil.CEILED_DIMENSION_MAX_RENDER_DISTANCE) * LodUtil.CHUNK_WIDTH;
|
||||
else
|
||||
farPlaneBlockDistance = LodConfig.CLIENT.graphics.qualityOption.lodChunkRenderDistance.get() * LodUtil.CHUNK_WIDTH;
|
||||
|
||||
@@ -52,7 +52,7 @@ public class BlockColorWrapper
|
||||
+ Integer.toHexString(
|
||||
Minecraft.getInstance().getBlockColors().createDefault().getColor(
|
||||
block.defaultBlockState(),
|
||||
(World) MinecraftWrapper.INSTANCE.getWrappedServerWorld().getWorld(),
|
||||
(World) MinecraftWrapper.INSTANCE.getWrappedServerLevel().getLevel(),
|
||||
blockPosWrapper.getBlockPos())) + "\n"
|
||||
);
|
||||
for(Property x : Minecraft.getInstance().getBlockColors().getColoringProperties(block))
|
||||
@@ -134,7 +134,7 @@ public class BlockColorWrapper
|
||||
else
|
||||
{
|
||||
isColored = true;
|
||||
texture = mc.getModelManager().getBlockModelShaper().getTexture(block.defaultBlockState(), mc.getClientWorld(), blockPosWrapper.getBlockPos());
|
||||
texture = mc.getModelManager().getBlockModelShaper().getTexture(block.defaultBlockState(), mc.getClientLevel(), blockPosWrapper.getBlockPos());
|
||||
}
|
||||
|
||||
int count = 0;
|
||||
|
||||
@@ -194,17 +194,17 @@ public class MinecraftWrapper
|
||||
return mc.getModelManager();
|
||||
}
|
||||
|
||||
public ClientWorld getClientWorld()
|
||||
public ClientWorld getClientLevel()
|
||||
{
|
||||
return mc.level;
|
||||
}
|
||||
|
||||
public WorldWrapper getWrappedClientWorld()
|
||||
public WorldWrapper getWrappedClientLevel()
|
||||
{
|
||||
return WorldWrapper.getWorldWrapper(mc.level);
|
||||
}
|
||||
|
||||
public WorldWrapper getWrappedServerWorld()
|
||||
public WorldWrapper getWrappedServerLevel()
|
||||
{
|
||||
|
||||
if (mc.level == null)
|
||||
|
||||
Reference in New Issue
Block a user