Fix GT tools with duplicates in TFC cannot set on the tool racks

Fix GT tools with duplicates in TFC cannot set on the tool racks. Since original program will throw ReferenceError.
Tested on TFG 0.7.2 with TFC & GTM manually updated to newest version. However, tools appear only in GTM still cannot put on the tool racks. Need further investigation.
This commit is contained in:
chemlzh 2024-04-27 13:49:12 +08:00
parent 89c81edb51
commit 5930ee7a95
2 changed files with 2 additions and 2 deletions

View file

@ -30,7 +30,7 @@ global.GTCEU_TOOLTYPES_WHICH_HAS_TFC_DUPS = {
"tfc:axes" : GTToolType.AXE,
"tfc:shovels" : GTToolType.SHOVEL,
"tfc:hoes" : GTToolType.HOE,
"tfc:hammers" : GTToolType.MINING_HAMMER,
"tfc:hammers" : GTToolType.HARD_HAMMER,
"tfc:knives" : GTToolType.KNIFE,
"tfc:saws" : GTToolType.SAW,
"tfc:scythes" : GTToolType.SCYTHE

View file

@ -6,7 +6,7 @@ const registerTFCItemTags = (event) => {
GTMaterialRegistry.getRegisteredMaterials().forEach(material => {
if (material.hasProperty(PropertyKey.TOOL)) {
for (let [key, value] of Object.entries(global.GTCEU_TOOLTYPES_WHICH_HAS_TFC_DUPS)) {
var tool = ToolHelper.get(value, material)
var tool = $ToolHelper.get(value, material)
if (!tool.isEmpty()) event.add(key, tool.getId())
event.add('tfc:usable_on_tool_rack', `#${key}`)