aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/blocks/GT_Block_Casings5.java
diff options
context:
space:
mode:
authorKiwi <42833050+Kiwi233@users.noreply.github.com>2021-07-05 22:06:44 +0800
committerGitHub <noreply@github.com>2021-07-05 22:06:44 +0800
commit4eaefbb5455dc3402b43dcbf6cba208cea4e301a (patch)
treeb7e34b2e20af663cdd72c616fd7424301304e3e4 /src/main/java/gregtech/common/blocks/GT_Block_Casings5.java
parent36406947fc5c0de1ee71da2644ec057b5fbc8d25 (diff)
parent703a8930bee25b1f908e9c4ea4f52cef24337d03 (diff)
downloadGT5-Unofficial-4eaefbb5455dc3402b43dcbf6cba208cea4e301a.tar.gz
GT5-Unofficial-4eaefbb5455dc3402b43dcbf6cba208cea4e301a.tar.bz2
GT5-Unofficial-4eaefbb5455dc3402b43dcbf6cba208cea4e301a.zip
Merge pull request #3 from GTNewHorizons/experimental
gregtech-5.09.35.00
Diffstat (limited to 'src/main/java/gregtech/common/blocks/GT_Block_Casings5.java')
-rw-r--r--src/main/java/gregtech/common/blocks/GT_Block_Casings5.java75
1 files changed, 70 insertions, 5 deletions
diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Casings5.java b/src/main/java/gregtech/common/blocks/GT_Block_Casings5.java
index 55492c961c..296bf765b0 100644
--- a/src/main/java/gregtech/common/blocks/GT_Block_Casings5.java
+++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings5.java
@@ -2,20 +2,25 @@ package gregtech.common.blocks;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
+import gregtech.api.enums.HeatingCoilLevel;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Textures;
-import gregtech.api.objects.GT_CopiedBlockTexture;
+import gregtech.api.interfaces.IHeatingCoil;
+import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_LanguageManager;
-import gregtech.api.util.GT_Utility;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
-public class GT_Block_Casings5
- extends GT_Block_Casings_Abstract {
+import java.util.function.Consumer;
+
+import static gregtech.api.enums.HeatingCoilLevel.*;
+
+public class GT_Block_Casings5 extends GT_Block_Casings_Abstract implements IHeatingCoil {
+
public GT_Block_Casings5() {
super(GT_Item_Casings5.class, "gt.blockcasings5", GT_Material_Casings.INSTANCE);
for (byte i = 0; i < 16; i = (byte) (i + 1)) {
- Textures.BlockIcons.casingTexturePages[1][i] = new GT_CopiedBlockTexture(this, 6, i);
+ Textures.BlockIcons.casingTexturePages[1][i] = TextureFactory.of(this, i);
}
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Cupronickel Coil Block");
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "Kanthal Coil Block");
@@ -26,6 +31,8 @@ public class GT_Block_Casings5
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".6.name", "Naquadah Alloy Coil Block");
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".7.name", "Electrum Flux Coil Block");
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".8.name", "Awakened Draconium Coil Block");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".9.name", "HSS-S Coil Block");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".10.name", "Trinium Coil Block");
ItemList.Casing_Coil_Cupronickel.set(new ItemStack(this, 1, 0));
ItemList.Casing_Coil_Kanthal.set(new ItemStack(this, 1, 1));
@@ -36,7 +43,10 @@ public class GT_Block_Casings5
ItemList.Casing_Coil_NaquadahAlloy.set(new ItemStack(this, 1, 6));
ItemList.Casing_Coil_ElectrumFlux.set(new ItemStack(this, 1, 7));
ItemList.Casing_Coil_AwakenedDraconium.set(new ItemStack(this, 1, 8));
+ ItemList.Casing_Coil_HSSS.set(new ItemStack(this, 1, 9));
+ ItemList.Casing_Coil_Trinium.set(new ItemStack(this, 1, 10));
}
+
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int aSide, int aMeta) {
@@ -59,7 +69,62 @@ public class GT_Block_Casings5
return Textures.BlockIcons.MACHINE_COIL_ELECTRUMFLUX.getIcon();
case 8:
return Textures.BlockIcons.MACHINE_COIL_AWAKENEDDRACONIUM.getIcon();
+ case 9:
+ return Textures.BlockIcons.MACHINE_COIL_HSSS.getIcon();
+ case 10:
+ return Textures.BlockIcons.MACHINE_COIL_TRINIUM.getIcon();
}
return Textures.BlockIcons.MACHINE_COIL_CUPRONICKEL.getIcon();
}
+
+ /*--------------- COIL CHECK IMPL. ------------*/
+
+ public static HeatingCoilLevel getCoilHeatFromDamage(int meta) {
+ switch (meta) {
+ case 0:
+ return LV;
+ case 1:
+ return MV;
+ case 2:
+ return HV;
+ case 3:
+ return EV;
+ case 4:
+ return IV;
+ case 5:
+ return ZPM;
+ case 6:
+ return UV;
+ case 7:
+ return UEV;
+ case 8:
+ return UIV;
+ case 9:
+ return LuV;
+ case 10:
+ return UHV;
+ default:
+ return None;
+ }
+ }
+
+ @Override
+ public HeatingCoilLevel getCoilHeat(int meta) {
+ getOnCoilCheck().accept(this);
+ return getCoilHeatFromDamage(meta);
+ }
+
+ /*--------------- CALLBACK ------------*/
+
+ private Consumer<IHeatingCoil> callback = coil -> {};
+
+ @Override
+ public void setOnCoilCheck(Consumer<IHeatingCoil> callback) {
+ this.callback = callback;
+ }
+
+ @Override
+ public Consumer<IHeatingCoil> getOnCoilCheck() {
+ return this.callback;
+ }
}