From b0d3a60dca5e98d84a99ff9d7ff29dd265f9e891 Mon Sep 17 00:00:00 2001 From: Alkalus Date: Sat, 5 Aug 2017 19:14:04 +1000 Subject: % Made the RTG pre .09 compliant. % Changed the RTGs tier to HV. --- .../generators/GregtechMetaTileEntity_RTG.java | 19 ++++++++++++++----- .../gregtech/registration/gregtech/GregtechRTG.java | 2 +- 2 files changed, 15 insertions(+), 6 deletions(-) (limited to 'src/Java') diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java index 7b7e48864b..02c8b02aef 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java @@ -10,6 +10,7 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.api.util.Recipe_GT; import gregtech.common.GT_Pollution; +import gtPlusPlus.core.util.PollutionUtils; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import net.minecraft.init.Blocks; @@ -38,7 +39,7 @@ public class GregtechMetaTileEntity_RTG extends GT_MetaTileEntity_BasicGenerator this.mInventory[getStackDisplaySlot()] = null; } else { if (this.mInventory[getStackDisplaySlot()] == null) - this.mInventory[getStackDisplaySlot()] = GregtechItemList.Pellet_RTG_AM241.get(1); + this.mInventory[getStackDisplaySlot()] = new ItemStack(Blocks.fire, 1); this.mInventory[getStackDisplaySlot()].setStackDisplayName("Generating: " + (aBaseMetaTileEntity.getUniversalEnergyStored() - getMinimumStoredEU()) + " EU"); } @@ -70,10 +71,7 @@ public class GregtechMetaTileEntity_RTG extends GT_MetaTileEntity_BasicGenerator } } if ((tProducedEU > 0L) && (getPollution() > 0)) { - GT_Pollution.addPollution(getBaseMetaTileEntity().getWorld(), - new ChunkPosition(getBaseMetaTileEntity().getXCoord(), getBaseMetaTileEntity().getYCoord(), - getBaseMetaTileEntity().getZCoord()), - (int) (tProducedEU * getPollution() / 500 * this.mTier + 1L)); + PollutionUtils.addPollution(aBaseMetaTileEntity, (int) (tProducedEU * getPollution() / 500 * this.mTier + 1L)); } } @@ -166,4 +164,15 @@ public class GregtechMetaTileEntity_RTG extends GT_MetaTileEntity_BasicGenerator public int getPollution() { return 0; } + + public int getFuelValue(ItemStack aStack) { + if ((GT_Utility.isStackInvalid(aStack)) || (getRecipes() == null)) + return 0; + GT_Recipe tFuel = getRecipes().findRecipe(getBaseMetaTileEntity(), false, 9223372036854775807L, null, + new ItemStack[] { aStack }); + if (tFuel != null) + //return (int) (tFuel.mSpecialValue * 365L * getEfficiency() / 100L); + return tFuel.mEUt; + return 0; + } } \ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRTG.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRTG.java index 53350a4621..f3e2a2c5f4 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRTG.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRTG.java @@ -14,7 +14,7 @@ public class GregtechRTG { } private static void run1(){ - GregtechItemList.RTG.set(new GregtechMetaTileEntity_RTG(800, "rtg.01.tier.single", "Radioisotope Thermoelectric Generator", 0).getStackForm(1L)); + GregtechItemList.RTG.set(new GregtechMetaTileEntity_RTG(800, "rtg.01.tier.single", "Radioisotope Thermoelectric Generator", 3).getStackForm(1L)); } } -- cgit