Skip to content

Commit

Permalink
Merge pull request #7 from KatatsumuriPan/develop
Browse files Browse the repository at this point in the history
Update to v1.5.1
  • Loading branch information
KatatsumuriPan authored Dec 7, 2023
2 parents 8480cab + 28139ee commit 2d2610a
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/main/java/kpan/uti_alsofluids/ModMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

@Mod(modid = ModReference.MOD_ID, name = ModReference.MOD_NAME
, guiFactory = ModReference.SRC_DIR + ".config.ModGuiFactory"
, dependencies = "required:untranslateditems@[1.0.0,);"
+ GTInternalTags.DEP_VERSION_STRING
, dependencies = "required-client:untranslateditems@[1.0.0,);"
+ "after:gregtech@[" + GTInternalTags.VERSION + ",);"
, acceptableRemoteVersions = BuildInfo.MAJOR_VERSION + "." + BuildInfo.MINOR_VERSION
//
//, serverSideOnly = true //サーバーのみにする場合に必要(acceptableRemoteVersionsを*に変えないとダメ)、デバッグ時はオフにする
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import kpan.uti_alsofluids.asm.tf.integration.gregtech.TF_GTFluid$GTMaterialFluid;
import kpan.uti_alsofluids.asm.tf.integration.gregtech.TF_MetaTileEntityFluidHatch;
import kpan.uti_alsofluids.asm.tf.integration.gregtech.TF_MetaTileEntityQuantumTank;
import kpan.uti_alsofluids.asm.tf.integration.gregtech.TF_MetaTileEntityReservoirHatch;
import kpan.uti_alsofluids.asm.tf.integration.gregtech.TF_PhantomFluidWidget;
import kpan.uti_alsofluids.asm.tf.integration.gregtech.TF_TankWidget;
import kpan.uti_alsofluids.asm.tf.integration.jei.TF_FluidStackRenderer;
Expand Down Expand Up @@ -68,8 +69,9 @@ public byte[] transform(String name, String transformedName, byte[] bytes) {
cv = TF_GuiFluidTerminal.appendVisitor(cv, transformedName);
cv = TF_LanguageMapUs.appendVisitor(cv, transformedName);
cv = TF_GTFluid$GTMaterialFluid.appendVisitor(cv, transformedName);
cv = TF_MetaTileEntityQuantumTank.appendVisitor(cv, transformedName);
cv = TF_MetaTileEntityFluidHatch.appendVisitor(cv, transformedName);
cv = TF_MetaTileEntityQuantumTank.appendVisitor(cv, transformedName);
cv = TF_MetaTileEntityReservoirHatch.appendVisitor(cv, transformedName);
cv = TF_TankWidget.appendVisitor(cv, transformedName);
cv = TF_PhantomFluidWidget.appendVisitor(cv, transformedName);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package kpan.uti_alsofluids.asm.tf.integration.gregtech;

import kpan.uti_alsofluids.asm.core.AsmTypes;
import kpan.uti_alsofluids.asm.core.adapters.Instructions;
import kpan.uti_alsofluids.asm.core.adapters.Instructions.OpcodeInt;
import kpan.uti_alsofluids.asm.core.adapters.MyClassVisitor;
import kpan.uti_alsofluids.asm.core.adapters.ReplaceInstructionsAdapter;
import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;

public class TF_MetaTileEntityReservoirHatch {

private static final String TARGET = "gregtech.common.metatileentities.multi.multiblockpart.MetaTileEntityReservoirHatch";
private static final String FLUID_NAME_TEXT_WIDGET = AsmTypes.HOOK + "integration/gregtech/" + "FluidNameTextWidget";

public static ClassVisitor appendVisitor(ClassVisitor cv, String className) {
if (TARGET.equals(className)) {
ClassVisitor newcv = new MyClassVisitor(cv, className) {
@Override
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
MethodVisitor mv = super.visitMethod(access, name, desc, signature, exceptions);
if (name.equals("createTankUI")) {
mv = new ReplaceInstructionsAdapter(mv, name,
Instructions.create()
.typeInsn(Opcodes.NEW, "gregtech/api/gui/widgets/AdvancedTextWidget")
.insn(Opcodes.DUP)
.intInsn(OpcodeInt.BIPUSH, 11)
.intInsn(OpcodeInt.BIPUSH, 40)
.aload(0)
.aload(5)
.label(10)
.invokespecial(TARGET, "getFluidNameText", "(Lgregtech/api/gui/widgets/TankWidget;)Ljava/util/function/Consumer;")
.ldcInsn(0xFFFFFF)
.invokespecial("gregtech/api/gui/widgets/AdvancedTextWidget", "<init>", "(IILjava/util/function/Consumer;I)V")
,
Instructions.create()
.typeInsn(Opcodes.NEW, FLUID_NAME_TEXT_WIDGET)
.insn(Opcodes.DUP)
.intInsn(OpcodeInt.BIPUSH, 11)
.intInsn(OpcodeInt.BIPUSH, 40)
.aload(0)
.aload(5)
.label(10)
.invokespecial(TARGET, "getFluidNameText", "(Lgregtech/api/gui/widgets/TankWidget;)Ljava/util/function/Consumer;")
.ldcInsn(0xFFFFFF)
.invokespecial(FLUID_NAME_TEXT_WIDGET, "<init>", "(IILjava/util/function/Consumer;I)V")
);
success();
}
return mv;
}
};
return newcv;
}
return cv;
}
}
2 changes: 2 additions & 0 deletions src/main/resources/assets/uti_alsofluids/lang/ja_jp.lang
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

item.forge.bucketFilled.name=%s入りバケツ
4 changes: 4 additions & 0 deletions src/main/resources/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
version 1.5.1 :
Add ja_jp forge universal forge bucket localization.
Fix bug that no localized name(obviously water) was displayed in Reservoir Hatch(GTCEu).
Fix server side crashing bug.
version 1.5.0 :
Update the GTCEu dependency version to 2.8.0(before 2.8 is no longer supported).
Internal refactoring.
Expand Down
2 changes: 1 addition & 1 deletion version.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
majorVersion=1
minorVersion=5
patchVersion=0
patchVersion=1

0 comments on commit 2d2610a

Please sign in to comment.