Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Magic fix #1272

Merged
merged 6 commits into from
Nov 25, 2017
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package gregtech.common.tileentities.generators;

import cpw.mods.fml.common.FMLLog;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea how that got there

import cpw.mods.fml.common.Loader;
import gregtech.api.GregTech_API;
import gregtech.api.enums.ConfigCategories;
Expand Down Expand Up @@ -38,7 +39,7 @@ 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;
public static int sDragonEggEnergyPerTick = 128;
public static boolean isThaumcraftLoaded;
public int mEfficiency;
Expand Down Expand Up @@ -109,34 +110,31 @@ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
// Energyzed node
if (isThaumcraftLoaded) {
try {
int multFactor = 2;
World tmpWorld = this.getBaseMetaTileEntity().getWorld();
int tmpX = this.getBaseMetaTileEntity().getXCoord();
int tmpY = this.getBaseMetaTileEntity().getYCoord();
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);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the value returned from "getEfficency()" is 10000 for 100% i somehow get the feeling that the changed EnergyFromVis value does not account for that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't the getEfficiency() function return the efficiency of that block? Such as 90% for LV, 80% for MV, 70% for HV, and so on? I was trying my best to keep the old code's functionality so I just left it there like that

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking at it again is seems you are right. was working too much with the multiblocks lately to remember that single blocks work differently...

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
Expand Down Expand Up @@ -294,4 +292,4 @@ public ITexture[] getSidesActive(byte aColor) {
public int getPollution() {
return 0;
}
}
}