Mixins priority changes
This commit is contained in:
parent
ef717e9f3d
commit
2b757d5658
@ -34,7 +34,7 @@ mod_name=Better Random
|
|||||||
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
|
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
|
||||||
mod_license=BSD 2 Clause
|
mod_license=BSD 2 Clause
|
||||||
# The mod version. See https://semver.org/
|
# The mod version. See https://semver.org/
|
||||||
mod_version=1.3.0
|
mod_version=1.3.1
|
||||||
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
|
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
|
||||||
# This should match the base package used for the mod sources.
|
# This should match the base package used for the mod sources.
|
||||||
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
|
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||||
|
@ -11,13 +11,12 @@ import org.spongepowered.asm.mixin.injection.At;
|
|||||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
import ru.dbotthepony.mc.prng.BetterRandom;
|
import ru.dbotthepony.mc.prng.BetterRandom;
|
||||||
|
|
||||||
@Mixin(Level.class)
|
@Mixin(value = Level.class, priority = 10000) // ensure this mixin is applied over other "regular" mixins
|
||||||
public abstract class LevelMixin {
|
public abstract class LevelMixin {
|
||||||
@Shadow
|
@Shadow
|
||||||
@Final
|
@Final
|
||||||
private Thread thread;
|
private Thread thread;
|
||||||
|
|
||||||
@Final // ensure it is on top-level
|
|
||||||
@Redirect(
|
@Redirect(
|
||||||
method = "<init>",
|
method = "<init>",
|
||||||
at = @At(
|
at = @At(
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package ru.dbotthepony.mc.prng.mixin;
|
package ru.dbotthepony.mc.prng.mixin;
|
||||||
|
|
||||||
import net.minecraft.util.RandomSource;
|
import net.minecraft.util.RandomSource;
|
||||||
|
import org.spongepowered.asm.mixin.Final;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.Overwrite;
|
import org.spongepowered.asm.mixin.Overwrite;
|
||||||
import ru.dbotthepony.mc.prng.GJRAND64RandomSource;
|
import ru.dbotthepony.mc.prng.GJRAND64RandomSource;
|
||||||
@ -8,11 +9,13 @@ import ru.dbotthepony.mc.prng.GJRAND64RandomSource;
|
|||||||
@Mixin(RandomSource.class)
|
@Mixin(RandomSource.class)
|
||||||
public interface RandomSourceMixin {
|
public interface RandomSourceMixin {
|
||||||
@Overwrite
|
@Overwrite
|
||||||
|
@Final
|
||||||
static RandomSource create() {
|
static RandomSource create() {
|
||||||
return new GJRAND64RandomSource();
|
return new GJRAND64RandomSource();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Overwrite
|
@Overwrite
|
||||||
|
@Final
|
||||||
static RandomSource create(long seed) {
|
static RandomSource create(long seed) {
|
||||||
return new GJRAND64RandomSource(seed);
|
return new GJRAND64RandomSource(seed);
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ import org.spongepowered.asm.mixin.injection.At;
|
|||||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
import ru.dbotthepony.mc.prng.GJRAND64RandomSource;
|
import ru.dbotthepony.mc.prng.GJRAND64RandomSource;
|
||||||
|
|
||||||
@Mixin(WorldgenRandom.class)
|
@Mixin(value = WorldgenRandom.class, priority = 10000) // ensure this mixin is applied over other "regular" mixins
|
||||||
public abstract class WorldgenRandomMixin {
|
public abstract class WorldgenRandomMixin {
|
||||||
@Shadow
|
@Shadow
|
||||||
private RandomSource randomSource;
|
private RandomSource randomSource;
|
||||||
|
Loading…
Reference in New Issue
Block a user