resolved couple warnings. If it causes problems just revert it.
This commit is contained in:
@@ -60,7 +60,7 @@ public class Config extends ConfigGui
|
||||
// This is a hacky method to not show the button in the options screen but show it in the mod menu
|
||||
// Tough it is in client in the wrapper singleton
|
||||
@ConfigAnnotations.Entry
|
||||
public static boolean optionsButton = true;
|
||||
public static final boolean optionsButton = true;
|
||||
|
||||
public static class Client
|
||||
{
|
||||
@@ -92,38 +92,38 @@ public class Config extends ConfigGui
|
||||
public static class Quality
|
||||
{
|
||||
@ConfigAnnotations.Entry
|
||||
public static HorizontalResolution drawResolution = IQuality.DRAW_RESOLUTION_DEFAULT;
|
||||
public static final HorizontalResolution drawResolution = IQuality.DRAW_RESOLUTION_DEFAULT;
|
||||
|
||||
@ConfigAnnotations.Entry(minValue = 16, maxValue = 1024)
|
||||
public static int lodChunkRenderDistance = IQuality.LOD_CHUNK_RENDER_DISTANCE_MIN_DEFAULT_MAX.defaultValue;
|
||||
public static final int lodChunkRenderDistance = IQuality.LOD_CHUNK_RENDER_DISTANCE_MIN_DEFAULT_MAX.defaultValue;
|
||||
|
||||
@ConfigAnnotations.Entry
|
||||
public static VerticalQuality verticalQuality = IQuality.VERTICAL_QUALITY_DEFAULT;
|
||||
public static final VerticalQuality verticalQuality = IQuality.VERTICAL_QUALITY_DEFAULT;
|
||||
|
||||
@ConfigAnnotations.Entry(minValue = 2, maxValue = 32)
|
||||
public static int horizontalScale = IQuality.HORIZONTAL_SCALE_MIN_DEFAULT_MAX.defaultValue;
|
||||
public static final int horizontalScale = IQuality.HORIZONTAL_SCALE_MIN_DEFAULT_MAX.defaultValue;
|
||||
|
||||
@ConfigAnnotations.Entry
|
||||
public static HorizontalQuality horizontalQuality = IQuality.HORIZONTAL_QUALITY_DEFAULT;
|
||||
public static final HorizontalQuality horizontalQuality = IQuality.HORIZONTAL_QUALITY_DEFAULT;
|
||||
|
||||
@ConfigAnnotations.Entry
|
||||
public static DropoffQuality dropoffQuality = IQuality.DROPOFF_QUALITY_DEFAULT;
|
||||
public static final DropoffQuality dropoffQuality = IQuality.DROPOFF_QUALITY_DEFAULT;
|
||||
}
|
||||
|
||||
|
||||
public static class FogQuality
|
||||
{
|
||||
@ConfigAnnotations.Entry
|
||||
public static FogDistance fogDistance = IFogQuality.FOG_DISTANCE_DEFAULT;
|
||||
public static final FogDistance fogDistance = IFogQuality.FOG_DISTANCE_DEFAULT;
|
||||
|
||||
@ConfigAnnotations.Entry
|
||||
public static FogDrawMode fogDrawMode = IFogQuality.FOG_DRAW_MODE_DEFAULT;
|
||||
public static final FogDrawMode fogDrawMode = IFogQuality.FOG_DRAW_MODE_DEFAULT;
|
||||
|
||||
@ConfigAnnotations.Entry
|
||||
public static FogColorMode fogColorMode = IFogQuality.FOG_COLOR_MODE_DEFAULT;
|
||||
public static final FogColorMode fogColorMode = IFogQuality.FOG_COLOR_MODE_DEFAULT;
|
||||
|
||||
@ConfigAnnotations.Entry
|
||||
public static boolean disableVanillaFog = IFogQuality.DISABLE_VANILLA_FOG_DEFAULT;
|
||||
public static final boolean disableVanillaFog = IFogQuality.DISABLE_VANILLA_FOG_DEFAULT;
|
||||
}
|
||||
|
||||
|
||||
@@ -133,35 +133,35 @@ public class Config extends ConfigGui
|
||||
public static ConfigAnnotations.Comment cloudWarning;
|
||||
|
||||
@ConfigAnnotations.Entry
|
||||
public static boolean customClouds = ICloudQuality.CUSTOM_CLOUDS_DEFAULT;
|
||||
public static final boolean customClouds = ICloudQuality.CUSTOM_CLOUDS_DEFAULT;
|
||||
|
||||
@ConfigAnnotations.Entry
|
||||
public static boolean fabulousClouds = ICloudQuality.FABULOUS_CLOUDS_DEFAULT;
|
||||
public static final boolean fabulousClouds = ICloudQuality.FABULOUS_CLOUDS_DEFAULT;
|
||||
|
||||
@ConfigAnnotations.Entry
|
||||
public static boolean extendClouds = ICloudQuality.EXTEND_CLOUDS_DEFAULT;
|
||||
public static final boolean extendClouds = ICloudQuality.EXTEND_CLOUDS_DEFAULT;
|
||||
|
||||
@ConfigAnnotations.Entry
|
||||
public static double cloudHeight = DimensionSpecialEffects.OverworldEffects.CLOUD_LEVEL;
|
||||
public static final double cloudHeight = DimensionSpecialEffects.OverworldEffects.CLOUD_LEVEL;
|
||||
}
|
||||
|
||||
|
||||
public static class AdvancedGraphics
|
||||
{
|
||||
@ConfigAnnotations.Entry
|
||||
public static boolean disableDirectionalCulling = IAdvancedGraphics.DISABLE_DIRECTIONAL_CULLING_DEFAULT;
|
||||
public static final boolean disableDirectionalCulling = IAdvancedGraphics.DISABLE_DIRECTIONAL_CULLING_DEFAULT;
|
||||
|
||||
@ConfigAnnotations.Entry
|
||||
public static boolean alwaysDrawAtMaxQuality = IAdvancedGraphics.ALWAYS_DRAW_AT_MAD_QUALITY_DEFAULT;
|
||||
public static final boolean alwaysDrawAtMaxQuality = IAdvancedGraphics.ALWAYS_DRAW_AT_MAD_QUALITY_DEFAULT;
|
||||
|
||||
@ConfigAnnotations.Entry
|
||||
public static VanillaOverdraw vanillaOverdraw = IAdvancedGraphics.VANILLA_OVERDRAW_DEFAULT;
|
||||
public static final VanillaOverdraw vanillaOverdraw = IAdvancedGraphics.VANILLA_OVERDRAW_DEFAULT;
|
||||
|
||||
@ConfigAnnotations.Entry
|
||||
public static boolean useExtendedNearClipPlane = IAdvancedGraphics.USE_EXTENDED_NEAR_CLIP_PLANE_DEFAULT;
|
||||
public static final boolean useExtendedNearClipPlane = IAdvancedGraphics.USE_EXTENDED_NEAR_CLIP_PLANE_DEFAULT;
|
||||
|
||||
@ConfigAnnotations.Entry(minValue = 0, maxValue = 512)
|
||||
public static int backsideCullingRange = IAdvancedGraphics.VANILLA_CULLING_RANGE_MIN_DEFAULT_MAX.defaultValue;
|
||||
public static final int backsideCullingRange = IAdvancedGraphics.VANILLA_CULLING_RANGE_MIN_DEFAULT_MAX.defaultValue;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -169,17 +169,17 @@ public class Config extends ConfigGui
|
||||
public static class WorldGenerator
|
||||
{
|
||||
@ConfigAnnotations.Entry
|
||||
public static GenerationPriority generationPriority = IWorldGenerator.GENERATION_PRIORITY_DEFAULT;
|
||||
public static final GenerationPriority generationPriority = IWorldGenerator.GENERATION_PRIORITY_DEFAULT;
|
||||
|
||||
@ConfigAnnotations.Entry
|
||||
public static DistanceGenerationMode distanceGenerationMode = IWorldGenerator.DISTANCE_GENERATION_MODE_DEFAULT;
|
||||
public static final DistanceGenerationMode distanceGenerationMode = IWorldGenerator.DISTANCE_GENERATION_MODE_DEFAULT;
|
||||
|
||||
// FIXME: Temperary override. In 1.18, the newer Unstable gnerator is more usable
|
||||
@ConfigAnnotations.Entry
|
||||
public static boolean allowUnstableFeatureGeneration = true;//IWorldGenerator.ALLOW_UNSTABLE_FEATURE_GENERATION_DEFAULT;
|
||||
public static final boolean allowUnstableFeatureGeneration = true;//IWorldGenerator.ALLOW_UNSTABLE_FEATURE_GENERATION_DEFAULT;
|
||||
|
||||
@ConfigAnnotations.Entry
|
||||
public static BlocksToAvoid blocksToAvoid = IWorldGenerator.BLOCKS_TO_AVOID_DEFAULT;
|
||||
public static final BlocksToAvoid blocksToAvoid = IWorldGenerator.BLOCKS_TO_AVOID_DEFAULT;
|
||||
}
|
||||
|
||||
public static class Advanced
|
||||
@@ -197,36 +197,36 @@ public class Config extends ConfigGui
|
||||
public static class Threading
|
||||
{
|
||||
@ConfigAnnotations.Entry(minValue = 1, maxValue = 50)
|
||||
public static int numberOfWorldGenerationThreads = IThreading.NUMBER_OF_WORLD_GENERATION_THREADS_DEFAULT.defaultValue;
|
||||
public static final int numberOfWorldGenerationThreads = IThreading.NUMBER_OF_WORLD_GENERATION_THREADS_DEFAULT.defaultValue;
|
||||
|
||||
@ConfigAnnotations.Entry(minValue = 1, maxValue = 50)
|
||||
public static int numberOfBufferBuilderThreads = IThreading.NUMBER_OF_BUFFER_BUILDER_THREADS_MIN_DEFAULT_MAX.defaultValue;
|
||||
public static final int numberOfBufferBuilderThreads = IThreading.NUMBER_OF_BUFFER_BUILDER_THREADS_MIN_DEFAULT_MAX.defaultValue;
|
||||
}
|
||||
|
||||
|
||||
public static class Debugging
|
||||
{
|
||||
@ConfigAnnotations.Entry
|
||||
public static boolean drawLods = IDebugging.DRAW_LODS_DEFAULT;
|
||||
public static final boolean drawLods = IDebugging.DRAW_LODS_DEFAULT;
|
||||
|
||||
@ConfigAnnotations.Entry
|
||||
public static DebugMode debugMode = IDebugging.DEBUG_MODE_DEFAULT;
|
||||
public static final DebugMode debugMode = IDebugging.DEBUG_MODE_DEFAULT;
|
||||
|
||||
@ConfigAnnotations.Entry
|
||||
public static boolean enableDebugKeybindings = IDebugging.DEBUG_KEYBINDINGS_ENABLED_DEFAULT;
|
||||
public static final boolean enableDebugKeybindings = IDebugging.DEBUG_KEYBINDINGS_ENABLED_DEFAULT;
|
||||
}
|
||||
|
||||
|
||||
public static class Buffers
|
||||
{
|
||||
@ConfigAnnotations.Entry
|
||||
public static GpuUploadMethod gpuUploadMethod = IBuffers.GPU_UPLOAD_METHOD_DEFAULT;
|
||||
public static final GpuUploadMethod gpuUploadMethod = IBuffers.GPU_UPLOAD_METHOD_DEFAULT;
|
||||
|
||||
@ConfigAnnotations.Entry(minValue = 0, maxValue = 5000)
|
||||
public static int gpuUploadPerMegabyteInMilliseconds = IBuffers.GPU_UPLOAD_PER_MEGABYTE_IN_MILLISECONDS_DEFAULT.defaultValue;
|
||||
public static final int gpuUploadPerMegabyteInMilliseconds = IBuffers.GPU_UPLOAD_PER_MEGABYTE_IN_MILLISECONDS_DEFAULT.defaultValue;
|
||||
|
||||
@ConfigAnnotations.Entry
|
||||
public static BufferRebuildTimes rebuildTimes = IBuffers.REBUILD_TIMES_DEFAULT;
|
||||
public static final BufferRebuildTimes rebuildTimes = IBuffers.REBUILD_TIMES_DEFAULT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,8 +13,8 @@ public class CloudBufferSingleton
|
||||
|
||||
public static final CloudBufferSingleton INSTANCE = new CloudBufferSingleton();
|
||||
|
||||
public FloatBuffer customBuffer = MemoryUtil.memAllocFloat(16);
|
||||
public FloatBuffer mcBuffer = MemoryUtil.memAllocFloat(16);
|
||||
public final FloatBuffer customBuffer = MemoryUtil.memAllocFloat(16);
|
||||
public final FloatBuffer mcBuffer = MemoryUtil.memAllocFloat(16);
|
||||
|
||||
public CloudBufferSingleton(){
|
||||
|
||||
|
||||
@@ -7,15 +7,14 @@ import net.minecraft.world.level.levelgen.LegacyRandomSource;
|
||||
import net.minecraft.world.level.levelgen.synth.SimplexNoise;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
|
||||
public class CloudTexture {
|
||||
|
||||
public List<PixelCoordinate> pixels = new LinkedList<PixelCoordinate>() {};
|
||||
public final List<PixelCoordinate> pixels = new LinkedList<PixelCoordinate>() {};
|
||||
|
||||
public SimplexNoise noise;
|
||||
public DynamicTexture cloudsTexture;
|
||||
public ResourceLocation resourceLocation;
|
||||
public final ResourceLocation resourceLocation;
|
||||
public double cloudiness;
|
||||
|
||||
public CloudTexture(ResourceLocation resourceLocation) {
|
||||
@@ -72,9 +71,9 @@ public class CloudTexture {
|
||||
}
|
||||
|
||||
public static class PixelCoordinate {
|
||||
public int posX;
|
||||
public int posZ;
|
||||
public boolean fading;
|
||||
public final int posX;
|
||||
public final int posZ;
|
||||
public final boolean fading;
|
||||
|
||||
public PixelCoordinate(int posX, int posZ, boolean fading) {
|
||||
this.posX = posX;
|
||||
|
||||
@@ -8,7 +8,7 @@ import java.util.List;
|
||||
|
||||
public final class NoiseCloudHandler {
|
||||
|
||||
public static List<CloudTexture> cloudTextures = new LinkedList<CloudTexture>() {};
|
||||
public static final List<CloudTexture> cloudTextures = new LinkedList<CloudTexture>() {};
|
||||
|
||||
private static long cloudIdx = -1;
|
||||
private static long timeIdx = -1;
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
package com.seibel.lod.common.networking;
|
||||
|
||||
import com.seibel.lod.common.LodCommonMain;
|
||||
import io.netty.buffer.Unpooled;
|
||||
import net.minecraft.network.FriendlyByteBuf;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
/**
|
||||
* This class holds most of the networking code for the mod.
|
||||
* @author Ran
|
||||
|
||||
@@ -6,7 +6,6 @@ import java.util.Random;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
|
||||
import com.seibel.lod.common.LodCommonMain;
|
||||
import com.seibel.lod.common.wrappers.minecraft.MinecraftWrapper;
|
||||
import com.seibel.lod.core.util.ColorUtil;
|
||||
import com.seibel.lod.core.wrapperInterfaces.block.AbstractBlockPosWrapper;
|
||||
@@ -154,10 +153,8 @@ public class BlockColorWrapper implements IBlockColorWrapper
|
||||
|
||||
// generate the block's color
|
||||
// for (int frameIndex = 0; frameIndex < texture.getFrameCount(); frameIndex++)
|
||||
boolean lookForTint = false;
|
||||
if (grassInstance() || leavesInstance() || waterIstance())
|
||||
lookForTint = true;
|
||||
|
||||
boolean lookForTint = grassInstance() || leavesInstance() || waterIstance();
|
||||
|
||||
int frameIndex = 0; // TODO
|
||||
{
|
||||
// textures normally use u and v instead of x and y
|
||||
|
||||
@@ -14,7 +14,7 @@ import net.minecraft.core.BlockPos;
|
||||
*/
|
||||
public class BlockPosWrapper extends AbstractBlockPosWrapper
|
||||
{
|
||||
private BlockPos.MutableBlockPos blockPos;
|
||||
private final BlockPos.MutableBlockPos blockPos;
|
||||
|
||||
|
||||
public BlockPosWrapper()
|
||||
|
||||
@@ -5,7 +5,6 @@ import java.util.Objects;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
|
||||
import com.seibel.lod.core.wrapperInterfaces.block.AbstractBlockPosWrapper;
|
||||
import com.seibel.lod.core.wrapperInterfaces.block.IBlockShapeWrapper;
|
||||
import com.seibel.lod.core.wrapperInterfaces.chunk.IChunkWrapper;
|
||||
import com.seibel.lod.common.wrappers.chunk.ChunkWrapper;
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.seibel.lod.common.wrappers.chunk;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import com.seibel.lod.core.objects.lod.RegionPos;
|
||||
import com.seibel.lod.core.wrapperInterfaces.block.AbstractBlockPosWrapper;
|
||||
import com.seibel.lod.core.wrapperInterfaces.chunk.AbstractChunkPosWrapper;
|
||||
import com.seibel.lod.common.wrappers.block.BlockPosWrapper;
|
||||
@@ -17,7 +16,7 @@ import net.minecraft.world.level.ChunkPos;
|
||||
*/
|
||||
public class ChunkPosWrapper extends AbstractChunkPosWrapper
|
||||
{
|
||||
private net.minecraft.world.level.ChunkPos chunkPos;
|
||||
private final net.minecraft.world.level.ChunkPos chunkPos;
|
||||
|
||||
public ChunkPosWrapper()
|
||||
{
|
||||
|
||||
@@ -30,8 +30,8 @@ import net.minecraft.world.level.levelgen.Heightmap;
|
||||
*/
|
||||
public class ChunkWrapper implements IChunkWrapper
|
||||
{
|
||||
private ChunkAccess chunk;
|
||||
private BlockAndTintGetter lightSource;
|
||||
private final ChunkAccess chunk;
|
||||
private final BlockAndTintGetter lightSource;
|
||||
private final int CHUNK_SECTION_SHIFT = 4;
|
||||
private final int CHUNK_SECTION_MASK = 0b1111;
|
||||
private final int CHUNK_SIZE_SHIFT = 4;
|
||||
@@ -46,16 +46,10 @@ public class ChunkWrapper implements IChunkWrapper
|
||||
public boolean isPositionInWater(int x, int y, int z)
|
||||
{
|
||||
BlockState blockState = chunk.getSections()[y >> CHUNK_SECTION_SHIFT].getBlockState(x & CHUNK_SIZE_MASK, y & CHUNK_SECTION_MASK, z & CHUNK_SIZE_MASK);
|
||||
|
||||
//This type of block is always in water
|
||||
if((blockState.getBlock() instanceof LiquidBlock))// && !(blockState.getBlock() instanceof IWaterLoggable))
|
||||
return true;
|
||||
|
||||
|
||||
//This type of block could be in water
|
||||
if(blockState.getOptionalValue(BlockStateProperties.WATERLOGGED).isPresent() && blockState.getOptionalValue(BlockStateProperties.WATERLOGGED).get())
|
||||
return true;
|
||||
|
||||
return false;
|
||||
return (blockState.getBlock() instanceof LiquidBlock)// && !(blockState.getBlock() instanceof IWaterLoggable))
|
||||
|| (blockState.getOptionalValue(BlockStateProperties.WATERLOGGED).isPresent() && blockState.getOptionalValue(BlockStateProperties.WATERLOGGED).get());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -124,7 +124,7 @@ public abstract class ConfigGui
|
||||
TranslatableComponent name;
|
||||
int index;
|
||||
/** Hides the button */
|
||||
boolean hideOption = false;
|
||||
final boolean hideOption = false;
|
||||
/** This asks if it is a button to goto a new screen */
|
||||
boolean screenButton = false;
|
||||
/** This is only called if button is true */
|
||||
@@ -170,9 +170,10 @@ public abstract class ConfigGui
|
||||
initClient(field, info, category);
|
||||
}
|
||||
|
||||
String s = (!category.isEmpty() ? category + "." : "") + field.getName();
|
||||
if (field.isAnnotationPresent(ConfigAnnotations.Entry.class))
|
||||
{
|
||||
entryMap.put((!category.isEmpty() ? category + "." : "") + field.getName(), info);
|
||||
entryMap.put(s, info);
|
||||
info.varClass = field.getType();
|
||||
try
|
||||
{
|
||||
@@ -182,7 +183,7 @@ public abstract class ConfigGui
|
||||
}
|
||||
|
||||
if (field.isAnnotationPresent(ConfigAnnotations.ScreenEntry.class))
|
||||
initNestedClass(field.getType(), (!category.isEmpty() ? category + "." : "") + field.getName());
|
||||
initNestedClass(field.getType(), s);
|
||||
|
||||
|
||||
info.field = field;
|
||||
@@ -440,7 +441,6 @@ public abstract class ConfigGui
|
||||
try {
|
||||
Files.deleteIfExists(configFilePath);
|
||||
saveToFile();
|
||||
return;
|
||||
} catch (Exception f) {
|
||||
LOGGER.info("Failed creating config file for " + MOD_NAME_READABLE + " at the path [" + configFilePath.toString() + "].");
|
||||
f.printStackTrace();
|
||||
@@ -476,7 +476,7 @@ public abstract class ConfigGui
|
||||
|
||||
private final String translationPrefix;
|
||||
private final Screen parent;
|
||||
private String category;
|
||||
private final String category;
|
||||
private ConfigListWidget list;
|
||||
private boolean reload = false;
|
||||
|
||||
@@ -605,7 +605,7 @@ public abstract class ConfigGui
|
||||
String key = translationPrefix + (info.category.isEmpty() ? "" : info.category + ".") + info.field.getName() + ".@tooltip";
|
||||
|
||||
if (info.error != null && text.equals(name)) renderTooltip(matrices, (Component) info.error.getValue(), mouseX, mouseY);
|
||||
else if (I18n.exists(key) && (text == null ? false : text.equals(name))) {
|
||||
else if (I18n.exists(key) && (text != null && text.equals(name))) {
|
||||
List<Component> list = new ArrayList<>();
|
||||
for (String str : I18n.get(key).split("\n"))
|
||||
list.add(new TextComponent(str));
|
||||
@@ -623,7 +623,7 @@ public abstract class ConfigGui
|
||||
|
||||
public static class ConfigListWidget extends ContainerObjectSelectionList<ButtonEntry>
|
||||
{
|
||||
Font textRenderer;
|
||||
final Font textRenderer;
|
||||
|
||||
public ConfigListWidget(Minecraft minecraftClient, int i, int j, int k, int l, int m)
|
||||
{
|
||||
|
||||
+1
-1
@@ -172,7 +172,7 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper
|
||||
int lightMapHeight = getLightmapTextureHeight();
|
||||
int lightMapWidth = getLightmapTextureWidth();
|
||||
|
||||
int pixels[] = new int[lightMapWidth * lightMapHeight];
|
||||
int[] pixels = new int[lightMapWidth * lightMapHeight];
|
||||
for (int u = 0; u < lightMapWidth; u++)
|
||||
{
|
||||
for (int v = 0; v < lightMapWidth; v++)
|
||||
|
||||
@@ -36,7 +36,7 @@ public class BiomeWrapper implements IBiomeWrapper
|
||||
{
|
||||
|
||||
public static final ConcurrentMap<Biome, BiomeWrapper> biomeWrapperMap = new ConcurrentHashMap<>();
|
||||
private Biome biome;
|
||||
private final Biome biome;
|
||||
|
||||
public BiomeWrapper(Biome biome)
|
||||
{
|
||||
|
||||
@@ -34,7 +34,7 @@ import net.minecraft.world.level.dimension.DimensionType;
|
||||
public class DimensionTypeWrapper implements IDimensionTypeWrapper
|
||||
{
|
||||
private static final ConcurrentMap<DimensionType, DimensionTypeWrapper> dimensionTypeWrapperMap = new ConcurrentHashMap<>();
|
||||
private DimensionType dimensionType;
|
||||
private final DimensionType dimensionType;
|
||||
|
||||
public DimensionTypeWrapper(DimensionType dimensionType)
|
||||
{
|
||||
|
||||
@@ -24,12 +24,9 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
|
||||
import com.seibel.lod.core.enums.WorldType;
|
||||
import com.seibel.lod.core.wrapperInterfaces.block.AbstractBlockPosWrapper;
|
||||
import com.seibel.lod.core.wrapperInterfaces.chunk.AbstractChunkPosWrapper;
|
||||
import com.seibel.lod.core.wrapperInterfaces.chunk.IChunkWrapper;
|
||||
import com.seibel.lod.core.wrapperInterfaces.world.IBiomeWrapper;
|
||||
import com.seibel.lod.core.wrapperInterfaces.world.IWorldWrapper;
|
||||
import com.seibel.lod.common.wrappers.block.BlockPosWrapper;
|
||||
import com.seibel.lod.common.wrappers.chunk.ChunkWrapper;
|
||||
|
||||
import net.minecraft.client.multiplayer.ClientLevel;
|
||||
|
||||
+2
-3
@@ -113,11 +113,10 @@ public class ExperimentalGenerator extends AbstractExperimentalWorldGeneratorWra
|
||||
targetStep = Steps.Surface; //Carvers or Surface???
|
||||
break;
|
||||
case FEATURES:
|
||||
case FULL:
|
||||
targetStep = Steps.Features;
|
||||
break;
|
||||
case FULL:
|
||||
targetStep = Steps.Features; // TODO!
|
||||
break;
|
||||
// TODO!
|
||||
default:
|
||||
assert false;
|
||||
return;
|
||||
|
||||
+45
-69
@@ -27,11 +27,8 @@ import com.seibel.lod.core.enums.config.DistanceGenerationMode;
|
||||
import com.seibel.lod.core.objects.lod.LodDimension;
|
||||
import com.seibel.lod.core.wrapperInterfaces.modAccessor.IStarlightAccessor;
|
||||
|
||||
import it.unimi.dsi.fastutil.objects.ObjectListIterator;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
@@ -44,23 +41,17 @@ import java.util.concurrent.TimeUnit;
|
||||
|
||||
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
||||
import com.mojang.datafixers.DataFixer;
|
||||
import com.mojang.datafixers.util.Pair;
|
||||
import com.seibel.lod.common.wrappers.chunk.ChunkWrapper;
|
||||
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.server.level.WorldGenRegion;
|
||||
import net.minecraft.world.level.BlockAndTintGetter;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
import net.minecraft.world.level.ChunkPos;
|
||||
import net.minecraft.world.level.ColorResolver;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.LightLayer;
|
||||
import net.minecraft.world.level.StructureFeatureManager;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
import net.minecraft.world.level.biome.BiomeManager;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.chunk.ChunkAccess;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.chunk.ChunkStatus;
|
||||
@@ -74,7 +65,6 @@ import net.minecraft.CrashReport;
|
||||
import net.minecraft.CrashReportCategory;
|
||||
import net.minecraft.ReportedException;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.core.RegistryAccess;
|
||||
import net.minecraft.core.SectionPos;
|
||||
@@ -84,9 +74,7 @@ import net.minecraft.world.level.levelgen.blending.Blender;
|
||||
import net.minecraft.world.level.levelgen.structure.StructureCheck;
|
||||
import net.minecraft.world.level.levelgen.structure.StructureStart;
|
||||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureManager;
|
||||
import net.minecraft.world.level.lighting.LayerLightEngine;
|
||||
import net.minecraft.world.level.lighting.LevelLightEngine;
|
||||
import net.minecraft.world.level.material.FluidState;
|
||||
import net.minecraft.world.level.storage.WorldData;
|
||||
|
||||
/*
|
||||
@@ -111,10 +99,10 @@ public final class WorldGenerationStep {
|
||||
|
||||
public static class Rolling {
|
||||
|
||||
private int size;
|
||||
private final int size;
|
||||
private double total = 0d;
|
||||
private int index = 0;
|
||||
private double samples[];
|
||||
private final double[] samples;
|
||||
|
||||
public Rolling(int size) {
|
||||
this.size = size;
|
||||
@@ -152,17 +140,17 @@ public final class WorldGenerationStep {
|
||||
|
||||
public static class PerfCalculator {
|
||||
public static final int SIZE = 50;
|
||||
Rolling totalTime = new Rolling(SIZE);
|
||||
Rolling emptyTime = new Rolling(SIZE);
|
||||
Rolling structStartTime = new Rolling(SIZE);
|
||||
Rolling structRefTime = new Rolling(SIZE);
|
||||
Rolling biomeTime = new Rolling(SIZE);
|
||||
Rolling noiseTime = new Rolling(SIZE);
|
||||
Rolling surfaceTime = new Rolling(SIZE);
|
||||
Rolling carverTime = new Rolling(SIZE);
|
||||
Rolling featureTime = new Rolling(SIZE);
|
||||
Rolling lightTime = new Rolling(SIZE);
|
||||
Rolling lodTime = new Rolling(SIZE);
|
||||
final Rolling totalTime = new Rolling(SIZE);
|
||||
final Rolling emptyTime = new Rolling(SIZE);
|
||||
final Rolling structStartTime = new Rolling(SIZE);
|
||||
final Rolling structRefTime = new Rolling(SIZE);
|
||||
final Rolling biomeTime = new Rolling(SIZE);
|
||||
final Rolling noiseTime = new Rolling(SIZE);
|
||||
final Rolling surfaceTime = new Rolling(SIZE);
|
||||
final Rolling carverTime = new Rolling(SIZE);
|
||||
final Rolling featureTime = new Rolling(SIZE);
|
||||
final Rolling lightTime = new Rolling(SIZE);
|
||||
final Rolling lodTime = new Rolling(SIZE);
|
||||
|
||||
public void recordEvent(PrefEvent e) {
|
||||
totalTime.add(e.endNano - e.beginNano);
|
||||
@@ -206,8 +194,8 @@ public final class WorldGenerationStep {
|
||||
public static final class GridList<T> extends ArrayList<T> implements List<T> {
|
||||
|
||||
public static class Pos {
|
||||
public int x;
|
||||
public int y;
|
||||
public final int x;
|
||||
public final int y;
|
||||
|
||||
public Pos(int xx, int yy) {
|
||||
x = xx;
|
||||
@@ -225,23 +213,23 @@ public final class WorldGenerationStep {
|
||||
this.gridCentreToEdge = gridCentreToEdge;
|
||||
}
|
||||
|
||||
public final T getOffsetOf(int index, int x, int y) {
|
||||
public T getOffsetOf(int index, int x, int y) {
|
||||
return get(index + x + y * gridSize);
|
||||
}
|
||||
|
||||
public final int offsetOf(int index, int x, int y) {
|
||||
public int offsetOf(int index, int x, int y) {
|
||||
return index + x + y * gridSize;
|
||||
}
|
||||
|
||||
public final Pos posOf(int index) {
|
||||
public Pos posOf(int index) {
|
||||
return new Pos(index % gridSize, index / gridSize);
|
||||
}
|
||||
|
||||
public final int calculateOffset(int x, int y) {
|
||||
public int calculateOffset(int x, int y) {
|
||||
return x + y * gridSize;
|
||||
}
|
||||
|
||||
public final GridList<T> subGrid(int gridCentreToEdge) {
|
||||
public GridList<T> subGrid(int gridCentreToEdge) {
|
||||
int centreIndex = size() / 2;
|
||||
GridList<T> subGrid = new GridList<T>(gridCentreToEdge);
|
||||
for (int oy = -gridCentreToEdge; oy <= gridCentreToEdge; oy++) {
|
||||
@@ -310,14 +298,14 @@ public final class WorldGenerationStep {
|
||||
}
|
||||
|
||||
public static final class ThreadedParameters {
|
||||
private static ThreadLocal<ThreadedParameters> localParam = new ThreadLocal<ThreadedParameters>();
|
||||
private static final ThreadLocal<ThreadedParameters> localParam = new ThreadLocal<ThreadedParameters>();
|
||||
final ServerLevel level;
|
||||
final StructureFeatureManager structFeat;
|
||||
final StructureCheck structCheck;
|
||||
boolean isValid = true;
|
||||
public final PerfCalculator perf = new PerfCalculator();
|
||||
|
||||
public static final ThreadedParameters getOrMake(GlobalParameters param) {
|
||||
public static ThreadedParameters getOrMake(GlobalParameters param) {
|
||||
ThreadedParameters tParam = localParam.get();
|
||||
if (tParam != null && tParam.isValid && tParam.level == param.level)
|
||||
return tParam;
|
||||
@@ -366,21 +354,21 @@ public final class WorldGenerationStep {
|
||||
});
|
||||
}
|
||||
|
||||
public final boolean isCompleted() {
|
||||
public boolean isCompleted() {
|
||||
return future.isDone();
|
||||
}
|
||||
|
||||
public final boolean hasTimeout(int duration, TimeUnit unit) {
|
||||
public boolean hasTimeout(int duration, TimeUnit unit) {
|
||||
long currentTime = System.nanoTime();
|
||||
long delta = currentTime - nanotime;
|
||||
return (delta > TimeUnit.NANOSECONDS.convert(duration, unit));
|
||||
}
|
||||
|
||||
public final void terminate() {
|
||||
public void terminate() {
|
||||
future.cancel(true);
|
||||
}
|
||||
|
||||
public final void join() {
|
||||
public void join() {
|
||||
try {
|
||||
future.get();
|
||||
} catch (InterruptedException | ExecutionException e) {
|
||||
@@ -388,7 +376,7 @@ public final class WorldGenerationStep {
|
||||
}
|
||||
}
|
||||
|
||||
public final boolean tooClose(int cx, int cz, int cr) {
|
||||
public boolean tooClose(int cx, int cz, int cr) {
|
||||
int distX = Math.abs(cx - pos.x);
|
||||
int distZ = Math.abs(cz - pos.z);
|
||||
int minRange = cr+range+1; //Need one to account for the center
|
||||
@@ -396,7 +384,7 @@ public final class WorldGenerationStep {
|
||||
return distX < minRange && distZ < minRange;
|
||||
}
|
||||
|
||||
public final void refreshTimeout() {
|
||||
public void refreshTimeout() {
|
||||
nanotime = System.nanoTime();
|
||||
}
|
||||
|
||||
@@ -406,7 +394,7 @@ public final class WorldGenerationStep {
|
||||
}
|
||||
}
|
||||
|
||||
private final static <T> T joinAsync(CompletableFuture<T> f) {
|
||||
private static <T> T joinAsync(CompletableFuture<T> f) {
|
||||
return f.join();
|
||||
}
|
||||
|
||||
@@ -424,7 +412,7 @@ public final class WorldGenerationStep {
|
||||
public final ExecutorService executors = Executors
|
||||
.newCachedThreadPool(new ThreadFactoryBuilder().setNameFormat("Gen-Worker-Thread-%d").build());
|
||||
|
||||
public final boolean tryAddPoint(int px, int pz, int range, Steps target) {
|
||||
public boolean tryAddPoint(int px, int pz, int range, Steps target) {
|
||||
int boxSize = range * 2 + 1;
|
||||
int x = Math.floorDiv(px, boxSize) * boxSize + range;
|
||||
int z = Math.floorDiv(pz, boxSize) * boxSize + range;
|
||||
@@ -438,7 +426,7 @@ public final class WorldGenerationStep {
|
||||
return true;
|
||||
}
|
||||
|
||||
public final void updateAllFutures() {
|
||||
public void updateAllFutures() {
|
||||
// Update all current out standing jobs
|
||||
Iterator<GenerationEvent> iter = events.iterator();
|
||||
while (iter.hasNext()) {
|
||||
@@ -504,33 +492,24 @@ public final class WorldGenerationStep {
|
||||
}
|
||||
|
||||
switch (e.target) {
|
||||
case Empty:
|
||||
return;
|
||||
case StructureStart:
|
||||
generationMode = DistanceGenerationMode.NONE;
|
||||
break;
|
||||
case StructureReference:
|
||||
generationMode = DistanceGenerationMode.NONE;
|
||||
break;
|
||||
case Biomes:
|
||||
generationMode = DistanceGenerationMode.BIOME_ONLY_SIMULATE_HEIGHT;
|
||||
break;
|
||||
case Noise:
|
||||
generationMode = DistanceGenerationMode.BIOME_ONLY_SIMULATE_HEIGHT;
|
||||
break;
|
||||
case Surface:
|
||||
generationMode = DistanceGenerationMode.SURFACE;
|
||||
break;
|
||||
case Carvers:
|
||||
generationMode = DistanceGenerationMode.SURFACE;
|
||||
break;
|
||||
case Features:
|
||||
generationMode = DistanceGenerationMode.FEATURES;
|
||||
break;
|
||||
case Empty:
|
||||
case LiquidCarvers:
|
||||
return;
|
||||
case Light:
|
||||
return;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
@@ -553,7 +532,7 @@ public final class WorldGenerationStep {
|
||||
}
|
||||
}
|
||||
|
||||
public final GridList<ChunkAccess> generateDirect(GenerationEvent e, GridList<ChunkAccess> subRange, Steps step,
|
||||
public GridList<ChunkAccess> generateDirect(GenerationEvent e, GridList<ChunkAccess> subRange, Steps step,
|
||||
LightedWorldGenRegion region) {
|
||||
try {
|
||||
subRange.forEach((chunk) -> {
|
||||
@@ -629,7 +608,7 @@ public final class WorldGenerationStep {
|
||||
}
|
||||
}
|
||||
|
||||
public final void generateGroup(ThreadedParameters tParams, WorldGenRegion worldGenRegion,
|
||||
public void generateGroup(ThreadedParameters tParams, WorldGenRegion worldGenRegion,
|
||||
List<ChunkAccess> chunks) {
|
||||
|
||||
for (ChunkAccess chunk : chunks) {
|
||||
@@ -654,7 +633,7 @@ public final class WorldGenerationStep {
|
||||
}
|
||||
}
|
||||
|
||||
public final class StepStructureReference {
|
||||
public static final class StepStructureReference {
|
||||
public final ChunkStatus STATUS = ChunkStatus.STRUCTURE_REFERENCES;
|
||||
|
||||
private void createReferences(WorldGenRegion worldGenLevel, StructureFeatureManager structureFeatureManager,
|
||||
@@ -695,7 +674,7 @@ public final class WorldGenerationStep {
|
||||
}
|
||||
}
|
||||
|
||||
public final void generateGroup(ThreadedParameters tParams, WorldGenRegion worldGenRegion,
|
||||
public void generateGroup(ThreadedParameters tParams, WorldGenRegion worldGenRegion,
|
||||
List<ChunkAccess> chunks) {
|
||||
|
||||
for (ChunkAccess chunk : chunks) {
|
||||
@@ -712,7 +691,7 @@ public final class WorldGenerationStep {
|
||||
public final class StepBiomes {
|
||||
public final ChunkStatus STATUS = ChunkStatus.BIOMES;
|
||||
|
||||
public final void generateGroup(ThreadedParameters tParams, WorldGenRegion worldGenRegion,
|
||||
public void generateGroup(ThreadedParameters tParams, WorldGenRegion worldGenRegion,
|
||||
List<ChunkAccess> chunks) {
|
||||
|
||||
for (ChunkAccess chunk : chunks) {
|
||||
@@ -730,7 +709,7 @@ public final class WorldGenerationStep {
|
||||
public final class StepNoise {
|
||||
public final ChunkStatus STATUS = ChunkStatus.NOISE;
|
||||
|
||||
public final void generateGroup(ThreadedParameters tParams, WorldGenRegion worldGenRegion,
|
||||
public void generateGroup(ThreadedParameters tParams, WorldGenRegion worldGenRegion,
|
||||
List<ChunkAccess> chunks) {
|
||||
|
||||
for (ChunkAccess chunk : chunks) {
|
||||
@@ -747,7 +726,7 @@ public final class WorldGenerationStep {
|
||||
public final class StepSurface {
|
||||
public final ChunkStatus STATUS = ChunkStatus.SURFACE;
|
||||
|
||||
public final void generateGroup(ThreadedParameters tParams, WorldGenRegion worldGenRegion,
|
||||
public void generateGroup(ThreadedParameters tParams, WorldGenRegion worldGenRegion,
|
||||
List<ChunkAccess> chunks) {
|
||||
for (ChunkAccess chunk : chunks) {
|
||||
((ProtoChunk) chunk).setStatus(STATUS);
|
||||
@@ -760,10 +739,10 @@ public final class WorldGenerationStep {
|
||||
}
|
||||
}
|
||||
|
||||
public final class StepCarvers {
|
||||
public static final class StepCarvers {
|
||||
public final ChunkStatus STATUS = ChunkStatus.CARVERS;
|
||||
|
||||
public final void generateGroup(ThreadedParameters tParams, WorldGenRegion worldGenRegion,
|
||||
public void generateGroup(ThreadedParameters tParams, WorldGenRegion worldGenRegion,
|
||||
List<ChunkAccess> chunks) {
|
||||
for (ChunkAccess chunk : chunks) {
|
||||
// DISABLED CURRENTLY!
|
||||
@@ -782,7 +761,7 @@ public final class WorldGenerationStep {
|
||||
public final class StepFeatures {
|
||||
public final ChunkStatus STATUS = ChunkStatus.FEATURES;
|
||||
|
||||
public final void generateGroup(ThreadedParameters tParams, WorldGenRegion worldGenRegion,
|
||||
public void generateGroup(ThreadedParameters tParams, WorldGenRegion worldGenRegion,
|
||||
GridList<ChunkAccess> chunks) {
|
||||
for (ChunkAccess chunk : chunks) {
|
||||
((ProtoChunk) chunk).setStatus(STATUS);
|
||||
@@ -795,7 +774,6 @@ public final class WorldGenerationStep {
|
||||
Blender.generateBorderTicks(worldGenRegion, chunk);
|
||||
} catch (ReportedException e) {
|
||||
e.printStackTrace();
|
||||
continue;
|
||||
// FIXME: Features concurrent modification issue. Something about cocobeans just
|
||||
// aren't happy
|
||||
// For now just retry.
|
||||
@@ -809,10 +787,10 @@ public final class WorldGenerationStep {
|
||||
}
|
||||
}
|
||||
|
||||
public final class StepLight {
|
||||
public static final class StepLight {
|
||||
public final ChunkStatus STATUS = ChunkStatus.LIGHT;
|
||||
|
||||
public final void generateGroup(LevelLightEngine lightEngine,
|
||||
public void generateGroup(LevelLightEngine lightEngine,
|
||||
GridList<ChunkAccess> chunks) {
|
||||
for (ChunkAccess chunk : chunks) {
|
||||
((ProtoChunk) chunk).setStatus(STATUS);
|
||||
@@ -829,7 +807,6 @@ public final class WorldGenerationStep {
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -882,8 +859,7 @@ public final class WorldGenerationStep {
|
||||
@Override
|
||||
public BlockGetter getChunkForLighting(int chunkX, int chunkZ) {
|
||||
// May be null
|
||||
ChunkAccess chunk = genRegion.getChunk(chunkX, chunkZ, ChunkStatus.EMPTY, false);
|
||||
return chunk;
|
||||
return genRegion.getChunk(chunkX, chunkZ, ChunkStatus.EMPTY, false);
|
||||
}
|
||||
@Override
|
||||
public BlockGetter getLevel() {
|
||||
|
||||
+11
-45
@@ -4,58 +4,25 @@ import com.seibel.lod.core.builders.lodBuilding.LodBuilder;
|
||||
import com.seibel.lod.core.builders.lodBuilding.LodBuilderConfig;
|
||||
import com.seibel.lod.core.enums.config.DistanceGenerationMode;
|
||||
import com.seibel.lod.core.objects.lod.LodDimension;
|
||||
import com.seibel.lod.core.util.LodThreadFactory;
|
||||
import com.seibel.lod.core.wrapperInterfaces.chunk.AbstractChunkPosWrapper;
|
||||
import com.seibel.lod.core.wrapperInterfaces.world.IWorldWrapper;
|
||||
import com.seibel.lod.core.wrapperInterfaces.worldGeneration.AbstractWorldGeneratorWrapper;
|
||||
|
||||
import it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.concurrent.atomic.AtomicReferenceArray;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.IntFunction;
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.mojang.datafixers.util.Either;
|
||||
import com.seibel.lod.common.wrappers.chunk.ChunkWrapper;
|
||||
import com.seibel.lod.common.wrappers.world.WorldWrapper;
|
||||
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.server.level.WorldGenRegion;
|
||||
import net.minecraft.server.level.ChunkHolder.ChunkLoadingFailure;
|
||||
import net.minecraft.world.level.ChunkPos;
|
||||
import net.minecraft.world.level.LevelHeightAccessor;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.level.chunk.*;
|
||||
import net.minecraft.world.level.chunk.ChunkStatus.ChunkType;
|
||||
import net.minecraft.server.level.ThreadedLevelLightEngine;
|
||||
import net.minecraft.Util;
|
||||
import net.minecraft.core.Registry;
|
||||
/* */ import net.minecraft.server.level.ChunkHolder;
|
||||
/* */
|
||||
/* */ import net.minecraft.server.level.ServerLevel;
|
||||
/* */ import net.minecraft.server.level.ThreadedLevelLightEngine;
|
||||
/* */ import net.minecraft.server.level.WorldGenRegion;
|
||||
/* */ import net.minecraft.util.profiling.jfr.JvmProfiler;
|
||||
/* */ import net.minecraft.util.profiling.jfr.callback.ProfiledDuration;
|
||||
/* */ import net.minecraft.world.level.WorldGenLevel;
|
||||
/* */ import net.minecraft.world.level.levelgen.BelowZeroRetrogen;
|
||||
/* */ import net.minecraft.world.level.levelgen.GenerationStep;
|
||||
/* */ import net.minecraft.world.level.levelgen.Heightmap;
|
||||
import net.minecraft.world.level.levelgen.Heightmap.Types;
|
||||
/* */ import net.minecraft.world.level.levelgen.blending.Blender;
|
||||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureManager;
|
||||
import net.minecraft.world.level.lighting.LevelLightEngine;
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
|
||||
/**
|
||||
* @author James Seibel
|
||||
@@ -122,8 +89,6 @@ public class WorldGeneratorWrapper extends AbstractWorldGeneratorWrapper
|
||||
|
||||
ChunkStatus targetStatus;
|
||||
switch (generationMode) {
|
||||
case NONE:
|
||||
return;
|
||||
case BIOME_ONLY:
|
||||
targetStatus = ChunkStatus.BIOMES;
|
||||
break;
|
||||
@@ -139,6 +104,7 @@ public class WorldGeneratorWrapper extends AbstractWorldGeneratorWrapper
|
||||
case FULL:
|
||||
targetStatus = ChunkStatus.FULL;
|
||||
break;
|
||||
case NONE:
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -28,20 +28,12 @@ import com.seibel.lod.common.wrappers.world.WorldWrapper;
|
||||
import com.seibel.lod.core.util.SingletonHandler;
|
||||
import com.seibel.lod.core.wrapperInterfaces.chunk.IChunkWrapper;
|
||||
import com.seibel.lod.core.wrapperInterfaces.config.ILodConfigWrapperSingleton;
|
||||
import com.seibel.lod.fabric.mixins.events.MixinClientLevel;
|
||||
|
||||
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientChunkEvents;
|
||||
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientLifecycleEvents;
|
||||
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
|
||||
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
|
||||
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerChunkEvents;
|
||||
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents;
|
||||
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerWorldEvents;
|
||||
import net.fabricmc.fabric.mixin.event.lifecycle.client.ClientChunkManagerMixin;
|
||||
import net.minecraft.client.KeyMapping;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.multiplayer.ClientChunkCache;
|
||||
import net.minecraft.client.multiplayer.ClientPacketListener;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.world.level.Level;
|
||||
|
||||
@@ -26,7 +26,7 @@ public class MixinFogRenderer {
|
||||
private static final float A_EVEN_LARGER_VALUE = 42069420694206942069.F;
|
||||
|
||||
@Inject(at = @At("RETURN"), method = "setupFog(Lnet/minecraft/client/Camera;Lnet/minecraft/client/renderer/FogRenderer$FogMode;FZ)V")
|
||||
private static final void disableSetupFog(Camera camera, FogMode fogMode, float f, boolean bl, CallbackInfo callback) {
|
||||
private static void disableSetupFog(Camera camera, FogMode fogMode, float f, boolean bl, CallbackInfo callback) {
|
||||
FogType fogTypes = camera.getFluidInCamera();
|
||||
Entity entity = camera.getEntity();
|
||||
boolean isUnderWater = (entity instanceof LivingEntity) && ((LivingEntity)entity).hasEffect(MobEffects.BLINDNESS);
|
||||
|
||||
@@ -19,19 +19,15 @@
|
||||
|
||||
package com.seibel.lod.fabric.mixins;
|
||||
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import com.mojang.math.Matrix4f;
|
||||
import com.seibel.lod.common.clouds.CloudBufferSingleton;
|
||||
import com.seibel.lod.common.clouds.CloudTexture;
|
||||
import com.seibel.lod.common.clouds.NoiseCloudHandler;
|
||||
import com.seibel.lod.common.wrappers.McObjectConverter;
|
||||
import com.seibel.lod.common.wrappers.config.LodConfigWrapperSingleton;
|
||||
import com.seibel.lod.core.util.LodUtil;
|
||||
import com.seibel.lod.core.util.SingletonHandler;
|
||||
import com.seibel.lod.core.wrapperInterfaces.config.ILodConfigWrapperSingleton;
|
||||
import com.seibel.lod.core.wrapperInterfaces.modAccessor.IModChecker;
|
||||
import net.minecraft.client.renderer.LevelRenderer;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
@@ -39,8 +35,6 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import com.seibel.lod.core.api.ClientApi;
|
||||
import com.seibel.lod.core.objects.math.Mat4f;
|
||||
|
||||
import net.minecraft.client.renderer.RenderType;
|
||||
|
||||
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
@@ -170,9 +164,9 @@ public class MixinWorldRenderer
|
||||
double posZ = cameraZ / scale + 0.33000001311302185D;
|
||||
posX -= Math.floor(posX / 2048.0D) * 2048;
|
||||
posZ -= Math.floor(posZ / 2048.0D) * 2048;
|
||||
float adjustedX = (float) (posX - (double) Math.floor(posX));
|
||||
float adjustedY = (float) (posY / 4.0D - (double) Math.floor(posY / 4.0D)) * 4.0F;
|
||||
float adjustedZ = (float) (posZ - (double) Math.floor(posZ));
|
||||
float adjustedX = (float) (posX - Math.floor(posX));
|
||||
float adjustedY = (float) (posY / 4.0D - Math.floor(posY / 4.0D)) * 4.0F;
|
||||
float adjustedZ = (float) (posZ - Math.floor(posZ));
|
||||
Vec3 cloudColor = minecraft.level.getCloudColor(tickDelta);
|
||||
int floorX = (int) Math.floor(posX);
|
||||
int floorY = (int) Math.floor(posY / 4.0D);
|
||||
|
||||
@@ -5,8 +5,6 @@ import net.minecraft.client.multiplayer.ClientLevel;
|
||||
import net.minecraft.client.multiplayer.ClientPacketListener;
|
||||
import net.minecraft.client.renderer.LevelRenderer;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.util.profiling.ProfilerFiller;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.chunk.LevelChunk;
|
||||
import net.minecraft.world.level.dimension.DimensionType;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
|
||||
@@ -4,7 +4,6 @@ import com.seibel.lod.fabric.Main;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.client.multiplayer.ClientLevel;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
|
||||
@@ -15,7 +15,7 @@ import net.minecraft.world.level.ChunkPos;
|
||||
import net.minecraft.world.level.LevelHeightAccessor;
|
||||
|
||||
public class SodiumAccessor implements ISodiumAccessor {
|
||||
IWrapperFactory factory = SingletonHandler.get(IWrapperFactory.class);
|
||||
final IWrapperFactory factory = SingletonHandler.get(IWrapperFactory.class);
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
@@ -37,7 +37,7 @@ public class SodiumAccessor implements ISodiumAccessor {
|
||||
return false;
|
||||
//return true;
|
||||
}).mapToObj((long l) -> {
|
||||
return (AbstractChunkPosWrapper)factory.createChunkPos(l);
|
||||
return factory.createChunkPos(l);
|
||||
}).collect(Collectors.toCollection(HashSet::new));
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,6 @@ public class DependencySetup
|
||||
{
|
||||
public static void createInitialBindings()
|
||||
{
|
||||
SingletonHandler.bind(ILodConfigWrapperSingleton.class, LodConfigWrapperSingleton.INSTANCE);;
|
||||
SingletonHandler.bind(ILodConfigWrapperSingleton.class, LodConfigWrapperSingleton.INSTANCE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,9 +6,6 @@ import com.terraformersmc.modmenu.api.ModMenuApi;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* For making the config show up in modmenu
|
||||
*/
|
||||
|
||||
@@ -87,7 +87,7 @@ public class ForgeMain implements LodForgeMethodCaller
|
||||
MinecraftForge.EVENT_BUS.register(forgeClientProxy);
|
||||
}
|
||||
|
||||
private ModelDataMap dataMap = new ModelDataMap.Builder().build();
|
||||
private final ModelDataMap dataMap = new ModelDataMap.Builder().build();
|
||||
@Override
|
||||
public List<BakedQuad> getQuads(MinecraftWrapper mc, Block block, BlockState blockState, Direction direction, Random random) {
|
||||
return mc.getModelManager().getBlockModelShaper().getBlockModel(block.defaultBlockState()).getQuads(blockState, direction, random, dataMap);
|
||||
|
||||
@@ -27,7 +27,7 @@ public class MixinFogRenderer {
|
||||
@Inject(at = @At("RETURN"),
|
||||
method = "setupFog(Lnet/minecraft/client/Camera;Lnet/minecraft/client/renderer/FogRenderer$FogMode;FZF)V",
|
||||
remap = false) // Remap = false due to this being added by forge.
|
||||
private static final void disableSetupFog(Camera camera, FogMode fogMode, float f, boolean bl, float partTick, CallbackInfo callback) {
|
||||
private static void disableSetupFog(Camera camera, FogMode fogMode, float f, boolean bl, float partTick, CallbackInfo callback) {
|
||||
ILodConfigWrapperSingleton CONFIG;
|
||||
try {
|
||||
CONFIG = SingletonHandler.get(ILodConfigWrapperSingleton.class);
|
||||
|
||||
@@ -19,19 +19,15 @@
|
||||
|
||||
package com.seibel.lod.forge.mixins;
|
||||
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import com.mojang.math.Matrix4f;
|
||||
import com.seibel.lod.common.clouds.CloudBufferSingleton;
|
||||
import com.seibel.lod.common.clouds.CloudTexture;
|
||||
import com.seibel.lod.common.clouds.NoiseCloudHandler;
|
||||
import com.seibel.lod.common.wrappers.McObjectConverter;
|
||||
import com.seibel.lod.common.wrappers.config.LodConfigWrapperSingleton;
|
||||
import com.seibel.lod.core.util.LodUtil;
|
||||
import com.seibel.lod.core.util.SingletonHandler;
|
||||
import com.seibel.lod.core.wrapperInterfaces.config.ILodConfigWrapperSingleton;
|
||||
import com.seibel.lod.core.wrapperInterfaces.modAccessor.IModChecker;
|
||||
import net.minecraft.client.renderer.LevelRenderer;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
@@ -39,8 +35,6 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import com.seibel.lod.core.api.ClientApi;
|
||||
import com.seibel.lod.core.objects.math.Mat4f;
|
||||
|
||||
import net.minecraft.client.renderer.RenderType;
|
||||
|
||||
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
@@ -170,9 +164,9 @@ public class MixinWorldRenderer
|
||||
double posZ = cameraZ / scale + 0.33000001311302185D;
|
||||
posX -= Math.floor(posX / 2048.0D) * 2048;
|
||||
posZ -= Math.floor(posZ / 2048.0D) * 2048;
|
||||
float adjustedX = (float) (posX - (double) Math.floor(posX));
|
||||
float adjustedY = (float) (posY / 4.0D - (double) Math.floor(posY / 4.0D)) * 4.0F;
|
||||
float adjustedZ = (float) (posZ - (double) Math.floor(posZ));
|
||||
float adjustedX = (float) (posX - Math.floor(posX));
|
||||
float adjustedY = (float) (posY / 4.0D - Math.floor(posY / 4.0D)) * 4.0F;
|
||||
float adjustedZ = (float) (posZ - Math.floor(posZ));
|
||||
Vec3 cloudColor = minecraft.level.getCloudColor(tickDelta);
|
||||
int floorX = (int) Math.floor(posX);
|
||||
int floorY = (int) Math.floor(posY / 4.0D);
|
||||
|
||||
Reference in New Issue
Block a user