aboutsummaryrefslogtreecommitdiff
path: root/main/java/gregtech/common/tileentities
diff options
context:
space:
mode:
authorBlood Asp <Blood@Asp>2015-04-27 23:38:12 +0200
committerBlood Asp <Blood@Asp>2015-04-27 23:38:12 +0200
commit7c0de38a9fe24ef60ab328e074432881ce4fbda4 (patch)
treec5b0a5bf9b78c1951e7f6375c91cc20423c05201 /main/java/gregtech/common/tileentities
parentf1610b1721ed22fcbd4cafb61b0867d8611c00f6 (diff)
downloadGT5-Unofficial-7c0de38a9fe24ef60ab328e074432881ce4fbda4.tar.gz
GT5-Unofficial-7c0de38a9fe24ef60ab328e074432881ce4fbda4.tar.bz2
GT5-Unofficial-7c0de38a9fe24ef60ab328e074432881ce4fbda4.zip
Add and fix
More Bugfixes, Soldering Iron and Magic Energy Absorber
Diffstat (limited to 'main/java/gregtech/common/tileentities')
-rw-r--r--main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java3
-rw-r--r--main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java9
-rw-r--r--main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java10
-rw-r--r--main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java181
4 files changed, 193 insertions, 10 deletions
diff --git a/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java b/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java
index 8852a6bde0..64b452e60c 100644
--- a/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java
+++ b/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java
@@ -42,7 +42,8 @@ public abstract class GT_MetaTileEntity_Boiler
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone)
{
- ITexture[] tmp = mTextures[(aSide==aFacing?(aActive?4:3):aSide==GT_Utility.getOppositeSide(aFacing)?2:aSide==0?0:aSide==1?1:2)][aColorIndex+1];
+ ITexture[] tmp = mTextures[aSide >= 2 ? aSide != aFacing ? 2 : ((byte)(aActive ? 4 : 3)) : aSide][aColorIndex + 1];
+ //mTextures[(aSide==aFacing?(aActive?4:3):aSide==GT_Utility.getOppositeSide(aFacing)?2:aSide==0?0:aSide==1?1:2)][aColorIndex+1];
if(aSide!=aFacing&&tmp.length==2){
tmp = new ITexture[]{tmp[0]};
}
diff --git a/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java b/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java
index 7105315eb6..2d298fed43 100644
--- a/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java
+++ b/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java
@@ -8,6 +8,7 @@ import gregtech.api.enums.Textures;
/* 7: */ import gregtech.api.metatileentity.MetaTileEntity;
/* 8: */ import gregtech.api.objects.GT_RenderedTexture;
/* 9: */ import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_Utility;
/* 10: */ import gregtech.common.gui.GT_Container_Boiler;
/* 11: */ import gregtech.common.gui.GT_GUIContainer_Boiler;
/* 12: */ import net.minecraft.entity.player.InventoryPlayer;
@@ -37,18 +38,18 @@ import gregtech.api.enums.Textures;
/* 36: */ {ITexture[] tmp0 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa)) };
/* 37: 30 */ rTextures[0][(i + 1)] = tmp0;
/* 38: 31 */ ITexture[] tmp1 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_SOLAR) };
-rTextures[1][(i + 1)] = tmp1;
+ rTextures[1][(i + 1)] = tmp1;
/* 39: 32 */ ITexture[] tmp2 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)) };
-rTextures[2][(i + 1)] = tmp2;
+ rTextures[2][(i + 1)] = tmp2;
/* 40: 33 */ ITexture[] tmp3 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE) };
-rTextures[3][(i + 1)] = tmp3;
+ rTextures[3][(i + 1)] = tmp3;
/* 41: */ }
/* 42: 35 */ return rTextures;
/* 43: */ }
/* 44: */
/* 45: */ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone)
/* 46: */ {
-/* 47: 40 */ return this.mTextures[2][(aColorIndex + 1)];
+ return mTextures[aSide >= 2 ? ((byte)(aSide != aFacing ? 2 : 3)) : aSide][aColorIndex + 1];
/* 48: */ }
/* 49: */
/* 50: */ public int maxProgresstime()
diff --git a/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java b/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java
index 839485d2b0..01c2912c51 100644
--- a/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java
+++ b/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java
@@ -87,26 +87,26 @@ public void onConfigLoad()
/* 73: */
/* 74: */ public ITexture[] getFrontActive(byte aColor)
/* 75: */ {
-/* 76:47 */ return new ITexture[] { super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] };
+/* 76:47 */ return new ITexture[] { super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] };
/* 77: */ }
/* 78: */
/* 79: */ public ITexture[] getBackActive(byte aColor)
/* 80: */ {
-/* 81:48 */ return new ITexture[] { super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT) };
+/* 81:48 */ return new ITexture[] { super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT_ACTIVE) };
/* 82: */ }
/* 83: */
/* 84: */ public ITexture[] getBottomActive(byte aColor)
/* 85: */ {
-/* 86:49 */ return new ITexture[] { super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC) };
+/* 86:49 */ return new ITexture[] { super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE) };
/* 87: */ }
/* 88: */
/* 89: */ public ITexture[] getTopActive(byte aColor)
/* 90: */ {
-/* 91:50 */ return new ITexture[] { super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC) };
+/* 91:50 */ return new ITexture[] { super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE) };
/* 92: */ }
/* 93: */
/* 94: */ public ITexture[] getSidesActive(byte aColor)
/* 95: */ {
-/* 96:51 */ return new ITexture[] { super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC) };
+/* 96:51 */ return new ITexture[] { super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE) };
/* 97: */ }
/* 98: */ } \ No newline at end of file
diff --git a/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java b/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java
new file mode 100644
index 0000000000..c74c04cdb4
--- /dev/null
+++ b/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java
@@ -0,0 +1,181 @@
+package gregtech.common.tileentities.generators;
+
+/* 3: */ import java.util.ArrayList;
+
+import thaumcraft.api.aspects.Aspect;
+import thaumcraft.api.visnet.VisNetHandler;
+import cpw.mods.fml.common.Loader;
+import net.minecraft.block.Block;
+import net.minecraft.entity.item.EntityEnderCrystal;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.ConfigCategories;
+import gregtech.api.enums.Textures;
+import gregtech.api.enums.Textures.BlockIcons;
+/* 4: */ import gregtech.api.interfaces.ITexture;
+/* 5: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+/* 6: */ import gregtech.api.metatileentity.MetaTileEntity;
+/* 7: */ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator;
+/* 8: */ import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Utility;
+/* 9: */ import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
+/* 10: */
+/* 11: */ public class GT_MetaTileEntity_MagicalEnergyAbsorber
+/* 12: */ extends GT_MetaTileEntity_BasicGenerator
+/* 13: */ {
+
+ public int mEfficiency;
+ public static boolean sAllowMultipleEggs = true;
+ public static GT_MetaTileEntity_MagicalEnergyAbsorber mActiveSiphon = null;
+ public static int sEnergyPerEnderCrystal = 32;
+ public static int sEnergyFromVis = 12800;
+ public static final ArrayList<EntityEnderCrystal> sUsedDragonCrystalList = new ArrayList();
+ public EntityEnderCrystal mTargetedCrystal;
+ public static int sDragonEggEnergyPerTick = 128;
+ public static boolean isThaumcraftLoaded;
+
+/* 14: */ public boolean isOutputFacing(byte aSide)
+/* 15: */ {
+/* 16:12 */ return aSide == getBaseMetaTileEntity().getFrontFacing();
+/* 17: */ }
+/* 18: */
+/* 19: */ public GT_MetaTileEntity_MagicalEnergyAbsorber(int aID, String aName, String aNameRegional, int aTier)
+/* 20: */ {
+/* 21:15 */ super(aID, aName, aNameRegional, aTier, "Feasts on magic close to it", new ITexture[0]);
+ onConfigLoad();
+/* 22: */ }
+/* 23: */
+/* 24: */ public GT_MetaTileEntity_MagicalEnergyAbsorber(String aName, int aTier, String aDescription, ITexture[][][] aTextures)
+/* 25: */ {
+/* 26:19 */ super(aName, aTier, aDescription, aTextures);
+ onConfigLoad();
+/* 27: */ }
+/* 28: */
+/* 29: */ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+/* 30: */ {
+/* 31:24 */ return new GT_MetaTileEntity_MagicalEnergyAbsorber(this.mName, this.mTier, this.mDescription, this.mTextures);
+/* 32: */ }
+/* 33: */
+/* 34: */ public GT_Recipe.GT_Recipe_Map getRecipes()
+/* 35: */ {
+/* 36:29 */ return GT_Recipe.GT_Recipe_Map.sMagicFuels;
+/* 37: */ }
+/* 38: */
+/* 39: */ public int getCapacity()
+/* 40: */ {
+/* 41:34 */ return 16000;
+/* 42: */ }
+
+ public void onConfigLoad()
+/* 39: */ {
+ this.mEfficiency =GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyAbsorber.efficiency.tier."+this.mTier, 100-this.mTier*10);
+ this.sAllowMultipleEggs = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyAbsorber.AllowMultipleEggs", false);
+ this.sEnergyPerEnderCrystal = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyAbsorber.EnergyPerTick.EnderCrystal", 32);
+ this.sEnergyFromVis = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyAbsorber.EnergyPerVisDivisor", 2500);
+ this.sDragonEggEnergyPerTick = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyAbsorber.EnergyPerTick", 2048);
+ this.isThaumcraftLoaded = Loader.isModLoaded("Thaumcraft");
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity.getUniversalEnergyStored() < maxEUOutput() + aBaseMetaTileEntity.getEUCapacity()) {
+ //Dragon Egg
+ if(hasEgg()&&aTick%10==0){
+ getBaseMetaTileEntity().increaseStoredEnergyUnits(sDragonEggEnergyPerTick*getEfficiency()/10, false);
+ if ((mActiveSiphon != this) && (!sAllowMultipleEggs)) {
+ if ((mActiveSiphon == null) || (mActiveSiphon.getBaseMetaTileEntity() == null) || (mActiveSiphon.getBaseMetaTileEntity().isInvalidTileEntity()) || (!mActiveSiphon.hasEgg())) {
+ mActiveSiphon = this;
+ } else {
+ getBaseMetaTileEntity().doExplosion(Integer.MAX_VALUE);
+ }
+ }
+ }
+ //Energyzed node
+ if(isThaumcraftLoaded){
+ try{
+ int fire = VisNetHandler.drainVis(this.getBaseMetaTileEntity().getWorld(), this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord(), Aspect.FIRE, 1000);
+ int earth = VisNetHandler.drainVis(this.getBaseMetaTileEntity().getWorld(), this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord(), Aspect.EARTH, 1000);
+ int air = VisNetHandler.drainVis(this.getBaseMetaTileEntity().getWorld(), this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord(), Aspect.AIR, 1000);
+ int destruction = VisNetHandler.drainVis(this.getBaseMetaTileEntity().getWorld(), this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord(), Aspect.ENTROPY, 1000);
+ int order = VisNetHandler.drainVis(this.getBaseMetaTileEntity().getWorld(), this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord(), Aspect.ORDER, 1000);
+ int water = VisNetHandler.drainVis(this.getBaseMetaTileEntity().getWorld(), this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord(), Aspect.WATER, 1000);
+ int visEU = (int) (Math.pow(fire, 4)+Math.pow(earth, 4)+Math.pow(air, 4)+Math.pow(destruction, 4)+Math.pow(order, 4)+Math.pow(water, 4));
+ getBaseMetaTileEntity().increaseStoredEnergyUnits(Math.min(maxEUOutput(), visEU*getEfficiency()/this.sEnergyFromVis), false);
+ }catch (Throwable e){}
+ }
+ //EnderCrystal
+
+ //GC Creeper Egg
+
+ }
+ }
+
+ public void inValidate()
+ {
+ if (mActiveSiphon == this) {
+ mActiveSiphon = null;
+ }
+ }
+
+ public boolean hasEgg()
+ {
+ return Blocks.dragon_egg == getBaseMetaTileEntity().getBlockOffset(0, 1, 0);
+ }
+/* 43: */
+/* 44: */ public int getEfficiency()
+/* 45: */ {
+/* 46:39 */ return this.mEfficiency;
+/* 47: */ }
+/* 48: */
+/* 49: */ public ITexture[] getFront(byte aColor)
+/* 50: */ {
+/* 51:42 */ return new ITexture[] { super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] };
+/* 52: */ }
+/* 53: */
+/* 54: */ public ITexture[] getBack(byte aColor)
+/* 55: */ {
+/* 56:43 */ return new ITexture[] { super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT) };
+/* 57: */ }
+/* 58: */
+/* 59: */ public ITexture[] getBottom(byte aColor)
+/* 60: */ {
+/* 61:44 */ return new ITexture[] { super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC) };
+/* 62: */ }
+/* 63: */
+/* 64: */ public ITexture[] getTop(byte aColor)
+/* 65: */ {
+/* 66:45 */ return new ITexture[] { super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_DRAGONEGG) };
+/* 67: */ }
+/* 68: */
+/* 69: */ public ITexture[] getSides(byte aColor)
+/* 70: */ {
+/* 71:46 */ return new ITexture[] { super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC) };
+/* 72: */ }
+/* 73: */
+/* 74: */ public ITexture[] getFrontActive(byte aColor)
+/* 75: */ {
+/* 76:47 */ return new ITexture[] { super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] };
+/* 77: */ }
+/* 78: */
+/* 79: */ public ITexture[] getBackActive(byte aColor)
+/* 80: */ {
+/* 81:48 */ return new ITexture[] { super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT_ACTIVE) };
+/* 82: */ }
+/* 83: */
+/* 84: */ public ITexture[] getBottomActive(byte aColor)
+/* 85: */ {
+/* 86:49 */ return new ITexture[] { super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE) };
+/* 87: */ }
+/* 88: */
+/* 89: */ public ITexture[] getTopActive(byte aColor)
+/* 90: */ {
+/* 91:50 */ return new ITexture[] { super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_DRAGONEGG) };
+/* 92: */ }
+/* 93: */
+/* 94: */ public ITexture[] getSidesActive(byte aColor)
+/* 95: */ {
+/* 96:51 */ return new ITexture[] { super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE) };
+/* 97: */ }
+/* 98: */ } \ No newline at end of file