use of codechicken.lib.asm.ModularASMTransformer.MethodTransformer in project Galacticraft by micdoodle8.
the class TweakTransformer method load.
public static void load() {
CodeChickenCoreModContainer.loadConfig();
tweaks = CodeChickenCoreModContainer.config.getTag("tweaks").setComment("Various tweaks that can be applied to game mechanics.").useBraces();
tweaks.removeTag("persistantLava");
if (tweaks.getTag("environmentallyFriendlyCreepers").setComment("If set to true, creepers will not destroy landscape. (A version of mobGriefing setting just for creepers)").getBooleanValue(false)) {
transformer.add(new MethodReplacer(new ObfMapping("net/minecraft/entity/monster/EntityCreeper", "func_146077_cc", "()V"), blocks.get("d_environmentallyFriendlyCreepers"), blocks.get("environmentallyFriendlyCreepers")));
}
if (tweaks.getTag("finiteWater").setComment("If set to true two adjacent water source blocks will not generate a third.").getBooleanValue(false)) {
transformer.add(new MethodTransformer(new ObfMapping("net/minecraft/block/BlockDynamicLiquid", "func_149674_a", "(Lnet/minecraft/world/World;IIILjava/util/Random;)V")) {
@Override
public void transform(MethodNode mv) {
InsnListSection key = findOnce(mv.instructions, blocks.get("finiteWater").list);
key.setLast(((JumpInsnNode) key.getLast()).label);
key.remove();
}
});
}
}
Aggregations