mirror of
https://github.com/GTMEGA/EndlessIDs.git
synced 2026-11-12 06:07:31 +00:00
surround my dynamics
This commit is contained in:
4 files changed
+25
-6
No files matched your search
+4
-2
@@ -23,8 +23,10 @@ public abstract class BiomeGenBasePlaceholderMixin {
|
||||
remap = false),
|
||||
require = 1)
|
||||
private int removePlaceholders(int id, boolean register) {
|
||||
if (biomeList[id] instanceof PlaceholderBiome) {
|
||||
biomeList[id] = null;
|
||||
if (register) {
|
||||
if (biomeList[id] instanceof PlaceholderBiome) {
|
||||
biomeList[id] = null;
|
||||
}
|
||||
}
|
||||
return AsmHooks.getBiomeID(id, register);
|
||||
}
|
||||
|
||||
+2
-2
@@ -34,8 +34,8 @@ public abstract class BiomeGenBaseMixin {
|
||||
@Inject(method = "<init>(IZ)V",
|
||||
at = @At(value = "RETURN"),
|
||||
require = 1)
|
||||
private void generatePlaceholders(int p_i1971_1_, boolean register, CallbackInfo ci) {
|
||||
if (((Object) this) instanceof PlaceholderBiome) {
|
||||
private void generatePlaceholders(int id, boolean register, CallbackInfo ci) {
|
||||
if (((Object) this) instanceof PlaceholderBiome || !register) {
|
||||
return;
|
||||
}
|
||||
if (biomeID >= 128 && biomeList[biomeID - 128] == null) {
|
||||
|
||||
+18
-2
@@ -7,6 +7,7 @@ import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Mutable;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyVariable;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
@@ -22,15 +23,30 @@ public abstract class BiomeGenBasePlaceholderMixin {
|
||||
@Final
|
||||
public int biomeID;
|
||||
|
||||
private static ThreadLocal<Boolean> wantsRegister;
|
||||
|
||||
@Redirect(method = "<init>(IZ)V",
|
||||
at = @At(value = "FIELD",
|
||||
opcode = Opcodes.PUTFIELD,
|
||||
target = "Lnet/minecraft/world/biome/BiomeGenBase;biomeID:I"),
|
||||
require = 1)
|
||||
private void removePlaceholders(BiomeGenBase instance, int id) {
|
||||
if (biomeList[id] instanceof PlaceholderBiome) {
|
||||
biomeList[id] = null;
|
||||
if (wantsRegister.get()) {
|
||||
if (biomeList[id] instanceof PlaceholderBiome) {
|
||||
biomeList[id] = null;
|
||||
}
|
||||
}
|
||||
biomeID = id;
|
||||
}
|
||||
|
||||
@ModifyVariable(method = "<init>(IZ)V",
|
||||
at = @At(value = "HEAD"),
|
||||
index = 2,
|
||||
require = 1,
|
||||
argsOnly = true)
|
||||
private static boolean modifyArg(boolean register) {
|
||||
if (wantsRegister == null) wantsRegister = new ThreadLocal<>();
|
||||
wantsRegister.set(register);
|
||||
return register;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user