Skip to content

Commit

Permalink
Add config to remove gold coins from the oredict (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
rndmorris authored Jan 14, 2025
1 parent 1d8397c commit 864c240
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class BugfixesModule extends BaseConfigModule {
public final ToggleSetting renderRedstoneFix;
public final ToggleSetting slabBurnTimeFix;
public final ToggleSetting strictInfusionMatrixInputChecks;
public final ToggleSetting unOredictGoldCoin;

public BugfixesModule() {
addSettings(
Expand Down Expand Up @@ -72,7 +73,12 @@ public BugfixesModule() {
this,
ConfigPhase.EARLY,
"strictInfusionMatrixInputChecks",
"Check the infusion matrix's center item more strictly. Prevents an exploit with infusion enchanting."));
"Check the infusion matrix's center item more strictly. Prevents an exploit with infusion enchanting."),
unOredictGoldCoin = (ToggleSetting) new ToggleSetting(
this,
ConfigPhase.EARLY,
"unOredictGoldCoin",
"Remove gold coins from the gold nugget ore dictionary.").setEnabled(false));
}

@Nonnull
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/dev/rndmorris/salisarcana/mixins/Mixins.java
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,11 @@ public enum Mixins {
.setApplyIf(ConfigModuleRoot.bugfixes.strictInfusionMatrixInputChecks::isEnabled)
.addMixinClasses("tiles.MixinTileInfusionMatrix_InputEnforcement")
.addTargetedMod(TargetedMod.THAUMCRAFT)),
UN_OREDICT_GOLD_COIN(new Builder().setPhase(Phase.LATE)
.setSide(Side.BOTH)
.setApplyIf(ConfigModuleRoot.bugfixes.unOredictGoldCoin::isEnabled)
.addMixinClasses("config.MixinConfigItems_UnOredictGoldCoin")
.addTargetedMod(TargetedMod.THAUMCRAFT)),

// Enhancements
EXTENDED_BAUBLES_SUPPORT(new Builder().setPhase(Phase.LATE)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package dev.rndmorris.salisarcana.mixins.late.config;

import net.minecraft.item.ItemStack;

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;

import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;

import thaumcraft.common.config.ConfigItems;

@Mixin(value = ConfigItems.class, remap = false)
public class MixinConfigItems_UnOredictGoldCoin {

@WrapOperation(
method = "init",
at = @At(
value = "INVOKE",
ordinal = 24,
target = "Lnet/minecraftforge/oredict/OreDictionary;registerOre(Ljava/lang/String;Lnet/minecraft/item/ItemStack;)V"))
private static void onInit(String s, ItemStack itemStack, Operation<Void> original) {
// intentionally do nothing
}

}

0 comments on commit 864c240

Please sign in to comment.