Skip to content

Commit

Permalink
Format Numbers, Make Mixin Client Only
Browse files Browse the repository at this point in the history
  • Loading branch information
IntegerLimit committed Nov 14, 2024
1 parent a75252c commit 380b1f9
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.nomiceu.nomilabs.mixin.gregtech;

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

import com.nomiceu.nomilabs.util.LabsTranslate;

import gregtech.api.util.TextFormattingUtil;
import gregtech.common.metatileentities.multi.MetaTileEntityLargeBoiler;

/**
* Updates Tooltips for the 10x Fuel Efficiency Increase in {@link BoilerRecipeLogicMixin}.
*/
@Mixin(value = MetaTileEntityLargeBoiler.class, remap = false)
public class MetaTileEntityLargeBoilerClientMixin {

@Redirect(method = "addInformation",
at = @At(value = "INVOKE",
target = "Lnet/minecraft/client/resources/I18n;format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;",
ordinal = 0,
remap = true))
private String formatNew(String s, Object[] objects) {
return LabsTranslate.translate(s, TextFormattingUtil.formatNumbers((int) objects[0] * 10));
}
}

This file was deleted.

5 changes: 3 additions & 2 deletions src/main/resources/mixins.nomilabs.gregtech.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"MaterialRecipeHandlerMixin",
"MaterialStackMixin",
"MetaItemsMixin",
"MetaTileEntityLargeBoilerMixin",
"MetaTileEntityMEStockingBusMixin",
"MetaTileEntityMEStockingHatchMixin",
"MetaTileEntityProcessingArrayMixin",
Expand All @@ -41,6 +40,8 @@
"TileEntityPipeBaseMixin",
"VirtualizedRecipeMapMixin"
],
"client": [],
"client": [
"MetaTileEntityLargeBoilerClientMixin"
],
"server": []
}

0 comments on commit 380b1f9

Please sign in to comment.