diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/updater/ChangelogScreen.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/updater/ChangelogScreen.java index 25ac35ea3..bf7114d98 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/updater/ChangelogScreen.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/updater/ChangelogScreen.java @@ -161,16 +161,28 @@ public class ChangelogScreen extends DhScreen #else this.renderBackground(matrices, mouseX, mouseY, delta); // Render background #endif - if (!usable) + if (!this.usable) + { return; + } + + int maxScroll; + #if MC_VER <= MC_1_21_3 + maxScroll = this.changelogArea.getMaxScroll(); + #else + maxScroll = this.changelogArea.maxScrollAmount(); + #endif // Set the scroll position to the mouse height relative to the screen // This is a bit of a hack as we cannot scroll on this area - double scrollAmount = ((double) mouseY) / ((double) this.height) * 1.1 * this.changelogArea.getMaxScroll(); + double scrollAmount = ((double) mouseY) / ((double) this.height) * 1.1 * maxScroll; + #if MC_VER == MC_1_16_5 || MC_VER == MC_1_17_1 this.changelogArea.setScrollAmount(scrollAmount); - #else + #elif MC_VER <= MC_1_21_3 this.changelogArea.scrollAmount = scrollAmount; + #else + this.changelogArea.setScrollAmount(scrollAmount); #endif diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/step/StepStructureStart.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/step/StepStructureStart.java index 96f58c730..d991fefa6 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/step/StepStructureStart.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/step/StepStructureStart.java @@ -28,7 +28,9 @@ import com.seibel.distanthorizons.common.wrappers.worldGeneration.BatchGeneratio import com.seibel.distanthorizons.common.wrappers.worldGeneration.ThreadedParameters; import com.seibel.distanthorizons.core.logging.DhLoggerBuilder; +import net.minecraft.resources.ResourceKey; import net.minecraft.server.level.WorldGenRegion; +import net.minecraft.world.level.Level; import net.minecraft.world.level.chunk.ChunkAccess; import net.minecraft.world.level.chunk.ProtoChunk; import org.apache.logging.log4j.Logger; @@ -96,7 +98,8 @@ public final class StepStructureStart if (this.environment.params.worldGenSettings.generateFeatures()) { #elif MC_VER < MC_1_19_4 - if (this.environment.params.worldGenSettings.generateStructures()) { + if (this.environment.params.worldGenSettings.generateStructures()) + { #else if (this.environment.params.worldOptions.generateStructures()) { @@ -114,15 +117,20 @@ public final class StepStructureStart STRUCTURE_PLACEMENT_LOCK.lock(); #if MC_VER < MC_1_19_2 - environment.params.generator.createStructures(environment.params.registry, tParams.structFeat, chunk, environment.params.structures, - environment.params.worldSeed); + this.environment.params.generator.createStructures(this.environment.params.registry, tParams.structFeat, chunk, this.environment.params.structures, + this.environment.params.worldSeed); #elif MC_VER < MC_1_19_4 - environment.params.generator.createStructures(environment.params.registry, environment.params.randomState, tParams.structFeat, chunk, environment.params.structures, - environment.params.worldSeed); + this.environment.params.generator.createStructures(this.environment.params.registry, this.environment.params.randomState, tParams.structFeat, chunk, this.environment.params.structures, + this.environment.params.worldSeed); + #elif MC_VER <= MC_1_21_3 + this.environment.params.generator.createStructures(this.environment.params.registry, + this.environment.params.level.getChunkSource().getGeneratorState(), + tParams.structFeat, chunk, this.environment.params.structures); #else - environment.params.generator.createStructures(environment.params.registry, - environment.params.level.getChunkSource().getGeneratorState(), - tParams.structFeat, chunk, environment.params.structures); + this.environment.params.generator.createStructures(this.environment.params.registry, + this.environment.params.level.getChunkSource().getGeneratorState(), + tParams.structFeat, chunk, this.environment.params.structures, + this.environment.params.level.dimension()); #endif #if MC_VER >= MC_1_18_2 diff --git a/common/src/main/resources/1_21_4.distanthorizons.accesswidener b/common/src/main/resources/1_21_4.distanthorizons.accesswidener new file mode 100644 index 000000000..76bbf1cda --- /dev/null +++ b/common/src/main/resources/1_21_4.distanthorizons.accesswidener @@ -0,0 +1,47 @@ +accessWidener v1 named + +# used when determining where to save files to +accessible field net/minecraft/world/level/storage/DimensionDataStorage dataFolder Ljava/nio/file/Path; +# used to help determine what folder a clientLevel is +accessible field net/minecraft/world/level/biome/BiomeManager biomeZoomSeed J + +# used when rendering +accessible method net/minecraft/client/renderer/GameRenderer getFov (Lnet/minecraft/client/Camera;FZ)F +accessible field net/minecraft/client/Minecraft deltaTracker Lnet/minecraft/client/DeltaTracker$Timer; + + +# used for grabbing vanilla rendered chunks +accessible field net/minecraft/client/renderer/LevelRenderer visibleSections Lit/unimi/dsi/fastutil/objects/ObjectArrayList; + +# 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 +accessible field net/minecraft/world/level/lighting/LightEngine storage Lnet/minecraft/world/level/lighting/LayerLightSectionStorage; +accessible method net/minecraft/world/level/lighting/LayerLightSectionStorage lightOnInSection (J)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 class net/minecraft/client/renderer/texture/SpriteContents$AnimatedTexture +accessible method net/minecraft/client/renderer/texture/SpriteContents$AnimatedTexture getFrameX (I)I +accessible method net/minecraft/client/renderer/texture/SpriteContents$AnimatedTexture getFrameY (I)I +accessible field net/minecraft/client/renderer/texture/SpriteContents animatedTexture Lnet/minecraft/client/renderer/texture/SpriteContents$AnimatedTexture; +accessible field net/minecraft/client/renderer/texture/SpriteContents originalImage Lcom/mojang/blaze3d/platform/NativeImage; + +# UI stuff +accessible field net/minecraft/client/gui/components/AbstractButton SPRITES Lnet/minecraft/client/gui/components/WidgetSprites; +# Handles inserting the config button +accessible field net/minecraft/client/gui/layouts/HeaderAndFooterLayout headerFrame Lnet/minecraft/client/gui/layouts/FrameLayout; +accessible field net/minecraft/client/gui/layouts/FrameLayout children Ljava/util/List; +accessible class net/minecraft/client/gui/layouts/FrameLayout$ChildContainer +accessible field net/minecraft/client/gui/layouts/LinearLayout wrapped Lnet/minecraft/client/gui/layouts/GridLayout; + +# hacky stuff +accessible field net/minecraft/util/ThreadingDetector lock Ljava/util/concurrent/Semaphore; +mutable field net/minecraft/util/ThreadingDetector lock Ljava/util/concurrent/Semaphore; + + diff --git a/gradle.properties b/gradle.properties index a02af788d..65e6cb77f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -51,7 +51,7 @@ versionStr= # This defines what MC version Intellij will use for the preprocessor # and what version is used automatically by build and run commands -mcVer=1.21.3 +mcVer=1.21.4 # Defines the maximum amount of memory Minecraft is allowed when run in a development environment #minecraftMemoryJavaArg="-Xmx4G" diff --git a/versionProperties/1.21.3.properties b/versionProperties/1.21.3.properties index 0ae5a2566..ae8fc88ce 100644 --- a/versionProperties/1.21.3.properties +++ b/versionProperties/1.21.3.properties @@ -25,7 +25,7 @@ fabric_api_version=0.110.0+1.21.3 canvas_version= # fabric-api 0.110.0 fixed a bug in MC 1.21.3 with the rendering API DH relied on - fabric_incompatibility_list={ "iris": "<=1.7.4", "fabric-api": "<0.110.0" } + fabric_incompatibility_list={ "fabric-api": "<0.110.0" } fabric_recommend_list={} # Fabric mod run diff --git a/versionProperties/1.21.4.properties b/versionProperties/1.21.4.properties new file mode 100644 index 000000000..087706b70 --- /dev/null +++ b/versionProperties/1.21.4.properties @@ -0,0 +1,56 @@ +# 1.21.1 version +java_version=21 +minecraft_version=1.21.4 +parchment_version=1.21:2024.07.28 +compatible_minecraft_versions=["1.21.4"] +accessWidenerVersion=1_21_4 +builds_for=neoforge,fabric +# forge is broken due to gradle/build script issues + +# Netty +netty_version=4.1.97.Final + +# Fabric loader +fabric_loader_version=0.16.9 +fabric_api_version=0.110.5+1.21.4 + # Fabric mod versions 12.0.0-beta.1 + modmenu_version=13.0.0-beta.1 + starlight_version_fabric= + phosphor_version_fabric= + lithium_version= + sodium_version=mc1.21.4-0.6.2-fabric + iris_version=1.8.2+1.21.4-fabric + bclib_version= + immersive_portals_version= + canvas_version= + + fabric_incompatibility_list={ } + fabric_recommend_list={} + + # 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=1 + enable_bclib=0 + enable_immersive_portals=0 + enable_canvas=0 + +# (Neo)Forge loader +forge_version= +neoforge_version=21.4.2-beta + # (Neo)Forge mod versions + starlight_version_forge= + terraforged_version= + + # (Neo)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 + enable_terrafirmacraft=0