From 682069aa3b8bb06ab63202f9cce83499913ed18a Mon Sep 17 00:00:00 2001 From: Pranav Date: Fri, 3 Nov 2017 22:06:43 -0400 Subject: [PATCH 1/4] Fix the magic energy absorber --- ..._MetaTileEntity_MagicalEnergyAbsorber.java | 45 ++++++++++--------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java index cb4d9886..2ae10062 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java @@ -1,5 +1,6 @@ package gregtech.common.tileentities.generators; +import cpw.mods.fml.common.FMLLog; import cpw.mods.fml.common.Loader; import gregtech.api.GregTech_API; import gregtech.api.enums.ConfigCategories; @@ -38,11 +39,13 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B public static boolean sAllowMultipleEggs = true; public static GT_MetaTileEntity_MagicalEnergyAbsorber mActiveSiphon = null; public static int sEnergyPerEnderCrystal = 32; - public static int sEnergyFromVis = 12800; + public static int sEnergyFromVis = 512; //really? this high? no wonder no eu was generating... (it was 12800 at the time) public static int sDragonEggEnergyPerTick = 128; public static boolean isThaumcraftLoaded; + public static boolean tLameMode = false; // if you use this... lame. public int mEfficiency; public EntityEnderCrystal mTargetedCrystal; + //public static int[] VoltageOut = {32, 128,512,2048}; // Because what the fuck even is this code. public GT_MetaTileEntity_MagicalEnergyAbsorber(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, "Feasts on magic close to it", new ITexture[0]); @@ -109,34 +112,34 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B // Energyzed node if (isThaumcraftLoaded) { try { + int multFactor = 2; + if (tLameMode){ + multFactor = 10; //Don't do this. Unless you want to be cheaty and lame. + } World tmpWorld = this.getBaseMetaTileEntity().getWorld(); int tmpX = this.getBaseMetaTileEntity().getXCoord(); - int tmpY = this.getBaseMetaTileEntity().getYCoord(); + int tmpY = this.getBaseMetaTileEntity().getYCoord() + 2; //Add 2 because +1 is the node stabiliser and +2 is the node itself int tmpZ = this.getBaseMetaTileEntity().getZCoord(); - int fire = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, Aspect.FIRE, 1000); + int fire = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, Aspect.FIRE, 1000); // all of these should be 1000 int earth = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, Aspect.EARTH, 1000); int air = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, Aspect.AIR, 1000); - int destruction = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, Aspect.ENTROPY, 1000); + int entropy = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, Aspect.ENTROPY, 1000); int order = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, Aspect.ORDER, 1000); int water = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, 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)); - int mult = 85; - if (fire > 4) - mult += 15; - if (earth > 4) - mult += 15; - if (air > 4) - mult += 15; - if (destruction > 4) - mult += 15; - if (order > 4) - mult += 15; - if (water > 4) - mult += 15; - visEU = (visEU * mult) / 100; - getBaseMetaTileEntity().increaseStoredEnergyUnits(Math.min(maxEUOutput(), visEU * getEfficiency() / this.sEnergyFromVis), false); + int visEU = (int) (Math.pow(fire, 2) + Math.pow(earth, 2) + Math.pow(air, 2) + Math.pow(entropy, 2) + Math.pow(order, 2) + Math.pow(water, 2)); + int mult = 0; //this should make it more dependant on how big your node is + mult += fire * multFactor; + mult += earth * multFactor; + mult += air * multFactor; + mult += entropy * multFactor; + mult += order * multFactor; + mult += water * multFactor; + visEU = (visEU * mult) / 100; + + getBaseMetaTileEntity().increaseStoredEnergyUnits(Math.min(maxEUOutput(), visEU * getEfficiency() / sEnergyFromVis), false); + } catch (Throwable e) { + } } // EnderCrystal From 5bfe5a55c8b0727c8f181eef712e400b48d8f88d Mon Sep 17 00:00:00 2001 From: SuperCoder79 Date: Sat, 4 Nov 2017 11:32:42 -0400 Subject: [PATCH 2/4] Clean up code --- .../GT_MetaTileEntity_MagicalEnergyAbsorber.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java index 2ae10062..72974432 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java @@ -39,13 +39,11 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B public static boolean sAllowMultipleEggs = true; public static GT_MetaTileEntity_MagicalEnergyAbsorber mActiveSiphon = null; public static int sEnergyPerEnderCrystal = 32; - public static int sEnergyFromVis = 512; //really? this high? no wonder no eu was generating... (it was 12800 at the time) + public static int sEnergyFromVis = 512; public static int sDragonEggEnergyPerTick = 128; public static boolean isThaumcraftLoaded; - public static boolean tLameMode = false; // if you use this... lame. public int mEfficiency; public EntityEnderCrystal mTargetedCrystal; - //public static int[] VoltageOut = {32, 128,512,2048}; // Because what the fuck even is this code. public GT_MetaTileEntity_MagicalEnergyAbsorber(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, "Feasts on magic close to it", new ITexture[0]); @@ -113,9 +111,6 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B if (isThaumcraftLoaded) { try { int multFactor = 2; - if (tLameMode){ - multFactor = 10; //Don't do this. Unless you want to be cheaty and lame. - } World tmpWorld = this.getBaseMetaTileEntity().getWorld(); int tmpX = this.getBaseMetaTileEntity().getXCoord(); int tmpY = this.getBaseMetaTileEntity().getYCoord() + 2; //Add 2 because +1 is the node stabiliser and +2 is the node itself @@ -297,4 +292,4 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B public int getPollution() { return 0; } -} \ No newline at end of file +} From 8c80a050ca47b8582164e44b39365836021a51cc Mon Sep 17 00:00:00 2001 From: SuperCoder79 Date: Sun, 5 Nov 2017 12:44:51 -0500 Subject: [PATCH 3/4] Fix small bug with block position --- .../generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java index 72974432..2e4fe229 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java @@ -113,7 +113,7 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B int multFactor = 2; World tmpWorld = this.getBaseMetaTileEntity().getWorld(); int tmpX = this.getBaseMetaTileEntity().getXCoord(); - int tmpY = this.getBaseMetaTileEntity().getYCoord() + 2; //Add 2 because +1 is the node stabiliser and +2 is the node itself + int tmpY = this.getBaseMetaTileEntity().getYCoord(); int tmpZ = this.getBaseMetaTileEntity().getZCoord(); int fire = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, Aspect.FIRE, 1000); // all of these should be 1000 int earth = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, Aspect.EARTH, 1000); From f17a3efb6bee4e7c0e2cc8d980c00ac12f6f1871 Mon Sep 17 00:00:00 2001 From: SuperCoder79 Date: Mon, 6 Nov 2017 08:52:18 -0500 Subject: [PATCH 4/4] Remove useless import --- .../generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java index 2e4fe229..dc56e7d3 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java @@ -1,6 +1,5 @@ package gregtech.common.tileentities.generators; -import cpw.mods.fml.common.FMLLog; import cpw.mods.fml.common.Loader; import gregtech.api.GregTech_API; import gregtech.api.enums.ConfigCategories;