|
2 | 2 |
|
3 | 3 | import static gtexpert.common.items.GTEMetaItems.*; |
4 | 4 |
|
| 5 | +import gtexpert.api.util.GTELog; |
| 6 | + |
5 | 7 | import net.minecraft.client.resources.I18n; |
6 | 8 |
|
7 | 9 | import gregtech.api.GTValues; |
@@ -31,32 +33,38 @@ public void registerSubItems() { |
31 | 33 | // Free range: ID 3-10 |
32 | 34 |
|
33 | 35 | // Primitive parts: ID 11-20 |
34 | | - String componentsName = GTEConfigHolder.gteFlag.componentsName ? "ulv" : "primitive"; |
35 | | - GTE_ELECTRIC_MOTOR = addItem(11, "electric.motor." + componentsName); |
36 | | - GTE_ELECTRIC_PUMP = addItem(12, "electric.pump." + componentsName) |
37 | | - .addComponents(new TooltipBehavior(lines -> { |
38 | | - lines.add(I18n.format("metaitem.electric.pump.tooltip")); |
39 | | - lines.add(I18n.format("gregtech.universal.tooltip.fluid_transfer_rate", (1280 / 4) / 20)); |
40 | | - })); |
41 | | - GTE_CONVEYOR_MODULE = addItem(13, "conveyor.module." + componentsName) |
42 | | - .addComponents(new TooltipBehavior(lines -> { |
43 | | - lines.add(I18n.format("metaitem.conveyor.module.tooltip")); |
44 | | - lines.add(I18n.format("gregtech.universal.tooltip.item_transfer_rate", 2)); |
45 | | - })); |
46 | | - GTE_ELECTRIC_PISTON = addItem(14, "electric.piston." + componentsName); |
47 | | - GTE_ROBOT_ARM = addItem(15, "robot.arm." + componentsName) |
48 | | - .addComponents(new TooltipBehavior(lines -> { |
49 | | - lines.add(I18n.format("metaitem.robot.arm.tooltip")); |
50 | | - lines.add(I18n.format("gregtech.universal.tooltip.item_transfer_rate", 2)); |
51 | | - })); |
52 | | - GTE_FLUID_REGULATOR = addItem(16, "fluid.regulator." + componentsName) |
53 | | - .addComponents(new TooltipBehavior(lines -> { |
54 | | - lines.add(I18n.format("metaitem.fluid.regulator.tooltip")); |
55 | | - lines.add(I18n.format("gregtech.universal.tooltip.fluid_transfer_rate", (1280 / 4) / 20)); |
56 | | - })); |
57 | | - GTE_FIELD_GENERATOR = addItem(17, "field.generator." + componentsName); |
58 | | - GTE_EMITTER = addItem(18, "emitter." + componentsName); |
59 | | - GTE_SENSOR = addItem(19, "sensor." + componentsName); |
| 36 | + String componentsName = GTEConfigHolder.gteFlag.componentsName; |
| 37 | + if (componentsName.equals("ulv") || componentsName.equals("primitive")) { |
| 38 | + GTE_ELECTRIC_MOTOR = addItem(11, "electric.motor." + componentsName); |
| 39 | + GTE_ELECTRIC_PUMP = addItem(12, "electric.pump." + componentsName) |
| 40 | + .addComponents(new TooltipBehavior(lines -> { |
| 41 | + lines.add(I18n.format("metaitem.electric.pump.tooltip")); |
| 42 | + lines.add(I18n.format("gregtech.universal.tooltip.fluid_transfer_rate", (1280 / 4) / 20)); |
| 43 | + })); |
| 44 | + GTE_CONVEYOR_MODULE = addItem(13, "conveyor.module." + componentsName) |
| 45 | + .addComponents(new TooltipBehavior(lines -> { |
| 46 | + lines.add(I18n.format("metaitem.conveyor.module.tooltip")); |
| 47 | + lines.add(I18n.format("gregtech.universal.tooltip.item_transfer_rate", 2)); |
| 48 | + })); |
| 49 | + GTE_ELECTRIC_PISTON = addItem(14, "electric.piston." + componentsName); |
| 50 | + GTE_ROBOT_ARM = addItem(15, "robot.arm." + componentsName) |
| 51 | + .addComponents(new TooltipBehavior(lines -> { |
| 52 | + lines.add(I18n.format("metaitem.robot.arm.tooltip")); |
| 53 | + lines.add(I18n.format("gregtech.universal.tooltip.item_transfer_rate", 2)); |
| 54 | + })); |
| 55 | + GTE_FLUID_REGULATOR = addItem(16, "fluid.regulator." + componentsName) |
| 56 | + .addComponents(new TooltipBehavior(lines -> { |
| 57 | + lines.add(I18n.format("metaitem.fluid.regulator.tooltip")); |
| 58 | + lines.add(I18n.format("gregtech.universal.tooltip.fluid_transfer_rate", (1280 / 4) / 20)); |
| 59 | + })); |
| 60 | + GTE_FIELD_GENERATOR = addItem(17, "field.generator." + componentsName); |
| 61 | + GTE_EMITTER = addItem(18, "emitter." + componentsName); |
| 62 | + GTE_SENSOR = addItem(19, "sensor." + componentsName); |
| 63 | + } |
| 64 | + else { |
| 65 | + GTELog.logger.error("Invalid componentsName setting: {}", |
| 66 | + componentsName, new Throwable()); |
| 67 | + } |
60 | 68 |
|
61 | 69 | // Shapes: ID 101-110 |
62 | 70 | if (AEConfigHolder.moveSteelShape) { |
|
0 commit comments