aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com
diff options
context:
space:
mode:
authorbasdxz <tudurap.com@gmail.com>2021-01-18 21:53:31 +0000
committerbasdxz <tudurap.com@gmail.com>2021-01-18 21:53:31 +0000
commit1ae93f958c53ce6ad798be33360a6b10345e810b (patch)
treee14917f359b4289c42807e356957660ed3617486 /src/main/java/com
parent37e87dcfcee4220f7c724f07c00f1cb07892a9cc (diff)
parent50eed5564fda6e36e18a9658e055a7f37476b1fc (diff)
downloadGT5-Unofficial-1ae93f958c53ce6ad798be33360a6b10345e810b.tar.gz
GT5-Unofficial-1ae93f958c53ce6ad798be33360a6b10345e810b.tar.bz2
GT5-Unofficial-1ae93f958c53ce6ad798be33360a6b10345e810b.zip
Merge branch 'ProperPowerPass' into BassAddons
Diffstat (limited to 'src/main/java/com')
-rw-r--r--src/main/java/com/github/technus/tectech/loader/thing/CoverLoader.java4
-rw-r--r--src/main/java/com/github/technus/tectech/loader/thing/ThingsLoader.java1
-rw-r--r--src/main/java/com/github/technus/tectech/thing/cover/GT_Cover_TM_PowerPassUpgrade.java37
-rw-r--r--src/main/java/com/github/technus/tectech/thing/item/PowerPassUpgradeCover.java47
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java3
5 files changed, 92 insertions, 0 deletions
diff --git a/src/main/java/com/github/technus/tectech/loader/thing/CoverLoader.java b/src/main/java/com/github/technus/tectech/loader/thing/CoverLoader.java
index 1376049f5a..880113073c 100644
--- a/src/main/java/com/github/technus/tectech/loader/thing/CoverLoader.java
+++ b/src/main/java/com/github/technus/tectech/loader/thing/CoverLoader.java
@@ -2,9 +2,11 @@ package com.github.technus.tectech.loader.thing;
import com.github.technus.tectech.TecTech;
import com.github.technus.tectech.thing.cover.GT_Cover_TM_EnderFluidLink;
+import com.github.technus.tectech.thing.cover.GT_Cover_TM_PowerPassUpgrade;
import com.github.technus.tectech.thing.cover.GT_Cover_TM_TeslaCoil;
import com.github.technus.tectech.thing.cover.GT_Cover_TM_TeslaCoil_Ultimate;
import com.github.technus.tectech.thing.item.EnderFluidLinkCover;
+import com.github.technus.tectech.thing.item.PowerPassUpgradeCover;
import com.github.technus.tectech.thing.item.TeslaCoilCover;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Textures;
@@ -19,10 +21,12 @@ public class CoverLoader implements Runnable {
final IIconContainer TESLA_OVERLAY = new Textures.BlockIcons.CustomIcon("iconsets/TESLA_OVERLAY");
final IIconContainer TESLA_OVERLAY_ULTIMATE = new Textures.BlockIcons.CustomIcon("iconsets/TESLA_OVERLAY_ULTIMATE");
final IIconContainer ENDERFLUIDLINK_OVERLAY = new Textures.BlockIcons.CustomIcon("iconsets/ENDERFLUIDLINK_OVERLAY");
+ final IIconContainer POWERPASSUPGRADE_OVERLAY = new Textures.BlockIcons.CustomIcon("iconsets/POWERPASSUPGRADE_OVERLAY");
GregTech_API.registerCover(new ItemStack(TeslaCoilCover.INSTANCE, 1, 0), new GT_RenderedTexture(TESLA_OVERLAY), new GT_Cover_TM_TeslaCoil());
GregTech_API.registerCover(new ItemStack(TeslaCoilCover.INSTANCE, 1, 1), new GT_RenderedTexture(TESLA_OVERLAY_ULTIMATE), new GT_Cover_TM_TeslaCoil_Ultimate());
GregTech_API.registerCover(new ItemStack(EnderFluidLinkCover.INSTANCE, 1, 0), new GT_RenderedTexture(ENDERFLUIDLINK_OVERLAY), new GT_Cover_TM_EnderFluidLink());
+ GregTech_API.registerCover(new ItemStack(PowerPassUpgradeCover.INSTANCE, 1, 0), new GT_RenderedTexture(POWERPASSUPGRADE_OVERLAY), new GT_Cover_TM_PowerPassUpgrade());
TecTech.LOGGER.info("Cover functionality registered");
}
}
diff --git a/src/main/java/com/github/technus/tectech/loader/thing/ThingsLoader.java b/src/main/java/com/github/technus/tectech/loader/thing/ThingsLoader.java
index 6fa0ba2bb3..4adeeec315 100644
--- a/src/main/java/com/github/technus/tectech/loader/thing/ThingsLoader.java
+++ b/src/main/java/com/github/technus/tectech/loader/thing/ThingsLoader.java
@@ -61,6 +61,7 @@ public class ThingsLoader implements Runnable {
TeslaCoilCover.run();
TeslaCoilCapacitor.run();
EnderFluidLinkCover.run();
+ PowerPassUpgradeCover.run();
TecTech.LOGGER.info("Useful Items registered");
TeslaCoilComponent.run();
diff --git a/src/main/java/com/github/technus/tectech/thing/cover/GT_Cover_TM_PowerPassUpgrade.java b/src/main/java/com/github/technus/tectech/thing/cover/GT_Cover_TM_PowerPassUpgrade.java
new file mode 100644
index 0000000000..ce40a33dff
--- /dev/null
+++ b/src/main/java/com/github/technus/tectech/thing/cover/GT_Cover_TM_PowerPassUpgrade.java
@@ -0,0 +1,37 @@
+package com.github.technus.tectech.thing.cover;
+
+import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM;
+import gregtech.api.interfaces.tileentity.ICoverable;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.util.GT_CoverBehavior;
+
+public class GT_Cover_TM_PowerPassUpgrade extends GT_CoverBehavior {
+ public GT_Cover_TM_PowerPassUpgrade() {
+ }
+
+ @Override
+ public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
+ IGregTechTileEntity TE = aTileEntity.getIGregTechTileEntityOffset(0, 0, 0);
+ if (TE instanceof GT_MetaTileEntity_MultiblockBase_EM) {
+ GT_MetaTileEntity_MultiblockBase_EM multi = (GT_MetaTileEntity_MultiblockBase_EM) TE;
+ multi.ePowerPassUpgraded = true;
+ }
+ return super.doCoverThings(aSide, aInputRedstone, aCoverID, aCoverVariable, aTileEntity, aTimer);
+ }
+
+ @Override
+ public boolean onCoverRemoval(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, boolean aForced) {
+ IGregTechTileEntity TE = aTileEntity.getIGregTechTileEntityOffset(0, 0, 0);
+ if (TE instanceof GT_MetaTileEntity_MultiblockBase_EM) {
+ GT_MetaTileEntity_MultiblockBase_EM multi = (GT_MetaTileEntity_MultiblockBase_EM) TE;
+ multi.ePowerPassUpgraded = false;
+ }
+ return true;
+ }
+
+ @Override
+ public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ //It updates once every 200 ticks, so once every 10 seconds
+ return 200;
+ }
+}
diff --git a/src/main/java/com/github/technus/tectech/thing/item/PowerPassUpgradeCover.java b/src/main/java/com/github/technus/tectech/thing/item/PowerPassUpgradeCover.java
new file mode 100644
index 0000000000..7dcf8bb48a
--- /dev/null
+++ b/src/main/java/com/github/technus/tectech/thing/item/PowerPassUpgradeCover.java
@@ -0,0 +1,47 @@
+package com.github.technus.tectech.thing.item;
+
+import com.github.technus.tectech.util.CommonValues;
+import cpw.mods.fml.common.registry.GameRegistry;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+
+import java.util.List;
+
+import static com.github.technus.tectech.Reference.MODID;
+import static com.github.technus.tectech.thing.CustomItemList.enderLinkFluidCover;
+import static net.minecraft.util.StatCollector.translateToLocal;
+
+public final class PowerPassUpgradeCover extends Item {
+ public static PowerPassUpgradeCover INSTANCE;
+
+ private PowerPassUpgradeCover() {
+ setHasSubtypes(true);
+ setUnlocalizedName("tm.powerpassupgradecover");
+ setTextureName(MODID + ":itemPowerPassUpgradeCover");
+ }
+
+ @Override
+ public void addInformation(ItemStack aStack, EntityPlayer ep, List aList, boolean boo) {
+ aList.add(CommonValues.BASS_MARK);
+ aList.add(translateToLocal("item.tm.powerpassupgradecover.desc.0"));//Ender-Fluid-Enables Machines!
+ aList.add(EnumChatFormatting.BLUE + translateToLocal("item.tm.powerpassupgradecover.desc.1"));//Use on any side of a fluid tank to link it to the Ender
+ aList.add(EnumChatFormatting.BLUE + translateToLocal("item.tm.powerpassupgradecover.desc.2"));//Ender Tanks so are laggy -Bot from the Chads of NH
+ }
+
+ public static void run() {
+ INSTANCE = new PowerPassUpgradeCover();
+ GameRegistry.registerItem(INSTANCE, INSTANCE.getUnlocalizedName());
+ enderLinkFluidCover.set(INSTANCE);
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IIconRegister iconRegister) {
+ itemIcon = iconRegister.registerIcon(getIconString());
+ }
+}
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java
index 63df215bc8..7cc83caaba 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java
@@ -121,6 +121,9 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
//if u need to force some things to be fixed - u might need to override doRandomMaintenanceDamage
protected byte minRepairStatus = 3;
+ //can power pass be enabled
+ public boolean ePowerPassUpgraded = false;
+
//functionality toggles - changed by buttons in gui also
public boolean ePowerPass = false, eSafeVoid = false;