|
20 | 20 | import gregtech.api.util.GT_Utility;
|
21 | 21 | import gregtech.api.util.WorldSpawnedEventBuilder;
|
22 | 22 | import ic2.core.Ic2Items;
|
| 23 | +import lombok.val; |
23 | 24 | import net.minecraft.entity.player.InventoryPlayer;
|
24 | 25 | import net.minecraft.init.Blocks;
|
25 | 26 | import net.minecraft.item.ItemStack;
|
@@ -52,16 +53,7 @@ public GT_MetaTileEntity_BasicMachine_GT_Recipe(
|
52 | 53 | int aInputSlots, int aOutputSlots, int aTankCapacity, int aGUIParameterA, int aGUIParameterB, String aGUIName, String aSound, boolean aSharedTank,
|
53 | 54 | boolean aRequiresFluidForFiltering, int aSpecialEffect, String aOverlays, Object[] aRecipe
|
54 | 55 | ) {
|
55 |
| - super(aID, aName, aNameRegional, aTier, aRecipes.mAmperage, aDescription, aInputSlots, aOutputSlots, aGUIName, aRecipes.mNEIName, |
56 |
| - TextureFactory.of(new CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_SIDE_ACTIVE")), |
57 |
| - TextureFactory.of(new CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_SIDE")), |
58 |
| - TextureFactory.of(new CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_FRONT_ACTIVE")), |
59 |
| - TextureFactory.of(new CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_FRONT")), |
60 |
| - TextureFactory.of(new CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_TOP_ACTIVE")), |
61 |
| - TextureFactory.of(new CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_TOP")), |
62 |
| - TextureFactory.of(new CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_BOTTOM_ACTIVE")), |
63 |
| - TextureFactory.of(new CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_BOTTOM")) |
64 |
| - ); |
| 56 | + super(aID, aName, aNameRegional, aTier, aRecipes.mAmperage, aDescription, aInputSlots, aOutputSlots, aGUIName, aRecipes.mNEIName, createTextures(aOverlays)); |
65 | 57 | this.mSharedTank = aSharedTank;
|
66 | 58 | this.mTankCapacity = aTankCapacity;
|
67 | 59 | this.mSpecialEffect = aSpecialEffect;
|
@@ -933,4 +925,32 @@ protected boolean displaysOutputFluid() {
|
933 | 925 | }
|
934 | 926 |
|
935 | 927 | public enum X {PUMP, WIRE, WIRE4, HULL, PIPE, GLASS, PLATE, MOTOR, ROTOR, SENSOR, PISTON, EMITTER, CONVEYOR, ROBOT_ARM, COIL_HEATING, COIL_ELECTRIC, STICK_MAGNETIC, STICK_DISTILLATION, FIELD_GENERATOR, COIL_HEATING_DOUBLE, STICK_ELECTROMAGNETIC, CIRCUIT_POWER, CIRCUIT_LOGIC}
|
| 928 | + |
| 929 | + @Override |
| 930 | + public boolean hasTranslucency() { |
| 931 | + return true; |
| 932 | + } |
| 933 | + |
| 934 | + private static ITexture[] createTextures(String aOverlays) { |
| 935 | + val prefix = "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_"; |
| 936 | + return new ITexture[]{ |
| 937 | + texzWithDaGlass(prefix, "SIDE_ACTIVE", "SIDE_TRANSLUCENT"), |
| 938 | + texzWithDaGlass(prefix, "SIDE", "SIDE_TRANSLUCENT"), |
| 939 | + texzWithDaGlass(prefix, "FRONT_ACTIVE", "FRONT_TRANSLUCENT"), |
| 940 | + texzWithDaGlass(prefix, "FRONT", "FRONT_TRANSLUCENT"), |
| 941 | + texzWithDaGlass(prefix, "TOP_ACTIVE", "TOP_TRANSLUCENT"), |
| 942 | + texzWithDaGlass(prefix, "TOP", "TOP_TRANSLUCENT"), |
| 943 | + texzWithDaGlass(prefix, "BOTTOM_ACTIVE", "BOTTOM_TRANSLUCENT"), |
| 944 | + texzWithDaGlass(prefix, "BOTTOM", "BOTTOM_TRANSLUCENT"), |
| 945 | + }; |
| 946 | + } |
| 947 | + |
| 948 | + private static ITexture texzWithDaGlass(String prefix, String opaqueName, String translucentName) { |
| 949 | + val opaque = TextureFactory.of(new CustomIcon(prefix + opaqueName)); |
| 950 | + val translucent = TextureFactory.builder() |
| 951 | + .addIcon(new CustomIcon(prefix + translucentName)) |
| 952 | + .setTranslucent(true) |
| 953 | + .build(); |
| 954 | + return TextureFactory.of(opaque, translucent); |
| 955 | + } |
936 | 956 | }
|
0 commit comments