From 27cd001680bc7838e89285ed6e0b8de701b325dc Mon Sep 17 00:00:00 2001 From: Steveplays28 Date: Tue, 22 Aug 2023 11:36:45 +0200 Subject: [PATCH 01/40] feat: Update rendering block ignores Barrier blocks, structure void blocks, light blocks, and air blocks now share 2 `HashMap`s that define blocks that should be ignored by the LOD builder. --- .../common/wrappers/WrapperFactory.java | 6 +- .../wrappers/block/BlockStateWrapper.java | 133 +++++++++++++----- .../BatchGenerationEnvironment.java | 2 +- 3 files changed, 101 insertions(+), 40 deletions(-) diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/WrapperFactory.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/WrapperFactory.java index 85fee0a84..911a2378a 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/WrapperFactory.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/WrapperFactory.java @@ -22,8 +22,8 @@ package com.seibel.distanthorizons.common.wrappers; import com.seibel.distanthorizons.api.interfaces.override.worldGenerator.IDhApiWorldGenerator; import com.seibel.distanthorizons.common.wrappers.block.BiomeWrapper; import com.seibel.distanthorizons.common.wrappers.block.BlockStateWrapper; -import com.seibel.distanthorizons.common.wrappers.worldGeneration.BatchGenerationEnvironment; import com.seibel.distanthorizons.common.wrappers.chunk.ChunkWrapper; +import com.seibel.distanthorizons.common.wrappers.worldGeneration.BatchGenerationEnvironment; import com.seibel.distanthorizons.core.level.IDhLevel; import com.seibel.distanthorizons.core.level.IDhServerLevel; import com.seibel.distanthorizons.core.wrapperInterfaces.IWrapperFactory; @@ -35,6 +35,7 @@ import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.chunk.ChunkAccess; import java.io.IOException; +import java.util.HashMap; /** * This handles creating abstract wrapper objects. @@ -71,6 +72,9 @@ public class WrapperFactory implements IWrapperFactory @Override public IBlockStateWrapper getAirBlockStateWrapper() { return BlockStateWrapper.AIR; } + @Override + public HashMap getRendererIgnoredBlocks() { return BlockStateWrapper.RENDERER_IGNORED_BLOCKS; } + /** * Note: when this is updated for different MC versions, make sure you also update the documentation in diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BlockStateWrapper.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BlockStateWrapper.java index e19d0d9fb..b54fd8a1c 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BlockStateWrapper.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BlockStateWrapper.java @@ -3,16 +3,15 @@ package com.seibel.distanthorizons.common.wrappers.block; import com.seibel.distanthorizons.core.logging.DhLoggerBuilder; import com.seibel.distanthorizons.core.wrapperInterfaces.block.IBlockStateWrapper; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; -import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.jetbrains.annotations.NotNull; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; +import java.util.*; import java.util.concurrent.ConcurrentHashMap; #if MC_1_16_5 || MC_1_17_1 @@ -39,8 +38,11 @@ public class BlockStateWrapper implements IBlockStateWrapper // must be defined before AIR, otherwise a null pointer will be thrown private static final Logger LOGGER = DhLoggerBuilder.getLogger(); - public static final BlockStateWrapper AIR = new BlockStateWrapper(null); - public static final ConcurrentHashMap cache = new ConcurrentHashMap<>(); + public static final ConcurrentHashMap cache = new ConcurrentHashMap<>(); + public static final BlockStateWrapper AIR = fromBlockState(BuiltInRegistries.BLOCK.get(ResourceLocation.tryParse("minecraft:air")).defaultBlockState(), false); + public static final String[] RENDERER_IGNORED_BLOCKS_RESOURCE_LOCATIONS = {"minecraft:air", "minecraft:barrier", "minecraft:structure_void"}; + public static final HashMap RENDERER_IGNORED_BLOCKS_INTERNAL = getRendererIgnoredBlocksInternal(RENDERER_IGNORED_BLOCKS_RESOURCE_LOCATIONS); + public static final HashMap RENDERER_IGNORED_BLOCKS = getRendererIgnoredBlocks(RENDERER_IGNORED_BLOCKS_INTERNAL); /** * Cached so it can be quickly used as a semi-stable hashing method.
@@ -53,21 +55,75 @@ public class BlockStateWrapper implements IBlockStateWrapper // constructors // //==============// - public static BlockStateWrapper fromBlockState(BlockState blockState) + public static BlockStateWrapper fromBlockState(BlockState blockState) { - if (blockState == null || blockState.isAir()) - { + return fromBlockState(blockState, true); + } + + private static BlockStateWrapper fromBlockState(BlockState blockState, boolean nullCheck) + { + if (Objects.requireNonNull(blockState).isAir() && AIR != null) return AIR; - } - return cache.computeIfAbsent(blockState, BlockStateWrapper::new); + return cache.computeIfAbsent(blockState, blockState1 -> new BlockStateWrapper(blockState1, nullCheck)); } - public final BlockState blockState; - BlockStateWrapper(BlockState blockState) + /** + * Only meant for use in the {@code RENDERER_IGNORED_BLOCKS_INTERNAL} list. Do not use elsewhere, since the {@code levelWrapper} parameter of each {@code IBlockStateWrapper} will be {@code null}, causing issues. + * @param resourceLocations The resource location(s) of the block(s) that should be ignored by the renderer, may only contain {@code [a-z0-9/._-)} characters. + * @return The default blockstate(s) of the block(s), paired with the serialized resource location(s) of the block(s), which should be passed into the {@code RENDERER_IGNORED_BLOCKS_INTERNAL} map and the {@code getRendererIgnoredBlocks} method. + */ + @SuppressWarnings("SameParameterValue") + private static @NotNull HashMap getRendererIgnoredBlocksInternal(String @NotNull ... resourceLocations) { + HashMap blockStates = new HashMap<>(); + + for (String resourceLocation : resourceLocations) + { + ResourceLocation fetchedResourceLocation = Objects.requireNonNull(ResourceLocation.tryParse(resourceLocation), String.format("Supplied a resource location that couldn't be parsed by Minecraft: %s", resourceLocation)); + var splitResourceLocation = resourceLocation.split(":"); + + if (splitResourceLocation.length == 0) { + LOGGER.warn("A resource location that should be ignored by the renderer was in an invalid format: {}", resourceLocation); + continue; + } + + blockStates.put(BuiltInRegistries.BLOCK.get(fetchedResourceLocation).defaultBlockState(), splitResourceLocation[1].toUpperCase(Locale.ROOT)); + } + + return blockStates; + } + + /** + * Only meant for use in the {@code RENDERER_IGNORED_BLOCKS} list. Do not use elsewhere, since the {@code levelWrapper} parameter of each {@code IBlockStateWrapper} will be {@code null}, causing issues. + * @param rendererIgnoredBlocks A map containing the blockstate(s) of the block(s), paired with the resource location(s) of the block(s) that should be ignored by the renderer. + * @return The blockstate wrapper(s) of the blockstate(s), which should be passed into the {@code RENDERER_IGNORED_BLOCKS} list. + */ + @SuppressWarnings("SameParameterValue") + private static @NotNull HashMap getRendererIgnoredBlocks(@NotNull Map rendererIgnoredBlocks) + { + HashMap blockStateWrappers = new HashMap<>(); + + for (Map.Entry blockStateResourceLocations : rendererIgnoredBlocks.entrySet()) + { + blockStateWrappers.put(blockStateResourceLocations.getValue(), fromBlockState(blockStateResourceLocations.getKey(), false)); + } + + return blockStateWrappers; + } + + public final BlockState blockState; + + BlockStateWrapper(BlockState blockState) + { + this(blockState, true); + } + + // TODO: Pass in levelwrapper so nullCheck has a use + private BlockStateWrapper(BlockState blockState, boolean nullCheck) { this.blockState = blockState; - LOGGER.trace("Created BlockStateWrapper for [" + blockState + "]"); + + LOGGER.trace("Created BlockStateWrapper for [{}]", blockState); } @@ -95,49 +151,50 @@ public class BlockStateWrapper implements IBlockStateWrapper @Override public int getLightEmission() { return (this.blockState != null) ? this.blockState.getLightEmission() : 0; } - @Override public String serialize() // FIXME pass in level to prevent null pointers (or maybe just RegistryAccess?) { - // cache the serialization result so it can be quickly used as a semi-stable hashing method - if (this.serializationResult == null) + // the result can be quickly used as a semi-stable hashing method, so it's going to be cached + if (this.serializationResult != null) + return this.serializationResult; + + if (this.blockState == null) { - if (this.blockState == null) - { - return "AIR"; - } - - ResourceLocation resourceLocation; + return "AIR"; + } + + if (RENDERER_IGNORED_BLOCKS_INTERNAL.containsKey(this.blockState)) + return this.serializationResult = RENDERER_IGNORED_BLOCKS_INTERNAL.get(this.blockState); + + ResourceLocation resourceLocation; #if MC_1_16_5 || MC_1_17_1 resourceLocation = Registry.BLOCK.getKey(this.blockState.getBlock()); #elif MC_1_18_2 || MC_1_19_2 net.minecraft.core.RegistryAccess registryAccess = Minecraft.getInstance().level.registryAccess(); resourceLocation = registryAccess.registryOrThrow(Registry.BLOCK_REGISTRY).getKey(this.blockState.getBlock()); #else - net.minecraft.core.RegistryAccess registryAccess = Minecraft.getInstance().level.registryAccess(); - resourceLocation = registryAccess.registryOrThrow(Registries.BLOCK).getKey(this.blockState.getBlock()); + net.minecraft.core.RegistryAccess registryAccess = Minecraft.getInstance().level.registryAccess(); + resourceLocation = registryAccess.registryOrThrow(Registries.BLOCK).getKey(this.blockState.getBlock()); #endif - - if (resourceLocation == null) - { - LOGGER.warn("unable to serialize: " + this.blockState); - } - - this.serializationResult = resourceLocation.getNamespace() + RESOURCE_LOCATION_SEPARATOR + resourceLocation.getPath() - + STATE_STRING_SEPARATOR + serializeBlockStateProperties(this.blockState); + + if (resourceLocation == null) + { + LOGGER.warn("unable to serialize: " + this.blockState); } + this.serializationResult = resourceLocation.getNamespace() + RESOURCE_LOCATION_SEPARATOR + resourceLocation.getPath() + + STATE_STRING_SEPARATOR + serializeBlockStateProperties(this.blockState); return this.serializationResult; } - public static BlockStateWrapper deserialize(String resourceStateString) throws IOException // FIXME pass in level to prevent null pointers (or maybe just RegistryAccess?) + public static IBlockStateWrapper deserialize(String resourceStateString) throws IOException // FIXME pass in level to prevent null pointers (or maybe just RegistryAccess?) { - if (resourceStateString.equals("AIR") || resourceStateString.equals("")) // the empty string shouldn't normally happen, but just in case - { - return AIR; - } + if (resourceStateString.isEmpty()) + throw new IOException("resourceStateString is empty"); + if (RENDERER_IGNORED_BLOCKS_INTERNAL.containsValue(resourceStateString)) + return RENDERER_IGNORED_BLOCKS.get(resourceStateString); // parse the BlockState diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/BatchGenerationEnvironment.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/BatchGenerationEnvironment.java index caacbd061..e54490bbb 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/BatchGenerationEnvironment.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/BatchGenerationEnvironment.java @@ -484,7 +484,7 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv ChunkAccess chunk = totalChunks.get(x, z); if (chunk != null) { - chunkWrapperList.set(x, z, new ChunkWrapper(chunk, region, null)); + chunkWrapperList.set(x, z, new ChunkWrapper(chunk, region, serverlevel.getLevelWrapper())); } }); From 944b3c05ab4e4d530c26f87e1a1d0c60e4936a77 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Tue, 22 Aug 2023 17:45:54 -0500 Subject: [PATCH 02/40] Fix Fabric 1.18.2 saving black/empty chunks --- .../fabric/mixins/server/MixinChunkMap.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/server/MixinChunkMap.java b/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/server/MixinChunkMap.java index 565b5aeb7..6ac075501 100644 --- a/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/server/MixinChunkMap.java +++ b/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/server/MixinChunkMap.java @@ -31,6 +31,18 @@ public class MixinChunkMap @Inject(method = "save", at = @At(value = "INVOKE", target = CHUNK_SERIALIZER_WRITE)) private void onChunkSave(ChunkAccess chunk, CallbackInfoReturnable ci) { + // corrupt/incomplete chunk validation + #if MC_1_18_2 + // MC 1.18.2 has the tendency to try saving incomplete or corrupted chunks (which show up as empty or black chunks) + // this should prevent that from happening + if (chunk.isUnsaved() || chunk.isUpgrading() || !chunk.isLightCorrect()) + { + return; + } + #endif + + + // biome validation #if MC_1_16_5 || MC_1_17_1 if (chunk.getBiomes() == null) { From 2f7852f103877b428004934413f7e083e9976c30 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Wed, 23 Aug 2023 21:25:40 -0500 Subject: [PATCH 03/40] Revert Air Block handling and use the old (de)serialization logic While having the ability to deserialize blockstates without a level is desired, I'm not sure if the method suggested here would work between MC versions or would support modded blocks (in the eventual case where someone wants to do that). --- .../common/wrappers/WrapperFactory.java | 5 +- .../wrappers/block/BlockStateWrapper.java | 259 ++++++++++-------- coreSubProjects | 2 +- 3 files changed, 154 insertions(+), 112 deletions(-) diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/WrapperFactory.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/WrapperFactory.java index 911a2378a..2ed92ea15 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/WrapperFactory.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/WrapperFactory.java @@ -30,12 +30,13 @@ import com.seibel.distanthorizons.core.wrapperInterfaces.IWrapperFactory; import com.seibel.distanthorizons.core.wrapperInterfaces.block.IBlockStateWrapper; import com.seibel.distanthorizons.core.wrapperInterfaces.chunk.IChunkWrapper; import com.seibel.distanthorizons.core.wrapperInterfaces.world.IBiomeWrapper; +import com.seibel.distanthorizons.core.wrapperInterfaces.world.ILevelWrapper; import com.seibel.distanthorizons.core.wrapperInterfaces.worldGeneration.AbstractBatchGenerationEnvironmentWrapper; import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.chunk.ChunkAccess; import java.io.IOException; -import java.util.HashMap; +import java.util.HashSet; /** * This handles creating abstract wrapper objects. @@ -73,7 +74,7 @@ public class WrapperFactory implements IWrapperFactory public IBlockStateWrapper getAirBlockStateWrapper() { return BlockStateWrapper.AIR; } @Override - public HashMap getRendererIgnoredBlocks() { return BlockStateWrapper.RENDERER_IGNORED_BLOCKS; } + public HashSet getRendererIgnoredBlocks(ILevelWrapper levelWrapper) { return BlockStateWrapper.getRendererIgnoredBlocks(levelWrapper); } /** diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BlockStateWrapper.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BlockStateWrapper.java index b54fd8a1c..6e2d03653 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BlockStateWrapper.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BlockStateWrapper.java @@ -3,8 +3,10 @@ package com.seibel.distanthorizons.common.wrappers.block; import com.seibel.distanthorizons.core.logging.DhLoggerBuilder; import com.seibel.distanthorizons.core.wrapperInterfaces.block.IBlockStateWrapper; +import com.seibel.distanthorizons.core.wrapperInterfaces.world.ILevelWrapper; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; import org.apache.logging.log4j.Logger; @@ -31,18 +33,25 @@ public class BlockStateWrapper implements IBlockStateWrapper { /** example "minecraft:plains" */ public static final String RESOURCE_LOCATION_SEPARATOR = ":"; - /** example "minecraft:water_state_{level:0}" */ + /** example "minecraft:water_STATE_{level:0}" */ public static final String STATE_STRING_SEPARATOR = "_STATE_"; // must be defined before AIR, otherwise a null pointer will be thrown private static final Logger LOGGER = DhLoggerBuilder.getLogger(); - public static final ConcurrentHashMap cache = new ConcurrentHashMap<>(); - public static final BlockStateWrapper AIR = fromBlockState(BuiltInRegistries.BLOCK.get(ResourceLocation.tryParse("minecraft:air")).defaultBlockState(), false); - public static final String[] RENDERER_IGNORED_BLOCKS_RESOURCE_LOCATIONS = {"minecraft:air", "minecraft:barrier", "minecraft:structure_void"}; - public static final HashMap RENDERER_IGNORED_BLOCKS_INTERNAL = getRendererIgnoredBlocksInternal(RENDERER_IGNORED_BLOCKS_RESOURCE_LOCATIONS); - public static final HashMap RENDERER_IGNORED_BLOCKS = getRendererIgnoredBlocks(RENDERER_IGNORED_BLOCKS_INTERNAL); + public static final ConcurrentHashMap WRAPPER_BY_BLOCK_STATE = new ConcurrentHashMap<>(); + + public static String AIR_STRING = "AIR"; + public static final BlockStateWrapper AIR = new BlockStateWrapper(null); + + public static final String[] RENDERER_IGNORED_BLOCKS_RESOURCE_LOCATIONS = { AIR_STRING, "minecraft:barrier", "minecraft:structure_void", "minecraft:light" }; + + public static HashSet rendererIgnoredBlocks = null; + + + + public final BlockState blockState; /** * Cached so it can be quickly used as a semi-stable hashing method.
@@ -51,86 +60,83 @@ public class BlockStateWrapper implements IBlockStateWrapper private String serializationResult = null; + //==============// // constructors // //==============// - public static BlockStateWrapper fromBlockState(BlockState blockState) + public static BlockStateWrapper fromBlockState(BlockState blockState) { - return fromBlockState(blockState, true); - } - - private static BlockStateWrapper fromBlockState(BlockState blockState, boolean nullCheck) - { - if (Objects.requireNonNull(blockState).isAir() && AIR != null) + if (blockState == null || blockState.isAir()) + { return AIR; - - return cache.computeIfAbsent(blockState, blockState1 -> new BlockStateWrapper(blockState1, nullCheck)); - } - - /** - * Only meant for use in the {@code RENDERER_IGNORED_BLOCKS_INTERNAL} list. Do not use elsewhere, since the {@code levelWrapper} parameter of each {@code IBlockStateWrapper} will be {@code null}, causing issues. - * @param resourceLocations The resource location(s) of the block(s) that should be ignored by the renderer, may only contain {@code [a-z0-9/._-)} characters. - * @return The default blockstate(s) of the block(s), paired with the serialized resource location(s) of the block(s), which should be passed into the {@code RENDERER_IGNORED_BLOCKS_INTERNAL} map and the {@code getRendererIgnoredBlocks} method. - */ - @SuppressWarnings("SameParameterValue") - private static @NotNull HashMap getRendererIgnoredBlocksInternal(String @NotNull ... resourceLocations) - { - HashMap blockStates = new HashMap<>(); - - for (String resourceLocation : resourceLocations) - { - ResourceLocation fetchedResourceLocation = Objects.requireNonNull(ResourceLocation.tryParse(resourceLocation), String.format("Supplied a resource location that couldn't be parsed by Minecraft: %s", resourceLocation)); - var splitResourceLocation = resourceLocation.split(":"); - - if (splitResourceLocation.length == 0) { - LOGGER.warn("A resource location that should be ignored by the renderer was in an invalid format: {}", resourceLocation); - continue; - } - - blockStates.put(BuiltInRegistries.BLOCK.get(fetchedResourceLocation).defaultBlockState(), splitResourceLocation[1].toUpperCase(Locale.ROOT)); } - return blockStates; + return WRAPPER_BY_BLOCK_STATE.computeIfAbsent(blockState, newBlockState -> new BlockStateWrapper(newBlockState)); } - /** - * Only meant for use in the {@code RENDERER_IGNORED_BLOCKS} list. Do not use elsewhere, since the {@code levelWrapper} parameter of each {@code IBlockStateWrapper} will be {@code null}, causing issues. - * @param rendererIgnoredBlocks A map containing the blockstate(s) of the block(s), paired with the resource location(s) of the block(s) that should be ignored by the renderer. - * @return The blockstate wrapper(s) of the blockstate(s), which should be passed into the {@code RENDERER_IGNORED_BLOCKS} list. - */ - @SuppressWarnings("SameParameterValue") - private static @NotNull HashMap getRendererIgnoredBlocks(@NotNull Map rendererIgnoredBlocks) + private BlockStateWrapper(BlockState blockState) { - HashMap blockStateWrappers = new HashMap<>(); - - for (Map.Entry blockStateResourceLocations : rendererIgnoredBlocks.entrySet()) - { - blockStateWrappers.put(blockStateResourceLocations.getValue(), fromBlockState(blockStateResourceLocations.getKey(), false)); - } - - return blockStateWrappers; - } - - public final BlockState blockState; - - BlockStateWrapper(BlockState blockState) - { - this(blockState, true); - } - - // TODO: Pass in levelwrapper so nullCheck has a use - private BlockStateWrapper(BlockState blockState, boolean nullCheck) { this.blockState = blockState; - - LOGGER.trace("Created BlockStateWrapper for [{}]", blockState); + LOGGER.trace("Created BlockStateWrapper for ["+blockState+"]"); } - //=========// - // methods // - //=========// + //================// + // helper methods // + //================// + + /** + * Requires a {@link ILevelWrapper} since {@link BlockStateWrapper#deserialize(String,ILevelWrapper)} also requires one. + * This way the method won't accidentally be called before the deserialization can be completed. + */ + public static HashSet getRendererIgnoredBlocks(ILevelWrapper levelWrapper) + { + // use the cached version if possible + if (rendererIgnoredBlocks != null) + { + return rendererIgnoredBlocks; + } + + + // deserialize each of the given resource locations + HashSet blockStateWrappers = new HashSet<>(); + for (String blockResourceLocation : RENDERER_IGNORED_BLOCKS_RESOURCE_LOCATIONS) + { + try + { + BlockStateWrapper DefaultBlockStateToIgnore = (BlockStateWrapper) deserialize(blockResourceLocation, levelWrapper); + blockStateWrappers.add(DefaultBlockStateToIgnore); + + if (DefaultBlockStateToIgnore == AIR) + { + continue; + } + + // add all possible blockstates (to account for light blocks with different light values and such) + List blockStatesToIgnore = DefaultBlockStateToIgnore.blockState.getBlock().getStateDefinition().getPossibleStates(); + for (BlockState blockState : blockStatesToIgnore) + { + BlockStateWrapper newBlockToIgnore = BlockStateWrapper.fromBlockState(blockState); + blockStateWrappers.add(newBlockToIgnore); + } + } + catch (IOException e) + { + LOGGER.warn("Unable to deserialize rendererIgnoredBlock with the resource location: ["+blockResourceLocation+"]. Error: "+e.getMessage(), e); + } + } + + rendererIgnoredBlocks = blockStateWrappers; + return rendererIgnoredBlocks; + } + + + + //=================// + // wrapper methods // + //=================// @Override public int getOpacity() @@ -152,30 +158,38 @@ public class BlockStateWrapper implements IBlockStateWrapper public int getLightEmission() { return (this.blockState != null) ? this.blockState.getLightEmission() : 0; } @Override - public String serialize() // FIXME pass in level to prevent null pointers (or maybe just RegistryAccess?) + public String serialize() { return this.serialize(null); } + public String serialize(ILevelWrapper levelWrapper) { - // the result can be quickly used as a semi-stable hashing method, so it's going to be cached + // the serialization result can be quickly used as a semi-stable hashing method, so it needs to be cached for speed if (this.serializationResult != null) + { return this.serializationResult; + } if (this.blockState == null) { - return "AIR"; + return AIR_STRING; } - if (RENDERER_IGNORED_BLOCKS_INTERNAL.containsKey(this.blockState)) - return this.serializationResult = RENDERER_IGNORED_BLOCKS_INTERNAL.get(this.blockState); + + + #if MC_1_18_2 || MC_1_19_2 || MC_1_20_1 + // use the given level if possible, otherwise try using the currently loaded one + Level level = (levelWrapper != null ? (Level)levelWrapper.getWrappedMcObject() : null); + level = (level == null ? Minecraft.getInstance().level : null); + #endif ResourceLocation resourceLocation; - #if MC_1_16_5 || MC_1_17_1 - resourceLocation = Registry.BLOCK.getKey(this.blockState.getBlock()); - #elif MC_1_18_2 || MC_1_19_2 - net.minecraft.core.RegistryAccess registryAccess = Minecraft.getInstance().level.registryAccess(); - resourceLocation = registryAccess.registryOrThrow(Registry.BLOCK_REGISTRY).getKey(this.blockState.getBlock()); - #else - net.minecraft.core.RegistryAccess registryAccess = Minecraft.getInstance().level.registryAccess(); + #if MC_1_16_5 || MC_1_17_1 + resourceLocation = Registry.BLOCK.getKey(this.blockState.getBlock()); + #elif MC_1_18_2 || MC_1_19_2 + net.minecraft.core.RegistryAccess registryAccess = level.registryAccess(); + resourceLocation = registryAccess.registryOrThrow(Registry.BLOCK_REGISTRY).getKey(this.blockState.getBlock()); + #else + net.minecraft.core.RegistryAccess registryAccess = level.registryAccess(); resourceLocation = registryAccess.registryOrThrow(Registries.BLOCK).getKey(this.blockState.getBlock()); - #endif + #endif if (resourceLocation == null) { @@ -188,23 +202,27 @@ public class BlockStateWrapper implements IBlockStateWrapper return this.serializationResult; } - public static IBlockStateWrapper deserialize(String resourceStateString) throws IOException // FIXME pass in level to prevent null pointers (or maybe just RegistryAccess?) + + /** will only work if a level is currently loaded */ + public static IBlockStateWrapper deserialize(String resourceStateString) throws IOException { return deserialize(resourceStateString, null); } + public static IBlockStateWrapper deserialize(String resourceStateString, ILevelWrapper levelWrapper) throws IOException { - if (resourceStateString.isEmpty()) - throw new IOException("resourceStateString is empty"); - - if (RENDERER_IGNORED_BLOCKS_INTERNAL.containsValue(resourceStateString)) - return RENDERER_IGNORED_BLOCKS.get(resourceStateString); - - - // parse the BlockState - int stateSeparatorIndex = resourceStateString.indexOf(STATE_STRING_SEPARATOR); - if (stateSeparatorIndex == -1) + if (resourceStateString.equals(AIR_STRING) || resourceStateString.equals("")) // the empty string shouldn't normally happen, but just in case { - throw new IOException("Unable to parse BlockState out of string: [" + resourceStateString + "]."); + return AIR; + } + + + + // try to parse out the BlockState + String blockStatePropertiesString = null; // will be null if no properties were included + int stateSeparatorIndex = resourceStateString.indexOf(STATE_STRING_SEPARATOR); + if (stateSeparatorIndex != -1) + { + // blockstate properties found + blockStatePropertiesString = resourceStateString.substring(stateSeparatorIndex + STATE_STRING_SEPARATOR.length()); + resourceStateString = resourceStateString.substring(0, stateSeparatorIndex); } - String blockStatePropertiesString = resourceStateString.substring(stateSeparatorIndex + STATE_STRING_SEPARATOR.length()); - resourceStateString = resourceStateString.substring(0, stateSeparatorIndex); // parse the resource location int resourceSeparatorIndex = resourceStateString.indexOf(RESOURCE_LOCATION_SEPARATOR); @@ -219,35 +237,58 @@ public class BlockStateWrapper implements IBlockStateWrapper // attempt to get the BlockState from all possible BlockStates try { + + #if MC_1_18_2 || MC_1_19_2 || MC_1_20_1 + // use the given level if possible, otherwise try using the currently loaded one + Level level = (levelWrapper != null ? (Level)levelWrapper.getWrappedMcObject() : null); + level = (level == null ? Minecraft.getInstance().level : null); + #endif + Block block; #if MC_1_16_5 || MC_1_17_1 block = Registry.BLOCK.get(resourceLocation); #elif MC_1_18_2 || MC_1_19_2 - net.minecraft.core.RegistryAccess registryAccess = Minecraft.getInstance().level.registryAccess(); + net.minecraft.core.RegistryAccess registryAccess = level.registryAccess(); block = registryAccess.registryOrThrow(Registry.BLOCK_REGISTRY).get(resourceLocation); #else - net.minecraft.core.RegistryAccess registryAccess = Minecraft.getInstance().level.registryAccess(); + net.minecraft.core.RegistryAccess registryAccess = level.registryAccess(); block = registryAccess.registryOrThrow(Registries.BLOCK).get(resourceLocation); #endif - - BlockState foundState = null; - List possibleStateList = block.getStateDefinition().getPossibleStates(); - for (BlockState possibleState : possibleStateList) + if (block == null) { - String possibleStatePropertiesString = serializeBlockStateProperties(possibleState); - if (possibleStatePropertiesString.equals(blockStatePropertiesString)) + // shouldn't normally happen, but here to make the compiler happy + LOGGER.warn("Unable to find BlockState with the resourceLocation [" + resourceLocation + "] and properties: [" + blockStatePropertiesString + "]. Air will be used instead, some data may be lost."); + return AIR; + } + + + // attempt to find the blockstate from all possibilities + BlockState foundState = null; + if (blockStatePropertiesString != null) + { + List possibleStateList = block.getStateDefinition().getPossibleStates(); + for (BlockState possibleState : possibleStateList) { - foundState = possibleState; - break; + String possibleStatePropertiesString = serializeBlockStateProperties(possibleState); + if (possibleStatePropertiesString.equals(blockStatePropertiesString)) + { + foundState = possibleState; + break; + } } } - // use the default if no state was found + // use the default if no state was found or given if (foundState == null) { - LOGGER.warn("Unable to find BlockState for Block [" + resourceLocation + "] with properties: [" + blockStatePropertiesString + "]."); + if (blockStatePropertiesString != null) + { + // we should have found a blockstate, but didn't + LOGGER.warn("Unable to find BlockState for Block [" + resourceLocation + "] with properties: [" + blockStatePropertiesString + "]."); + } + foundState = block.defaultBlockState(); } return new BlockStateWrapper(foundState); diff --git a/coreSubProjects b/coreSubProjects index 2964acfc8..f6ee8048e 160000 --- a/coreSubProjects +++ b/coreSubProjects @@ -1 +1 @@ -Subproject commit 2964acfc8cc0558435989c2dd4aa4b6c81e0c292 +Subproject commit f6ee8048eb49a8b0e2ac702bb3ba0f60638bd6aa From 1cb60f6a6decfacd25a9cc7ce91832adea4cdd6b Mon Sep 17 00:00:00 2001 From: James Seibel Date: Wed, 23 Aug 2023 21:28:46 -0500 Subject: [PATCH 04/40] Add core merge --- coreSubProjects | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreSubProjects b/coreSubProjects index 794e9afc1..f8814e3a1 160000 --- a/coreSubProjects +++ b/coreSubProjects @@ -1 +1 @@ -Subproject commit 794e9afc10e33e4f72849ff7a560ff596622789e +Subproject commit f8814e3a117f64aa0742f33eaf8b71d3fad107d3 From 90accf01db946842ca8b1dbce6df2a17c0866bdc Mon Sep 17 00:00:00 2001 From: James Seibel Date: Wed, 23 Aug 2023 22:00:13 -0500 Subject: [PATCH 05/40] Fix a null pointer --- .../common/wrappers/block/BlockStateWrapper.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BlockStateWrapper.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BlockStateWrapper.java index 6e2d03653..ed142e156 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BlockStateWrapper.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BlockStateWrapper.java @@ -177,7 +177,7 @@ public class BlockStateWrapper implements IBlockStateWrapper #if MC_1_18_2 || MC_1_19_2 || MC_1_20_1 // use the given level if possible, otherwise try using the currently loaded one Level level = (levelWrapper != null ? (Level)levelWrapper.getWrappedMcObject() : null); - level = (level == null ? Minecraft.getInstance().level : null); + level = (level == null ? Minecraft.getInstance().level : level); #endif ResourceLocation resourceLocation; @@ -241,7 +241,7 @@ public class BlockStateWrapper implements IBlockStateWrapper #if MC_1_18_2 || MC_1_19_2 || MC_1_20_1 // use the given level if possible, otherwise try using the currently loaded one Level level = (levelWrapper != null ? (Level)levelWrapper.getWrappedMcObject() : null); - level = (level == null ? Minecraft.getInstance().level : null); + level = (level == null ? Minecraft.getInstance().level : level); #endif Block block; From 73a42284f111122a2dae212e06a93068ba569d6a Mon Sep 17 00:00:00 2001 From: James Seibel Date: Wed, 23 Aug 2023 22:15:51 -0500 Subject: [PATCH 06/40] Fix MC 16, 17, 18, and 19 compiling --- .../common/wrappers/block/BlockStateWrapper.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BlockStateWrapper.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BlockStateWrapper.java index ed142e156..f239fed99 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BlockStateWrapper.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BlockStateWrapper.java @@ -4,13 +4,10 @@ import com.seibel.distanthorizons.core.logging.DhLoggerBuilder; import com.seibel.distanthorizons.core.wrapperInterfaces.block.IBlockStateWrapper; import com.seibel.distanthorizons.core.wrapperInterfaces.world.ILevelWrapper; -import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; import org.apache.logging.log4j.Logger; -import org.jetbrains.annotations.NotNull; import java.io.IOException; import java.util.*; @@ -18,12 +15,16 @@ import java.util.concurrent.ConcurrentHashMap; #if MC_1_16_5 || MC_1_17_1 import net.minecraft.core.Registry; +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.EmptyBlockGetter; #elif MC_1_18_2 || MC_1_19_2 import net.minecraft.client.Minecraft; +import net.minecraft.world.level.Level; import net.minecraft.core.BlockPos; import net.minecraft.core.Registry; #else import net.minecraft.client.Minecraft; +import net.minecraft.world.level.Level; import net.minecraft.core.BlockPos; import net.minecraft.core.registries.Registries; import net.minecraft.world.level.EmptyBlockGetter; @@ -174,7 +175,7 @@ public class BlockStateWrapper implements IBlockStateWrapper - #if MC_1_18_2 || MC_1_19_2 || MC_1_20_1 + #if !(MC_1_16_5 || MC_1_17_1) // use the given level if possible, otherwise try using the currently loaded one Level level = (levelWrapper != null ? (Level)levelWrapper.getWrappedMcObject() : null); level = (level == null ? Minecraft.getInstance().level : level); @@ -238,7 +239,7 @@ public class BlockStateWrapper implements IBlockStateWrapper try { - #if MC_1_18_2 || MC_1_19_2 || MC_1_20_1 + #if !(MC_1_16_5 || MC_1_17_1) // use the given level if possible, otherwise try using the currently loaded one Level level = (levelWrapper != null ? (Level)levelWrapper.getWrappedMcObject() : null); level = (level == null ? Minecraft.getInstance().level : level); From 73f4bc3108fd1a7f915967dbdc67f0aae2325bbc Mon Sep 17 00:00:00 2001 From: coolGi Date: Thu, 24 Aug 2023 20:28:25 +0930 Subject: [PATCH 07/40] Formatted some resource files --- .../DistantHorizons.fabric.mixins.json | 55 +++++----- fabric/src/main/resources/fabric.mod.json | 103 +++++++++--------- .../resources/DistantHorizons.mixins.json | 42 +++---- forge/src/main/resources/META-INF/mods.toml | 53 +++++---- 4 files changed, 125 insertions(+), 128 deletions(-) diff --git a/fabric/src/main/resources/DistantHorizons.fabric.mixins.json b/fabric/src/main/resources/DistantHorizons.fabric.mixins.json index 0c7244db8..d306798af 100644 --- a/fabric/src/main/resources/DistantHorizons.fabric.mixins.json +++ b/fabric/src/main/resources/DistantHorizons.fabric.mixins.json @@ -1,30 +1,29 @@ { - "required": true, - "minVersion": "0.8", - "package": "com.seibel.distanthorizons.fabric.mixins", - "mixins": [ - "server.unsafe.MixinThreadingDetector", - "server.MixinChunkGenerator", - "server.MixinChunkMap", - "server.MixinUtilBackgroundThread" - ], - "client": [ - "client.MixinClientLevel", - "client.MixinClientPacketListener", - "client.MixinDebugScreenOverlay", - "client.MixinFogRenderer", - "client.MixinGameRenderer", - "client.MixinLevelRenderer", - "client.MixinLightmap", - "client.MixinOptionsScreen", - "client.MixinMinecraft", - "client.MixinTextureUtil", - - "mods.sodium.MixinSodiumRenderer" - ], - "server": [], - "injectors": { - "defaultRequire": 1 - }, - "plugin": "com.seibel.distanthorizons.fabric.mixins.FabricMixinPlugin" + "required": true, + "minVersion": "0.8", + "package": "com.seibel.distanthorizons.fabric.mixins", + "mixins": [ + "server.unsafe.MixinThreadingDetector", + "server.MixinChunkGenerator", + "server.MixinChunkMap", + "server.MixinUtilBackgroundThread" + ], + "client": [ + "client.MixinClientLevel", + "client.MixinClientPacketListener", + "client.MixinDebugScreenOverlay", + "client.MixinFogRenderer", + "client.MixinGameRenderer", + "client.MixinLevelRenderer", + "client.MixinLightmap", + "client.MixinOptionsScreen", + "client.MixinMinecraft", + "client.MixinTextureUtil", + "mods.sodium.MixinSodiumRenderer" + ], + "server": [], + "injectors": { + "defaultRequire": 1 + }, + "plugin": "com.seibel.distanthorizons.fabric.mixins.FabricMixinPlugin" } diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json index 7e6907fd7..1b03cb8cc 100644 --- a/fabric/src/main/resources/fabric.mod.json +++ b/fabric/src/main/resources/fabric.mod.json @@ -1,56 +1,55 @@ { - "schemaVersion": 1, - "id": "distanthorizons", - "version": "${version}", - - "name": "${mod_name}", - "description": "${description}", - "authors": $authors, - - "contact": { - "homepage": "${homepage}", - "sources": "${source}", - "issues": "${issues}" - }, - - "license": "LGPL-3", - "icon": "icon.png", - - "accessWidener": "distanthorizons.accesswidener", - - "environment": "*", - "entrypoints": { - "client": [ - "com.seibel.distanthorizons.fabric.FabricClientMain" + "schemaVersion": 1, + "id": "distanthorizons", + "version": "${version}", + + "name": "${mod_name}", + "description": "${description}", + "authors": $authors, + + "contact": { + "homepage": "${homepage}", + "sources": "${source}", + "issues": "${issues}" + }, + + "license": "LGPL-3", + "icon": "icon.png", + + "accessWidener": "distanthorizons.accesswidener", + + "environment": "*", + "entrypoints": { + "client": [ + "com.seibel.distanthorizons.fabric.FabricClientMain" + ], + "server": [ + "com.seibel.distanthorizons.fabric.FabricDedicatedServerMain" + ], + "modmenu": [ + "com.seibel.distanthorizons.fabric.wrappers.config.ModMenuIntegration" + ] + }, + + "mixins": [ + "DistantHorizons.fabric.mixins.json" ], - "server": [ - "com.seibel.distanthorizons.fabric.FabricDedicatedServerMain" - ], - - "modmenu": [ - "com.seibel.distanthorizons.fabric.wrappers.config.ModMenuIntegration" - ] - }, - - "mixins": [ - "DistantHorizons.fabric.mixins.json" - ], - - "depends": { - "fabricloader": "*", - "fabric-api-base": "*", - "fabric-lifecycle-events-v1": "*", - "fabric-key-binding-api-v1": "*", - "fabric-resource-loader-v0": "*", - "minecraft": $compatible_minecraft_versions, - "java": ">=${java_version}" - }, - - "custom": { - "modmenu": { - "links": { - "modmenu.discord": "${discord}" - } + + "depends": { + "fabricloader": "*", + "fabric-api-base": "*", + "fabric-lifecycle-events-v1": "*", + "fabric-key-binding-api-v1": "*", + "fabric-resource-loader-v0": "*", + "minecraft": $compatible_minecraft_versions, + "java": ">=${java_version}" + }, + + "custom": { + "modmenu": { + "links": { + "modmenu.discord": "${discord}" + } + } } - } } diff --git a/forge/src/main/resources/DistantHorizons.mixins.json b/forge/src/main/resources/DistantHorizons.mixins.json index 83bfe64e2..4d03828c3 100644 --- a/forge/src/main/resources/DistantHorizons.mixins.json +++ b/forge/src/main/resources/DistantHorizons.mixins.json @@ -1,23 +1,23 @@ { - "required": true, - "minVersion": "0.8", - "package": "com.seibel.distanthorizons.forge.mixins", - "mixins": [ - "server.unsafe.MixinThreadingDetector", - "server.MixinUtilBackgroundThread", - "server.MixinChunkGenerator", - "server.MixinTFChunkGenerator" - ], - "client": [ - "client.MixinClientPacketListener", - "client.MixinDebugScreenOverlay", - "client.MixinFogRenderer", - "client.MixinGameRenderer", - "client.MixinLevelRenderer", - "client.MixinLightmap", - "client.MixinOptionsScreen", - "client.MixinTextureUtil" - ], - "server": [], - "plugin": "com.seibel.distanthorizons.forge.mixins.ForgeMixinPlugin" + "required": true, + "minVersion": "0.8", + "package": "com.seibel.distanthorizons.forge.mixins", + "mixins": [ + "server.unsafe.MixinThreadingDetector", + "server.MixinUtilBackgroundThread", + "server.MixinChunkGenerator", + "server.MixinTFChunkGenerator" + ], + "client": [ + "client.MixinClientPacketListener", + "client.MixinDebugScreenOverlay", + "client.MixinFogRenderer", + "client.MixinGameRenderer", + "client.MixinLevelRenderer", + "client.MixinLightmap", + "client.MixinOptionsScreen", + "client.MixinTextureUtil" + ], + "server": [], + "plugin": "com.seibel.distanthorizons.forge.mixins.ForgeMixinPlugin" } diff --git a/forge/src/main/resources/META-INF/mods.toml b/forge/src/main/resources/META-INF/mods.toml index a9dccfc67..30f586289 100644 --- a/forge/src/main/resources/META-INF/mods.toml +++ b/forge/src/main/resources/META-INF/mods.toml @@ -1,33 +1,32 @@ - -modLoader="javafml" #//mandatory -loaderVersion="*" # // mandatory. Allow all forge versions as we are definding what Minecraft versions we requre later on -license="LGPL" -issueTrackerURL="${issues}" +modLoader = "javafml" #//mandatory +loaderVersion = "*" # // mandatory. Allow all forge versions as we are definding what Minecraft versions we requre later on +license = "LGPL" +issueTrackerURL = "${issues}" [[mods]] #//mandatory - modId="distanthorizons" #//mandatory - version= "${version}" #//mandatory, gets the version number from jar populated by the build.gradle script - displayName="${mod_name}" #//mandatory - authors=["James Seibel", "Leonardo Amato", "Cola", "coolGi", "Ran", "Leetom"] - #//updateJSONURL="https://change.me.example.invalid/updates.json" # A URL to query for updates for this mod. See the JSON update specification https://mcforge.readthedocs.io/en/latest/gettingstarted/autoupdate/ - displayURL="${homepage}" - description= "${description}" #//mandatory. The description text for the mod - logoFile="logo.png" - catalogueImageIcon="icon.png" - credits="Massive thanks to: Leonardo, Cola, Ran, CoolGi, and Leetom. For their hard work to bring Distant Horizons to where it is today. - James" - #// if not set defaults to "false" - clientSideOnly="true" - #// if not set side defaults to "BOTH" - #// TODO change to "BOTH" when we add server support - side="CLIENT" - #// Allow any version to be present (or not) on the server - acceptableRemoteVersions="*" + modId = "distanthorizons" #//mandatory + version = "${version}" #//mandatory, gets the version number from jar populated by the build.gradle script + displayName = "${mod_name}" #//mandatory + authors = ["James Seibel", "Leonardo Amato", "Cola", "coolGi", "Ran", "Leetom"] + #//updateJSONURL="https://change.me.example.invalid/updates.json" # A URL to query for updates for this mod. See the JSON update specification https://mcforge.readthedocs.io/en/latest/gettingstarted/autoupdate/ + displayURL = "${homepage}" + description = "${description}" #//mandatory. The description text for the mod + logoFile = "logo.png" + catalogueImageIcon = "icon.png" + credits = "Massive thanks to: Leonardo, Cola, Ran, CoolGi, and Leetom. For their hard work to bring Distant Horizons to where it is today. - James" + #// if not set defaults to "false" + clientSideOnly = "true" + #// if not set side defaults to "BOTH" + #// TODO change to "BOTH" when we add server support + side = "CLIENT" + #// Allow any version to be present (or not) on the server + acceptableRemoteVersions = "*" [[dependencies.distanthorizons]] - modId="minecraft" - mandatory=true - versionRange="${compatible_forgemc_versions}" # Where we set what version of mc it is avalible for - ordering="NONE" - side="BOTH" \ No newline at end of file + modId = "minecraft" + mandatory = true + versionRange = "${compatible_forgemc_versions}" # Where we set what version of mc it is avalible for + ordering = "NONE" + side = "BOTH" \ No newline at end of file From c78f6eb66d3c1c81f30fdbb47eebcfadfd572ed6 Mon Sep 17 00:00:00 2001 From: coolGi Date: Thu, 24 Aug 2023 20:58:43 +0930 Subject: [PATCH 08/40] Added blendium to mod suggestion on fabric --- fabric/src/main/resources/fabric.mod.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json index 1b03cb8cc..01ab3fbf9 100644 --- a/fabric/src/main/resources/fabric.mod.json +++ b/fabric/src/main/resources/fabric.mod.json @@ -51,5 +51,9 @@ "modmenu.discord": "${discord}" } } + }, + + "suggests": { + "blendium": "*" } } From bf3428b53c1a2018fc5b4c20be7668f425f8d826 Mon Sep 17 00:00:00 2001 From: coolGi Date: Thu, 24 Aug 2023 21:07:05 +0930 Subject: [PATCH 09/40] Added version number to bottom left of config (#558) --- .../common/wrappers/gui/ClassicConfigGUI.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/ClassicConfigGUI.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/ClassicConfigGUI.java index cd0b35ab2..ca0f10490 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/ClassicConfigGUI.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/ClassicConfigGUI.java @@ -385,9 +385,15 @@ public class ClassicConfigGUI DhDrawCenteredString(matrices, font, title, width / 2, 15, 0xFFFFFF); // Render title - // If the update is pending, display this message to inform the user that it will apply when the game restarts - if (SelfUpdater.deleteOldOnClose) - DhDrawString(matrices, font, Translatable(configBase.modID + ".updater.waitingForClose"), 4, height - 38, 0xFFFFFF); + if (this.configBase.modID == "distanthorizons") + { + // Display version + DhDrawString(matrices, font, TextOrLiteral(ModInfo.VERSION), 2, height - 10, 0xAAAAAA); + + // If the update is pending, display this message to inform the user that it will apply when the game restarts + if (SelfUpdater.deleteOldOnClose) + DhDrawString(matrices, font, Translatable(configBase.modID + ".updater.waitingForClose"), 4, height - 38, 0xFFFFFF); + } // Render the tooltip only if it can find a tooltip in the language file From 9ffc54f0b1198742af7bd515a441d116f7a4b254 Mon Sep 17 00:00:00 2001 From: coolGi Date: Thu, 24 Aug 2023 21:12:56 +0930 Subject: [PATCH 10/40] Updated readme --- Readme.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Readme.md b/Readme.md index 2566023d5..6875690be 100644 --- a/Readme.md +++ b/Readme.md @@ -20,7 +20,7 @@ If you want to see a quick demo, check out a video covering the mod here: ### This branch supports the following versions of Minecraft: -#### 1.20.1, 1.20 +#### 1.20.1, 1.20 (Default) Fabric: 0.14.21\ Fabric API: 0.85.0+1.20.1\ Forge: 45.1.0\ @@ -41,21 +41,21 @@ Forge: 43.2.14\ Parchment: 1.19.2:2022.11.27\ Modmenu: 4.2.0-beta.2 -#### 1.18.2 (Default) +#### 1.18.2 Fabric: 0.14.21\ Fabric API: 0.76.0+1.18.2\ Forge: 40.2.10\ Parchment: 1.18.2:2022.11.06\ Modmenu: 3.2.5 -#### 1.17.1, 1.17 (BROKE) +#### 1.17.1, 1.17 Fabric: 0.14.21\ Fabric API: 0.46.1+1.17\ Forge: 37.1.1\ Parchment: 1.17.1:2021.12.12\ Modmenu: 2.0.14 -#### 1.16.5, 1.16.4 (BROKE) +#### 1.16.5, 1.16.4 Fabric: 0.14.21\ Fabric API: 0.42.0+1.16\ Forge: 36.2.39\ @@ -196,5 +196,5 @@ https://github.com/TheElectronWill/night-config SVG Salamander for SVG support\ https://github.com/blackears/svgSalamander -FlatLaf for theming (for development testing, may remove later)\ +FlatLaf for Java Swing theming (for development testing, may remove later, and not included in compiled jars)\ https://www.formdev.com/flatlaf/ From a96e345fbe804a6d2f8298cb879f91be8d7a8982 Mon Sep 17 00:00:00 2001 From: coolGi Date: Thu, 24 Aug 2023 21:13:23 +0930 Subject: [PATCH 11/40] Updated core subproject --- coreSubProjects | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreSubProjects b/coreSubProjects index 794e9afc1..81992f6a8 160000 --- a/coreSubProjects +++ b/coreSubProjects @@ -1 +1 @@ -Subproject commit 794e9afc10e33e4f72849ff7a560ff596622789e +Subproject commit 81992f6a87307d9869d8bef5f926b4c92e4b7295 From 60cbbb0393745de71a1432304bbcbefc93b7ae2f Mon Sep 17 00:00:00 2001 From: coolGi Date: Thu, 24 Aug 2023 21:20:46 +0930 Subject: [PATCH 12/40] Updated core sub-project --- coreSubProjects | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreSubProjects b/coreSubProjects index 81992f6a8..c8f9c8393 160000 --- a/coreSubProjects +++ b/coreSubProjects @@ -1 +1 @@ -Subproject commit 81992f6a87307d9869d8bef5f926b4c92e4b7295 +Subproject commit c8f9c839351ca6f42314f1263e8b5a5738c5e2d2 From 263574bf3844e5d38d283020fb5dec9196e87226 Mon Sep 17 00:00:00 2001 From: coolGi Date: Thu, 24 Aug 2023 21:26:24 +0930 Subject: [PATCH 13/40] Added string (tripwire) to the ignored blocks --- .../common/wrappers/block/BlockStateWrapper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BlockStateWrapper.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BlockStateWrapper.java index b54fd8a1c..ffe66ea10 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BlockStateWrapper.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BlockStateWrapper.java @@ -40,7 +40,7 @@ public class BlockStateWrapper implements IBlockStateWrapper public static final ConcurrentHashMap cache = new ConcurrentHashMap<>(); public static final BlockStateWrapper AIR = fromBlockState(BuiltInRegistries.BLOCK.get(ResourceLocation.tryParse("minecraft:air")).defaultBlockState(), false); - public static final String[] RENDERER_IGNORED_BLOCKS_RESOURCE_LOCATIONS = {"minecraft:air", "minecraft:barrier", "minecraft:structure_void"}; + public static final String[] RENDERER_IGNORED_BLOCKS_RESOURCE_LOCATIONS = {"minecraft:air", "minecraft:barrier", "minecraft:structure_void", "minecraft:tripwire"}; public static final HashMap RENDERER_IGNORED_BLOCKS_INTERNAL = getRendererIgnoredBlocksInternal(RENDERER_IGNORED_BLOCKS_RESOURCE_LOCATIONS); public static final HashMap RENDERER_IGNORED_BLOCKS = getRendererIgnoredBlocks(RENDERER_IGNORED_BLOCKS_INTERNAL); From 7ee42a9529d387a90cfce77506368694a1d4af54 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Thu, 24 Aug 2023 07:21:05 -0500 Subject: [PATCH 14/40] Add missing render cache config listeners --- coreSubProjects | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreSubProjects b/coreSubProjects index 48a3675ee..971caca9c 160000 --- a/coreSubProjects +++ b/coreSubProjects @@ -1 +1 @@ -Subproject commit 48a3675eecbe6f867939689f918f4261678eed15 +Subproject commit 971caca9c922a9f65c8deae9ef6e1badc2108b16 From 9297ac4c35d1193ad16e4ee82b5816fe911db1b6 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Thu, 24 Aug 2023 07:41:14 -0500 Subject: [PATCH 15/40] Fix config presets rewriting the config file before it loads --- coreSubProjects | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreSubProjects b/coreSubProjects index 971caca9c..3361ba2fa 160000 --- a/coreSubProjects +++ b/coreSubProjects @@ -1 +1 @@ -Subproject commit 971caca9c922a9f65c8deae9ef6e1badc2108b16 +Subproject commit 3361ba2fabd2c0d86d78b936ab7b5907bf7a0003 From d9b969e7a796ec8f295fae5f34ce235f4381346e Mon Sep 17 00:00:00 2001 From: coolGi Date: Thu, 24 Aug 2023 23:30:25 +0930 Subject: [PATCH 16/40] Fixed up git on ci (well, kinda) --- .gitlab-ci.yml | 6 +++--- build.gradle | 20 ++++++++++++++++---- gradle.properties | 8 ++++++++ 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 41c60758c..79e63d175 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -33,9 +33,9 @@ build: - MC_VER: ["1.16.5", "1.17.1", "1.18.2", "1.19.2", "1.19.4", "1.20.1"] script: # this both runs the unit tests and assembles the code - - ./gradlew clean -PmcVer="${MC_VER}" --gradle-user-home cache/; - - ./gradlew build -PmcVer="${MC_VER}" --gradle-user-home cache/; - - ./gradlew mergeJars -PmcVer="${MC_VER}" --gradle-user-home cache/; + - ./gradlew clean -PmcVer="${MC_VER}" -PgitMainBranch="${CI_COMMIT_BRANCH}" -PgitMainCommit="${CI_COMMIT_SHA}" -PgitCoreCommit="None(ran through Gitlab CI)" --gradle-user-home cache/; + - ./gradlew build -PmcVer="${MC_VER}" -PgitMainBranch="${CI_COMMIT_BRANCH}" -PgitMainCommit="${CI_COMMIT_SHA}" -PgitCoreCommit="None(ran through Gitlab CI)" --gradle-user-home cache/; + - ./gradlew mergeJars -PmcVer="${MC_VER}" -PgitMainBranch="${CI_COMMIT_BRANCH}" -PgitMainCommit="${CI_COMMIT_SHA}" -PgitCoreCommit="None(ran through Gitlab CI)" --gradle-user-home cache/; artifacts: name: "NightlyBuild_${MC_VER}-${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_TIMESTAMP}" paths: diff --git a/build.gradle b/build.gradle index 42edd49ad..f40fda823 100644 --- a/build.gradle +++ b/build.gradle @@ -363,11 +363,23 @@ subprojects { p -> def git_main_commit = "Git_not_found" def git_core_commit = "Git_not_found" def git_main_branch = "Git_not_found" + // These "hasProperty"'s are so that they can be passed through the cli (ie in the CI) try { - "git rev-parse --is-inside-work-tree".execute() // If git doesnt exist, or this isnt cloned from git, then this wont work - git_main_commit = 'git rev-parse --verify HEAD'.execute().text.trim() - git_core_commit = 'git ls-tree --object-only HEAD ../coreSubProjects'.execute().text.trim() // TODO: is there a way to do this universally - git_main_branch = 'git symbolic-ref --short HEAD'.execute().text.trim() +// "git rev-parse --is-inside-work-tree".execute() // If git doesnt exist, or this isnt cloned from git, then this wont work + if (gitMainCommit != "null") + git_main_commit = gitMainCommit + else + git_main_commit = 'git rev-parse --verify HEAD'.execute().text.trim() + + if (gitCoreCommit != "null") + git_core_commit = gitCoreCommit + else + git_core_commit = 'git ls-tree --object-only HEAD ../coreSubProjects'.execute().text.trim() // TODO: is there a way to do this universally + + if (gitMainBranch != "null") + git_main_branch = gitMainBranch + else + git_main_branch = 'git symbolic-ref --short HEAD'.execute().text.trim() } catch (Exception e) { println "Git or Git project not found" } diff --git a/gradle.properties b/gradle.properties index 3516d29bd..1eb3e376a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -30,6 +30,14 @@ netty_version=4.1.94.Final lwjgl_version=3.2.3 joml_version=1.10.2 + +# These are here so they can be changed with cmd arguments +# If they are null, they would be automatically set +# (This is mainly used for the CI) +gitMainCommit=null +gitCoreCommit=null +gitMainBranch=null + # Internal Properties (These are set at runtime for Forgix to merge jar's) versionStr= From a41afa0dbfc1d0adcff21c10645bd25b6f91f1eb Mon Sep 17 00:00:00 2001 From: coolGi Date: Fri, 25 Aug 2023 00:09:57 +0930 Subject: [PATCH 17/40] Fixed BCLib compat 1.19.4+ --- .../fabric/wrappers/modAccessor/BCLibAccessor.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fabric/src/main/java/com/seibel/distanthorizons/fabric/wrappers/modAccessor/BCLibAccessor.java b/fabric/src/main/java/com/seibel/distanthorizons/fabric/wrappers/modAccessor/BCLibAccessor.java index 2b7b642db..d3d05e2a3 100644 --- a/fabric/src/main/java/com/seibel/distanthorizons/fabric/wrappers/modAccessor/BCLibAccessor.java +++ b/fabric/src/main/java/com/seibel/distanthorizons/fabric/wrappers/modAccessor/BCLibAccessor.java @@ -22,6 +22,8 @@ public class BCLibAccessor implements IBCLibAccessor // Change the value of CUSTOM_FOG_RENDERING in the bclib client config // This disabled fog from rendering within bclib Configs.CLIENT_CONFIG.set(ClientConfig.CUSTOM_FOG_RENDERING, newValue); + #else + Configs.CLIENT_CONFIG.set(ClientConfig.CUSTOM_FOG_RENDERING, newValue); #endif } From a122b2c14348eebcd1a42fc98c4d42666e418bd2 Mon Sep 17 00:00:00 2001 From: coolGi Date: Fri, 25 Aug 2023 00:10:34 +0930 Subject: [PATCH 18/40] Fixed javadocs reference, and updated core --- coreSubProjects | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreSubProjects b/coreSubProjects index 3361ba2fa..697abb520 160000 --- a/coreSubProjects +++ b/coreSubProjects @@ -1 +1 @@ -Subproject commit 3361ba2fabd2c0d86d78b936ab7b5907bf7a0003 +Subproject commit 697abb520b56e7381f2c757e6288e909b9a55737 From 888651ef52a8485045d0435e4ec4d8b031d098c5 Mon Sep 17 00:00:00 2001 From: coolGi Date: Fri, 25 Aug 2023 00:14:37 +0930 Subject: [PATCH 19/40] Fixed duplicate bclib code from previous commit --- .gitlab-ci.yml | 6 +++--- .../fabric/wrappers/modAccessor/BCLibAccessor.java | 5 ----- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 79e63d175..357292dae 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -33,9 +33,9 @@ build: - MC_VER: ["1.16.5", "1.17.1", "1.18.2", "1.19.2", "1.19.4", "1.20.1"] script: # this both runs the unit tests and assembles the code - - ./gradlew clean -PmcVer="${MC_VER}" -PgitMainBranch="${CI_COMMIT_BRANCH}" -PgitMainCommit="${CI_COMMIT_SHA}" -PgitCoreCommit="None(ran through Gitlab CI)" --gradle-user-home cache/; - - ./gradlew build -PmcVer="${MC_VER}" -PgitMainBranch="${CI_COMMIT_BRANCH}" -PgitMainCommit="${CI_COMMIT_SHA}" -PgitCoreCommit="None(ran through Gitlab CI)" --gradle-user-home cache/; - - ./gradlew mergeJars -PmcVer="${MC_VER}" -PgitMainBranch="${CI_COMMIT_BRANCH}" -PgitMainCommit="${CI_COMMIT_SHA}" -PgitCoreCommit="None(ran through Gitlab CI)" --gradle-user-home cache/; + - ./gradlew clean -PmcVer="${MC_VER}" -PgitMainBranch="${CI_COMMIT_BRANCH}" -PgitMainCommit="${CI_COMMIT_SHA}" -PgitCoreCommit="Unavailable (built by Gitlab CI)" --gradle-user-home cache/; + - ./gradlew build -PmcVer="${MC_VER}" -PgitMainBranch="${CI_COMMIT_BRANCH}" -PgitMainCommit="${CI_COMMIT_SHA}" -PgitCoreCommit="Unavailable (built by Gitlab CI)" --gradle-user-home cache/; + - ./gradlew mergeJars -PmcVer="${MC_VER}" -PgitMainBranch="${CI_COMMIT_BRANCH}" -PgitMainCommit="${CI_COMMIT_SHA}" -PgitCoreCommit="Unavailable (built by Gitlab CI)" --gradle-user-home cache/; artifacts: name: "NightlyBuild_${MC_VER}-${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_TIMESTAMP}" paths: diff --git a/fabric/src/main/java/com/seibel/distanthorizons/fabric/wrappers/modAccessor/BCLibAccessor.java b/fabric/src/main/java/com/seibel/distanthorizons/fabric/wrappers/modAccessor/BCLibAccessor.java index d3d05e2a3..7409b8978 100644 --- a/fabric/src/main/java/com/seibel/distanthorizons/fabric/wrappers/modAccessor/BCLibAccessor.java +++ b/fabric/src/main/java/com/seibel/distanthorizons/fabric/wrappers/modAccessor/BCLibAccessor.java @@ -17,14 +17,9 @@ public class BCLibAccessor implements IBCLibAccessor public void setRenderCustomFog(boolean newValue) { - #if MC_1_16_5 || MC_1_17_1 - #elif PRE_MC_1_19_2 // Change the value of CUSTOM_FOG_RENDERING in the bclib client config // This disabled fog from rendering within bclib Configs.CLIENT_CONFIG.set(ClientConfig.CUSTOM_FOG_RENDERING, newValue); - #else - Configs.CLIENT_CONFIG.set(ClientConfig.CUSTOM_FOG_RENDERING, newValue); - #endif } } \ No newline at end of file From 5b4049e0ca9d9bff2a28dcb222dfcf9ece948cf1 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Thu, 24 Aug 2023 20:10:59 -0500 Subject: [PATCH 20/40] Require a ILevelWrapper when deserializing BlockStateWrappers --- .../common/wrappers/WrapperFactory.java | 36 +++- .../wrappers/block/BlockStateWrapper.java | 165 +++++++++--------- .../common/wrappers/chunk/ChunkWrapper.java | 9 +- .../wrappers/world/ClientLevelWrapper.java | 2 +- .../wrappers/world/ServerLevelWrapper.java | 2 +- coreSubProjects | 2 +- 6 files changed, 118 insertions(+), 98 deletions(-) diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/WrapperFactory.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/WrapperFactory.java index 2ed92ea15..81f95245b 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/WrapperFactory.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/WrapperFactory.java @@ -23,6 +23,8 @@ import com.seibel.distanthorizons.api.interfaces.override.worldGenerator.IDhApiW import com.seibel.distanthorizons.common.wrappers.block.BiomeWrapper; import com.seibel.distanthorizons.common.wrappers.block.BlockStateWrapper; import com.seibel.distanthorizons.common.wrappers.chunk.ChunkWrapper; +import com.seibel.distanthorizons.common.wrappers.world.ClientLevelWrapper; +import com.seibel.distanthorizons.common.wrappers.world.ServerLevelWrapper; import com.seibel.distanthorizons.common.wrappers.worldGeneration.BatchGenerationEnvironment; import com.seibel.distanthorizons.core.level.IDhLevel; import com.seibel.distanthorizons.core.level.IDhServerLevel; @@ -32,6 +34,9 @@ import com.seibel.distanthorizons.core.wrapperInterfaces.chunk.IChunkWrapper; import com.seibel.distanthorizons.core.wrapperInterfaces.world.IBiomeWrapper; import com.seibel.distanthorizons.core.wrapperInterfaces.world.ILevelWrapper; import com.seibel.distanthorizons.core.wrapperInterfaces.worldGeneration.AbstractBatchGenerationEnvironmentWrapper; +import net.minecraft.client.multiplayer.ClientLevel; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.world.level.Level; import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.chunk.ChunkAccess; @@ -68,7 +73,7 @@ public class WrapperFactory implements IWrapperFactory public IBiomeWrapper deserializeBiomeWrapper(String str) throws IOException { return BiomeWrapper.deserialize(str); } @Override - public IBlockStateWrapper deserializeBlockStateWrapper(String str) throws IOException { return BlockStateWrapper.deserialize(str); } + public IBlockStateWrapper deserializeBlockStateWrapper(String str, ILevelWrapper levelWrapper) throws IOException { return BlockStateWrapper.deserialize(str, levelWrapper); } @Override public IBlockStateWrapper getAirBlockStateWrapper() { return BlockStateWrapper.AIR; } @@ -114,15 +119,34 @@ public class WrapperFactory implements IWrapperFactory } ChunkAccess chunk = (ChunkAccess) objectArray[0]; - // light source - if (!(objectArray[1] instanceof LevelReader)) + // level / light source + if (!(objectArray[1] instanceof Level)) { throw new ClassCastException(createChunkWrapperErrorMessage(objectArray)); } - LevelReader lightSource = (LevelReader) objectArray[1]; + // the level is needed for the DH level wrapper... + Level level = (Level) objectArray[1]; + // ...the LevelReader is needed for chunk lighting + LevelReader lightSource = level; - return new ChunkWrapper(chunk, lightSource, /*A DH wrapped level isn't necessary*/null); + // level wrapper + ILevelWrapper levelWrapper; + if (level instanceof ServerLevel) + { + levelWrapper = ServerLevelWrapper.getWrapper((ServerLevel)level); + } + else if (level instanceof ClientLevel) + { + levelWrapper = ClientLevelWrapper.getWrapper((ClientLevel)level); + } + else + { + throw new ClassCastException(createChunkWrapperErrorMessage(objectArray)); + } + + + return new ChunkWrapper(chunk, lightSource, levelWrapper); } // incorrect number of parameters from the API else @@ -153,7 +177,7 @@ public class WrapperFactory implements IWrapperFactory // MC 1.16, 1.18, 1.19, 1.20 #if POST_MC_1_17_1 || MC_1_16_5 message.append("[" + ChunkAccess.class.getName() + "], \n"); - message.append("[" + LevelReader.class.getName() + "]. \n"); + message.append("[" + ServerLevel.class.getName() + "] or [" + ClientLevel.class.getName() + "]. \n"); #else // See preprocessor comment in createChunkWrapper() for full documentation not implemented for this version of Minecraft! diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BlockStateWrapper.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BlockStateWrapper.java index f239fed99..484842367 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BlockStateWrapper.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BlockStateWrapper.java @@ -32,7 +32,7 @@ import net.minecraft.world.level.EmptyBlockGetter; public class BlockStateWrapper implements IBlockStateWrapper { - /** example "minecraft:plains" */ + /** example "minecraft:water" */ public static final String RESOURCE_LOCATION_SEPARATOR = ":"; /** example "minecraft:water_STATE_{level:0}" */ public static final String STATE_STRING_SEPARATOR = "_STATE_"; @@ -44,7 +44,7 @@ public class BlockStateWrapper implements IBlockStateWrapper public static final ConcurrentHashMap WRAPPER_BY_BLOCK_STATE = new ConcurrentHashMap<>(); public static String AIR_STRING = "AIR"; - public static final BlockStateWrapper AIR = new BlockStateWrapper(null); + public static final BlockStateWrapper AIR = new BlockStateWrapper(null, null); public static final String[] RENDERER_IGNORED_BLOCKS_RESOURCE_LOCATIONS = { AIR_STRING, "minecraft:barrier", "minecraft:structure_void", "minecraft:light" }; @@ -53,12 +53,8 @@ public class BlockStateWrapper implements IBlockStateWrapper public final BlockState blockState; - - /** - * Cached so it can be quickly used as a semi-stable hashing method.
- * This may also fix the issue where we can serialize and save after a level has been shut down. - */ - private String serializationResult = null; + /** technically final, but since it requires a method call to generate it can't be marked as such */ + private String serialString; @@ -66,19 +62,20 @@ public class BlockStateWrapper implements IBlockStateWrapper // constructors // //==============// - public static BlockStateWrapper fromBlockState(BlockState blockState) + public static BlockStateWrapper fromBlockState(BlockState blockState, ILevelWrapper levelWrapper) { if (blockState == null || blockState.isAir()) { return AIR; } - return WRAPPER_BY_BLOCK_STATE.computeIfAbsent(blockState, newBlockState -> new BlockStateWrapper(newBlockState)); + return WRAPPER_BY_BLOCK_STATE.computeIfAbsent(blockState, newBlockState -> new BlockStateWrapper(newBlockState, levelWrapper)); } - private BlockStateWrapper(BlockState blockState) + private BlockStateWrapper(BlockState blockState, ILevelWrapper levelWrapper) { this.blockState = blockState; + this.serialString = this.serialize(levelWrapper); LOGGER.trace("Created BlockStateWrapper for ["+blockState+"]"); } @@ -119,7 +116,7 @@ public class BlockStateWrapper implements IBlockStateWrapper List blockStatesToIgnore = DefaultBlockStateToIgnore.blockState.getBlock().getStateDefinition().getPossibleStates(); for (BlockState blockState : blockStatesToIgnore) { - BlockStateWrapper newBlockToIgnore = BlockStateWrapper.fromBlockState(blockState); + BlockStateWrapper newBlockToIgnore = BlockStateWrapper.fromBlockState(blockState, levelWrapper); blockStateWrappers.add(newBlockToIgnore); } } @@ -159,15 +156,73 @@ public class BlockStateWrapper implements IBlockStateWrapper public int getLightEmission() { return (this.blockState != null) ? this.blockState.getLightEmission() : 0; } @Override - public String serialize() { return this.serialize(null); } - public String serialize(ILevelWrapper levelWrapper) + public String getSerialString() { return this.serialString; } + + @Override + public boolean equals(Object obj) { - // the serialization result can be quickly used as a semi-stable hashing method, so it needs to be cached for speed - if (this.serializationResult != null) + if (this == obj) { - return this.serializationResult; + return true; } + if (obj == null || this.getClass() != obj.getClass()) + { + return false; + } + + BlockStateWrapper that = (BlockStateWrapper) obj; + // the serialized value is used so we can test the contents instead of the references + return Objects.equals(this.getSerialString(), that.getSerialString()); + } + + @Override + public int hashCode() { return Objects.hash(this.getSerialString()); } + + + @Override + public Object getWrappedMcObject() { return this.blockState; } + + @Override + public boolean isAir() { return this.isAir(this.blockState); } + public boolean isAir(BlockState blockState) { return blockState == null || blockState.isAir(); } + + @Override + public boolean isSolid() + { + #if PRE_MC_1_20_1 + return this.blockState.getMaterial().isSolid(); + #else + return !this.blockState.getCollisionShape(EmptyBlockGetter.INSTANCE, BlockPos.ZERO).isEmpty(); + #endif + } + + @Override + public boolean isLiquid() + { + if (this.isAir()) + { + return false; + } + + #if PRE_MC_1_20_1 + return this.blockState.getMaterial().isLiquid(); + #else + return !this.blockState.getFluidState().isEmpty(); + #endif + } + + @Override + public String toString() { return this.getSerialString(); } + + + + //=======================// + // serialization methods // + //=======================// + + private String serialize(ILevelWrapper levelWrapper) + { if (this.blockState == null) { return AIR_STRING; @@ -175,37 +230,37 @@ public class BlockStateWrapper implements IBlockStateWrapper + // older versions of MC have a static registry #if !(MC_1_16_5 || MC_1_17_1) - // use the given level if possible, otherwise try using the currently loaded one - Level level = (levelWrapper != null ? (Level)levelWrapper.getWrappedMcObject() : null); - level = (level == null ? Minecraft.getInstance().level : level); + Level level = (Level)levelWrapper.getWrappedMcObject(); + net.minecraft.core.RegistryAccess registryAccess = level.registryAccess(); #endif ResourceLocation resourceLocation; #if MC_1_16_5 || MC_1_17_1 resourceLocation = Registry.BLOCK.getKey(this.blockState.getBlock()); #elif MC_1_18_2 || MC_1_19_2 - net.minecraft.core.RegistryAccess registryAccess = level.registryAccess(); resourceLocation = registryAccess.registryOrThrow(Registry.BLOCK_REGISTRY).getKey(this.blockState.getBlock()); #else - net.minecraft.core.RegistryAccess registryAccess = level.registryAccess(); resourceLocation = registryAccess.registryOrThrow(Registries.BLOCK).getKey(this.blockState.getBlock()); #endif + + if (resourceLocation == null) { - LOGGER.warn("unable to serialize: " + this.blockState); + LOGGER.warn("No ResourceLocation found, unable to serialize: " + this.blockState); + return AIR_STRING; } - this.serializationResult = resourceLocation.getNamespace() + RESOURCE_LOCATION_SEPARATOR + resourceLocation.getPath() + this.serialString = resourceLocation.getNamespace() + RESOURCE_LOCATION_SEPARATOR + resourceLocation.getPath() + STATE_STRING_SEPARATOR + serializeBlockStateProperties(this.blockState); - return this.serializationResult; + return this.serialString; } /** will only work if a level is currently loaded */ - public static IBlockStateWrapper deserialize(String resourceStateString) throws IOException { return deserialize(resourceStateString, null); } public static IBlockStateWrapper deserialize(String resourceStateString, ILevelWrapper levelWrapper) throws IOException { if (resourceStateString.equals(AIR_STRING) || resourceStateString.equals("")) // the empty string shouldn't normally happen, but just in case @@ -292,7 +347,7 @@ public class BlockStateWrapper implements IBlockStateWrapper foundState = block.defaultBlockState(); } - return new BlockStateWrapper(foundState); + return new BlockStateWrapper(foundState, levelWrapper); } catch (Exception e) { @@ -331,61 +386,5 @@ public class BlockStateWrapper implements IBlockStateWrapper } - @Override - public boolean equals(Object obj) - { - if (this == obj) - { - return true; - } - - if (obj == null || this.getClass() != obj.getClass()) - { - return false; - } - - BlockStateWrapper that = (BlockStateWrapper) obj; - // the serialized value is used so we can test the contents instead of the references - return Objects.equals(this.serialize(), that.serialize()); - } - - @Override - public int hashCode() { return Objects.hash(this.serialize()); } - - - @Override - public Object getWrappedMcObject() { return this.blockState; } - - @Override - public boolean isAir() { return this.isAir(this.blockState); } - public boolean isAir(BlockState blockState) { return blockState == null || blockState.isAir(); } - - @Override - public boolean isSolid() - { - #if PRE_MC_1_20_1 - return this.blockState.getMaterial().isSolid(); - #else - return !this.blockState.getCollisionShape(EmptyBlockGetter.INSTANCE, BlockPos.ZERO).isEmpty(); - #endif - } - - @Override - public boolean isLiquid() - { - if (this.isAir()) - { - return false; - } - - #if PRE_MC_1_20_1 - return this.blockState.getMaterial().isLiquid(); - #else - return !this.blockState.getFluidState().isEmpty(); - #endif - } - - @Override - public String toString() { return this.serialize(); } } diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/chunk/ChunkWrapper.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/chunk/ChunkWrapper.java index f502b1d3d..0c717923f 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/chunk/ChunkWrapper.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/chunk/ChunkWrapper.java @@ -95,7 +95,7 @@ public class ChunkWrapper implements IChunkWrapper // constructor // //=============// - public ChunkWrapper(ChunkAccess chunk, LevelReader lightSource, @Nullable ILevelWrapper wrappedLevel) + public ChunkWrapper(ChunkAccess chunk, LevelReader lightSource, ILevelWrapper wrappedLevel) { this.chunk = chunk; this.lightSource = lightSource; @@ -156,8 +156,6 @@ public class ChunkWrapper implements IChunkWrapper @Override public IBiomeWrapper getBiome(int relX, int relY, int relZ) { - //if (wrappedLevel != null) return wrappedLevel.getBiome(new DhBlockPos(x + getMinX(), y, z + getMinZ())); - #if PRE_MC_1_17_1 return BiomeWrapper.getBiomeWrapper(this.chunk.getBiomes().getNoiseBiome( relX >> 2, relY >> 2, relZ >> 2)); @@ -367,12 +365,11 @@ public class ChunkWrapper implements IChunkWrapper @Override public IBlockStateWrapper getBlockState(int relX, int relY, int relZ) { - //if (wrappedLevel != null) return wrappedLevel.getBlockState(new DhBlockPos(x + getMinX(), y, z + getMinZ())); - return BlockStateWrapper.fromBlockState(this.chunk.getBlockState(new BlockPos(relX, relY, relZ))); + return BlockStateWrapper.fromBlockState(this.chunk.getBlockState(new BlockPos(relX, relY, relZ)), this.wrappedLevel); } @Override - public boolean isStillValid() { return this.wrappedLevel == null || this.wrappedLevel.tryGetChunk(this.chunkPos) == this; } + public boolean isStillValid() { return this.wrappedLevel.tryGetChunk(this.chunkPos) == this; } #if POST_MC_1_20_1 private static boolean checkLightSectionsOnChunk(LevelChunk chunk, LevelLightEngine engine) diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/world/ClientLevelWrapper.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/world/ClientLevelWrapper.java index 377276816..545e8b3b1 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/world/ClientLevelWrapper.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/world/ClientLevelWrapper.java @@ -165,7 +165,7 @@ public class ClientLevelWrapper implements IClientLevelWrapper @Override public IBlockStateWrapper getBlockState(DhBlockPos pos) { - return BlockStateWrapper.fromBlockState(this.level.getBlockState(McObjectConverter.Convert(pos))); + return BlockStateWrapper.fromBlockState(this.level.getBlockState(McObjectConverter.Convert(pos)), this); } @Override diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/world/ServerLevelWrapper.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/world/ServerLevelWrapper.java index c8aa907cb..b2779cf4f 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/world/ServerLevelWrapper.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/world/ServerLevelWrapper.java @@ -156,7 +156,7 @@ public class ServerLevelWrapper implements IServerLevelWrapper @Override public IBlockStateWrapper getBlockState(DhBlockPos pos) { - return BlockStateWrapper.fromBlockState(level.getBlockState(McObjectConverter.Convert(pos))); + return BlockStateWrapper.fromBlockState(level.getBlockState(McObjectConverter.Convert(pos)), this); } @Override diff --git a/coreSubProjects b/coreSubProjects index 697abb520..e62ddc302 160000 --- a/coreSubProjects +++ b/coreSubProjects @@ -1 +1 @@ -Subproject commit 697abb520b56e7381f2c757e6288e909b9a55737 +Subproject commit e62ddc302b76b981cbe3635826f61510a5e5bbc1 From 83fa1a0281bd7ec9528ac247743ad83497fdf523 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Thu, 24 Aug 2023 21:38:01 -0500 Subject: [PATCH 21/40] Require a ILevelWrapper when deserializing BiomeWrappers --- .../common/wrappers/WrapperFactory.java | 2 +- .../common/wrappers/block/BiomeWrapper.java | 119 ++++++++++++------ .../wrappers/block/BlockStateWrapper.java | 8 +- .../common/wrappers/chunk/ChunkWrapper.java | 15 ++- .../wrappers/world/ClientLevelWrapper.java | 2 +- .../wrappers/world/ServerLevelWrapper.java | 2 +- coreSubProjects | 2 +- 7 files changed, 102 insertions(+), 48 deletions(-) diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/WrapperFactory.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/WrapperFactory.java index 81f95245b..01bcf52f7 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/WrapperFactory.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/WrapperFactory.java @@ -70,7 +70,7 @@ public class WrapperFactory implements IWrapperFactory } @Override - public IBiomeWrapper deserializeBiomeWrapper(String str) throws IOException { return BiomeWrapper.deserialize(str); } + public IBiomeWrapper deserializeBiomeWrapper(String str, ILevelWrapper levelWrapper) throws IOException { return BiomeWrapper.deserialize(str, levelWrapper); } @Override public IBlockStateWrapper deserializeBlockStateWrapper(String str, ILevelWrapper levelWrapper) throws IOException { return BlockStateWrapper.deserialize(str, levelWrapper); } diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BiomeWrapper.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BiomeWrapper.java index be8e7620c..aee4951ca 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BiomeWrapper.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BiomeWrapper.java @@ -24,6 +24,8 @@ import java.util.Objects; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; +import com.seibel.distanthorizons.core.wrapperInterfaces.world.ILevelWrapper; +import net.minecraft.world.level.Level; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -63,20 +65,27 @@ public class BiomeWrapper implements IBiomeWrapper { private static final Logger LOGGER = LogManager.getLogger(); - #if PRE_MC_1_18_2 public static final ConcurrentMap biomeWrapperMap = new ConcurrentHashMap<>(); - public final Biome biome; #else public static final ConcurrentMap, BiomeWrapper> biomeWrapperMap = new ConcurrentHashMap<>(); + #endif + + public static final String EMPTY_STRING = "EMPTY"; + public static final BiomeWrapper EMPTY_WRAPPER = new BiomeWrapper(null, null); + + + + // properties // + + #if PRE_MC_1_18_2 + public final Biome biome; + #else public final Holder biome; #endif - /** - * Cached so it can be quickly used as a semi-stable hashing method.
- * This may also fix the issue where we can serialize and save after a level has been shut down. - */ - private String serializationResult = null; + /** technically final, but since it requires a method call to generate it can't be marked as such */ + private String serialString = null; @@ -84,14 +93,21 @@ public class BiomeWrapper implements IBiomeWrapper // constructors // //==============// - static public IBiomeWrapper getBiomeWrapper(#if PRE_MC_1_18_2 Biome #else Holder #endif biome) + static public IBiomeWrapper getBiomeWrapper(#if PRE_MC_1_18_2 Biome #else Holder #endif biome, ILevelWrapper levelWrapper) { - return biomeWrapperMap.computeIfAbsent(biome, BiomeWrapper::new); + if (biome == null) + { + return EMPTY_WRAPPER; + } + + return biomeWrapperMap.computeIfAbsent(biome, newBiome -> new BiomeWrapper(newBiome, levelWrapper)); } - private BiomeWrapper(#if PRE_MC_1_18_2 Biome #else Holder #endif biome) + private BiomeWrapper(#if PRE_MC_1_18_2 Biome #else Holder #endif biome, ILevelWrapper levelWrapper) { this.biome = biome; + this.serialString = this.serialize(levelWrapper); + LOGGER.trace("Created BiomeWrapper ["+this.serialString+"] for ["+biome+"]"); } @@ -103,6 +119,11 @@ public class BiomeWrapper implements IBiomeWrapper @Override public String getName() { + if (this == EMPTY_WRAPPER) + { + return EMPTY_STRING; + } + #if PRE_MC_1_18_2 return biome.toString(); #else @@ -124,16 +145,36 @@ public class BiomeWrapper implements IBiomeWrapper BiomeWrapper that = (BiomeWrapper) obj; // the serialized value is used so we can test the contents instead of the references - return Objects.equals(this.serialize(), that.serialize()); + return Objects.equals(this.getSerialString(), that.getSerialString()); } @Override - public int hashCode() { return Objects.hash(this.serialize()); } + public int hashCode() { return Objects.hash(this.getSerialString()); } @Override - public String serialize() // FIXME pass in level to prevent null pointers (or maybe just RegistryAccess?) + public String getSerialString() { return this.serialString; } + + @Override + public Object getWrappedMcObject() { return this.biome; } + + @Override + public String toString() { return this.getSerialString(); } + + + + //=======================// + // serialization methods // + //=======================// + + public String serialize(ILevelWrapper levelWrapper) { - if (this.serializationResult == null) + if (levelWrapper == null) + { + return EMPTY_STRING; + } + + + if (this.serialString == null) { net.minecraft.core.RegistryAccess registryAccess = Minecraft.getInstance().level.registryAccess(); @@ -157,26 +198,30 @@ public class BiomeWrapper implements IBiomeWrapper LOGGER.warn("unable to serialize: " + biomeName); // shouldn't normally happen, but just in case - this.serializationResult = ""; + this.serialString = ""; } else { - this.serializationResult = resourceLocation.getNamespace() + ":" + resourceLocation.getPath(); + this.serialString = resourceLocation.getNamespace() + ":" + resourceLocation.getPath(); } } - return this.serializationResult; + return this.serialString; } - public static IBiomeWrapper deserialize(String resourceLocationString) throws IOException // FIXME pass in level to prevent null pointers (or maybe just RegistryAccess?) + public static IBiomeWrapper deserialize(String resourceLocationString, ILevelWrapper levelWrapper) throws IOException { - if (resourceLocationString.trim().isEmpty() || resourceLocationString.equals("")) + if (resourceLocationString.equals(EMPTY_STRING)) { - LOGGER.warn("null biome string deserialized"); - - // shouldn't normally happen, but just in case - new ResourceLocation("minecraft", "the_void"); // just "void" in MC 1.12 through 1.9 (inclusive) + LOGGER.warn("["+EMPTY_STRING+"] biome string deserialized. This may mean there was a file saving error or a biome saving error."); + return EMPTY_WRAPPER; } + else if (resourceLocationString.trim().isEmpty() || resourceLocationString.equals("")) + { + LOGGER.warn("Null biome string deserialized."); + return EMPTY_WRAPPER; + } + // parse the resource location @@ -190,23 +235,32 @@ public class BiomeWrapper implements IBiomeWrapper try { - net.minecraft.core.RegistryAccess registryAccess = Minecraft.getInstance().level.registryAccess(); + Level level = (Level)levelWrapper.getWrappedMcObject(); + net.minecraft.core.RegistryAccess registryAccess = level.registryAccess(); + boolean success; #if MC_1_16_5 || MC_1_17_1 Biome biome = registryAccess.registryOrThrow(Registry.BIOME_REGISTRY).get(resourceLocation); + success = (biome != null); #elif MC_1_18_2 || MC_1_19_2 Biome unwrappedBiome = registryAccess.registryOrThrow(Registry.BIOME_REGISTRY).get(resourceLocation); + success = (unwrappedBiome != null); Holder biome = new Holder.Direct<>(unwrappedBiome); #else Biome unwrappedBiome = registryAccess.registryOrThrow(Registries.BIOME).get(resourceLocation); - if (unwrappedBiome == null) - { - LOGGER.warn("null biome string deserialized from string: " + resourceLocationString); - } + success = (unwrappedBiome != null); Holder biome = new Holder.Direct<>(unwrappedBiome); #endif - return getBiomeWrapper(biome); + + + if (!success) + { + LOGGER.warn("Unable to deserialize biome from string: [" + resourceLocationString + "]"); + return EMPTY_WRAPPER; + } + + return getBiomeWrapper(biome, levelWrapper); } catch (Exception e) { @@ -214,11 +268,4 @@ public class BiomeWrapper implements IBiomeWrapper } } - - @Override - public Object getWrappedMcObject() { return this.biome; } - - @Override - public String toString() { return this.serialize(); } - } diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BlockStateWrapper.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BlockStateWrapper.java index 484842367..4923b9441 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BlockStateWrapper.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BlockStateWrapper.java @@ -43,7 +43,7 @@ public class BlockStateWrapper implements IBlockStateWrapper public static final ConcurrentHashMap WRAPPER_BY_BLOCK_STATE = new ConcurrentHashMap<>(); - public static String AIR_STRING = "AIR"; + public static final String AIR_STRING = "AIR"; public static final BlockStateWrapper AIR = new BlockStateWrapper(null, null); public static final String[] RENDERER_IGNORED_BLOCKS_RESOURCE_LOCATIONS = { AIR_STRING, "minecraft:barrier", "minecraft:structure_void", "minecraft:light" }; @@ -52,6 +52,8 @@ public class BlockStateWrapper implements IBlockStateWrapper + // properties // + public final BlockState blockState; /** technically final, but since it requires a method call to generate it can't be marked as such */ private String serialString; @@ -76,7 +78,7 @@ public class BlockStateWrapper implements IBlockStateWrapper { this.blockState = blockState; this.serialString = this.serialize(levelWrapper); - LOGGER.trace("Created BlockStateWrapper for ["+blockState+"]"); + LOGGER.trace("Created BlockStateWrapper ["+this.serialString+"] for ["+blockState+"]"); } @@ -342,7 +344,7 @@ public class BlockStateWrapper implements IBlockStateWrapper if (blockStatePropertiesString != null) { // we should have found a blockstate, but didn't - LOGGER.warn("Unable to find BlockState for Block [" + resourceLocation + "] with properties: [" + blockStatePropertiesString + "]."); + LOGGER.warn("Unable to find BlockState for Block [" + resourceLocation + "] with properties: [" + blockStatePropertiesString + "]. Using the default block state."); } foundState = block.defaultBlockState(); diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/chunk/ChunkWrapper.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/chunk/ChunkWrapper.java index 0c717923f..f9cb65750 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/chunk/ChunkWrapper.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/chunk/ChunkWrapper.java @@ -158,16 +158,21 @@ public class ChunkWrapper implements IChunkWrapper { #if PRE_MC_1_17_1 return BiomeWrapper.getBiomeWrapper(this.chunk.getBiomes().getNoiseBiome( - relX >> 2, relY >> 2, relZ >> 2)); + relX >> 2, relY >> 2, relZ >> 2), + this.wrappedLevel); #elif PRE_MC_1_18_2 return BiomeWrapper.getBiomeWrapper(this.chunk.getBiomes().getNoiseBiome( - QuartPos.fromBlock(relX), QuartPos.fromBlock(relY), QuartPos.fromBlock(relZ))); + QuartPos.fromBlock(relX), QuartPos.fromBlock(relY), QuartPos.fromBlock(relZ)), + this.wrappedLevel); #elif PRE_MC_1_18_2 return BiomeWrapper.getBiomeWrapper(this.chunk.getNoiseBiome( - QuartPos.fromBlock(relX), QuartPos.fromBlock(relY), QuartPos.fromBlock(relZ))); - #else //Now returns a Holder instead of Biome + QuartPos.fromBlock(relX), QuartPos.fromBlock(relY), QuartPos.fromBlock(relZ)), + this.wrappedLevel); + #else + //Now returns a Holder instead of Biome return BiomeWrapper.getBiomeWrapper(this.chunk.getNoiseBiome( - QuartPos.fromBlock(relX), QuartPos.fromBlock(relY), QuartPos.fromBlock(relZ))); + QuartPos.fromBlock(relX), QuartPos.fromBlock(relY), QuartPos.fromBlock(relZ)), + this.wrappedLevel); #endif } diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/world/ClientLevelWrapper.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/world/ClientLevelWrapper.java index 545e8b3b1..0cd35bbda 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/world/ClientLevelWrapper.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/world/ClientLevelWrapper.java @@ -169,7 +169,7 @@ public class ClientLevelWrapper implements IClientLevelWrapper } @Override - public IBiomeWrapper getBiome(DhBlockPos pos) { return BiomeWrapper.getBiomeWrapper(this.level.getBiome(McObjectConverter.Convert(pos))); } + public IBiomeWrapper getBiome(DhBlockPos pos) { return BiomeWrapper.getBiomeWrapper(this.level.getBiome(McObjectConverter.Convert(pos)), this); } @Override public ClientLevel getWrappedMcObject() { return this.level; } diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/world/ServerLevelWrapper.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/world/ServerLevelWrapper.java index b2779cf4f..251db4535 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/world/ServerLevelWrapper.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/world/ServerLevelWrapper.java @@ -162,7 +162,7 @@ public class ServerLevelWrapper implements IServerLevelWrapper @Override public IBiomeWrapper getBiome(DhBlockPos pos) { - return BiomeWrapper.getBiomeWrapper(level.getBiome(McObjectConverter.Convert(pos))); + return BiomeWrapper.getBiomeWrapper(level.getBiome(McObjectConverter.Convert(pos)), this); } @Override diff --git a/coreSubProjects b/coreSubProjects index e62ddc302..269cbf835 160000 --- a/coreSubProjects +++ b/coreSubProjects @@ -1 +1 @@ -Subproject commit e62ddc302b76b981cbe3635826f61510a5e5bbc1 +Subproject commit 269cbf83557c16ac6a63aea6a2e57f0c7a7a63b6 From 56dd3c352ebb5b11ea9b875afc5eee129b557c23 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Fri, 25 Aug 2023 07:19:12 -0500 Subject: [PATCH 22/40] Fix BCLib compiling for MC 1.16 and disable 1.17 --- .../fabric/wrappers/modAccessor/BCLibAccessor.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fabric/src/main/java/com/seibel/distanthorizons/fabric/wrappers/modAccessor/BCLibAccessor.java b/fabric/src/main/java/com/seibel/distanthorizons/fabric/wrappers/modAccessor/BCLibAccessor.java index 7409b8978..945d8f148 100644 --- a/fabric/src/main/java/com/seibel/distanthorizons/fabric/wrappers/modAccessor/BCLibAccessor.java +++ b/fabric/src/main/java/com/seibel/distanthorizons/fabric/wrappers/modAccessor/BCLibAccessor.java @@ -2,7 +2,9 @@ package com.seibel.distanthorizons.fabric.wrappers.modAccessor; import com.seibel.distanthorizons.core.wrapperInterfaces.modAccessor.IBCLibAccessor; #if MC_1_16_5 -#elif PRE_MC_1_19_2 +import org.betterx.bclib.config.Configs; +import org.betterx.bclib.config.ClientConfig; +#elif MC_1_17_1 || MC_1_18_2 import ru.bclib.config.ClientConfig; import ru.bclib.config.Configs; #else @@ -17,9 +19,12 @@ public class BCLibAccessor implements IBCLibAccessor public void setRenderCustomFog(boolean newValue) { + #if !MC_1_17_1 // 1.17 doesn't have "ClientConfig.CUSTOM_FOG_RENDERING" + // Change the value of CUSTOM_FOG_RENDERING in the bclib client config // This disabled fog from rendering within bclib Configs.CLIENT_CONFIG.set(ClientConfig.CUSTOM_FOG_RENDERING, newValue); + #endif } } \ No newline at end of file From 3aa6cc33834ef7c1aacd684446090dc0b1ab0140 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Fri, 25 Aug 2023 07:52:20 -0500 Subject: [PATCH 23/40] Attempt to fix LodRenderer freeing GL objects while they are in use --- coreSubProjects | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreSubProjects b/coreSubProjects index 269cbf835..d5922900b 160000 --- a/coreSubProjects +++ b/coreSubProjects @@ -1 +1 @@ -Subproject commit 269cbf83557c16ac6a63aea6a2e57f0c7a7a63b6 +Subproject commit d5922900b5448e87cc9d26b52370073c0193ef3a From 37cbeebaa5c06c8762adeb20ddf28749d216139d Mon Sep 17 00:00:00 2001 From: James Seibel Date: Fri, 25 Aug 2023 18:26:52 -0500 Subject: [PATCH 24/40] Fix BCLib compiling for MC 1.16 and 1.17 --- .../fabric/wrappers/modAccessor/BCLibAccessor.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/fabric/src/main/java/com/seibel/distanthorizons/fabric/wrappers/modAccessor/BCLibAccessor.java b/fabric/src/main/java/com/seibel/distanthorizons/fabric/wrappers/modAccessor/BCLibAccessor.java index 945d8f148..968a98086 100644 --- a/fabric/src/main/java/com/seibel/distanthorizons/fabric/wrappers/modAccessor/BCLibAccessor.java +++ b/fabric/src/main/java/com/seibel/distanthorizons/fabric/wrappers/modAccessor/BCLibAccessor.java @@ -1,10 +1,8 @@ package com.seibel.distanthorizons.fabric.wrappers.modAccessor; import com.seibel.distanthorizons.core.wrapperInterfaces.modAccessor.IBCLibAccessor; -#if MC_1_16_5 -import org.betterx.bclib.config.Configs; -import org.betterx.bclib.config.ClientConfig; -#elif MC_1_17_1 || MC_1_18_2 +#if MC_1_16_5 || MC_1_17_1 +#elif MC_1_18_2 import ru.bclib.config.ClientConfig; import ru.bclib.config.Configs; #else @@ -19,7 +17,7 @@ public class BCLibAccessor implements IBCLibAccessor public void setRenderCustomFog(boolean newValue) { - #if !MC_1_17_1 // 1.17 doesn't have "ClientConfig.CUSTOM_FOG_RENDERING" + #if !(MC_1_16_5 || MC_1_17_1) // 1.16 and 1.17 don't have "ClientConfig.CUSTOM_FOG_RENDERING" // Change the value of CUSTOM_FOG_RENDERING in the bclib client config // This disabled fog from rendering within bclib From 30fac5e5cea7aa86600147ecfa1cfd0e771c7ac8 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Fri, 25 Aug 2023 21:17:54 -0500 Subject: [PATCH 25/40] Remove deprecated getX() and getZ() from DhChunkPos --- .../common/wrappers/world/ServerLevelWrapper.java | 2 +- coreSubProjects | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/world/ServerLevelWrapper.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/world/ServerLevelWrapper.java index 251db4535..18dbc08f0 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/world/ServerLevelWrapper.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/world/ServerLevelWrapper.java @@ -140,7 +140,7 @@ public class ServerLevelWrapper implements IServerLevelWrapper public IChunkWrapper tryGetChunk(DhChunkPos pos) { if (!level.hasChunk(pos.x, pos.z)) return null; - ChunkAccess chunk = level.getChunk(pos.getX(), pos.getZ(), ChunkStatus.EMPTY, false); + ChunkAccess chunk = level.getChunk(pos.x, pos.z, ChunkStatus.EMPTY, false); if (chunk == null) return null; return new ChunkWrapper(chunk, level, this); } diff --git a/coreSubProjects b/coreSubProjects index d5922900b..2e647b578 160000 --- a/coreSubProjects +++ b/coreSubProjects @@ -1 +1 @@ -Subproject commit d5922900b5448e87cc9d26b52370073c0193ef3a +Subproject commit 2e647b5781d654c0164c29579856602992da8664 From 3144e9d957f3728b6ab5e13a95ddbc44ebc8f4ac Mon Sep 17 00:00:00 2001 From: coolGi Date: Sat, 26 Aug 2023 17:29:48 +0930 Subject: [PATCH 26/40] Updated core-subproject --- coreSubProjects | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreSubProjects b/coreSubProjects index 2e647b578..747055257 160000 --- a/coreSubProjects +++ b/coreSubProjects @@ -1 +1 @@ -Subproject commit 2e647b5781d654c0164c29579856602992da8664 +Subproject commit 74705525765de5828fc68f6b42dc58c7464817bf From 0ea69d0ca43e7a535abe86ac6d39af6f2c56cc6a Mon Sep 17 00:00:00 2001 From: James Seibel Date: Sat, 26 Aug 2023 08:51:27 -0500 Subject: [PATCH 27/40] Add OpenGL error log config --- coreSubProjects | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreSubProjects b/coreSubProjects index 747055257..9e4307685 160000 --- a/coreSubProjects +++ b/coreSubProjects @@ -1 +1 @@ -Subproject commit 74705525765de5828fc68f6b42dc58c7464817bf +Subproject commit 9e43076853b7c20c0b58f003411b7703294b17f1 From fae58503a84facfd9898aac07386952109399296 Mon Sep 17 00:00:00 2001 From: coolGi Date: Sun, 27 Aug 2023 00:59:36 +0930 Subject: [PATCH 28/40] Removed flatlaf --- Readme.md | 3 --- build.gradle | 7 ------- 2 files changed, 10 deletions(-) diff --git a/Readme.md b/Readme.md index 6875690be..ffc3317bf 100644 --- a/Readme.md +++ b/Readme.md @@ -195,6 +195,3 @@ https://github.com/TheElectronWill/night-config SVG Salamander for SVG support\ https://github.com/blackears/svgSalamander - -FlatLaf for Java Swing theming (for development testing, may remove later, and not included in compiled jars)\ -https://www.formdev.com/flatlaf/ diff --git a/build.gradle b/build.gradle index f40fda823..1c0a778d9 100644 --- a/build.gradle +++ b/build.gradle @@ -223,12 +223,8 @@ subprojects { p -> forgeShadowMe("com.electronwill.night-config:toml:${rootProject.nightconfig_version}") forgeShadowMe("com.electronwill.night-config:json:${rootProject.nightconfig_version}") - // Theming - forgeShadowMe("com.formdev:flatlaf:${rootProject.flatlaf_version}") - // SVG forgeShadowMe("com.formdev:svgSalamander:${rootProject.svgSalamander_version}") - forgeShadowMe("com.formdev:flatlaf-extras:${rootProject.flatlaf_version}") // Netty // Breaks 1.16.5 @@ -308,9 +304,6 @@ subprojects { p -> // NightConfig (includes Toml & Json) relocate "com.electronwill.nightconfig", "${librariesLocation}.electronwill.nightconfig" - // Theming - relocate "com.formdev.flatlaf", "${librariesLocation}.formdev.flatlaf" - // SVG relocate "com.kitfox.svg", "${librariesLocation}.kitfox.svg" From 34bb512f030c4e4752e8be390805bd74fec17b3b Mon Sep 17 00:00:00 2001 From: coolGi Date: Sun, 27 Aug 2023 01:02:05 +0930 Subject: [PATCH 29/40] Disabled SVG from being included in the jar --- Readme.md | 2 +- build.gradle | 8 ++++---- coreSubProjects | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Readme.md b/Readme.md index ffc3317bf..48e52f592 100644 --- a/Readme.md +++ b/Readme.md @@ -193,5 +193,5 @@ https://github.com/lz4/lz4-java NightConfig for Json & Toml (config handling)\ https://github.com/TheElectronWill/night-config -SVG Salamander for SVG support\ +SVG Salamander for SVG support (not being used atm)\ https://github.com/blackears/svgSalamander diff --git a/build.gradle b/build.gradle index 1c0a778d9..7b19a6a3d 100644 --- a/build.gradle +++ b/build.gradle @@ -223,8 +223,8 @@ subprojects { p -> forgeShadowMe("com.electronwill.night-config:toml:${rootProject.nightconfig_version}") forgeShadowMe("com.electronwill.night-config:json:${rootProject.nightconfig_version}") - // SVG - forgeShadowMe("com.formdev:svgSalamander:${rootProject.svgSalamander_version}") + // SVG (not needed atm) +// forgeShadowMe("com.formdev:svgSalamander:${rootProject.svgSalamander_version}") // Netty // Breaks 1.16.5 @@ -304,8 +304,8 @@ subprojects { p -> // NightConfig (includes Toml & Json) relocate "com.electronwill.nightconfig", "${librariesLocation}.electronwill.nightconfig" - // SVG - relocate "com.kitfox.svg", "${librariesLocation}.kitfox.svg" + // SVG (not needed atm) +// relocate "com.kitfox.svg", "${librariesLocation}.kitfox.svg" // Netty relocate "io.netty", "${librariesLocation}.netty" diff --git a/coreSubProjects b/coreSubProjects index 9e4307685..0979d75a5 160000 --- a/coreSubProjects +++ b/coreSubProjects @@ -1 +1 @@ -Subproject commit 9e43076853b7c20c0b58f003411b7703294b17f1 +Subproject commit 0979d75a5d77ea2abd138ee882d71bd18b2c492f From e3da644b1cd7dca89e34f23e0b1b0ce5c7d346b6 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Sat, 26 Aug 2023 10:43:17 -0500 Subject: [PATCH 30/40] Optimize SSAO rendering --- coreSubProjects | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreSubProjects b/coreSubProjects index 9e4307685..cfa00010d 160000 --- a/coreSubProjects +++ b/coreSubProjects @@ -1 +1 @@ -Subproject commit 9e43076853b7c20c0b58f003411b7703294b17f1 +Subproject commit cfa00010d903539d72a3c7007dc072cc0d1861cf From 6c4364f0090a2ca5a31f2904e12378b056b2e11d Mon Sep 17 00:00:00 2001 From: James Seibel Date: Sat, 26 Aug 2023 10:56:36 -0500 Subject: [PATCH 31/40] Remove unused IDhApiConfigValue.getApiValue() --- coreSubProjects | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreSubProjects b/coreSubProjects index f8857d2a1..7a3f63040 160000 --- a/coreSubProjects +++ b/coreSubProjects @@ -1 +1 @@ -Subproject commit f8857d2a1d11a169816b702d1eda31afec3d3d3a +Subproject commit 7a3f63040da8dfc4d8d0cd0a7d5d890a7ba6bcc5 From 876c4f25109e5b371b46fbbaee8d5dd26951a68a Mon Sep 17 00:00:00 2001 From: coolGi Date: Sun, 27 Aug 2023 01:37:16 +0930 Subject: [PATCH 32/40] Moved fabric api stuff --- fabric/build.gradle | 9 ++++----- fabric/src/main/resources/fabric.mod.json | 1 - forge/src/main/resources/META-INF/mods.toml | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/fabric/build.gradle b/fabric/build.gradle index 2e32d9759..6ee8aa419 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -54,12 +54,11 @@ dependencies { modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}" // Fabric API - addModJar(fabricApi.module("fabric-events-interaction-v0", rootProject.fabric_api_version)) - addModJar(fabricApi.module("fabric-lifecycle-events-v1", rootProject.fabric_api_version)) - addModJar(fabricApi.module("fabric-key-binding-api-v1", rootProject.fabric_api_version)) - addModJar(fabricApi.module("fabric-resource-loader-v0", rootProject.fabric_api_version)) - addModJar(fabricApi.module("fabric-rendering-v1", rootProject.fabric_api_version)) // TODO: Remove this as it is only needed in 1 line (FabricClientProxy) addModJar(fabricApi.module("fabric-api-base", rootProject.fabric_api_version)) + addModJar(fabricApi.module("fabric-lifecycle-events-v1", rootProject.fabric_api_version)) + addModJar(fabricApi.module("fabric-resource-loader-v0", rootProject.fabric_api_version)) + addModJar(fabricApi.module("fabric-events-interaction-v0", rootProject.fabric_api_version)) + addModJar(fabricApi.module("fabric-rendering-v1", rootProject.fabric_api_version)) // TODO: Remove this as it is only needed in 1 line (FabricClientProxy) addModJar(fabricApi.module("fabric-networking-api-v1", rootProject.fabric_api_version)) // Mod Menu diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json index 01ab3fbf9..9a1e3fab2 100644 --- a/fabric/src/main/resources/fabric.mod.json +++ b/fabric/src/main/resources/fabric.mod.json @@ -39,7 +39,6 @@ "fabricloader": "*", "fabric-api-base": "*", "fabric-lifecycle-events-v1": "*", - "fabric-key-binding-api-v1": "*", "fabric-resource-loader-v0": "*", "minecraft": $compatible_minecraft_versions, "java": ">=${java_version}" diff --git a/forge/src/main/resources/META-INF/mods.toml b/forge/src/main/resources/META-INF/mods.toml index 30f586289..43a8eb78d 100644 --- a/forge/src/main/resources/META-INF/mods.toml +++ b/forge/src/main/resources/META-INF/mods.toml @@ -8,7 +8,7 @@ issueTrackerURL = "${issues}" modId = "distanthorizons" #//mandatory version = "${version}" #//mandatory, gets the version number from jar populated by the build.gradle script displayName = "${mod_name}" #//mandatory - authors = ["James Seibel", "Leonardo Amato", "Cola", "coolGi", "Ran", "Leetom"] + authors = ["James Seibel", "Leonardo Amato", "Cola", "coolGi", "Ran", "Leetom"] # Should be done with `$authors`, but architectury complains #//updateJSONURL="https://change.me.example.invalid/updates.json" # A URL to query for updates for this mod. See the JSON update specification https://mcforge.readthedocs.io/en/latest/gettingstarted/autoupdate/ displayURL = "${homepage}" description = "${description}" #//mandatory. The description text for the mod From 57e44cc4a7fff28905914342594a787d868f917f Mon Sep 17 00:00:00 2001 From: coolGi Date: Sun, 27 Aug 2023 01:37:32 +0930 Subject: [PATCH 33/40] Updated core sub-project --- coreSubProjects | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreSubProjects b/coreSubProjects index f8857d2a1..b3591066b 160000 --- a/coreSubProjects +++ b/coreSubProjects @@ -1 +1 @@ -Subproject commit f8857d2a1d11a169816b702d1eda31afec3d3d3a +Subproject commit b3591066bd1c92ecf9ae9185eb349c02aa734f6e From 09e689dc2fc428367e82b1861a0b4617152ec856 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Sat, 26 Aug 2023 11:19:54 -0500 Subject: [PATCH 34/40] Add a ReadMe to DhApi --- coreSubProjects | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreSubProjects b/coreSubProjects index 781bcd318..c6ee61777 160000 --- a/coreSubProjects +++ b/coreSubProjects @@ -1 +1 @@ -Subproject commit 781bcd318c2983259f359bddcf86da1a0f8629a3 +Subproject commit c6ee61777c6f4225061ef80bdd166e921d46844b From b888103c80576f1bd6e75ec18acce5fc2bc5d7bb Mon Sep 17 00:00:00 2001 From: James Seibel Date: Sat, 26 Aug 2023 13:11:21 -0500 Subject: [PATCH 35/40] Add IDhApiConfigValue.addChangeListener() --- coreSubProjects | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreSubProjects b/coreSubProjects index c6ee61777..2cd2941cb 160000 --- a/coreSubProjects +++ b/coreSubProjects @@ -1 +1 @@ -Subproject commit c6ee61777c6f4225061ef80bdd166e921d46844b +Subproject commit 2cd2941cbe1a90937d97d920486c3ac109eb2d8f From 3ddc3158269d4e22e68f1928c431a30d7bda7b13 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Sat, 26 Aug 2023 15:19:19 -0500 Subject: [PATCH 36/40] Fix 1.16 compiling --- .../fabric/wrappers/modAccessor/SodiumAccessor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fabric/src/main/java/com/seibel/distanthorizons/fabric/wrappers/modAccessor/SodiumAccessor.java b/fabric/src/main/java/com/seibel/distanthorizons/fabric/wrappers/modAccessor/SodiumAccessor.java index d25ba257f..aa14661b1 100644 --- a/fabric/src/main/java/com/seibel/distanthorizons/fabric/wrappers/modAccessor/SodiumAccessor.java +++ b/fabric/src/main/java/com/seibel/distanthorizons/fabric/wrappers/modAccessor/SodiumAccessor.java @@ -96,7 +96,7 @@ public class SodiumAccessor implements ISodiumAccessor LevelAccessor height = Minecraft.getInstance().level; // TODO: Maybe use a mixin to make this more efficient return MC_RENDER.getMaximumRenderedChunks().stream().filter((DhChunkPos chunk) -> { - FakeChunkEntity AABB = new FakeChunkEntity(chunk.getX(), chunk.getZ(), height.getMaxBuildHeight()); + FakeChunkEntity AABB = new FakeChunkEntity(chunk.x, chunk.z, height.getMaxBuildHeight()); return (renderer.isEntityVisible(AABB)); }).collect(Collectors.toCollection(HashSet::new)); } From 0c87a2a9ea6e6cc1d4b891a3d88bce09b19bbe89 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Sat, 26 Aug 2023 17:32:55 -0500 Subject: [PATCH 37/40] Fix api:javadoc compiling and warnings --- coreSubProjects | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreSubProjects b/coreSubProjects index 2cd2941cb..4439983ac 160000 --- a/coreSubProjects +++ b/coreSubProjects @@ -1 +1 @@ -Subproject commit 2cd2941cbe1a90937d97d920486c3ac109eb2d8f +Subproject commit 4439983aceea7cd9592f64254cc749a0be6503be From 6f35d0710e9eed9e63aebbf764fc86e21157a9aa Mon Sep 17 00:00:00 2001 From: James Seibel Date: Sat, 26 Aug 2023 17:57:40 -0500 Subject: [PATCH 38/40] fix quality preset cache reset firing too often --- coreSubProjects | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreSubProjects b/coreSubProjects index 4439983ac..44691f38f 160000 --- a/coreSubProjects +++ b/coreSubProjects @@ -1 +1 @@ -Subproject commit 4439983aceea7cd9592f64254cc749a0be6503be +Subproject commit 44691f38f14a562a0e651dcc28393095fa31fc36 From 5cda6a6f2c3d35b16fdf06bdbc1cd4aa35b66ff0 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Sat, 26 Aug 2023 21:53:07 -0500 Subject: [PATCH 39/40] fix render source null pointer --- coreSubProjects | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreSubProjects b/coreSubProjects index 44691f38f..ee9312225 160000 --- a/coreSubProjects +++ b/coreSubProjects @@ -1 +1 @@ -Subproject commit 44691f38f14a562a0e651dcc28393095fa31fc36 +Subproject commit ee9312225448373e834f39d1ed1a5ee739c91940 From 8ad55651487f80b78173aff4c0d528dc8ec57a17 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Sun, 27 Aug 2023 07:53:44 -0500 Subject: [PATCH 40/40] Convert WorldGenQueue to use SectionPos instead of LodPos --- coreSubProjects | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreSubProjects b/coreSubProjects index ee9312225..93cfea4c8 160000 --- a/coreSubProjects +++ b/coreSubProjects @@ -1 +1 @@ -Subproject commit ee9312225448373e834f39d1ed1a5ee739c91940 +Subproject commit 93cfea4c84d82a152dffa331989159d0abf44f08