aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJordan Byrne <draknyte1@hotmail.com>2017-12-12 12:59:47 +1000
committerJordan Byrne <draknyte1@hotmail.com>2017-12-12 12:59:47 +1000
commit055adc23c39eb9b04f47ac0a3c71b5f7dbe7337a (patch)
treebade64077f5415cef0a8bb52808c88590982be0f /src
parent8074116a34299235b0fbfad2777b140153abe237 (diff)
downloadGT5-Unofficial-055adc23c39eb9b04f47ac0a3c71b5f7dbe7337a.tar.gz
GT5-Unofficial-055adc23c39eb9b04f47ac0a3c71b5f7dbe7337a.tar.bz2
GT5-Unofficial-055adc23c39eb9b04f47ac0a3c71b5f7dbe7337a.zip
$ Hopefully fixes #159.
$ Implemented fix to stop Wireless charging exploits. $ Fixed Casing textures on the Tree Farmer. ^ Version bump to 1.6.101-prerelease
Diffstat (limited to 'src')
-rw-r--r--src/Java/gtPlusPlus/core/handler/events/ZombieBackupSpawnEventHandler.java1
-rw-r--r--src/Java/gtPlusPlus/core/lib/CORE.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java4
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler2.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/helpers/ChargingHelper.java89
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java23
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityTreeFarm.java16
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialWashPlant.java99
-rw-r--r--src/resources/mcmod.info2
9 files changed, 127 insertions, 111 deletions
diff --git a/src/Java/gtPlusPlus/core/handler/events/ZombieBackupSpawnEventHandler.java b/src/Java/gtPlusPlus/core/handler/events/ZombieBackupSpawnEventHandler.java
index fb1617d29e..d40ed64f4d 100644
--- a/src/Java/gtPlusPlus/core/handler/events/ZombieBackupSpawnEventHandler.java
+++ b/src/Java/gtPlusPlus/core/handler/events/ZombieBackupSpawnEventHandler.java
@@ -10,7 +10,6 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import gtPlusPlus.api.analytics.SegmentHelper;
import gtPlusPlus.core.util.Utils;
import net.minecraftforge.event.entity.living.ZombieEvent;
-import net.minecraftforge.event.entity.living.ZombieEvent.SummonAidEvent;
public class ZombieBackupSpawnEventHandler {
diff --git a/src/Java/gtPlusPlus/core/lib/CORE.java b/src/Java/gtPlusPlus/core/lib/CORE.java
index 9b14e38527..c7bf277974 100644
--- a/src/Java/gtPlusPlus/core/lib/CORE.java
+++ b/src/Java/gtPlusPlus/core/lib/CORE.java
@@ -52,7 +52,7 @@ public class CORE {
public static final String name = "GT++";
public static final String MODID = "miscutils";
- public static final String VERSION = "1.6.99-release";
+ public static final String VERSION = "1.6.101-prerelease";
public static String MASTER_VERSION = NetworkUtils.getContentFromURL("https://raw.githubusercontent.com/draknyte1/GTplusplus/master/Recommended.txt").toLowerCase();
public static String USER_COUNTRY = GeoUtils.determineUsersCountry();
public static boolean isModUpToDate = Utils.isModUpToDate();
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java
index 51a2c208e6..21f7742b60 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java
@@ -34,7 +34,7 @@ extends GregtechMetaCasingBlocksAbstract {
GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", "Autocrafter Frame");
GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", "Cutting Factory Frame");
GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", "Placeholder Casing ");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", "Placeholder Casing ");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", "Casing "); //Tree Farmer Textures
GregtechItemList.Casing_ThermalCentrifuge.set(new ItemStack(this, 1, 0));
GregtechItemList.Casing_Refinery_External.set(new ItemStack(this, 1, 1));
GregtechItemList.Casing_Refinery_Structural.set(new ItemStack(this, 1, 2));
@@ -50,7 +50,7 @@ extends GregtechMetaCasingBlocksAbstract {
GregtechItemList.Casing_Autocrafter.set(new ItemStack(this, 1, 12));
GregtechItemList.Casing_CuttingFactoryFrame.set(new ItemStack(this, 1, 13));
GregtechItemList.Casing_PlaceHolder14.set(new ItemStack(this, 1, 14));
- GregtechItemList.Casing_PlaceHolder15.set(new ItemStack(this, 1, 15));
+ GregtechItemList.Casing_PlaceHolder15.set(new ItemStack(this, 1, 15)); //Tree Farmer Textures
}
@Override
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler2.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler2.java
index af9edb3e0c..d588e38dbe 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler2.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler2.java
@@ -54,7 +54,7 @@ public class CasingTextureHandler2 {
case 14:
return TexturesGtBlock._PlaceHolder.getIcon();
case 15:
- return TexturesGtBlock._PlaceHolder.getIcon();
+ return TexturesGtBlock.Casing_Machine_Farm_Manager.getIcon(); //Tree Farmer Textures
default:
return TexturesGtBlock.Overlay_UU_Matter.getIcon();
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/ChargingHelper.java b/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/ChargingHelper.java
index 6ff0536c85..35cf3d02e1 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/ChargingHelper.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/ChargingHelper.java
@@ -31,7 +31,7 @@ public class ChargingHelper {
protected static Map<BlockPos, GregtechMetaWirelessCharger> mChargerMap = new HashMap<BlockPos, GregtechMetaWirelessCharger>();
private int mTickTimer = 0;
private final int mTickMultiplier = 20;
-
+
//Called whenever the player is updated or ticked.
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void onPlayerTick(LivingUpdateEvent event) {
@@ -54,67 +54,68 @@ public class ChargingHelper {
long mEuStored = 0;
if (!mChargerMap.isEmpty() && mValidPlayers.containsKey(mPlayerMan)){
-
InventoryPlayer mPlayerInventory = mPlayerMan.inventory;
ItemStack[] mArmourContents = mPlayerInventory.armorInventory.clone();
ItemStack[] mInventoryContents = mPlayerInventory.mainInventory.clone();
for (GregtechMetaWirelessCharger mEntityTemp : mChargerMap.values()){
if (mEntityTemp != null){
- mVoltage = mEntityTemp.maxEUInput();
- mEuStored = mEntityTemp.getEUVar();
- if (mVoltage > 0 && mEuStored >= mVoltage){
+ if (mPlayerMan.getEntityWorld().provider.dimensionId == mEntityTemp.getDimensionID()){
+ mVoltage = mEntityTemp.maxEUInput();
+ mEuStored = mEntityTemp.getEUVar();
+ if (mVoltage > 0 && mEuStored >= mVoltage){
- Map<EntityPlayer, UUID> LR = mEntityTemp.getLongRangeMap();
- Map<UUID, EntityPlayer> LO = mEntityTemp.getLocalMap();
+ Map<EntityPlayer, UUID> LR = mEntityTemp.getLongRangeMap();
+ Map<UUID, EntityPlayer> LO = mEntityTemp.getLocalMap();
- long mStartingEu = mEntityTemp.getEUVar();
- long mCurrentEu = mEntityTemp.getEUVar();
- long mEuUsed = 0;
- if (mEntityTemp.getMode() == 0){
+ long mStartingEu = mEntityTemp.getEUVar();
+ long mCurrentEu = mEntityTemp.getEUVar();
+ long mEuUsed = 0;
+ if (mEntityTemp.getMode() == 0){
- /*if (!LR.isEmpty() && LR.containsKey(mPlayerMan)){
+ /*if (!LR.isEmpty() && LR.containsKey(mPlayerMan)){
mCurrentEu = chargeItems(mEntityTemp, mArmourContents, mPlayerMan);
mCurrentEu = chargeItems(mEntityTemp, mInventoryContents, mPlayerMan);
}*/
- }
- else if (mEntityTemp.getMode() == 1){
- if (!LO.isEmpty() && LO.containsValue(mPlayerMan)){
- mCurrentEu = chargeItems(mEntityTemp, mArmourContents, mPlayerMan);
- mCurrentEu = chargeItems(mEntityTemp, mInventoryContents, mPlayerMan);
- }
- }
- else {
- /*if (!LR.isEmpty() && LR.containsKey(mPlayerMan)){
- mCurrentEu = chargeItems(mEntityTemp, mArmourContents, mPlayerMan);
- mCurrentEu = chargeItems(mEntityTemp, mInventoryContents, mPlayerMan);
- }*/
- if (!LO.isEmpty() && LO.containsValue(mPlayerMan)){
- mCurrentEu = chargeItems(mEntityTemp, mArmourContents, mPlayerMan);
- mCurrentEu = chargeItems(mEntityTemp, mInventoryContents, mPlayerMan);
- }
- }
-
- if ((mEuUsed = (mStartingEu - mCurrentEu)) <= 0 && mEntityTemp != null){
- long mMaxDistance;
- if (mEntityTemp.getMode() == 0){
- mMaxDistance = (4*GT_Values.V[mEntityTemp.getTier()]);
}
else if (mEntityTemp.getMode() == 1){
- mMaxDistance = (mEntityTemp.getTier()*10);
+ if (!LO.isEmpty() && LO.containsValue(mPlayerMan)){
+ mCurrentEu = chargeItems(mEntityTemp, mArmourContents, mPlayerMan);
+ mCurrentEu = chargeItems(mEntityTemp, mInventoryContents, mPlayerMan);
+ }
}
else {
- mMaxDistance = (4*GT_Values.V[mEntityTemp.getTier()]/2);
- }
- double mDistance = calculateDistance(mEntityTemp, mPlayerMan);
- long mVoltageCost = MathUtils.findPercentageOfInt(mMaxDistance, (float) mDistance);
+ /*if (!LR.isEmpty() && LR.containsKey(mPlayerMan)){
+ mCurrentEu = chargeItems(mEntityTemp, mArmourContents, mPlayerMan);
+ mCurrentEu = chargeItems(mEntityTemp, mInventoryContents, mPlayerMan);
+ }*/
+ if (!LO.isEmpty() && LO.containsValue(mPlayerMan)){
+ mCurrentEu = chargeItems(mEntityTemp, mArmourContents, mPlayerMan);
+ mCurrentEu = chargeItems(mEntityTemp, mInventoryContents, mPlayerMan);
+ }
+ }
- if (mVoltageCost > 0){
- if (mVoltageCost > mEntityTemp.maxEUInput()){
- mEntityTemp.setEUVar((mEntityTemp.getEUVar()-mEntityTemp.maxEUInput()));
+ if ((mEuUsed = (mStartingEu - mCurrentEu)) <= 0 && mEntityTemp != null){
+ long mMaxDistance;
+ if (mEntityTemp.getMode() == 0){
+ mMaxDistance = (4*GT_Values.V[mEntityTemp.getTier()]);
+ }
+ else if (mEntityTemp.getMode() == 1){
+ mMaxDistance = (mEntityTemp.getTier()*10);
}
else {
- mEntityTemp.setEUVar((mEntityTemp.getEUVar()-mVoltageCost));
+ mMaxDistance = (4*GT_Values.V[mEntityTemp.getTier()]/2);
+ }
+ double mDistance = calculateDistance(mEntityTemp, mPlayerMan);
+ long mVoltageCost = MathUtils.findPercentageOfInt(mMaxDistance, (float) mDistance);
+
+ if (mVoltageCost > 0){
+ if (mVoltageCost > mEntityTemp.maxEUInput()){
+ mEntityTemp.setEUVar((mEntityTemp.getEUVar()-mEntityTemp.maxEUInput()));
+ }
+ else {
+ mEntityTemp.setEUVar((mEntityTemp.getEUVar()-mVoltageCost));
+ }
}
}
}
@@ -128,7 +129,7 @@ public class ChargingHelper {
}
}
}
-
+
catch (Throwable t){
//Utils.LOG_WARNING("State of Wireless Charger changed in an invalid way, this prevented a crash.");
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java
index 7f2accdd00..7f70712ee9 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java
@@ -23,10 +23,13 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.world.World;
public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity {
private boolean mHasBeenMapped = false;
+ private int mCurrentDimension = 0;
+ public int mMode = 0;
public GregtechMetaWirelessCharger(final int aID, final String aName, final String aNameRegional, final int aTier, final String aDescription, final int aSlotCount) {
super(aID, aName, aNameRegional, aTier, aSlotCount, aDescription);
@@ -57,6 +60,10 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity {
public int getMode(){
return this.mMode;
}
+
+ public int getDimensionID(){
+ return this.mCurrentDimension;
+ }
public Map<UUID, EntityPlayer> getLocalMap(){
return this.mLocalChargingMap;
@@ -143,7 +150,7 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity {
public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
mWirelessChargingMap.clear();
mLocalChargingMap.clear();
-
+
if (!this.getBaseMetaTileEntity().getWorld().playerEntities.isEmpty()){
for (Object mTempPlayer : this.getBaseMetaTileEntity().getWorld().playerEntities){
if (mTempPlayer instanceof EntityPlayer || mTempPlayer instanceof EntityPlayerMP){
@@ -152,7 +159,7 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity {
}
}
}
-
+
if (this.mMode >= 2){
this.mMode = 0;
}
@@ -237,8 +244,6 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity {
return true;
}
- public int mMode = 0;
-
@Override
public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
return false;
@@ -345,11 +350,13 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity {
@Override
public void saveNBTData(final NBTTagCompound aNBT) {
aNBT.setInteger("mMode", this.mMode);
+ aNBT.setInteger("mCurrentDimension", this.mCurrentDimension);
}
@Override
public void loadNBTData(final NBTTagCompound aNBT) {
this.mMode = aNBT.getInteger("mMode");
+ this.mCurrentDimension = aNBT.getInteger("mCurrentDimension");
}
@Override
@@ -368,6 +375,10 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity {
super.onPostTick(aBaseMetaTileEntity, aTick);
if (this.getBaseMetaTileEntity().isServerSide()) {
+ if (this.mCurrentDimension != aBaseMetaTileEntity.getWorld().provider.dimensionId){
+ this.mCurrentDimension = aBaseMetaTileEntity.getWorld().provider.dimensionId;
+ }
+
if (!mHasBeenMapped && ChargingHelper.addEntry(getTileEntityPosition(), this)){
mHasBeenMapped = true;
}
@@ -450,9 +461,9 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity {
@Override
public void onRemoval() {
-
+
ChargingHelper.removeEntry(getTileEntityPosition(), this);
-
+
mWirelessChargingMap.clear();
mLocalChargingMap.clear();
if (!this.getBaseMetaTileEntity().getWorld().playerEntities.isEmpty()){
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityTreeFarm.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityTreeFarm.java
index d8b5e16b7c..eccc96c253 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityTreeFarm.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityTreeFarm.java
@@ -10,7 +10,7 @@ import forestry.core.utils.GeneticsUtil;
import forestry.plugins.PluginManager;
import gregtech.api.GregTech_API;
import gregtech.api.enums.OrePrefixes;
-import gregtech.api.interfaces.IDamagableItem;
+import gregtech.api.enums.TAE;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.items.GT_MetaGenerated_Tool;
@@ -38,7 +38,6 @@ import gtPlusPlus.xmod.gregtech.api.gui.GUI_TreeFarmer;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import gtPlusPlus.xmod.gregtech.common.helpers.TreeFarmHelper;
import net.minecraft.block.Block;
-import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.player.InventoryPlayer;
@@ -49,8 +48,6 @@ import net.minecraft.server.MinecraftServer;
import net.minecraft.world.World;
import net.minecraftforge.fluids.FluidStack;
-import java.util.ArrayList;
-
public class GregtechMetaTileEntityTreeFarm extends GT_MetaTileEntity_MultiBlockBase {
/* private */ private int treeCheckTicks = 0;
@@ -58,6 +55,7 @@ public class GregtechMetaTileEntityTreeFarm extends GT_MetaTileEntity_MultiBlock
/* private */ private int cleanupTicks = 0;
/* private */ public long mInternalPower = 0;
/* private */ private static int powerDrain = 32;
+ public final static int TEX_INDEX = 31;
private short energyHatchRetryCount = 0;
@@ -87,6 +85,11 @@ public class GregtechMetaTileEntityTreeFarm extends GT_MetaTileEntity_MultiBlock
"Dark Purple: Dirt/Grass/Podzol/Humus",
"Light Blue: Fence/Fence Gate",
"Blue/Yellow: Controller",
+ "1x Input Bus (anywhere)",
+ "1x Output Bus (anywhere)",
+ "1x Input Hatch (anywhere)",
+ "1x Energy Hatch (anywhere)",
+ "1x Maintenance Hatch (anywhere)",
CORE.GT_Tooltip
};
}
@@ -309,7 +312,7 @@ public class GregtechMetaTileEntityTreeFarm extends GT_MetaTileEntity_MultiBlock
}
//Deal with Bottom edges (Add Hatches/Busses first, othercheck make sure it's dirt) //TODO change the casings to not dirt~?
else if (h == 0) {
- if ((!this.addMaintenanceToMachineList(tTileEntity, 77)) && (!this.addInputToMachineList(tTileEntity, 77)) && (!this.addOutputToMachineList(tTileEntity, 77)) && (!this.addEnergyInputToMachineList(tTileEntity, 77))) {
+ if ((!this.addMaintenanceToMachineList(tTileEntity, TAE.GTPP_INDEX(TEX_INDEX))) && (!this.addInputToMachineList(tTileEntity, TAE.GTPP_INDEX(TEX_INDEX))) && (!this.addOutputToMachineList(tTileEntity, TAE.GTPP_INDEX(TEX_INDEX))) && (!this.addEnergyInputToMachineList(tTileEntity, TAE.GTPP_INDEX(TEX_INDEX)))) {
if (((xDir + i) != 0) || ((zDir + j) != 0)) {//no controller
if (tTileEntity.getMetaTileID() != 752) {
@@ -416,9 +419,6 @@ public class GregtechMetaTileEntityTreeFarm extends GT_MetaTileEntity_MultiBlock
return false;
}
-
-
- @SuppressWarnings("unused")
private boolean findLogs(final IGregTechTileEntity aBaseMetaTileEntity){
Utils.LOG_MACHINE_INFO("called findLogs()");
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialWashPlant.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialWashPlant.java
index 3309010054..c6d82cf512 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialWashPlant.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialWashPlant.java
@@ -90,57 +90,62 @@ extends GregtechMeta_MultiBlockBase {
ArrayList<ItemStack> tInputList = getStoredInputs();
ArrayList<FluidStack> tFluidInputs = getStoredFluids();
for (ItemStack tInput : tInputList) {
- long tVoltage = getMaxInputVoltage();
- byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
- GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sOreWasherRecipes.findRecipe(getBaseMetaTileEntity(), this.mLastRecipe, false, gregtech.api.enums.GT_Values.V[tTier], tFluidInputs.isEmpty() ? null : new FluidStack[]{tFluidInputs.get(0)}, new ItemStack[]{tInput});
- if ((tRecipe == null && !mRunningOnLoad)) {
- this.mLastRecipe = null;
- return false;
- }
+ if (tInput.stackSize >= 2){
+
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sOreWasherRecipes.findRecipe(getBaseMetaTileEntity(), this.mLastRecipe, false, gregtech.api.enums.GT_Values.V[tTier], tFluidInputs.isEmpty() ? null : new FluidStack[]{tFluidInputs.get(0)}, new ItemStack[]{tInput});
- if (tRecipe != null) {
- FluidStack[] mFluidInputList = new FluidStack[tFluidInputs.size()];
- int tri = 0;
- for (FluidStack f : tFluidInputs){
- mFluidInputList[tri] = f;
- tri++;
+ if ((tRecipe == null && !mRunningOnLoad)) {
+ this.mLastRecipe = null;
+ return false;
}
- if (tRecipe.isRecipeInputEqual(true, mFluidInputList, tInput)) {
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
- this.mEUt = tRecipe.mEUt;
-
- if (tRecipe.mEUt <= 16) {
- this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
- this.mMaxProgresstime = (tRecipe.mDuration / (1 << tTier - 1));
- } else {
+
+ if (tRecipe != null) {
+ FluidStack[] mFluidInputList = new FluidStack[tFluidInputs.size()];
+ int tri = 0;
+ for (FluidStack f : tFluidInputs){
+ mFluidInputList[tri] = f;
+ tri++;
+ }
+ if (tRecipe.isRecipeInputEqual(true, mFluidInputList, tInput)) {
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
this.mEUt = tRecipe.mEUt;
- this.mMaxProgresstime = tRecipe.mDuration;
- while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
- this.mEUt *= 4;
- this.mMaxProgresstime /= 2;
+
+ if (tRecipe.mEUt <= 16) {
+ this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = (tRecipe.mDuration / (1 << tTier - 1));
+ } else {
+ this.mEUt = tRecipe.mEUt;
+ this.mMaxProgresstime = tRecipe.mDuration;
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= 2;
+ }
+ }
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+
+ if (mRunningOnLoad || tRecipe.isRecipeInputEqual(true, mFluidInputList, new ItemStack[]{tInput})) {
+ Utils.LOG_WARNING("Recipe Complete.");
+ this.mLastRecipe = tRecipe;
+ this.mEUt = MathUtils.findPercentageOfInt(this.mLastRecipe.mEUt, 80);
+ this.mMaxProgresstime = MathUtils.findPercentageOfInt(this.mLastRecipe.mDuration, 20);
+ this.mEfficiencyIncrease = 10000;
+ this.addOutput(tRecipe.getOutput(0));
+ this.addOutput(tRecipe.getOutput(0));
+ this.addOutput(tRecipe.getOutput(1));
+ this.addOutput(tRecipe.getOutput(1));
+ mRunningOnLoad = false;
+ this.updateSlots();
+ return true;
}
- }
- if (this.mEUt > 0) {
- this.mEUt = (-this.mEUt);
- }
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
- if (mRunningOnLoad || tRecipe.isRecipeInputEqual(true, mFluidInputList, new ItemStack[]{tInput})) {
- Utils.LOG_INFO("Recipe Complete.");
- this.mLastRecipe = tRecipe;
- this.mEUt = MathUtils.findPercentageOfInt(this.mLastRecipe.mEUt, 80);
- this.mMaxProgresstime = MathUtils.findPercentageOfInt(this.mLastRecipe.mDuration, 20);
- this.mEfficiencyIncrease = 10000;
- this.addOutput(tRecipe.getOutput(0));
- this.addOutput(tRecipe.getOutput(0));
- this.addOutput(tRecipe.getOutput(1));
- this.addOutput(tRecipe.getOutput(1));
- mRunningOnLoad = false;
- return true;
}
-
}
}
}
@@ -329,7 +334,7 @@ extends GregtechMeta_MultiBlockBase {
for (FluidStack stored : this.getStoredFluids()){
if (stored.isFluidEqual(FluidUtils.getFluidStack("water", 1))){
if (stored.amount >= 1000){
- //Utils.LOG_INFO("Going to try swap an air block for water from inut bus.");
+ //Utils.LOG_WARNING("Going to try swap an air block for water from inut bus.");
stored.amount -= 1000;
Block fluidUsed = null;
if (tBlock == Blocks.air || tBlock == Blocks.flowing_water){
@@ -349,12 +354,12 @@ extends GregtechMeta_MultiBlockBase {
}
if (tBlock == Blocks.water){
++tAmount;
- //Utils.LOG_INFO("Found Water");
+ //Utils.LOG_WARNING("Found Water");
}
else if (tBlock == BlocksItems.getFluidBlock(InternalName.fluidDistilledWater)){
++tAmount;
++tAmount;
- //Utils.LOG_INFO("Found Distilled Water");
+ //Utils.LOG_WARNING("Found Distilled Water");
}
}
else {
diff --git a/src/resources/mcmod.info b/src/resources/mcmod.info
index 4f69478763..0c16205538 100644
--- a/src/resources/mcmod.info
+++ b/src/resources/mcmod.info
@@ -5,7 +5,7 @@
"description": "Adds a few various Multiblocks, Machines, etc to Gregtech and a plethora of other mods (Nearly 30!)",
"credits": "",
"logoFile": "",
- "version": "1.6.99-release",
+ "version": "1.6.101-prerelease",
"mcversion": "1.7.10",
"url": "https://github.com/draknyte1/GTplusplus/wiki",
"updateUrl": "https://github.com/draknyte1/GTplusplus/releases/latest",