Merge branch 'main' of gitlab.com:jeseibel/minecraft-lod-mod
This commit is contained in:
@@ -9,6 +9,7 @@ stages:
|
||||
- build_1_18_2
|
||||
- build_1_19_4
|
||||
- build_1_20_1
|
||||
- build_1_19_2
|
||||
- api
|
||||
- pages
|
||||
|
||||
@@ -51,6 +52,39 @@ build_1_18_2:
|
||||
- cache/
|
||||
allow_failure: true
|
||||
|
||||
# 1.19.2 build
|
||||
build_1_19_2:
|
||||
stage: build_1_19_2
|
||||
script:
|
||||
# this both runs the unit tests and assembles the code
|
||||
- ./gradlew clean -PmcVer="1.19.2" --gradle-user-home cache/;
|
||||
- ./gradlew build -PmcVer="1.19.2" --gradle-user-home cache/;
|
||||
- ./gradlew mergeJars -PmcVer="1.19.2" --gradle-user-home cache/;
|
||||
image: eclipse-temurin:17
|
||||
artifacts:
|
||||
name: "NightlyBuild_1_19_2-${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_TIMESTAMP}"
|
||||
paths:
|
||||
- Merged/*.jar
|
||||
- fabric/build/libs/*.jar
|
||||
- forge/build/libs/*.jar
|
||||
- quilt/build/libs/*.jar
|
||||
exclude:
|
||||
# TODO: There is a lot of duplicate stuff here, fix it later to be smaller
|
||||
- fabric/build/libs/*-all.jar
|
||||
- fabric/build/libs/*-sources.jar
|
||||
- forge/build/libs/*-all.jar
|
||||
- forge/build/libs/*-sources.jar
|
||||
- quilt/build/libs/*-all.jar
|
||||
- quilt/build/libs/*-sources.jar
|
||||
expire_in: 1 day
|
||||
when: always
|
||||
cache:
|
||||
key: "gradleCache"
|
||||
policy: pull-push
|
||||
paths:
|
||||
- .gradle
|
||||
- cache/
|
||||
allow_failure: true
|
||||
|
||||
# 1.19.4 build
|
||||
build_1_19_4:
|
||||
|
||||
+2
-4
@@ -10,11 +10,9 @@ echo So if someone does use Windows and knows how to script stuff then can you p
|
||||
@REM Old BAT script if you need some help with this task
|
||||
|
||||
@REM SETLOCAL
|
||||
@REM CALL :buildVersion "1.19"
|
||||
@REM CALL :buildVersion "1.18.2"
|
||||
@REM CALL :buildVersion "1.18.1"
|
||||
@REM CALL :buildVersion "1.17.1"
|
||||
@REM CALL :buildVersion "1.16.5"
|
||||
@REM CALL :buildVersion "1.19.4"
|
||||
@REM CALL :buildVersion "1.20.1"
|
||||
@REM EXIT /B %ERRORLEVEL%
|
||||
@REM
|
||||
@REM :buildVersion
|
||||
|
||||
+2
-2
@@ -22,7 +22,7 @@ package com.seibel.distanthorizons.common.forge;
|
||||
import com.seibel.distanthorizons.common.wrappers.minecraft.MinecraftClientWrapper;
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.core.Direction;
|
||||
#if POST_MC_1_19
|
||||
#if POST_MC_1_19_2
|
||||
import net.minecraft.util.RandomSource;
|
||||
#endif
|
||||
import net.minecraft.world.level.ColorResolver;
|
||||
@@ -39,7 +39,7 @@ import java.util.Random;
|
||||
* @author Ran
|
||||
*/
|
||||
public interface LodForgeMethodCaller {
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_2
|
||||
List<BakedQuad> getQuads(MinecraftClientWrapper mc, Block block, BlockState blockState, Direction direction, Random random); // FIXME: For 1.19
|
||||
#else
|
||||
List<BakedQuad> getQuads(MinecraftClientWrapper mc, Block block, BlockState blockState, Direction direction, RandomSource random); // FIXME: For 1.19
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ public class VersionConstants implements IVersionConstants
|
||||
|
||||
@Override
|
||||
public String getMinecraftVersion() {
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_2
|
||||
return Minecraft.getInstance().getGame().getVersion().getId();
|
||||
#else
|
||||
return SharedConstants.getCurrentVersion().getId();
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ import com.seibel.distanthorizons.core.wrapperInterfaces.world.IBiomeWrapper;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.core.Holder;
|
||||
#if POST_MC_1_19
|
||||
#if POST_MC_1_19_2
|
||||
import net.minecraft.data.worldgen.biome.EndBiomes;
|
||||
import net.minecraft.data.worldgen.biome.NetherBiomes;
|
||||
#endif
|
||||
|
||||
+2
-2
@@ -19,7 +19,7 @@ import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.FlowerBlock;
|
||||
import net.minecraft.world.level.block.LeavesBlock;
|
||||
import net.minecraft.world.level.block.RotatedPillarBlock;
|
||||
#if POST_MC_1_19
|
||||
#if POST_MC_1_19_2
|
||||
import net.minecraft.util.RandomSource;
|
||||
#endif
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
@@ -37,7 +37,7 @@ public class ClientBlockStateCache
|
||||
|
||||
private static final Logger LOGGER = DhLoggerBuilder.getLogger();
|
||||
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_2
|
||||
public static final Random random = new Random(0);
|
||||
#else
|
||||
public static final RandomSource random = RandomSource.create();
|
||||
|
||||
+3
-3
@@ -144,7 +144,7 @@ public class ChunkWrapper implements IChunkWrapper
|
||||
#if PRE_MC_1_17_1
|
||||
return BiomeWrapper.getBiomeWrapper(chunk.getBiomes().getNoiseBiome(
|
||||
x >> 2, y >> 2, z >> 2));
|
||||
#elif PRE_MC_1_18_1
|
||||
#elif PRE_MC_1_18_2
|
||||
return BiomeWrapper.getBiomeWrapper(chunk.getBiomes().getNoiseBiome(
|
||||
QuartPos.fromBlock(x), QuartPos.fromBlock(y), QuartPos.fromBlock(z)));
|
||||
#elif PRE_MC_1_18_2
|
||||
@@ -176,7 +176,7 @@ public class ChunkWrapper implements IChunkWrapper
|
||||
@Override
|
||||
public boolean isLightCorrect()
|
||||
{
|
||||
#if PRE_MC_1_18_1
|
||||
#if PRE_MC_1_18_2
|
||||
return true;
|
||||
#else
|
||||
if (this.chunk instanceof LevelChunk)
|
||||
@@ -399,7 +399,7 @@ public class ChunkWrapper implements IChunkWrapper
|
||||
|
||||
public static void syncedUpdateClientLightStatus()
|
||||
{
|
||||
#if PRE_MC_1_18_1
|
||||
#if PRE_MC_1_18_2
|
||||
// TODO: Check what to do in 1.18.1, or in other versions
|
||||
#else
|
||||
weakMapLock.writeLock().lock();
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ import net.minecraft.client.resources.language.I18n; // translation
|
||||
#if POST_MC_1_17_1
|
||||
import net.minecraft.client.gui.narration.NarratableEntry;
|
||||
#endif
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_2
|
||||
import net.minecraft.network.chat.TextComponent;
|
||||
import net.minecraft.network.chat.TranslatableComponent;
|
||||
#endif
|
||||
|
||||
@@ -5,7 +5,7 @@ import net.minecraft.client.gui.components.Button;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.MutableComponent;
|
||||
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_2
|
||||
import net.minecraft.network.chat.TextComponent;
|
||||
import net.minecraft.network.chat.TranslatableComponent;
|
||||
#endif
|
||||
@@ -15,7 +15,7 @@ public class GuiHelper {
|
||||
* Helper static methods for versional compat
|
||||
*/
|
||||
public static Button MakeBtn(Component base, int a, int b, int c, int d, Button.OnPress action) {
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_4
|
||||
return new Button(a, b, c, d, base, action);
|
||||
#else
|
||||
return Button.builder(base, action).bounds(a,b,c,d).build();
|
||||
@@ -23,7 +23,7 @@ public class GuiHelper {
|
||||
}
|
||||
|
||||
public static MutableComponent TextOrLiteral(String text) {
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_2
|
||||
return new TextComponent(text);
|
||||
#else
|
||||
return Component.literal(text);
|
||||
@@ -31,7 +31,7 @@ public class GuiHelper {
|
||||
}
|
||||
|
||||
public static MutableComponent TextOrTranslatable(String text) {
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_2
|
||||
return new TextComponent(text);
|
||||
#else
|
||||
return Component.translatable(text);
|
||||
@@ -39,7 +39,7 @@ public class GuiHelper {
|
||||
}
|
||||
|
||||
public static MutableComponent Translatable(String text, Object... args) {
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_2
|
||||
return new TranslatableComponent(text, args);
|
||||
#else
|
||||
return Component.translatable(text, args);
|
||||
@@ -47,7 +47,7 @@ public class GuiHelper {
|
||||
}
|
||||
|
||||
public static void SetX(AbstractWidget w, int x) {
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_4
|
||||
w.x = x;
|
||||
#else
|
||||
w.setX(x);
|
||||
@@ -55,7 +55,7 @@ public class GuiHelper {
|
||||
}
|
||||
|
||||
public static void SetY(AbstractWidget w, int y) {
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_4
|
||||
w.y = y;
|
||||
#else
|
||||
w.setY(y);
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ public class MinecraftScreen {
|
||||
private AbstractScreen screen;
|
||||
|
||||
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_2
|
||||
public static net.minecraft.network.chat.TranslatableComponent translate (String str, Object... args) {
|
||||
return new net.minecraft.network.chat.TranslatableComponent(str, args);
|
||||
}
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ public class TexturedButtonWidget extends ImageButton {
|
||||
super(x, y, width, height, u, v, hoveredVOffset, texture, textureWidth, textureHeight, pressAction, text);
|
||||
}
|
||||
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_2
|
||||
public TexturedButtonWidget(int x, int y, int width, int height, int u, int v, int hoveredVOffset, ResourceLocation texture, int textureWidth, int textureHeight, OnPress pressAction, OnTooltip tooltipSupplier, Component text) {
|
||||
super(x, y, width, height, u, v, hoveredVOffset, texture, textureWidth, textureHeight, pressAction, tooltipSupplier, text);
|
||||
}
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ import net.minecraft.client.gui.components.events.GuiEventListener;
|
||||
import net.minecraft.client.gui.narration.NarratableEntry;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.network.chat.Component;
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_2
|
||||
import net.minecraft.network.chat.TextComponent;
|
||||
#endif
|
||||
|
||||
|
||||
+2
-2
@@ -43,7 +43,7 @@ import net.minecraft.client.player.LocalPlayer;
|
||||
import net.minecraft.client.resources.model.ModelManager;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_2
|
||||
import net.minecraft.network.chat.TextComponent;
|
||||
#endif
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
@@ -223,7 +223,7 @@ public class MinecraftClientWrapper implements IMinecraftClientWrapper, IMinecra
|
||||
{
|
||||
LocalPlayer p = getPlayer();
|
||||
if (p == null) return;
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_2
|
||||
p.sendMessage(new TextComponent(string), getPlayer().getUUID());
|
||||
#else
|
||||
p.sendSystemMessage(net.minecraft.network.chat.Component.translatable(string));
|
||||
|
||||
+3
-3
@@ -138,7 +138,7 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper
|
||||
@Override
|
||||
public double getGamma()
|
||||
{
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_2
|
||||
return MC.options.gamma;
|
||||
#else
|
||||
return MC.options.gamma().get();
|
||||
@@ -186,7 +186,7 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper
|
||||
@Override
|
||||
public int getRenderDistance()
|
||||
{
|
||||
#if PRE_MC_1_18_1
|
||||
#if PRE_MC_1_18_2
|
||||
//FIXME: How to resolve this?
|
||||
return MC.options.renderDistance;
|
||||
#else
|
||||
@@ -278,7 +278,7 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper
|
||||
try {
|
||||
LevelRenderer levelRenderer = MC.levelRenderer;
|
||||
Collection<LevelRenderer.RenderChunkInfo> chunks =
|
||||
#if PRE_MC_1_18_1 levelRenderer.renderChunks;
|
||||
#if PRE_MC_1_18_2 levelRenderer.renderChunks;
|
||||
#else levelRenderer.renderChunkStorage.get().renderChunks; #endif
|
||||
|
||||
return (chunks.stream().map((chunk) -> {
|
||||
|
||||
+6
-6
@@ -55,7 +55,7 @@ import com.seibel.distanthorizons.common.wrappers.worldGeneration.step.StepStruc
|
||||
import com.seibel.distanthorizons.common.wrappers.worldGeneration.step.StepStructureStart;
|
||||
import com.seibel.distanthorizons.common.wrappers.worldGeneration.step.StepSurface;
|
||||
|
||||
#if POST_MC_1_19
|
||||
#if POST_MC_1_19_4
|
||||
import net.minecraft.core.registries.Registries;
|
||||
#endif
|
||||
|
||||
@@ -309,7 +309,7 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv
|
||||
private static ProtoChunk EmptyChunk(ServerLevel level, ChunkPos chunkPos) {
|
||||
return new ProtoChunk(chunkPos, UpgradeData.EMPTY
|
||||
#if POST_MC_1_17_1, level #endif
|
||||
#if POST_MC_1_18_1, level.registryAccess().registryOrThrow(
|
||||
#if POST_MC_1_18_2, level.registryAccess().registryOrThrow(
|
||||
#if PRE_MC_1_19_4
|
||||
Registry.BIOME_REGISTRY
|
||||
#else
|
||||
@@ -394,7 +394,7 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv
|
||||
{
|
||||
target = new ProtoChunk(chunkPos, UpgradeData.EMPTY
|
||||
#if POST_MC_1_17_1 , params.level #endif
|
||||
#if POST_MC_1_18_1 , params.biomes, null #endif
|
||||
#if POST_MC_1_18_2 , params.biomes, null #endif
|
||||
);
|
||||
}
|
||||
return target;
|
||||
@@ -433,7 +433,7 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv
|
||||
}
|
||||
|
||||
boolean isFull = target.getStatus() == ChunkStatus.FULL || target instanceof LevelChunk;
|
||||
#if POST_MC_1_18_1
|
||||
#if POST_MC_1_18_2
|
||||
boolean isPartial = target.isOldNoiseGeneration();
|
||||
#endif
|
||||
if (isFull)
|
||||
@@ -441,7 +441,7 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv
|
||||
LOAD_LOGGER.info("Detected full existing chunk at {}", target.getPos());
|
||||
genEvent.resultConsumer.accept(wrappedChunk);
|
||||
}
|
||||
#if POST_MC_1_18_1
|
||||
#if POST_MC_1_18_2
|
||||
else if (isPartial)
|
||||
{
|
||||
LOAD_LOGGER.info("Detected old existing chunk at {}", target.getPos());
|
||||
@@ -582,7 +582,7 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv
|
||||
// that though is no longer needed...
|
||||
}
|
||||
|
||||
#if POST_MC_1_18_1
|
||||
#if POST_MC_1_18_2
|
||||
if (chunk instanceof LevelChunk)
|
||||
{
|
||||
LevelChunk levelChunk = (LevelChunk) chunk;
|
||||
|
||||
+7
-7
@@ -31,16 +31,16 @@ import net.minecraft.server.level.ThreadedLevelLightEngine;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
import net.minecraft.world.level.biome.BiomeManager;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
#if POST_MC_1_18_1
|
||||
#if POST_MC_1_18_2
|
||||
import net.minecraft.world.level.chunk.storage.ChunkScanAccess;
|
||||
#endif
|
||||
import net.minecraft.world.level.levelgen.WorldGenSettings;
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_2
|
||||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureManager;
|
||||
#else
|
||||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplateManager;
|
||||
import net.minecraft.world.level.levelgen.RandomState;
|
||||
#if POST_MC_1_19
|
||||
#if POST_MC_1_19_4
|
||||
import net.minecraft.world.level.levelgen.WorldOptions;
|
||||
import net.minecraft.core.registries.Registries;
|
||||
#endif
|
||||
@@ -50,7 +50,7 @@ import net.minecraft.world.level.storage.WorldData;
|
||||
public final class GlobalParameters
|
||||
{
|
||||
public final ChunkGenerator generator;
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_2
|
||||
public final StructureManager structures;
|
||||
#else
|
||||
public final StructureTemplateManager structures;
|
||||
@@ -68,7 +68,7 @@ public final class GlobalParameters
|
||||
public final RegistryAccess registry;
|
||||
public final long worldSeed;
|
||||
public final DataFixer fixerUpper;
|
||||
#if POST_MC_1_18_1
|
||||
#if POST_MC_1_18_2
|
||||
public final BiomeManager biomeManager;
|
||||
public final ChunkScanAccess chunkScanner; // FIXME: Figure out if this is actually needed
|
||||
#endif
|
||||
@@ -92,14 +92,14 @@ public final class GlobalParameters
|
||||
biomes = registry.registryOrThrow(Registries.BIOME);
|
||||
worldSeed = worldOptions.seed();
|
||||
#endif
|
||||
#if POST_MC_1_18_1
|
||||
#if POST_MC_1_18_2
|
||||
biomeManager = new BiomeManager(level, BiomeManager.obfuscateSeed(worldSeed));
|
||||
chunkScanner = level.getChunkSource().chunkScanner();
|
||||
#endif
|
||||
structures = server.getStructureManager();
|
||||
generator = level.getChunkSource().getGenerator();
|
||||
fixerUpper = server.getFixerUpper();
|
||||
#if POST_MC_1_19
|
||||
#if POST_MC_1_19_2
|
||||
randomState = level.getChunkSource().randomState();
|
||||
#endif
|
||||
}
|
||||
|
||||
+6
-6
@@ -25,7 +25,7 @@ import com.seibel.distanthorizons.common.wrappers.worldGeneration.mimicObject.Wo
|
||||
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
#if POST_MC_1_18_1
|
||||
#if POST_MC_1_18_2
|
||||
import net.minecraft.world.level.levelgen.structure.StructureCheck;
|
||||
#endif
|
||||
|
||||
@@ -35,7 +35,7 @@ public final class ThreadedParameters
|
||||
|
||||
final ServerLevel level;
|
||||
public WorldGenStructFeatManager structFeat = null;
|
||||
#if POST_MC_1_18_1
|
||||
#if POST_MC_1_18_2
|
||||
public StructureCheck structCheck;
|
||||
#endif
|
||||
boolean isValid = true;
|
||||
@@ -63,9 +63,9 @@ public final class ThreadedParameters
|
||||
previousGlobalParameters = param;
|
||||
|
||||
this.level = param.level;
|
||||
#if PRE_MC_1_18_1
|
||||
#if PRE_MC_1_18_2
|
||||
this.structFeat = new WorldGenStructFeatManager(param.worldGenSettings, level);
|
||||
#elif PRE_MC_1_19
|
||||
#elif PRE_MC_1_19_2
|
||||
this.structCheck = this.createStructureCheck(param);
|
||||
#else
|
||||
this.structCheck = new StructureCheck(param.chunkScanner, param.registry, param.structures,
|
||||
@@ -81,14 +81,14 @@ public final class ThreadedParameters
|
||||
public void makeStructFeat(WorldGenLevel genLevel, GlobalParameters param)
|
||||
{
|
||||
#if PRE_MC_1_19_4
|
||||
structFeat = new WorldGenStructFeatManager(param.worldGenSettings, genLevel #if POST_MC_1_18_1, structCheck #endif);
|
||||
structFeat = new WorldGenStructFeatManager(param.worldGenSettings, genLevel #if POST_MC_1_18_2, structCheck #endif);
|
||||
#else
|
||||
structFeat = new WorldGenStructFeatManager(param.worldOptions, genLevel, structCheck);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_2
|
||||
public void recreateStructureCheck()
|
||||
{
|
||||
if (previousGlobalParameters != null)
|
||||
|
||||
+14
-14
@@ -54,9 +54,9 @@ import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.chunk.*;
|
||||
import net.minecraft.world.level.chunk.storage.ChunkSerializer;
|
||||
import net.minecraft.world.level.levelgen.Heightmap;
|
||||
#if POST_MC_1_18_1
|
||||
#if POST_MC_1_18_2
|
||||
import net.minecraft.world.level.levelgen.blending.BlendingData;
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_2
|
||||
import net.minecraft.world.level.levelgen.feature.StructureFeature;
|
||||
#endif
|
||||
import net.minecraft.world.level.levelgen.structure.StructureStart;
|
||||
@@ -66,7 +66,7 @@ import net.minecraft.world.ticks.LevelChunkTicks;
|
||||
#if POST_MC_1_18_2
|
||||
import net.minecraft.core.Holder;
|
||||
import net.minecraft.core.RegistryAccess;
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_2
|
||||
import net.minecraft.world.level.levelgen.feature.ConfiguredStructureFeature;
|
||||
#endif
|
||||
#endif
|
||||
@@ -78,9 +78,9 @@ import org.apache.logging.log4j.Logger;
|
||||
|
||||
public class ChunkLoader
|
||||
{
|
||||
#if POST_MC_1_19
|
||||
#if POST_MC_1_19_2
|
||||
private static final Codec<PalettedContainer<BlockState>> BLOCK_STATE_CODEC = PalettedContainer.codecRW(Block.BLOCK_STATE_REGISTRY, BlockState.CODEC, PalettedContainer.Strategy.SECTION_STATES, Blocks.AIR.defaultBlockState());
|
||||
#elif POST_MC_1_18_1
|
||||
#elif POST_MC_1_18_2
|
||||
private static final Codec<PalettedContainer<BlockState>> BLOCK_STATE_CODEC = PalettedContainer.codec(Block.BLOCK_STATE_REGISTRY, BlockState.CODEC, PalettedContainer.Strategy.SECTION_STATES, Blocks.AIR.defaultBlockState());
|
||||
#endif
|
||||
private static final String TAG_UPGRADE_DATA = "UpgradeData";
|
||||
@@ -90,7 +90,7 @@ public class ChunkLoader
|
||||
private static final String FLUID_TICKS_TAG_PRE18 = "LiquidTicks";
|
||||
private static final ConfigBasedLogger LOGGER = BatchGenerationEnvironment.LOAD_LOGGER;
|
||||
|
||||
#if POST_MC_1_18_1
|
||||
#if POST_MC_1_18_2
|
||||
private static BlendingData readBlendingData(CompoundTag chunkData)
|
||||
{
|
||||
BlendingData blendingData = null;
|
||||
@@ -106,7 +106,7 @@ public class ChunkLoader
|
||||
|
||||
private static LevelChunkSection[] readSections(LevelAccessor level, LevelLightEngine lightEngine, ChunkPos chunkPos, CompoundTag chunkData)
|
||||
{
|
||||
#if POST_MC_1_18_1
|
||||
#if POST_MC_1_18_2
|
||||
#if PRE_MC_1_19_4
|
||||
Registry<Biome> biomes = level.registryAccess().registryOrThrow(Registry.BIOME_REGISTRY);
|
||||
#else
|
||||
@@ -115,7 +115,7 @@ public class ChunkLoader
|
||||
#if PRE_MC_1_18_2
|
||||
Codec<PalettedContainer<Biome>> biomeCodec = PalettedContainer.codec(
|
||||
biomes, biomes.byNameCodec(), PalettedContainer.Strategy.SECTION_BIOMES, biomes.getOrThrow(Biomes.PLAINS));
|
||||
#elif PRE_MC_1_19
|
||||
#elif PRE_MC_1_19_2
|
||||
Codec<PalettedContainer<Holder<Biome>>> biomeCodec = PalettedContainer.codec(
|
||||
biomes.asHolderIdMap(), biomes.holderByNameCodec(), PalettedContainer.Strategy.SECTION_BIOMES, biomes.getHolderOrThrow(Biomes.PLAINS));
|
||||
#else
|
||||
@@ -136,7 +136,7 @@ public class ChunkLoader
|
||||
CompoundTag tagSection = tagSections.getCompound(j);
|
||||
int sectionYPos = tagSection.getByte("Y");
|
||||
|
||||
#if PRE_MC_1_18_1
|
||||
#if PRE_MC_1_18_2
|
||||
if (tagSection.contains("Palette", 9) && tagSection.contains("BlockStates", 12)) {
|
||||
LevelChunkSection levelChunkSection = new LevelChunkSection(sectionYPos << 4);
|
||||
levelChunkSection.getStates().read(tagSection.getList("Palette", 10),
|
||||
@@ -225,7 +225,7 @@ public class ChunkLoader
|
||||
|
||||
public static LevelChunk read(WorldGenLevel level, LevelLightEngine lightEngine, ChunkPos chunkPos, CompoundTag chunkData)
|
||||
{
|
||||
#if PRE_MC_1_18_1
|
||||
#if PRE_MC_1_18_2
|
||||
CompoundTag tagLevel = chunkData.getCompound("Level");
|
||||
#else
|
||||
CompoundTag tagLevel = chunkData;
|
||||
@@ -238,12 +238,12 @@ public class ChunkLoader
|
||||
}
|
||||
|
||||
ChunkStatus.ChunkType chunkType = readChunkType(tagLevel);
|
||||
#if PRE_MC_1_18_1
|
||||
#if PRE_MC_1_18_2
|
||||
if (chunkType != ChunkStatus.ChunkType.LEVELCHUNK)
|
||||
return null;
|
||||
#else
|
||||
BlendingData blendingData = readBlendingData(tagLevel);
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_2
|
||||
if (chunkType == ChunkStatus.ChunkType.PROTOCHUNK && (blendingData == null || !blendingData.oldNoise()))
|
||||
return null;
|
||||
#else
|
||||
@@ -261,7 +261,7 @@ public class ChunkLoader
|
||||
|
||||
boolean isLightOn = tagLevel.getBoolean("isLightOn");
|
||||
if (isLightOn) lightEngine.retainData(chunkPos, true);
|
||||
#if PRE_MC_1_18_1
|
||||
#if PRE_MC_1_18_2
|
||||
ChunkBiomeContainer chunkBiomeContainer = new ChunkBiomeContainer(
|
||||
level.getLevel().registryAccess().registryOrThrow(Registry.BIOME_REGISTRY)#if POST_MC_1_17_1, level #endif,
|
||||
chunkPos, level.getLevel().getChunkSource().getGenerator().getBiomeSource(),
|
||||
@@ -293,7 +293,7 @@ public class ChunkLoader
|
||||
LevelChunkSection[] levelChunkSections = readSections(level, lightEngine, chunkPos, tagLevel);
|
||||
|
||||
// ====================== Make the chunk =========================
|
||||
#if PRE_MC_1_18_1
|
||||
#if PRE_MC_1_18_2
|
||||
LevelChunk chunk = new LevelChunk((Level) level.getLevel(), chunkPos, chunkBiomeContainer, upgradeData, blockTicks,
|
||||
fluidTicks, inhabitedTime, levelChunkSections, null);
|
||||
#else
|
||||
|
||||
+4
-4
@@ -66,7 +66,7 @@ public class LightedWorldGenRegion extends WorldGenRegion
|
||||
private final List<ChunkAccess> cache;
|
||||
Long2ObjectOpenHashMap<ChunkAccess> chunkMap = new Long2ObjectOpenHashMap<ChunkAccess>();
|
||||
|
||||
#if PRE_MC_1_18_1
|
||||
#if PRE_MC_1_18_2
|
||||
private ChunkPos overrideCenterPos = null;
|
||||
|
||||
public void setOverrideCenter(ChunkPos pos) {overrideCenterPos = pos;}
|
||||
@@ -114,7 +114,7 @@ public class LightedWorldGenRegion extends WorldGenRegion
|
||||
if (k > this.writeRadius || l > this.writeRadius) {
|
||||
return false;
|
||||
}
|
||||
#if POST_MC_1_18_1
|
||||
#if POST_MC_1_18_2
|
||||
if (center.isUpgrading()) {
|
||||
LevelHeightAccessor levelHeightAccessor = center.getHeightAccessorForGeneration();
|
||||
if (blockPos.getY() < levelHeightAccessor.getMinBuildHeight() || blockPos.getY() >= levelHeightAccessor.getMaxBuildHeight()) {
|
||||
@@ -220,7 +220,7 @@ public class LightedWorldGenRegion extends WorldGenRegion
|
||||
public ChunkAccess getChunk(int i, int j, ChunkStatus chunkStatus, boolean bl) {
|
||||
ChunkAccess chunk = getChunkAccess(i, j, chunkStatus, bl);
|
||||
if (chunk instanceof LevelChunk) {
|
||||
chunk = new ImposterProtoChunk((LevelChunk) chunk #if POST_MC_1_18_1, true #endif);
|
||||
chunk = new ImposterProtoChunk((LevelChunk) chunk #if POST_MC_1_18_2, true #endif);
|
||||
}
|
||||
return chunk;
|
||||
}
|
||||
@@ -284,7 +284,7 @@ public class LightedWorldGenRegion extends WorldGenRegion
|
||||
|
||||
public int calculateBlockTint(BlockPos blockPos, ColorResolver colorResolver)
|
||||
{
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_2
|
||||
int i = (Minecraft.getInstance()).options.biomeBlendRadius;
|
||||
#else
|
||||
int i = (Minecraft.getInstance()).options.biomeBlendRadius().get();
|
||||
|
||||
+1
-1
@@ -221,7 +221,7 @@ public class WorldGenLevelLightEngine extends LevelLightEngine {
|
||||
if (!LevelChunkSection.isEmpty(levelChunkSection)) {
|
||||
updateSectionStatus(SectionPos.of(chunkPos, i), false);
|
||||
}
|
||||
#elif PRE_MC_1_18_1
|
||||
#elif PRE_MC_1_18_2
|
||||
if (!LevelChunkSection.isEmpty(levelChunkSection)) {
|
||||
int j = this.levelHeightAccessor.getSectionYFromSectionIndex(i);
|
||||
updateSectionStatus(SectionPos.of(chunkPos, j), false);
|
||||
|
||||
+14
-12
@@ -37,41 +37,43 @@ import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.level.chunk.ChunkAccess;
|
||||
import net.minecraft.world.level.chunk.ChunkStatus;
|
||||
import net.minecraft.world.level.levelgen.WorldGenSettings;
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_2
|
||||
import net.minecraft.world.level.levelgen.feature.ConfiguredStructureFeature;
|
||||
import net.minecraft.world.level.StructureFeatureManager;
|
||||
#else
|
||||
#if POST_MC_1_19_4
|
||||
import net.minecraft.world.level.levelgen.WorldOptions;
|
||||
#endif
|
||||
import net.minecraft.world.level.levelgen.structure.Structure;
|
||||
import net.minecraft.world.level.StructureManager;
|
||||
#endif
|
||||
#if POST_MC_1_18_1
|
||||
#if POST_MC_1_18_2
|
||||
import net.minecraft.world.level.levelgen.structure.StructureCheck;
|
||||
#endif
|
||||
import net.minecraft.world.level.levelgen.structure.StructureStart;
|
||||
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_2
|
||||
public class WorldGenStructFeatManager extends StructureFeatureManager {
|
||||
#else
|
||||
public class WorldGenStructFeatManager extends StructureManager {
|
||||
#endif
|
||||
final WorldGenLevel genLevel;
|
||||
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_4
|
||||
WorldGenSettings worldGenSettings;
|
||||
#else
|
||||
WorldOptions worldOptions;
|
||||
#endif
|
||||
|
||||
#if POST_MC_1_18_1
|
||||
#if POST_MC_1_18_2
|
||||
StructureCheck structureCheck;
|
||||
#endif
|
||||
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_4
|
||||
public WorldGenStructFeatManager(WorldGenSettings worldGenSettings,
|
||||
WorldGenLevel genLevel #if POST_MC_1_18_1 , StructureCheck structureCheck #endif ) {
|
||||
WorldGenLevel genLevel #if POST_MC_1_18_2 , StructureCheck structureCheck #endif ) {
|
||||
|
||||
super(genLevel, worldGenSettings #if POST_MC_1_18_1 , structureCheck #endif );
|
||||
super(genLevel, worldGenSettings #if POST_MC_1_18_2 , structureCheck #endif );
|
||||
this.genLevel = genLevel;
|
||||
this.worldGenSettings = worldGenSettings;
|
||||
}
|
||||
@@ -89,8 +91,8 @@ public class WorldGenStructFeatManager extends StructureManager {
|
||||
public WorldGenStructFeatManager forWorldGenRegion(WorldGenRegion worldGenRegion) {
|
||||
if (worldGenRegion == genLevel)
|
||||
return this;
|
||||
#if PRE_MC_1_19
|
||||
return new WorldGenStructFeatManager(worldGenSettings, worldGenRegion #if POST_MC_1_18_1 , structureCheck #endif );
|
||||
#if PRE_MC_1_19_4
|
||||
return new WorldGenStructFeatManager(worldGenSettings, worldGenRegion #if POST_MC_1_18_2 , structureCheck #endif );
|
||||
#else
|
||||
return new WorldGenStructFeatManager(worldOptions, worldGenRegion, structureCheck);
|
||||
#endif
|
||||
@@ -101,7 +103,7 @@ public class WorldGenStructFeatManager extends StructureManager {
|
||||
return genLevel.getChunk(x, z, status, false);
|
||||
}
|
||||
|
||||
#if PRE_MC_1_18_1
|
||||
#if PRE_MC_1_18_2
|
||||
@Override
|
||||
public Stream<? extends StructureStart<?>> startsForFeature(SectionPos sectionPos2,
|
||||
StructureFeature<?> structureFeature) {
|
||||
@@ -149,7 +151,7 @@ public class WorldGenStructFeatManager extends StructureManager {
|
||||
return builder.build();
|
||||
}
|
||||
#else
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_2
|
||||
@Override
|
||||
public List<StructureStart> startsForFeature(SectionPos sectionPos, Predicate<ConfiguredStructureFeature<?, ?>> predicate) {
|
||||
ChunkAccess chunk = _getChunk(sectionPos.x(), sectionPos.z(), ChunkStatus.STRUCTURE_REFERENCES);
|
||||
|
||||
+5
-5
@@ -26,12 +26,12 @@ import com.seibel.distanthorizons.common.wrappers.worldGeneration.BatchGeneratio
|
||||
import com.seibel.distanthorizons.common.wrappers.worldGeneration.ThreadedParameters;
|
||||
|
||||
import net.minecraft.server.level.WorldGenRegion;
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_2
|
||||
#endif
|
||||
import net.minecraft.world.level.chunk.ChunkAccess;
|
||||
import net.minecraft.world.level.chunk.ChunkStatus;
|
||||
import net.minecraft.world.level.chunk.ProtoChunk;
|
||||
#if POST_MC_1_18_1
|
||||
#if POST_MC_1_18_2
|
||||
import net.minecraft.world.level.levelgen.blending.Blender;
|
||||
#endif
|
||||
|
||||
@@ -64,12 +64,12 @@ public final class StepBiomes {
|
||||
|
||||
for (ChunkAccess chunk : chunksToDo) {
|
||||
// System.out.println("StepBiomes: "+chunk.getPos());
|
||||
#if PRE_MC_1_18_1
|
||||
#if PRE_MC_1_18_2
|
||||
environment.params.generator.createBiomes(environment.params.biomes, chunk);
|
||||
#elif PRE_MC_1_19
|
||||
#elif PRE_MC_1_19_2
|
||||
chunk = environment.joinSync(environment.params.generator.createBiomes(environment.params.biomes, Runnable::run, Blender.of(worldGenRegion),
|
||||
tParams.structFeat.forWorldGenRegion(worldGenRegion), chunk));
|
||||
#elif PRE_MC_1_19_3
|
||||
#elif PRE_MC_1_19_4
|
||||
chunk = environment.joinSync(environment.params.generator.createBiomes(environment.params.biomes, Runnable::run, environment.params.randomState, Blender.of(worldGenRegion),
|
||||
tParams.structFeat.forWorldGenRegion(worldGenRegion), chunk));
|
||||
#else
|
||||
|
||||
+2
-2
@@ -31,7 +31,7 @@ import net.minecraft.world.level.chunk.ChunkAccess;
|
||||
import net.minecraft.world.level.chunk.ChunkStatus;
|
||||
import net.minecraft.world.level.chunk.ProtoChunk;
|
||||
import net.minecraft.world.level.levelgen.Heightmap;
|
||||
#if POST_MC_1_18_1
|
||||
#if POST_MC_1_18_2
|
||||
#endif
|
||||
|
||||
public final class StepFeatures {
|
||||
@@ -62,7 +62,7 @@ public final class StepFeatures {
|
||||
|
||||
for (ChunkAccess chunk : chunksToDo) {
|
||||
try {
|
||||
#if PRE_MC_1_18_1
|
||||
#if PRE_MC_1_18_2
|
||||
worldGenRegion.setOverrideCenter(chunk.getPos());
|
||||
environment.params.generator.applyBiomeDecoration(worldGenRegion, tParams.structFeat);
|
||||
Heightmap.primeHeightmaps(chunk, STATUS.heightmapsAfter());
|
||||
|
||||
+1
-1
@@ -72,7 +72,7 @@ public final class StepLight {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
#if POST_MC_1_18_1 && PRE_MC_1_20_1
|
||||
#if POST_MC_1_18_2 && PRE_MC_1_20_1
|
||||
if (chunk instanceof LevelChunk) ((LevelChunk)chunk).setClientLightReady(true);
|
||||
#elif POST_MC_1_20_1
|
||||
lightEngine.setLightEnabled(chunk.getPos(), true);
|
||||
|
||||
+4
-4
@@ -29,12 +29,12 @@ import com.seibel.distanthorizons.core.util.objects.UncheckedInterruptedExceptio
|
||||
import net.minecraft.server.level.WorldGenRegion;
|
||||
#if POST_MC_1_17_1
|
||||
#endif
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_2
|
||||
#endif
|
||||
import net.minecraft.world.level.chunk.ChunkAccess;
|
||||
import net.minecraft.world.level.chunk.ChunkStatus;
|
||||
import net.minecraft.world.level.chunk.ProtoChunk;
|
||||
#if POST_MC_1_18_1
|
||||
#if POST_MC_1_18_2
|
||||
import net.minecraft.world.level.levelgen.blending.Blender;
|
||||
#endif
|
||||
|
||||
@@ -69,10 +69,10 @@ public final class StepNoise {
|
||||
// System.out.println("StepNoise: "+chunk.getPos());
|
||||
#if PRE_MC_1_17_1
|
||||
environment.params.generator.fillFromNoise(worldGenRegion, tParams.structFeat, chunk);
|
||||
#elif PRE_MC_1_18_1
|
||||
#elif PRE_MC_1_18_2
|
||||
chunk = environment.joinSync(environment.params.generator.fillFromNoise(Runnable::run,
|
||||
tParams.structFeat.forWorldGenRegion(worldGenRegion), chunk));
|
||||
#elif PRE_MC_1_19
|
||||
#elif PRE_MC_1_19_2
|
||||
chunk = environment.joinSync(environment.params.generator.fillFromNoise(Runnable::run, Blender.of(worldGenRegion),
|
||||
tParams.structFeat.forWorldGenRegion(worldGenRegion), chunk));
|
||||
#else
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ import com.seibel.distanthorizons.common.wrappers.worldGeneration.BatchGeneratio
|
||||
import com.seibel.distanthorizons.common.wrappers.worldGeneration.ThreadedParameters;
|
||||
|
||||
import net.minecraft.server.level.WorldGenRegion;
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_2
|
||||
#endif
|
||||
import net.minecraft.world.level.chunk.ChunkAccess;
|
||||
import net.minecraft.world.level.chunk.ChunkStatus;
|
||||
|
||||
+7
-5
@@ -72,18 +72,20 @@ public final class StepStructureStart
|
||||
}
|
||||
}
|
||||
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_2
|
||||
if (environment.params.worldGenSettings.generateFeatures()) {
|
||||
#elif POST_MC_1_19
|
||||
#elif PRE_MC_1_19_4
|
||||
if (environment.params.worldGenSettings.generateStructures()) {
|
||||
#else
|
||||
if (environment.params.worldOptions.generateStructures()) {
|
||||
#endif
|
||||
for (ChunkAccess chunk : chunksToDo)
|
||||
{
|
||||
// System.out.println("StepStructureStart: "+chunk.getPos());
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_2
|
||||
environment.params.generator.createStructures(environment.params.registry, tParams.structFeat, chunk, environment.params.structures,
|
||||
environment.params.worldSeed);
|
||||
#elif PRE_MC_1_19_3
|
||||
#elif PRE_MC_1_19_4
|
||||
environment.params.generator.createStructures(environment.params.registry, environment.params.randomState, tParams.structFeat, chunk, environment.params.structures,
|
||||
environment.params.worldSeed);
|
||||
#else
|
||||
@@ -91,7 +93,7 @@ public final class StepStructureStart
|
||||
environment.params.level.getChunkSource().getGeneratorState(),
|
||||
tParams.structFeat, chunk, environment.params.structures);
|
||||
#endif
|
||||
#if POST_MC_1_18_1
|
||||
#if POST_MC_1_18_2
|
||||
try
|
||||
{
|
||||
tParams.structCheck.onStructureLoad(chunk.getPos(), chunk.getAllStarts());
|
||||
|
||||
+2
-2
@@ -58,9 +58,9 @@ public final class StepSurface {
|
||||
|
||||
for (ChunkAccess chunk : chunksToDo) {
|
||||
// System.out.println("StepSurface: "+chunk.getPos());
|
||||
#if PRE_MC_1_18_1
|
||||
#if PRE_MC_1_18_2
|
||||
environment.params.generator.buildSurfaceAndBedrock(worldGenRegion, chunk);
|
||||
#elif PRE_MC_1_19
|
||||
#elif PRE_MC_1_19_2
|
||||
environment.params.generator.buildSurface(worldGenRegion, tParams.structFeat.forWorldGenRegion(worldGenRegion), chunk);
|
||||
#else
|
||||
environment.params.generator.buildSurface(worldGenRegion, tParams.structFeat.forWorldGenRegion(worldGenRegion), environment.params.randomState, chunk);
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
accessWidener v1 named
|
||||
|
||||
# used when determining where to save files to
|
||||
accessible field net/minecraft/world/level/storage/DimensionDataStorage dataFolder Ljava/io/File;
|
||||
|
||||
# used when rendering
|
||||
accessible method net/minecraft/client/renderer/GameRenderer getFov (Lnet/minecraft/client/Camera;FZ)D
|
||||
|
||||
# used for grabbing vanilla rendered chunks
|
||||
accessible field net/minecraft/client/renderer/LevelRenderer renderChunkStorage Ljava/util/concurrent/atomic/AtomicReference;
|
||||
accessible class net/minecraft/client/renderer/LevelRenderer$RenderChunkStorage
|
||||
accessible class net/minecraft/client/renderer/LevelRenderer$RenderChunkInfo
|
||||
accessible field net/minecraft/client/renderer/LevelRenderer$RenderChunkInfo chunk Lnet/minecraft/client/renderer/chunk/ChunkRenderDispatcher$RenderChunk;
|
||||
|
||||
# world generation
|
||||
accessible method net/minecraft/world/level/lighting/LayerLightEngine queueSectionData (JLnet/minecraft/world/level/chunk/DataLayer;Z)V
|
||||
accessible field net/minecraft/world/level/chunk/LevelChunk loaded Z
|
||||
|
||||
# lod generation from save file
|
||||
accessible field net/minecraft/world/level/chunk/storage/ChunkStorage worker Lnet/minecraft/world/level/chunk/storage/IOWorker;
|
||||
accessible field net/minecraft/world/level/chunk/storage/IOWorker storage Lnet/minecraft/world/level/chunk/storage/RegionFileStorage;
|
||||
accessible field net/minecraft/world/level/chunk/storage/RegionFileStorage regionCache Lit/unimi/dsi/fastutil/longs/Long2ObjectLinkedOpenHashMap;
|
||||
accessible field net/minecraft/world/level/chunk/storage/RegionFileStorage folder Ljava/nio/file/Path;
|
||||
|
||||
# grabbing textures
|
||||
accessible field net/minecraft/client/renderer/texture/TextureAtlasSprite animatedTexture Lnet/minecraft/client/renderer/texture/TextureAtlasSprite$AnimatedTexture;
|
||||
accessible field net/minecraft/client/renderer/texture/TextureAtlasSprite width I
|
||||
accessible field net/minecraft/client/renderer/texture/TextureAtlasSprite height I
|
||||
accessible field net/minecraft/client/renderer/texture/TextureAtlasSprite mainImage [Lcom/mojang/blaze3d/platform/NativeImage;
|
||||
accessible class net/minecraft/client/renderer/texture/TextureAtlasSprite$AnimatedTexture
|
||||
accessible method net/minecraft/client/renderer/texture/TextureAtlasSprite$AnimatedTexture getFrameX (I)I
|
||||
accessible method net/minecraft/client/renderer/texture/TextureAtlasSprite$AnimatedTexture getFrameY (I)I
|
||||
extendable class com/mojang/math/Matrix4f
|
||||
|
||||
|
||||
# hacky stuff
|
||||
accessible field net/minecraft/util/ThreadingDetector lock Ljava/util/concurrent/Semaphore;
|
||||
mutable field net/minecraft/util/ThreadingDetector lock Ljava/util/concurrent/Semaphore;
|
||||
accessible field net/minecraft/client/gui/components/AbstractSelectionList scrollAmount D # Hack to bypass vanilla's setScrollAmount's clamp
|
||||
+1
-1
Submodule coreSubProjects updated: 77bc3bd3c2...b9cfe535d1
@@ -97,7 +97,7 @@ public class FabricClientProxy
|
||||
|
||||
// ClientChunkLoadEvent
|
||||
// TODO: Is using setClientLightReady one still better?
|
||||
//#if PRE_MC_1_18_1 // in 1.18+, we use mixin hook in setClientLightReady(true)
|
||||
//#if PRE_MC_1_18_2 // in 1.18+, we use mixin hook in setClientLightReady(true)
|
||||
ClientChunkEvents.CHUNK_LOAD.register((level, chunk) ->
|
||||
{
|
||||
ClientLevelWrapper wrappedLevel = ClientLevelWrapper.getWrapper(level);
|
||||
|
||||
+2
-2
@@ -44,13 +44,13 @@ public class MixinClientLevel
|
||||
// @Inject(method = "<init>", at = @At("TAIL"))
|
||||
// private void loadWorldEvent(ClientPacketListener clientPacketListener, ClientLevel.ClientLevelData clientLevelData, ResourceKey resourceKey,
|
||||
// #if POST_MC_1_18_2 Holder holder, #else DimensionType dimensionType, #endif int i,
|
||||
// #if POST_MC_1_18_1 int j, #endif Supplier supplier, LevelRenderer levelRenderer, boolean bl, long l, CallbackInfo ci)
|
||||
// #if POST_MC_1_18_2 int j, #endif Supplier supplier, LevelRenderer levelRenderer, boolean bl, long l, CallbackInfo ci)
|
||||
// {
|
||||
// ClientApi.INSTANCE.clientLevelLoadEvent(WorldWrapper.getWorldWrapper((ClientLevel)(Object)this));
|
||||
// }
|
||||
|
||||
// Moved to overriding the enableChunkLight(...) method over at ClientPacketListener for 1.20+
|
||||
#if POST_MC_1_18_1 && PRE_MC_1_20_1 // Only the setLightReady is only available after 1.18. This ensures the light data is ready.
|
||||
#if POST_MC_1_18_2 && PRE_MC_1_20_1 // Only the setLightReady is only available after 1.18. This ensures the light data is ready.
|
||||
@Inject(method = "setLightReady", at = @At("HEAD"))
|
||||
private void onChunkLightReady(int x, int z, CallbackInfo ci)
|
||||
{
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ public class MixinClientPacketListener
|
||||
@Inject(method = "handleRespawn", at = @At("RETURN"))
|
||||
void onHandleRespawnEnd(CallbackInfo ci) { ClientApi.INSTANCE.clientLevelLoadEvent(ClientLevelWrapper.getWrapper(level)); }
|
||||
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_4
|
||||
@Inject(method = "cleanup", at = @At("HEAD"))
|
||||
#else
|
||||
@Inject(method = "close", at = @At("HEAD"))
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ public class MixinFogRenderer {
|
||||
private static final float A_EVEN_LARGER_VALUE = 42069420694206942069.F;
|
||||
|
||||
@Inject(at = @At("RETURN"), method = "setupFog")
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_2
|
||||
private static void disableSetupFog(Camera camera, FogMode fogMode, float f, boolean bl, CallbackInfo callback) {
|
||||
#else
|
||||
private static void disableSetupFog(Camera camera, FogMode fogMode, float f, boolean bl, float g, CallbackInfo callback) {
|
||||
|
||||
+2
-2
@@ -26,7 +26,7 @@ import com.seibel.distanthorizons.core.config.Config;
|
||||
import net.minecraft.client.gui.screens.OptionsScreen;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.network.chat.Component;
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_2
|
||||
import net.minecraft.network.chat.TranslatableComponent;
|
||||
#endif
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
@@ -68,7 +68,7 @@ public class MixinOptionsScreen extends Screen {
|
||||
// For now it goes to the client option by default
|
||||
(buttonWidget) -> Objects.requireNonNull(minecraft).setScreen(GetConfigScreen.getScreen(this)),
|
||||
// Add a title to the utton
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_2
|
||||
new TranslatableComponent(ModInfo.ID + ".title")));
|
||||
#else
|
||||
Component.translatable(ModInfo.ID + ".title")));
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ package com.seibel.distanthorizons.fabric.mixins.server;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
|
||||
#if PRE_MC_1_18_1
|
||||
#if PRE_MC_1_18_2
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ public class MixinUtilBackgroundThread
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if POST_MC_1_18_1
|
||||
#if POST_MC_1_18_2
|
||||
@Inject(method = "wrapThreadWithTaskName(Ljava/lang/String;Ljava/util/function/Supplier;)Ljava/util/function/Supplier;",
|
||||
at = @At("HEAD"), cancellable = true)
|
||||
private static void overrideUtil$wrapThreadWithTaskNameForSupplier(String string, Supplier<?> r, CallbackInfoReturnable<Supplier<?>> ci)
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ package com.seibel.distanthorizons.fabric.mixins.server.unsafe;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
|
||||
//FIXME: Is this still needed?
|
||||
#if POST_MC_1_18_1
|
||||
#if POST_MC_1_18_2
|
||||
|
||||
import net.minecraft.util.ThreadingDetector;
|
||||
import org.spongepowered.asm.mixin.Mutable;
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ public class SodiumAccessor implements ISodiumAccessor {
|
||||
SodiumWorldRenderer renderer = SodiumWorldRenderer.instance();
|
||||
LevelHeightAccessor height = Minecraft.getInstance().level;
|
||||
|
||||
#if POST_MC_1_18_1
|
||||
#if POST_MC_1_18_2
|
||||
// 0b11 = Lighted chunk & loaded chunk
|
||||
return renderer.getChunkTracker().getChunks(0b00).filter(
|
||||
(long l) -> {
|
||||
|
||||
@@ -27,7 +27,7 @@ import com.seibel.distanthorizons.core.wrapperInterfaces.chunk.IChunkWrapper;
|
||||
import net.minecraft.world.level.LevelAccessor;
|
||||
|
||||
import net.minecraft.client.multiplayer.ClientLevel;
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_2
|
||||
import net.minecraftforge.event.world.ChunkEvent;
|
||||
import net.minecraftforge.event.world.WorldEvent;
|
||||
#else
|
||||
@@ -54,7 +54,7 @@ import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
*/
|
||||
public class ForgeClientProxy
|
||||
{
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_2
|
||||
private static LevelAccessor GetLevel(WorldEvent e) { return e.getWorld(); }
|
||||
#else
|
||||
private static LevelAccessor GetLevel(LevelEvent e) { return e.getLevel(); }
|
||||
@@ -117,7 +117,7 @@ public class ForgeClientProxy
|
||||
|
||||
// Register KeyBindings
|
||||
@SubscribeEvent
|
||||
public void registerKeyBindings(#if PRE_MC_1_19 InputEvent.KeyInputEvent #else InputEvent.Key #endif event)
|
||||
public void registerKeyBindings(#if PRE_MC_1_19_2 InputEvent.KeyInputEvent #else InputEvent.Key #endif event)
|
||||
{
|
||||
if (Minecraft.getInstance().player == null) return;
|
||||
if (event.getAction() != GLFW.GLFW_PRESS) return;
|
||||
|
||||
@@ -38,7 +38,7 @@ import com.seibel.distanthorizons.forge.wrappers.modAccessor.OptifineAccessor;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.core.Direction;
|
||||
#if POST_MC_1_19
|
||||
#if POST_MC_1_19_2
|
||||
import net.minecraft.util.RandomSource;
|
||||
#endif
|
||||
import net.minecraft.world.level.ColorResolver;
|
||||
@@ -54,7 +54,7 @@ import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
||||
import net.minecraftforge.fml.ExtensionPoint;
|
||||
#elif MC_1_17_1
|
||||
import net.minecraftforge.fmlclient.ConfigGuiHandler;
|
||||
#elif POST_MC_1_18_2 && PRE_MC_1_19
|
||||
#elif POST_MC_1_18_2 && PRE_MC_1_19_2
|
||||
import net.minecraftforge.client.ConfigGuiHandler;
|
||||
#else
|
||||
import net.minecraftforge.client.ConfigScreenHandler;
|
||||
@@ -63,7 +63,7 @@ import net.minecraftforge.client.ConfigScreenHandler;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
// these imports change due to forge refactoring classes in 1.19
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_2
|
||||
import net.minecraftforge.client.model.data.ModelDataMap;
|
||||
import java.util.Random;
|
||||
#else
|
||||
@@ -124,7 +124,7 @@ public class ForgeMain implements LodForgeMethodCaller
|
||||
#if PRE_MC_1_17_1
|
||||
ModLoadingContext.get().registerExtensionPoint(ExtensionPoint.CONFIGGUIFACTORY,
|
||||
() -> (client, parent) -> GetConfigScreen.getScreen(parent));
|
||||
#elif POST_MC_1_18_2 && PRE_MC_1_19
|
||||
#elif POST_MC_1_18_2 && PRE_MC_1_19_2
|
||||
ModLoadingContext.get().registerExtensionPoint(ConfigGuiHandler.ConfigGuiFactory.class,
|
||||
() -> new ConfigGuiHandler.ConfigGuiFactory((client, parent) -> GetConfigScreen.getScreen(parent)));
|
||||
#else
|
||||
@@ -168,13 +168,13 @@ public class ForgeMain implements LodForgeMethodCaller
|
||||
#endif
|
||||
|
||||
@Override
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_2
|
||||
public List<BakedQuad> getQuads(MinecraftClientWrapper mc, Block block, BlockState blockState, Direction direction, Random random) {
|
||||
return mc.getModelManager().getBlockModelShaper().getBlockModel(block.defaultBlockState()).getQuads(blockState, direction, random, modelData);
|
||||
}
|
||||
#else
|
||||
public List<BakedQuad> getQuads(MinecraftClientWrapper mc, Block block, BlockState blockState, Direction direction, RandomSource random) {
|
||||
return mc.getModelManager().getBlockModelShaper().getBlockModel(block.defaultBlockState()).getQuads(blockState, direction, random, modelData #if POST_MC_1_19, RenderType.solid() #endif);
|
||||
return mc.getModelManager().getBlockModelShaper().getBlockModel(block.defaultBlockState()).getQuads(blockState, direction, random, modelData #if POST_MC_1_19_2, RenderType.solid() #endif);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ import net.minecraft.world.level.LevelAccessor;
|
||||
import net.minecraftforge.event.TickEvent;
|
||||
import net.minecraftforge.event.server.ServerAboutToStartEvent;
|
||||
import net.minecraftforge.event.server.ServerStoppingEvent;
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_2
|
||||
import net.minecraftforge.event.world.ChunkEvent;
|
||||
import net.minecraftforge.event.world.WorldEvent;
|
||||
#else
|
||||
@@ -31,7 +31,7 @@ import java.util.function.Supplier;
|
||||
|
||||
public class ForgeServerProxy
|
||||
{
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_2
|
||||
private static LevelAccessor GetLevel(WorldEvent e) { return e.getWorld(); }
|
||||
#else
|
||||
private static LevelAccessor GetLevel(LevelEvent e) { return e.getLevel(); }
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ public class MixinClientPacketListener
|
||||
@Inject(method = "handleRespawn", at = @At("RETURN"))
|
||||
void onHandleRespawnEnd(CallbackInfo ci) { ClientApi.INSTANCE.clientLevelLoadEvent(ClientLevelWrapper.getWrapper(level)); }
|
||||
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_4
|
||||
@Inject(method = "cleanup", at = @At("HEAD"))
|
||||
#else
|
||||
@Inject(method = "close", at = @At("HEAD"))
|
||||
|
||||
+2
-2
@@ -26,7 +26,7 @@ import com.seibel.distanthorizons.core.config.Config;
|
||||
import net.minecraft.client.gui.screens.OptionsScreen;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.network.chat.Component;
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_2
|
||||
import net.minecraft.network.chat.TranslatableComponent;
|
||||
#endif
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
@@ -68,7 +68,7 @@ public class MixinOptionsScreen extends Screen {
|
||||
// For now it goes to the client option by default
|
||||
(buttonWidget) -> Objects.requireNonNull(minecraft).setScreen(GetConfigScreen.getScreen(this)),
|
||||
// Add a title to the button
|
||||
#if PRE_MC_1_19
|
||||
#if PRE_MC_1_19_2
|
||||
new TranslatableComponent(ModInfo.ID + ".title")));
|
||||
#else
|
||||
Component.translatable(ModInfo.ID + ".title")));
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ package com.seibel.distanthorizons.forge.mixins.server;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
|
||||
#if PRE_MC_1_18_1
|
||||
#if PRE_MC_1_18_2
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ public class MixinUtilBackgroundThread
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if POST_MC_1_18_1
|
||||
#if POST_MC_1_18_2
|
||||
@Inject(method = "wrapThreadWithTaskName(Ljava/lang/String;Ljava/util/function/Supplier;)Ljava/util/function/Supplier;",
|
||||
at = @At("HEAD"), cancellable = true)
|
||||
private static void overrideUtil$wrapThreadWithTaskNameForSupplier(String string, Supplier<?> r, CallbackInfoReturnable<Supplier<?>> ci)
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
|
||||
package com.seibel.distanthorizons.forge.mixins.server.unsafe;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
#if POST_MC_1_18_1
|
||||
#if POST_MC_1_18_2
|
||||
|
||||
import net.minecraft.util.ThreadingDetector;
|
||||
import org.spongepowered.asm.mixin.Mutable;
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
# @Depricated
|
||||
# Support will be removed soon
|
||||
|
||||
# 1.18.1 version
|
||||
|
||||
|
||||
|
||||
#java_version = 17
|
||||
#minecraft_version=1.18.1
|
||||
#parchment_version=2022.03.06
|
||||
#compatible_minecraft_versions=["1.18", "1.18.1"]
|
||||
#accessWidenerVersion=1_18
|
||||
#builds_for=fabric,forge
|
||||
#
|
||||
## Fabric loader
|
||||
#fabric_loader_version=0.13.3
|
||||
#fabric_api_version=0.46.6+1.18
|
||||
# # Fabric mod versions
|
||||
# modmenu_version=3.0.1
|
||||
# starlight_version_fabric=3554912
|
||||
# phosphor_version_fabric=3573395
|
||||
# lithium_version=mc1.18.1-0.7.7
|
||||
# sodium_version=mc1.18.1-0.4.0-alpha6
|
||||
# iris_version=1.18.x-v1.2.5
|
||||
# bclib_version=1.2.5
|
||||
# immersive_portals_version=v1.0.4-1.18
|
||||
#
|
||||
# # Fabric mod run
|
||||
# # 0 = Don't enable and don't run
|
||||
# # 1 = Can be referenced in code but doesn't run
|
||||
# # 2 = Can be referenced in code and runs in client
|
||||
# enable_starlight=0
|
||||
# enable_phosphor=0
|
||||
# enable_sodium=1
|
||||
# enable_lithium=0
|
||||
# enable_iris=0
|
||||
# enable_bclib=0
|
||||
#
|
||||
## Forge loader
|
||||
#forge_version=39.1.2
|
||||
# # Forge mod versions
|
||||
# starlight_version_forge=3559934
|
||||
# terraforged_version=
|
||||
#
|
||||
# # Forge mod run
|
||||
# # 0 = Don't enable and don't run
|
||||
# # 1 = Can be referenced in code but doesn't run
|
||||
# # 2 = Can be referenced in code and runs in client
|
||||
# enable_starlight_forge=0
|
||||
# enable_terraforged=0
|
||||
@@ -3,7 +3,7 @@ java_version = 17
|
||||
minecraft_version=1.19.2
|
||||
parchment_version=1.19.2:2022.11.27
|
||||
compatible_minecraft_versions=["1.19.2"]
|
||||
accessWidenerVersion=1_19
|
||||
accessWidenerVersion=1_19_2
|
||||
builds_for=fabric,forge
|
||||
|
||||
# Fabric loader
|
||||
|
||||
@@ -3,7 +3,7 @@ java_version = 17
|
||||
minecraft_version=1.19.4
|
||||
parchment_version=1.19.3:2023.03.12
|
||||
compatible_minecraft_versions=["1.19.4"]
|
||||
accessWidenerVersion=1_19
|
||||
accessWidenerVersion=1_19_4
|
||||
builds_for=fabric,forge
|
||||
|
||||
# Fabric loader
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
# 1.19 version
|
||||
java_version = 17
|
||||
minecraft_version=1.19
|
||||
parchment_version=1.19.2:2022.11.27
|
||||
compatible_minecraft_versions=["1.19"]
|
||||
accessWidenerVersion=1_19
|
||||
builds_for=fabric,forge
|
||||
|
||||
# Fabric loader
|
||||
fabric_loader_version=0.14.21
|
||||
fabric_api_version=0.58.0+1.19
|
||||
# Fabric mod versions
|
||||
modmenu_version=4.0.4
|
||||
starlight_version_fabric=
|
||||
phosphor_version_fabric=
|
||||
lithium_version=
|
||||
sodium_version=mc1.19.2-0.4.4
|
||||
iris_version=1.6.4+1.19.2
|
||||
bclib_version=2.1.6
|
||||
immersive_portals_version=
|
||||
canvas_version=mc119-1.0.2453
|
||||
|
||||
# Fabric mod run
|
||||
# 0 = Don't enable and don't run
|
||||
# 1 = Can be referenced in code but doesn't run
|
||||
# 2 = Can be referenced in code and runs in client
|
||||
enable_starlight=0
|
||||
enable_phosphor=0
|
||||
enable_sodium=1
|
||||
enable_lithium=0
|
||||
enable_iris=0
|
||||
enable_bclib=1
|
||||
enable_immersive_portals=0
|
||||
enable_canvas=0
|
||||
|
||||
# Forge loader
|
||||
forge_version=41.1.0
|
||||
# Forge mod versions
|
||||
starlight_version_forge=
|
||||
terraforged_version=
|
||||
|
||||
# Forge mod run
|
||||
# 0 = Don't enable and don't run
|
||||
# 1 = Can be referenced in code but doesn't run
|
||||
# 2 = Can be referenced in code and runs in client
|
||||
enable_starlight_forge=0
|
||||
enable_terraforged=0
|
||||
Reference in New Issue
Block a user