-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Config option to fix end island generation at far distances
- Loading branch information
1 parent
bc3743c
commit 37ca0e7
Showing
9 changed files
with
90 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...spottedleaf/moonrise/mixin/end_island/DensityFunctions$EndIslandDensityFunctionMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package ca.spottedleaf.moonrise.mixin.end_island; | ||
|
||
import ca.spottedleaf.moonrise.common.PlatformHooks; | ||
import com.llamalad7.mixinextras.sugar.Local; | ||
import net.minecraft.world.level.levelgen.DensityFunctions; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
@Mixin(DensityFunctions.EndIslandDensityFunction.class) | ||
abstract class DensityFunctions$EndIslandDensityFunctionMixin { | ||
|
||
/** | ||
* @reason Fix <a href="https://bugs.mojang.com/browse/MC-159283">MC-159283</a> by avoiding overflow in the distance calculation. | ||
* See the bug report for the issue description. | ||
* @author Spottedleaf | ||
*/ | ||
@Redirect( | ||
method = "getHeightValue", | ||
at = @At( | ||
value = "INVOKE", | ||
target = "Lnet/minecraft/util/Mth;sqrt(F)F", | ||
ordinal = 0 | ||
) | ||
) | ||
private static float fixMC159283(final float input, | ||
@Local(ordinal = 0, argsOnly = true) final int x, | ||
@Local(ordinal = 1, argsOnly = true) final int z) { | ||
if (PlatformHooks.get().configFixMC159283()) { | ||
return (float)Math.sqrt((double)((long)x * (long)x + (long)z * (long)z)); | ||
} else { | ||
return (float)Math.sqrt((double)(float)(x * x + z * z)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
{ | ||
"title.moonrise.config": "Moonrise Config", | ||
"category.moonrise.bugfixes": "Bug Fixes", | ||
"tooltip.moonrise.fixMC224294": "Fixes lava being double ticked during random block ticking.", | ||
"option.moonrise.fixMC224294": "Fix MC-224294", | ||
"category.moonrise.chunksystem": "Chunk System", | ||
"tooltip.moonrise.populatorparallelism": "Allows populators to run in parallel. May set to true if any worldgen affecting mods are safe to run populators in parallel.", | ||
"option.moonrise.populatorparallelism": "World Generation Populator Parallelism", | ||
"tooltip.moonrise.iothreads": "Set the number of I/O threads for RegionFile operations. Only increase if I/O is a confirmed bottleneck and you are on SSDs.", | ||
"option.moonrise.iothreads": "RegionFile I/O Threads", | ||
"tooltip.moonrise.workerthreads": "Sets the number of threads to use for chunk generation,loading and clientside chunk rendering.", | ||
"option.moonrise.workerthreads": "Chunk Generation / Rendering Worker Threads", | ||
"tooltip.moonrise.genrate": "Sets the maximum number of chunks to generate per second.", | ||
"option.moonrise.genrate": "Maximum Chunk Generate Rate", | ||
"tooltip.moonrise.loadrate": "Sets the maximum number of chunks to load per second.", | ||
"option.moonrise.loadrate": "Maximum Chunk Load Rate" | ||
} | ||
"title.moonrise.config": "Moonrise Config", | ||
"category.moonrise.bugfixes": "Bug Fixes", | ||
"tooltip.moonrise.fixMC224294": "Fixes lava being double ticked during random block ticking.", | ||
"option.moonrise.fixMC224294": "Fix MC-224294", | ||
"category.moonrise.chunksystem": "Chunk System", | ||
"tooltip.moonrise.populatorparallelism": "Allows populators to run in parallel. May set to true if any worldgen affecting mods are safe to run populators in parallel.", | ||
"option.moonrise.populatorparallelism": "World Generation Populator Parallelism", | ||
"tooltip.moonrise.iothreads": "Set the number of I/O threads for RegionFile operations. Only increase if I/O is a confirmed bottleneck and you are on SSDs.", | ||
"option.moonrise.iothreads": "RegionFile I/O Threads", | ||
"tooltip.moonrise.workerthreads": "Sets the number of threads to use for chunk generation,loading and clientside chunk rendering.", | ||
"option.moonrise.workerthreads": "Chunk Generation / Rendering Worker Threads", | ||
"tooltip.moonrise.genrate": "Sets the maximum number of chunks to generate per second.", | ||
"option.moonrise.genrate": "Maximum Chunk Generate Rate", | ||
"tooltip.moonrise.loadrate": "Sets the maximum number of chunks to load per second.", | ||
"option.moonrise.loadrate": "Maximum Chunk Load Rate", | ||
"tooltip.moonrise.fixMC159283": "Fixes end islands not generating far away in the end. Does not affect already generated areas.", | ||
"option.moonrise.fixMC159283": "Fix MC-159283" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters