Skip to content

Commit

Permalink
move hard-coded GT translations to assets folder
Browse files Browse the repository at this point in the history
  • Loading branch information
reobf committed Feb 18, 2024
1 parent 4b8c275 commit 3e27737
Show file tree
Hide file tree
Showing 31 changed files with 290 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import net.minecraftforge.oredict.OreDictionary;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.gtnewhorizons.modularui.api.ModularUITextures;
import com.gtnewhorizons.modularui.api.drawable.IDrawable;
import com.gtnewhorizons.modularui.api.forge.IItemHandlerModifiable;
Expand Down Expand Up @@ -205,7 +206,7 @@ public BufferedDualInputHatch(int id, String name, String nameRegional, int tier
mMultiFluid,

(optional.length > 0 ? optional
: defaultObj(
: /*defaultObj(
ArrayExt.of(
"Item/Fluid Input for Multiblocks",
Expand All @@ -230,9 +231,16 @@ public BufferedDualInputHatch(int id, String name, String nameRegional, int tier
+ (mMultiFluid ? " x4种流体" : ""),
Math.min(16, (1 + tier) * (tier + 1)) + "格",
"每格堆叠限制:" + (int) (64 * Math.pow(2, Math.max(tier - 3, 0))),
StatCollector.translateToLocal("programmable_hatches.addedby")

))));
StatCollector.translateToLocal("programmable_hatches.addedby"))
*/reobf.proghatches.main.Config.get("BDH", ImmutableMap.of(
"bufferNum",bufferNum,
"cap",format.format((int) (4000 * Math.pow(4, tier) / (mMultiFluid ? 4 : 1))),
"mMultiFluid",mMultiFluid,
"slots", Math.min(16, (1 + tier) * (tier + 1)),
"stacksize",(int) (64 * Math.pow(2, Math.max(tier - 3, 0)))
))

))/*)*/;
this.bufferNum = bufferNum;
initBackend();

Expand Down Expand Up @@ -1321,9 +1329,13 @@ public void getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDat
}
String cpinfo="";
int copies=sub.getInteger("possibleCopies");
if(copies==-1)cpinfo=cpinfo+StatCollector.translateToLocal("programmable_hatches.buffer.waila.broken");
if(copies>0)cpinfo=cpinfo+StatCollector.translateToLocalFormatted("programmable_hatches.buffer.waila.copies",copies+"");

if(copies==-1
&&(sub.getBoolean("locked"))//if not locked, do not warn about the copies
)cpinfo=cpinfo+StatCollector.translateToLocal("programmable_hatches.buffer.waila.broken");
if(copies>0){
cpinfo=cpinfo+StatCollector.translateToLocalFormatted("programmable_hatches.buffer.waila.copies",copies+"");
if(sub.getBoolean("locked")){cpinfo+="???not locked but copies>0???";}
}
currenttip.add("#"+s+" "+info+" "+cpinfo);
String lock_item=sub.getString("lock_item");
String lock_fluid=sub.getString("lock_fluid");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import net.minecraftforge.fluids.FluidTank;
import net.minecraftforge.fluids.FluidTankInfo;

import com.google.common.collect.ImmutableMap;
import com.gtnewhorizons.modularui.api.ModularUITextures;
import com.gtnewhorizons.modularui.api.drawable.IDrawable;
import com.gtnewhorizons.modularui.api.drawable.UITexture;
Expand Down Expand Up @@ -81,7 +82,7 @@ public DualInputHatch(int id, String name, String nameRegional, int tier, int sl
tier,
slot,
(optional.length > 0 ? optional
: defaultObj(
: /*defaultObj(
ArrayExt.of(
"Item/Fluid Input for Multiblocks",
Expand All @@ -100,7 +101,19 @@ public DualInputHatch(int id, String name, String nameRegional, int tier, int sl
+ "L"
+ (mMultiFluid ? " x4种流体" : ""),
Math.min(16, (1 + tier) * (tier + 1)) + "格",
StatCollector.translateToLocal("programmable_hatches.addedby")))));
StatCollector.translateToLocal("programmable_hatches.addedby")))*/
reobf.proghatches.main.Config.get("DH", ImmutableMap.of(

"cap",format.format((int) (4000 * Math.pow(2, tier) / (mMultiFluid ? 4 : 1))),
"mMultiFluid",mMultiFluid,
"slots", Math.min(16, (1 + tier) * (tier + 1))

))

)


);
this.disableSort = true;
Registration.items.add(new ItemStack(GregTech_API.sBlockMachines, 1, id));
this.mMultiFluid = mMultiFluid;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import java.util.List;
import java.util.Optional;

import com.google.common.collect.ImmutableMap;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
Expand Down Expand Up @@ -49,7 +51,8 @@ public DualInputHatchSlave(int aID, String aName, String aNameRegional) {
aNameRegional,
6,
0,
defaultObj(
reobf.proghatches.main.Config.get("DHS", ImmutableMap.of())
/*defaultObj(
ArrayExt.of(
"Slave for Dual Input Hatch",
Expand All @@ -59,6 +62,8 @@ public DualInputHatchSlave(int aID, String aName, String aNameRegional) {
),
ArrayExt.of("二合一输入仓的镜像端", "将所绑定的样板输入总成的内容物共享过来", "闪存左键点击二合一输入仓,然后右键点击输入镜像完成链接绑定",
StatCollector.translateToLocal("programmable_hatches.addedby")))
*/


/*
* new String[] { "Slave for (Buffered) Dual Input Hatch",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import org.jetbrains.annotations.Nullable;

import com.google.common.collect.ImmutableMap;
import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
import com.gtnewhorizons.modularui.api.screen.ModularWindow.Builder;
import com.gtnewhorizons.modularui.api.widget.Widget;
Expand Down Expand Up @@ -49,7 +50,11 @@ public FilterOutputBus(int aID, String aName, String aNameRegional, int tier, bo
aName,
aNameRegional,
tier,
defaultObj(
reobf.proghatches.main.Config.get("FOB", ImmutableMap.of(
"keepone",keepone ,
"slots" , Math.min(16, (1 + tier) * (tier + 1))
))
/*defaultObj(
ArrayExt.of(
"Item Output for Multiblocks",
Expand All @@ -67,7 +72,10 @@ public FilterOutputBus(int aID, String aName, String aNameRegional, int tier, bo
Math.min(16, (1 + tier) * (tier + 1)) + "格",
StatCollector.translateToLocal("programmable_hatches.addedby")
)));
))*/


);
this.keepone = keepone;
Registration.items.add(new ItemStack(GregTech_API.sBlockMachines, 1, aID));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import com.glodblock.github.common.item.ItemFluidPacket;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.gtnewhorizons.modularui.api.math.Pos2d;
import com.gtnewhorizons.modularui.api.screen.ModularWindow;
import com.gtnewhorizons.modularui.api.screen.ModularWindow.Builder;
Expand Down Expand Up @@ -86,7 +87,15 @@ public PatternDualInputHatch(int id, String name, String nameRegional, int tier,
mMultiFluid,
bufferNum,
(optional.length > 0 ? optional
: defaultObj(
: reobf.proghatches.main.Config.get("PDIH", ImmutableMap.of(
"bufferNum",bufferNum,
"cap",format.format((int) (4000 * Math.pow(4, tier) / (mMultiFluid ? 4 : 1))),
"mMultiFluid",mMultiFluid,
"slots", Math.min(16, (1 + tier) * (tier + 1)),
"stacksize",(int) (64 * Math.pow(2, Math.max(tier - 3, 0)))
))

/*defaultObj(
ArrayExt.of(
"Item/Fluid Input for Multiblocks",
Expand Down Expand Up @@ -116,7 +125,11 @@ public PatternDualInputHatch(int id, String name, String nameRegional, int tier,
"每格堆叠限制:" + (int) (64 * Math.pow(2, Math.max(tier - 3, 0))),
StatCollector.translateToLocal("programmable_hatches.addedby")
))));
))*/



));
this.supportFluids = fluid;
}

Expand Down Expand Up @@ -308,15 +321,16 @@ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {

@Override
public boolean pushPattern(ICraftingPatternDetails patternDetails, InventoryCrafting table) {
if (!isActive()) return false;
if (!isActive()) return false;
if (!isEmpty()) return false;
if (!supportFluids) {
for (int i = 0; i < table.getSizeInventory(); ++i) {
ItemStack itemStack = table.getStackInSlot(i);
if (itemStack == null) continue;
if (itemStack.getItem() instanceof ItemFluidPacket) return false;
}
}
if (!isEmpty()) return false;


int items = 0;
int fluids = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;

import com.google.common.collect.ImmutableMap;
import com.gtnewhorizons.modularui.api.drawable.IDrawable;
import com.gtnewhorizons.modularui.api.forge.IItemHandlerModifiable;
import com.gtnewhorizons.modularui.api.screen.ModularWindow.Builder;
Expand Down Expand Up @@ -70,8 +71,8 @@ public ProgrammingCircuitProvider(int aID, String aName, String aNameRegional, i
aName,
aNameRegional,
aTier,
aInvSlotCount,
defaultObj(
aInvSlotCount,reobf.proghatches.main.Config.get("PCP", ImmutableMap.of())
/*defaultObj(
ArrayExt.of(
"Connect to AE network to provide Programming Circuit crafting",
"Each item costs 10AE",
Expand All @@ -86,7 +87,9 @@ public ProgrammingCircuitProvider(int aID, String aName, String aNameRegional, i
"放入编程电路以指定生成的编程器芯片类型",
"你也可以放入编程电路以外的物品",
"并不能从nei书签标记物品,你需要把目标物品留在提供器内",
StatCollector.translateToLocal("programmable_hatches.addedby"))));
StatCollector.translateToLocal("programmable_hatches.addedby")))*/

);
Registration.items.add(new ItemStack(GregTech_API.sBlockMachines, 1, aID));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import net.minecraftforge.common.util.ForgeDirection;

import com.gtnewhorizons.modularui.api.screen.ModularWindow.Builder;
import com.google.common.collect.ImmutableMap;
import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
import com.gtnewhorizons.modularui.common.widget.TextWidget;

Expand Down Expand Up @@ -173,7 +174,8 @@ public RemoteInputBus(int id, String name, String nameRegional, int tier) {
nameRegional,
0,
0,
defaultObj(
reobf.proghatches.main.Config.get("RIB", ImmutableMap.of())
/*defaultObj(
ArrayExt.of(
"Item Input for Multiblocks, wirelessly linked to a container, just like RemoteIO interface.",
Expand All @@ -188,7 +190,7 @@ public RemoteInputBus(int id, String name, String nameRegional, int tier) {
"无法被管道抽出的物品(除了虚拟电路板,如果目标有)也不能被访问",
"不能跨维度链接 不会触发目标区块加载,且目标区块未加载时不工作"
,StatCollector.translateToLocal("programmable_hatches.addedby")
)));
))*/);
Registration.items.add(new ItemStack(GregTech_API.sBlockMachines, 1, id));

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import net.minecraftforge.fluids.IFluidHandler;

import com.gtnewhorizons.modularui.api.screen.ModularWindow.Builder;
import com.google.common.collect.ImmutableMap;
import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
import com.gtnewhorizons.modularui.common.widget.TextWidget;

Expand Down Expand Up @@ -172,7 +173,8 @@ public RemoteInputHatch(int id, String name, String nameRegional, int tier) {
name,
nameRegional,
0,
defaultObj(
reobf.proghatches.main.Config.get("RIH", ImmutableMap.of())
/*defaultObj(
ArrayExt.of(
"Fluid Input for Multiblocks, wirelessly linked to a tank, just like RemoteIO interface.",
Expand All @@ -187,7 +189,9 @@ public RemoteInputHatch(int id, String name, String nameRegional, int tier) {
"无法被管道抽出的流体也不能被访问",
"不能跨维度链接 不会触发目标区块加载,且目标区块未加载时不工作"
,StatCollector.translateToLocal("programmable_hatches.addedby")
)));
))*/

);
Registration.items.add(new ItemStack(GregTech_API.sBlockMachines, 1, id));

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import java.util.ArrayList;

import com.google.common.collect.ImmutableMap;

import net.minecraft.util.StatCollector;
import net.minecraftforge.fluids.FluidTank;

Expand Down Expand Up @@ -40,8 +42,8 @@ public SuperfluidHatch(int id, String name, String nameRegional, int tier, boole
4 + 1,
mMultiFluid,
bufferNum,

(String[]) Config.defaultObj(
reobf.proghatches.main.Config.get("SH", ImmutableMap.of())
/* (String[]) Config.defaultObj(
ArrayExt.of(
"Dedicated to handle the siutation of many types of fluid input",
Expand All @@ -64,7 +66,7 @@ public SuperfluidHatch(int id, String name, String nameRegional, int tier, boole
"16 格",
"每格堆叠限制:64"
,StatCollector.translateToLocal("programmable_hatches.addedby")
))
))*/

);

Expand Down
Loading

0 comments on commit 3e27737

Please sign in to comment.