Merge pull request #19 from GTNewHorizons/essentiaGenFix

Essentia gen fixes
This commit is contained in:
Martin Robertz authored and GitHub committed 2021-01-10 15:17:56 +01:00
commit e4df980eac
4 files changed
+27 -20

No files matched your search

Binary file not shown.
+2 -2
View File
@@ -1,6 +1,6 @@
#Fri Nov 27 18:08:08 MSK 2015
#Sat Jan 04 01:56:22 CET 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-bin.zip
@@ -52,6 +52,8 @@ public class ConainerGenerator
if (i == 0) {
this.tileentity.generating = (((int) j) * 400);
} else if (i == 1) {
if (j == 0 || this.tileentity.fuel != j)
this.tileentity.tick = 0;
this.tileentity.fuel = ((byte) j);
} else if (i == 2) {
this.tileentity.mpshownstroage = (short) j;
@@ -96,6 +96,9 @@ public class TileEntityBaseGenerator
public void storeFuel() {
if (!side)
return;
if (this.fuel < this.maxfuel) {
for (int x = this.xCoord - 4; x < this.xCoord + 4; x++) {
for (int y = this.yCoord - 4; y < this.yCoord + 4; y++) {
@@ -116,6 +119,12 @@ public class TileEntityBaseGenerator
}
public void fillfrompipe() {
if (!side)
return;
if (this.fuel == this.maxfuel)
return;
TileEntity[] te = new TileEntity[ForgeDirection.VALID_DIRECTIONS.length];
for (int i = 0; i < ForgeDirection.VALID_DIRECTIONS.length; i++) {
te[i] = ThaumcraftApiHelper.getConnectableTile(this.worldObj, this.xCoord, this.yCoord, this.zCoord, ForgeDirection.VALID_DIRECTIONS[i]);
@@ -136,31 +145,24 @@ public class TileEntityBaseGenerator
}
public void createEnergy() {
if (!side) {
if (this.isActive && this.tick < 400) {
this.tick += 1;
}
return;
}
if (this.fuel > 0) {
if (this.storage + this.generating / 20.0D / 20.0D < this.maxstorage) {
this.isActive = true;
if (side) {
this.energySource.addEnergy(this.generating / 20.0D / 20.0D);
this.storage = ((int) this.energySource.getEnergyStored());
}
this.tick += 1;
if (this.tick == 400) {
this.fuel -= 1;
this.tick = 0;
}
} else if (this.storage == this.maxstorage) {
this.isActive = false;
} else if ((this.storage + this.generating / 20.0D / 20.0D > this.maxstorage)) {
this.isActive = true;
if (side) {
this.energySource.setEnergyStored(this.maxstorage);
this.storage = this.maxstorage;
}
this.energySource.addEnergy(this.generating / 20.0D / 20.0D);
this.storage = ((int) this.energySource.getEnergyStored());
this.tick += 1;
if (this.tick == 400) {
this.fuel -= 1;
this.tick = 0;
}
} else {
this.isActive = false;
}
} else {
@@ -300,7 +302,7 @@ public class TileEntityBaseGenerator
}
public int getSuctionAmount(ForgeDirection face) {
return 128;
return this.fuel == this.maxfuel ? 0 : 128;
}
public int takeEssentia(Aspect aspect, int amount, ForgeDirection face) {
@@ -331,6 +333,9 @@ public class TileEntityBaseGenerator
}
public void inputintoGTnet() {
if (!side)
return;
for (byte i = 0; i < 6; i = (byte) (i + 1)) {
if (getIGregTechTileEntityAtSide(i) != null) {
if (isUniversalEnergyStored(getOutputVoltage() * getOutputAmperage())) {