Skip to content

Commit

Permalink
BiomeTweaker - constant mixins
Browse files Browse the repository at this point in the history
Remove hardcoded biome ID limit in this mod
  • Loading branch information
sam-kirby committed Aug 23, 2019
1 parent af278e6 commit 932bb63
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package org.dimdev.jeid.mixin.modsupport.biometweaker;

import me.superckl.biometweaker.util.BiomeColorMappings;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;

@Mixin(BiomeColorMappings.class)
public class MixinBiomeColorMappings {
@ModifyConstant(method = "getColorForBiome", constant = @Constant(intValue = 0xFF), remap = false)
private static int getBitMask(int oldValue) {
return 0xFFFFFFFF;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package org.dimdev.jeid.mixin.modsupport.biometweaker;

import me.superckl.biometweaker.util.BiomeHelper;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;

@Mixin(BiomeHelper.class)
public class MixinBiomeHelper {
@ModifyConstant(method = "getNextFreeBiomeId", constant = @Constant(intValue = 0xFF), remap = false)
private static int getMaxBiomeId(int oldValue) {
return 0xFFFFFFFF;
}

@ModifyConstant(method = "getNextFreeBiomeId", constant = @Constant(intValue = 0x100), remap = false)
private static int getLoopUpperLimit(int oldValue) {
return 0xEFFFFFFF;
}
}
2 changes: 2 additions & 0 deletions src/main/resources/mixins.jeid.modsupport.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
"advancedrocketry.MixinPacketBiomeIDChange",
"biomesoplenty.MixinBOPCommand",
"biomesoplenty.MixinModBiomes",
"biometweaker.MixinBiomeColorMappings",
"biometweaker.MixinBiomeHelper",
"biometweaker.MixinCommandSetBiome",
"bookshelf.MixinWorldUtils",
"creepingnether.MixinCorruptorAbstract",
Expand Down

0 comments on commit 932bb63

Please sign in to comment.