Skip to content

Commit

Permalink
Node charging speed
Browse files Browse the repository at this point in the history
  • Loading branch information
wohaopa committed May 31, 2024
1 parent c9af490 commit 00274ed
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public List<String> getMixins(Set<String> loadedMods) {
}
if (ModHelper.hasThaumcraft) {
mixins.add("thaumcraft.TileAlchemyFurnaceMixin");
mixins.add("thaumcraft.TileNodeMixin");
}
if (ModHelper.hasGtnhIntergalactic) {
mixins.add("gtnhintergalactic.TileEntityModuleMinerMixin");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.github.wohaopa.GTNHModify.mixins.late.thaumcraft;

import org.objectweb.asm.Opcodes;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;

import com.github.wohaopa.GTNHModify.handler.ThaumcraftHandler;

import thaumcraft.common.tiles.TileNode;

@Mixin(value = TileNode.class, remap = false)
public abstract class TileNodeMixin {

@Shadow(remap = false)
int regeneration;

@Redirect(
method = "handleRecharge",
at = @At(
value = "FIELD",
target = "Lthaumcraft/common/tiles/TileNode;regeneration:I",
opcode = Opcodes.PUTFIELD))
private void injectedHandleRecharge(TileNode tileNode, int regeneration) {
this.regeneration = ThaumcraftHandler.handle(tileNode, regeneration);
}
}

0 comments on commit 00274ed

Please sign in to comment.