aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus
diff options
context:
space:
mode:
Diffstat (limited to 'src/Java/gtPlusPlus')
-rw-r--r--src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java6
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java1950
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCentrifuge.java72
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCokeOven.java40
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCuttingMachine.java45
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialElectrolyzer.java58
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialExtruder.java30
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMacerator.java6
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMixer.java12
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java38
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialPlatePress.java46
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSifter.java77
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialThermalCentrifuge.java9
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialVacuumFreezer.java76
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWashPlant.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWireMill.java37
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java49
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Implosion.java48
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_AutoCrafter.java76
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java47
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java48
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java13
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_AlloyBlastSmelter.java63
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java7
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java23
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java117
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_SolarTower.java1
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_MultiTank.java9
28 files changed, 1462 insertions, 1543 deletions
diff --git a/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java
index dd07e2cf8d..90bb90f6d0 100644
--- a/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java
+++ b/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java
@@ -814,10 +814,10 @@ public class ItemUtils {
if (mLocaleCache.get(mCacheKey).toLowerCase().contains(".name")) {
mLocaleCache.remove(mCacheKey);
String mNew = ItemUtils.simpleMetaStack(block, meta, 1).getDisplayName();
- Logger.INFO("Re-caching "+mNew+" into locale cache.");
+ //Logger.INFO("Re-caching "+mNew+" into locale cache.");
mLocaleCache.put(mCacheKey, mNew);
}
- Logger.INFO("Returning Cached Value.");
+ //Logger.INFO("Returning Cached Value.");
return mLocaleCache.get(mCacheKey);
} else {
Item item = Item.getItemFromBlock(block);
@@ -830,7 +830,7 @@ public class ItemUtils {
blockName = ItemUtils.simpleMetaStack(block, meta, 1).getDisplayName();
}
mLocaleCache.put(mCacheKey, blockName);
- Logger.INFO("Cached New Value.");
+ //Logger.INFO("Cached New Value.");
return blockName;
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
index c288fac496..81f6e9281b 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
@@ -51,6 +51,7 @@ import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEn
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBattery;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBattery;
import gtPlusPlus.xmod.gregtech.api.objects.MultiblockRequirements;
+import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.IInventory;
@@ -225,11 +226,11 @@ GT_MetaTileEntity_MultiBlockBase {
" "+StatCollector.translateToLocal("GTPP.multiblock.efficiency")+": "+
EnumChatFormatting.YELLOW+Float.toString(mEfficiency / 100.0F)+EnumChatFormatting.RESET + " %");
-
+
mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.pollution")+": "+ EnumChatFormatting.RED + this.getPollutionPerTick(null)*20+ EnumChatFormatting.RESET+"/sec");
mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.pollutionreduced")+": "+ EnumChatFormatting.GREEN + mPollutionReduction+ EnumChatFormatting.RESET+" %");
-
+
mInfo.add(StatCollector.translateToLocal("GTPP.CC.machinetier")+": "+
EnumChatFormatting.GREEN+tTier+EnumChatFormatting.RESET);
@@ -244,901 +245,927 @@ GT_MetaTileEntity_MultiBlockBase {
mInfo.add("Total Time in ticks: " + EnumChatFormatting.DARK_GREEN + Long.toString(this.mTotalRunTime));
- String[] mInfo2 = new String[mInfo.size()];
- mInfo.toArray(mInfo2);
- return mInfo2;
+ String[] mInfo2 = new String[mInfo.size()];
+ mInfo.toArray(mInfo2);
+ return mInfo2;
-}
+ }
-@Override
-public boolean isGivingInformation() {
- return true;
-}
+ @Override
+ public boolean isGivingInformation() {
+ return true;
+ }
-private String[] aCachedToolTip;
-
-@Override
-public final String[] getDescription() {
- if (aCachedToolTip != null) {
- return aCachedToolTip;
- }
- String[] x = getTooltip();
- //Add Stock Tooltip to bottom of list
- String[] z;
- if (getPollutionPerTick(null) > 0) {
- z = new String[] {
- getPollutionTooltip(),
- getMachineTooltip(),
- CORE.GT_Tooltip};
- }
- else {
- z = new String[] {
- getMachineTooltip(),
- CORE.GT_Tooltip};
- }
-
- int a2, a3;
- a2 = x != null ? x.length : 0;
- a3 = z != null ? z.length : 0;
- String[] aToolTip = new String[(a2 + a3)];
- aToolTip = ArrayUtils.addAll(aToolTip, x);
- aToolTip = ArrayUtils.addAll(aToolTip, z);
- aCachedToolTip = aToolTip;
- return aToolTip;
-}
+ private String[] aCachedToolTip;
-public abstract String[] getTooltip();
+ /*private final String aRequiresMuffler = "1x Muffler Hatch";
+ private final String aRequiresCoreModule = "1x Core Module";
+ private final String aRequiresMaint = "1x Maintanence Hatch";*/
-public synchronized final MultiblockRequirements getRequirements() {
- return mRequirements;
-}
+ @Override
+ public final String[] getDescription() {
+ /*if (aCachedToolTip != null) {
+ boolean uuuu = false;
+ for (String s : aCachedToolTip) {
+ if (s.toLowerCase().contains(".")) {
+ uuuu = true;
+ break;
+ }
+ }
+ if (!uuuu) {
+ return aCachedToolTip;
+ }
+ else {
+ aCachedToolTip = null;
+ }
+ }*/
+
+ String aRequiresMuffler = "1x Muffler Hatch";
+ String aRequiresCoreModule = "1x Core Module";
+ String aRequiresMaint = "1x Maintanence Hatch";
+
+ String[] x = getTooltip();
+ //Add Stock Tooltip to bottom of list
+ String[] z;
+ if (getPollutionPerTick(null) > 0) {
+ z = new String[] {
+ aRequiresMaint,
+ aRequiresCoreModule,
+ aRequiresMuffler,
+ getPollutionTooltip(),
+ getMachineTooltip(),
+ CORE.GT_Tooltip};
+ }
+ else {
+ z = new String[] {
+ aRequiresMaint,
+ aRequiresCoreModule,
+ getMachineTooltip(),
+ CORE.GT_Tooltip};
+ }
-//public abstract MultiblockRequirements setRequirements();
+ int a2, a3;
+ a2 = x != null ? x.length : 0;
+ a3 = z != null ? z.length : 0;
+ String[] aToolTip = new String[(a2 + a3)];
+ aToolTip = ArrayUtils.addAll(aToolTip, x);
+ aToolTip = ArrayUtils.addAll(aToolTip, z);
+ aCachedToolTip = aToolTip;
+ return aToolTip;
+ }
-public synchronized final void setRequirementsInternal() {
- //this.mRequirements = setRequirements();
- this.mRequirements = null;
-}
+ public abstract String[] getTooltip();
-public int getAmountOfOutputs() {
- return 1;
-}
+ public synchronized final MultiblockRequirements getRequirements() {
+ return mRequirements;
+ }
-public abstract int getMaxParallelRecipes();
-public abstract int getEuDiscountForParallelism();
+ //public abstract MultiblockRequirements setRequirements();
-@Override
-public boolean isCorrectMachinePart(final ItemStack paramItemStack) {
- return true;
-}
+ public synchronized final void setRequirementsInternal() {
+ //this.mRequirements = setRequirements();
+ this.mRequirements = null;
+ }
-@Override
-public int getDamageToComponent(final ItemStack paramItemStack) {
- return 0;
-}
+ public int getAmountOfOutputs() {
+ return 1;
+ }
-@Override
-public boolean explodesOnComponentBreak(ItemStack p0) {
- return false;
-}
+ public abstract int getMaxParallelRecipes();
+ public abstract int getEuDiscountForParallelism();
-@Override
-public void startSoundLoop(final byte aIndex, final double aX, final double aY, final double aZ) {
- super.startSoundLoop(aIndex, aX, aY, aZ);
- if (aIndex == 1) {
- GT_Utility.doSoundAtClient(getSound(), 10, 1.0F, aX, aY, aZ);
+ @Override
+ public boolean isCorrectMachinePart(final ItemStack paramItemStack) {
+ return true;
}
-}
-public void startProcess() {
- if(GT_Utility.isStringValid(getSound())) this.sendLoopStart((byte) 1);
-}
+ @Override
+ public int getDamageToComponent(final ItemStack paramItemStack) {
+ return 0;
+ }
-public String getSound() { return ""; }
+ @Override
+ public boolean explodesOnComponentBreak(ItemStack p0) {
+ return false;
+ }
-public boolean canBufferOutputs(final GT_Recipe aRecipe, int aParallelRecipes) {
- if (aRecipe.mOutputs.length > 16) {
- // Gendustry custom comb with a billion centrifuge outputs? Do it anyway.
- return true;
+ @Override
+ public void startSoundLoop(final byte aIndex, final double aX, final double aY, final double aZ) {
+ super.startSoundLoop(aIndex, aX, aY, aZ);
+ if (aIndex == 1) {
+ GT_Utility.doSoundAtClient(getSound(), 10, 1.0F, aX, aY, aZ);
+ }
+ }
+
+ public void startProcess() {
+ if(GT_Utility.isStringValid(getSound())) this.sendLoopStart((byte) 1);
}
- // Count slots available in output buses
- ArrayList<ItemStack> tBusStacks = new ArrayList<>();
+ public String getSound() { return ""; }
- int tEmptySlots = 0;
- for (final GT_MetaTileEntity_Hatch_OutputBus tBus : this.mOutputBusses) {
- if (!isValidMetaTileEntity(tBus)) {
- continue;
+ public boolean canBufferOutputs(final GT_Recipe aRecipe, int aParallelRecipes) {
+ if (aRecipe.mOutputs.length > 16) {
+ // Gendustry custom comb with a billion centrifuge outputs? Do it anyway.
+ return true;
}
- final IInventory tBusInv = tBus.getBaseMetaTileEntity();
- for (int i = 0; i < tBusInv.getSizeInventory(); i++) {
- if (tBus.getStackInSlot(i) == null) {
- tEmptySlots++;
+
+ // Count slots available in output buses
+ ArrayList<ItemStack> tBusStacks = new ArrayList<>();
+
+ int tEmptySlots = 0;
+ for (final GT_MetaTileEntity_Hatch_OutputBus tBus : this.mOutputBusses) {
+ if (!isValidMetaTileEntity(tBus)) {
+ continue;
}
- else {
- tBusStacks.add(tBus.getStackInSlot(i));
+ final IInventory tBusInv = tBus.getBaseMetaTileEntity();
+ for (int i = 0; i < tBusInv.getSizeInventory(); i++) {
+ if (tBus.getStackInSlot(i) == null) {
+ tEmptySlots++;
+ }
+ else {
+ tBusStacks.add(tBus.getStackInSlot(i));
+ }
}
}
- }
- int slotsNeeded = aRecipe.mOutputs.length;
- for (final ItemStack tRecipeOutput: aRecipe.mOutputs) {
- if (tRecipeOutput == null) continue;
- int amount = tRecipeOutput.stackSize * aParallelRecipes;
- for (final ItemStack tBusStack : tBusStacks) {
- if (GT_Utility.areStacksEqual(tBusStack, tRecipeOutput)) {
- if (tBusStack.stackSize + amount <= tBusStack.getMaxStackSize()) {
- slotsNeeded--;
- break;
+ int slotsNeeded = aRecipe.mOutputs.length;
+ for (final ItemStack tRecipeOutput: aRecipe.mOutputs) {
+ if (tRecipeOutput == null) continue;
+ int amount = tRecipeOutput.stackSize * aParallelRecipes;
+ for (final ItemStack tBusStack : tBusStacks) {
+ if (GT_Utility.areStacksEqual(tBusStack, tRecipeOutput)) {
+ if (tBusStack.stackSize + amount <= tBusStack.getMaxStackSize()) {
+ slotsNeeded--;
+ break;
+ }
}
}
}
- }
- // Enough open slots?
- if (tEmptySlots < slotsNeeded) return false;
-
- // For each output fluid, make sure an output hatch can accept it.
- for (FluidStack tRecipeFluid: aRecipe.mFluidOutputs) {
- if (tRecipeFluid == null) continue;
- boolean tCanBufferFluid = false;
- int tRecipeAmount = tRecipeFluid.amount;
- for (final GT_MetaTileEntity_Hatch_Output tHatch : this.mOutputHatches) {
- FluidStack tHatchFluid = tHatch.getFluid();
- if (tHatchFluid == null) {
- if(tHatch.getCapacity() > tRecipeAmount) {
+ // Enough open slots?
+ if (tEmptySlots < slotsNeeded) return false;
+
+ // For each output fluid, make sure an output hatch can accept it.
+ for (FluidStack tRecipeFluid: aRecipe.mFluidOutputs) {
+ if (tRecipeFluid == null) continue;
+ boolean tCanBufferFluid = false;
+ int tRecipeAmount = tRecipeFluid.amount;
+ for (final GT_MetaTileEntity_Hatch_Output tHatch : this.mOutputHatches) {
+ FluidStack tHatchFluid = tHatch.getFluid();
+ if (tHatchFluid == null) {
+ if(tHatch.getCapacity() > tRecipeAmount) {
+ tCanBufferFluid = true;
+ break;
+ }
+ }
+ else if (tHatchFluid.isFluidEqual(tRecipeFluid) && tHatch.getCapacity() - tHatchFluid.amount > tRecipeAmount) {
tCanBufferFluid = true;
break;
}
}
- else if (tHatchFluid.isFluidEqual(tRecipeFluid) && tHatch.getCapacity() - tHatchFluid.amount > tRecipeAmount) {
- tCanBufferFluid = true;
- break;
- }
+ if (!tCanBufferFluid) return false;
}
- if (!tCanBufferFluid) return false;
+ return true;
}
- return true;
-}
-/**
- * A Static {@link Method} object which holds the current status of logging.
- */
-public static Method aLogger = null;
+ /**
+ * A Static {@link Method} object which holds the current status of logging.
+ */
+ public static Method aLogger = null;
-public void log(String s) {
- boolean isDebugLogging = CORE.DEBUG;
- boolean reset = false;
- if (aLogger == null || reset) {
- if (isDebugLogging) {
- try {
- aLogger = Logger.class.getMethod("INFO", String.class);
- } catch (NoSuchMethodException | SecurityException e) {}
- }
- else {
- try {
- aLogger = Logger.class.getMethod("MACHINE_INFO", String.class);
- } catch (NoSuchMethodException | SecurityException e) {}
+ public void log(String s) {
+ boolean isDebugLogging = CORE.DEBUG;
+ boolean reset = false;
+ if (aLogger == null || reset) {
+ if (isDebugLogging) {
+ try {
+ aLogger = Logger.class.getMethod("INFO", String.class);
+ } catch (NoSuchMethodException | SecurityException e) {}
+ }
+ else {
+ try {
+ aLogger = Logger.class.getMethod("MACHINE_INFO", String.class);
+ } catch (NoSuchMethodException | SecurityException e) {}
+ }
}
- }
- try {
- aLogger.invoke(null, s);
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {}
+ try {
+ aLogger.invoke(null, s);
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {}
-}
-
-public boolean checkRecipeGeneric() {
- return checkRecipeGeneric(1, 100, 0);
-}
+ }
-public boolean checkRecipeGeneric(int aMaxParallelRecipes, int aEUPercent, int aSpeedBonusPercent) {
- return checkRecipeGeneric(aMaxParallelRecipes, aEUPercent, aSpeedBonusPercent, 10000);
-}
+ public boolean checkRecipeGeneric() {
+ return checkRecipeGeneric(1, 100, 0);
+ }
-public boolean checkRecipeGeneric(int aMaxParallelRecipes, int aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll) {
- ArrayList<ItemStack> tItems = getStoredInputs();
- ArrayList<FluidStack> tFluids = getStoredFluids();
- ItemStack[] tItemInputs = tItems.toArray(new ItemStack[tItems.size()]);
- FluidStack[] tFluidInputs = tFluids.toArray(new FluidStack[tFluids.size()]);
- return checkRecipeGeneric(tItemInputs, tFluidInputs, aMaxParallelRecipes, aEUPercent, aSpeedBonusPercent, aOutputChanceRoll);
-}
+ public boolean checkRecipeGeneric(int aMaxParallelRecipes, int aEUPercent, int aSpeedBonusPercent) {
+ return checkRecipeGeneric(aMaxParallelRecipes, aEUPercent, aSpeedBonusPercent, 10000);
+ }
+ public boolean checkRecipeGeneric(int aMaxParallelRecipes, int aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll) {
+ ArrayList<ItemStack> tItems = getStoredInputs();
+ ArrayList<FluidStack> tFluids = getStoredFluids();
+ ItemStack[] tItemInputs = tItems.toArray(new ItemStack[tItems.size()]);
+ FluidStack[] tFluidInputs = tFluids.toArray(new FluidStack[tFluids.size()]);
+ return checkRecipeGeneric(tItemInputs, tFluidInputs, aMaxParallelRecipes, aEUPercent, aSpeedBonusPercent, aOutputChanceRoll);
+ }
-public boolean checkRecipeGeneric(GT_Recipe aRecipe,
- int aMaxParallelRecipes, int aEUPercent,
- int aSpeedBonusPercent, int aOutputChanceRoll) {
- if (aRecipe == null) {
- return false;
- }
- ArrayList<ItemStack> tItems = getStoredInputs();
- ArrayList<FluidStack> tFluids = getStoredFluids();
- ItemStack[] tItemInputs = tItems.toArray(new ItemStack[tItems.size()]);
- FluidStack[] tFluidInputs = tFluids.toArray(new FluidStack[tFluids.size()]);
- return checkRecipeGeneric(tItemInputs, tFluidInputs, aMaxParallelRecipes, aEUPercent, aSpeedBonusPercent, aOutputChanceRoll, aRecipe);
-}
-public boolean checkRecipeGeneric(
- ItemStack[] aItemInputs, FluidStack[] aFluidInputs,
- int aMaxParallelRecipes, int aEUPercent,
- int aSpeedBonusPercent, int aOutputChanceRoll) {
- return checkRecipeGeneric(aItemInputs, aFluidInputs, aMaxParallelRecipes, aEUPercent, aSpeedBonusPercent, aOutputChanceRoll, null);
-}
+ public boolean checkRecipeGeneric(GT_Recipe aRecipe,
+ int aMaxParallelRecipes, int aEUPercent,
+ int aSpeedBonusPercent, int aOutputChanceRoll) {
+ if (aRecipe == null) {
+ return false;
+ }
+ ArrayList<ItemStack> tItems = getStoredInputs();
+ ArrayList<FluidStack> tFluids = getStoredFluids();
+ ItemStack[] tItemInputs = tItems.toArray(new ItemStack[tItems.size()]);
+ FluidStack[] tFluidInputs = tFluids.toArray(new FluidStack[tFluids.size()]);
+ return checkRecipeGeneric(tItemInputs, tFluidInputs, aMaxParallelRecipes, aEUPercent, aSpeedBonusPercent, aOutputChanceRoll, aRecipe);
+ }
+ public boolean checkRecipeGeneric(
+ ItemStack[] aItemInputs, FluidStack[] aFluidInputs,
+ int aMaxParallelRecipes, int aEUPercent,
+ int aSpeedBonusPercent, int aOutputChanceRoll) {
+ return checkRecipeGeneric(aItemInputs, aFluidInputs, aMaxParallelRecipes, aEUPercent, aSpeedBonusPercent, aOutputChanceRoll, null);
+ }
-public boolean checkRecipeGeneric(
- ItemStack[] aItemInputs, FluidStack[] aFluidInputs,
- int aMaxParallelRecipes, int aEUPercent,
- int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) {
- // Based on the Processing Array. A bit overkill, but very flexible.
+ public boolean checkRecipeGeneric(
+ ItemStack[] aItemInputs, FluidStack[] aFluidInputs,
+ int aMaxParallelRecipes, int aEUPercent,
+ int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) {
+ // Based on the Processing Array. A bit overkill, but very flexible.
- //Control Core to control the Multiblocks behaviour.
- int aControlCoreTier = getControlCoreTier();
- //If no core, return false;
- if (aControlCoreTier == 0) {
- log("No control core found.");
- return false;
- }
+ //Control Core to control the Multiblocks behaviour.
+ int aControlCoreTier = getControlCoreTier();
+ //If no core, return false;
+ if (aControlCoreTier == 0) {
+ log("No control core found.");
+ return false;
+ }
- // Reset outputs and progress stats
- this.mEUt = 0;
- this.mMaxProgresstime = 0;
- this.mOutputItems = new ItemStack[]{};
- this.mOutputFluids = new FluidStack[]{};
- long tVoltage = getMaxInputVoltage();
- byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
- log("Running checkRecipeGeneric(0)");
+ // Reset outputs and progress stats
+ this.mEUt = 0;
+ this.mMaxProgresstime = 0;
+ this.mOutputItems = new ItemStack[]{};
+ this.mOutputFluids = new FluidStack[]{};
- //Check to see if Voltage Tier > Control Core Tier
- if (tTier > aControlCoreTier) {
- log("Control core found is lower tier than power tier.");
- return false;
- }
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ log("Running checkRecipeGeneric(0)");
+ //Check to see if Voltage Tier > Control Core Tier
+ if (tTier > aControlCoreTier) {
+ log("Control core found is lower tier than power tier.");
+ return false;
+ }
- GT_Recipe tRecipe = aRecipe != null ? aRecipe : findRecipe(
- getBaseMetaTileEntity(), mLastRecipe, false,
- gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs);
- log("Running checkRecipeGeneric(1)");
- // Remember last recipe - an optimization for findRecipe()
- this.mLastRecipe = tRecipe;
+ GT_Recipe tRecipe = aRecipe != null ? aRecipe : findRecipe(
+ getBaseMetaTileEntity(), mLastRecipe, false,
+ gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs);
- if (tRecipe == null) {
- log("BAD RETURN - 1");
- return false;
- }
+ log("Running checkRecipeGeneric(1)");
+ // Remember last recipe - an optimization for findRecipe()
+ this.mLastRecipe = tRecipe;
- if (!this.canBufferOutputs(tRecipe, aMaxParallelRecipes)) {
- log("BAD RETURN - 2");
- return false;
- }
+ if (tRecipe == null) {
+ log("BAD RETURN - 1");
+ return false;
+ }
- // EU discount
- float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f;
- float tTotalEUt = 0.0f;
+ if (!this.canBufferOutputs(tRecipe, aMaxParallelRecipes)) {
+ log("BAD RETURN - 2");
+ return false;
+ }
- int parallelRecipes = 0;
+ // EU discount
+ float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f;
+ float tTotalEUt = 0.0f;
+
+ int parallelRecipes = 0;
+
+ log("parallelRecipes: "+parallelRecipes);
+ log("aMaxParallelRecipes: "+aMaxParallelRecipes);
+ log("tTotalEUt: "+tTotalEUt);
+ log("tVoltage: "+tVoltage);
+ log("tRecipeEUt: "+tRecipeEUt);
+ // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits
+ for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tVoltage - tRecipeEUt); parallelRecipes++) {
+ if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) {
+ log("Broke at "+parallelRecipes+".");
+ break;
+ }
+ log("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+".");
+ tTotalEUt += tRecipeEUt;
+ }
- log("parallelRecipes: "+parallelRecipes);
- log("aMaxParallelRecipes: "+aMaxParallelRecipes);
- log("tTotalEUt: "+tTotalEUt);
- log("tVoltage: "+tVoltage);
- log("tRecipeEUt: "+tRecipeEUt);
- // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits
- for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tVoltage - tRecipeEUt); parallelRecipes++) {
- if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) {
- log("Broke at "+parallelRecipes+".");
- break;
+ if (parallelRecipes == 0) {
+ log("BAD RETURN - 3");
+ return false;
}
- log("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+".");
- tTotalEUt += tRecipeEUt;
- }
- if (parallelRecipes == 0) {
- log("BAD RETURN - 3");
- return false;
- }
+ // -- Try not to fail after this point - inputs have already been consumed! --
- // -- Try not to fail after this point - inputs have already been consumed! --
+ // Convert speed bonus to duration multiplier
+ // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration.
+ aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent);
+ float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent);
+ this.mMaxProgresstime = (int)(tRecipe.mDuration * tTimeFactor);
- // Convert speed bonus to duration multiplier
- // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration.
- aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent);
- float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent);
- this.mMaxProgresstime = (int)(tRecipe.mDuration * tTimeFactor);
+ this.mEUt = (int)Math.ceil(tTotalEUt);
- this.mEUt = (int)Math.ceil(tTotalEUt);
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
+ //Only Overclock as high as the control circuit.
+ byte tTierOld = tTier;
+ tTier = (byte) aControlCoreTier;
- //Only Overclock as high as the control circuit.
- byte tTierOld = tTier;
- tTier = (byte) aControlCoreTier;
+ // Overclock
+ if (this.mEUt <= 16) {
+ this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1));
+ } else {
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= 2;
+ }
+ }
- // Overclock
- if (this.mEUt <= 16) {
- this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
- this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1));
- } else {
- 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);
}
- }
- if (this.mEUt > 0) {
- this.mEUt = (-this.mEUt);
- }
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ // Collect fluid outputs
+ FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length];
+ for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) {
+ if (tRecipe.getFluidOutput(h) != null) {
+ tOutputFluids[h] = tRecipe.getFluidOutput(h).copy();
+ tOutputFluids[h].amount *= parallelRecipes;
+ }
+ }
- // Collect fluid outputs
- FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length];
- for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) {
- if (tRecipe.getFluidOutput(h) != null) {
- tOutputFluids[h] = tRecipe.getFluidOutput(h).copy();
- tOutputFluids[h].amount *= parallelRecipes;
+ // Collect output item types
+ ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length];
+ for (int h = 0; h < tRecipe.mOutputs.length; h++) {
+ if (tRecipe.getOutput(h) != null) {
+ tOutputItems[h] = tRecipe.getOutput(h).copy();
+ tOutputItems[h].stackSize = 0;
+ }
}
- }
- // Collect output item types
- ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length];
- for (int h = 0; h < tRecipe.mOutputs.length; h++) {
- if (tRecipe.getOutput(h) != null) {
- tOutputItems[h] = tRecipe.getOutput(h).copy();
- tOutputItems[h].stackSize = 0;
+ // Set output item stack sizes (taking output chance into account)
+ for (int f = 0; f < tOutputItems.length; f++) {
+ if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) {
+ for (int g = 0; g < parallelRecipes; g++) {
+ if (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) < tRecipe.getOutputChance(f))
+ tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize;
+ }
+ }
}
- }
- // Set output item stack sizes (taking output chance into account)
- for (int f = 0; f < tOutputItems.length; f++) {
- if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) {
- for (int g = 0; g < parallelRecipes; g++) {
- if (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) < tRecipe.getOutputChance(f))
- tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize;
+ tOutputItems = removeNulls(tOutputItems);
+
+ // Sanitize item stack size, splitting any stacks greater than max stack size
+ List<ItemStack> splitStacks = new ArrayList<ItemStack>();
+ for (ItemStack tItem : tOutputItems) {
+ while (tItem.getMaxStackSize() < tItem.stackSize) {
+ ItemStack tmp = tItem.copy();
+ tmp.stackSize = tmp.getMaxStackSize();
+ tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize();
+ splitStacks.add(tmp);
}
}
- }
- tOutputItems = removeNulls(tOutputItems);
+ if (splitStacks.size() > 0) {
+ ItemStack[] tmp = new ItemStack[splitStacks.size()];
+ tmp = splitStacks.toArray(tmp);
+ tOutputItems = ArrayUtils.addAll(tOutputItems, tmp);
+ }
- // Sanitize item stack size, splitting any stacks greater than max stack size
- List<ItemStack> splitStacks = new ArrayList<ItemStack>();
- for (ItemStack tItem : tOutputItems) {
- while (tItem.getMaxStackSize() < tItem.stackSize) {
- ItemStack tmp = tItem.copy();
- tmp.stackSize = tmp.getMaxStackSize();
- tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize();
- splitStacks.add(tmp);
+ // Strip empty stacks
+ List<ItemStack> tSList = new ArrayList<ItemStack>();
+ for (ItemStack tS : tOutputItems) {
+ if (tS.stackSize > 0) tSList.add(tS);
}
- }
+ tOutputItems = tSList.toArray(new ItemStack[tSList.size()]);
- if (splitStacks.size() > 0) {
- ItemStack[] tmp = new ItemStack[splitStacks.size()];
- tmp = splitStacks.toArray(tmp);
- tOutputItems = ArrayUtils.addAll(tOutputItems, tmp);
- }
+ // Commit outputs
+ this.mOutputItems = tOutputItems;
+ this.mOutputFluids = tOutputFluids;
+ updateSlots();
- // Strip empty stacks
- List<ItemStack> tSList = new ArrayList<ItemStack>();
- for (ItemStack tS : tOutputItems) {
- if (tS.stackSize > 0) tSList.add(tS);
- }
- tOutputItems = tSList.toArray(new ItemStack[tSList.size()]);
+ // Play sounds (GT++ addition - GT multiblocks play no sounds)
+ startProcess();
- // Commit outputs
- this.mOutputItems = tOutputItems;
- this.mOutputFluids = tOutputFluids;
- updateSlots();
+ log("GOOD RETURN - 1");
+ return true;
+ }
- // Play sounds (GT++ addition - GT multiblocks play no sounds)
- startProcess();
+ public GT_Recipe reduceRecipeTimeByPercentage(final GT_Recipe tRecipe,
+ final float percentage) {
+ int cloneTime = 0;
+ GT_Recipe baseRecipe;
+ GT_Recipe cloneRecipe = null;
- log("GOOD RETURN - 1");
- return true;
-}
+ baseRecipe = tRecipe.copy();
+ if ((baseRecipe != null) && ((cloneRecipe != baseRecipe) || (cloneRecipe == null))) {
+ cloneRecipe = baseRecipe.copy();
+ log("Setting Recipe");
+ }
+ if ((baseRecipe != null) && ((cloneTime != baseRecipe.mDuration) || (cloneTime == 0))) {
+ cloneTime = baseRecipe.mDuration;
+ log("Setting Time");
+ }
-public GT_Recipe reduceRecipeTimeByPercentage(final GT_Recipe tRecipe,
- final float percentage) {
- int cloneTime = 0;
- GT_Recipe baseRecipe;
- GT_Recipe cloneRecipe = null;
-
- baseRecipe = tRecipe.copy();
- if ((baseRecipe != null) && ((cloneRecipe != baseRecipe) || (cloneRecipe == null))) {
- cloneRecipe = baseRecipe.copy();
- log("Setting Recipe");
- }
- if ((baseRecipe != null) && ((cloneTime != baseRecipe.mDuration) || (cloneTime == 0))) {
- cloneTime = baseRecipe.mDuration;
- log("Setting Time");
- }
-
- if ((cloneRecipe != null) && cloneRecipe.mDuration > 0) {
- final int originalTime = cloneRecipe.mDuration;
- final int tempTime = MathUtils.findPercentageOfInt(cloneRecipe.mDuration,
- (100 - percentage));
- cloneRecipe.mDuration = tempTime;
- if (cloneRecipe.mDuration < originalTime) {
- log("Generated recipe with a smaller time. | "
- + originalTime + " | " + cloneRecipe.mDuration + " |");
- return cloneRecipe;
- } else {
- log("Did not generate recipe with a smaller time. | "
- + originalTime + " | " + cloneRecipe.mDuration + " |");
- return tRecipe;
+ if ((cloneRecipe != null) && cloneRecipe.mDuration > 0) {
+ final int originalTime = cloneRecipe.mDuration;
+ final int tempTime = MathUtils.findPercentageOfInt(cloneRecipe.mDuration,
+ (100 - percentage));
+ cloneRecipe.mDuration = tempTime;
+ if (cloneRecipe.mDuration < originalTime) {
+ log("Generated recipe with a smaller time. | "
+ + originalTime + " | " + cloneRecipe.mDuration + " |");
+ return cloneRecipe;
+ } else {
+ log("Did not generate recipe with a smaller time. | "
+ + originalTime + " | " + cloneRecipe.mDuration + " |");
+ return tRecipe;
+ }
}
+ log("Error generating recipe, returning null.");
+ return null;
}
- log("Error generating recipe, returning null.");
- return null;
-}
-public boolean isMachineRunning() {
- boolean aRunning = this.getBaseMetaTileEntity().isActive();
- Logger.INFO("Queried Multiblock is currently running: "+aRunning);
- return aRunning;
-}
-
-@Override
-public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity,
- final long aTick) {
-
- //Time Counter
- if (aBaseMetaTileEntity.isServerSide()){
- this.mTotalRunTime++;
+ public boolean isMachineRunning() {
+ boolean aRunning = this.getBaseMetaTileEntity().isActive();
+ Logger.INFO("Queried Multiblock is currently running: "+aRunning);
+ return aRunning;
}
- if (aBaseMetaTileEntity.isServerSide()) {
- if (this.mUpdate == 1 || this.mStartUpCheck == 1) {
- this.mChargeHatches.clear();
- this.mDischargeHatches.clear();
- this.mControlCoreBus.clear();
- this.mMultiDynamoHatches.clear();
+ @Override
+ public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity,
+ final long aTick) {
+
+ //Time Counter
+ if (aBaseMetaTileEntity.isServerSide()){
+ this.mTotalRunTime++;
}
- }
+ if (aBaseMetaTileEntity.isServerSide()) {
+ if (this.mUpdate == 1 || this.mStartUpCheck == 1) {
+ this.mChargeHatches.clear();
+ this.mDischargeHatches.clear();
+ this.mControlCoreBus.clear();
+ this.mMultiDynamoHatches.clear();
+ }
+ }
- super.onPostTick(aBaseMetaTileEntity, aTick);
-}
-@Override
-public void explodeMultiblock() {
- MetaTileEntity tTileEntity;
- for (final Iterator<GT_MetaTileEntity_Hatch_InputBattery> localIterator = this.mChargeHatches
- .iterator(); localIterator.hasNext(); tTileEntity
- .getBaseMetaTileEntity()
- .doExplosion(gregtech.api.enums.GT_Values.V[8])) {
- tTileEntity = localIterator.next();
- }
- tTileEntity = null;
- for (final Iterator<GT_MetaTileEntity_Hatch_OutputBattery> localIterator = this.mDischargeHatches
- .iterator(); localIterator.hasNext(); tTileEntity
- .getBaseMetaTileEntity()
- .doExplosion(gregtech.api.enums.GT_Values.V[8])) {
- tTileEntity = localIterator.next();
- }
- tTileEntity = null;
- for (final Iterator<GT_MetaTileEntity_Hatch> localIterator = this.mMultiDynamoHatches
- .iterator(); localIterator.hasNext(); tTileEntity
- .getBaseMetaTileEntity()
- .doExplosion(gregtech.api.enums.GT_Values.V[8])) {
- tTileEntity = localIterator.next();
+ super.onPostTick(aBaseMetaTileEntity, aTick);
}
+ @Override
+ public void explodeMultiblock() {
+ MetaTileEntity tTileEntity;
+ for (final Iterator<GT_MetaTileEntity_Hatch_InputBattery> localIterator = this.mChargeHatches
+ .iterator(); localIterator.hasNext(); tTileEntity
+ .getBaseMetaTileEntity()
+ .doExplosion(gregtech.api.enums.GT_Values.V[8])) {
+ tTileEntity = localIterator.next();
+ }
+ tTileEntity = null;
+ for (final Iterator<GT_MetaTileEntity_Hatch_OutputBattery> localIterator = this.mDischargeHatches
+ .iterator(); localIterator.hasNext(); tTileEntity
+ .getBaseMetaTileEntity()
+ .doExplosion(gregtech.api.enums.GT_Values.V[8])) {
+ tTileEntity = localIterator.next();
+ }
+ tTileEntity = null;
+ for (final Iterator<GT_MetaTileEntity_Hatch> localIterator = this.mMultiDynamoHatches
+ .iterator(); localIterator.hasNext(); tTileEntity
+ .getBaseMetaTileEntity()
+ .doExplosion(gregtech.api.enums.GT_Values.V[8])) {
+ tTileEntity = localIterator.next();
+ }
- super.explodeMultiblock();
-}
-protected int getGUICircuit(ItemStack[] t) {
- Item g = CI.getNumberedCircuit(0).getItem();
- ItemStack guiSlot = this.mInventory[1];
- int mMode = -1;
- if (guiSlot != null && guiSlot.getItem() == g) {
- this.mInternalCircuit = true;
- return guiSlot.getItemDamage();
- }
- else {
- this.mInternalCircuit = false;
+ super.explodeMultiblock();
}
- if (!this.mInternalCircuit) {
- for (ItemStack j : t) {
- if (j.getItem() == g) {
- mMode = j.getItemDamage();
- break;
+ protected int getGUICircuit(ItemStack[] t) {
+ Item g = CI.getNumberedCircuit(0).getItem();
+ ItemStack guiSlot = this.mInventory[1];
+ int mMode = -1;
+ if (guiSlot != null && guiSlot.getItem() == g) {
+ this.mInternalCircuit = true;
+ return guiSlot.getItemDamage();
+ }
+ else {
+ this.mInternalCircuit = false;
+ }
+
+ if (!this.mInternalCircuit) {
+ for (ItemStack j : t) {
+ if (j.getItem() == g) {
+ mMode = j.getItemDamage();
+ break;
+ }
}
}
+ return mMode;
}
- return mMode;
-}
-protected ItemStack getGUIItemStack() {
- ItemStack guiSlot = this.mInventory[1];
- return guiSlot;
-}
+ protected ItemStack getGUIItemStack() {
+ ItemStack guiSlot = this.mInventory[1];
+ return guiSlot;
+ }
-@Override
-public void updateSlots() {
- for (final GT_MetaTileEntity_Hatch_InputBattery tHatch : this.mChargeHatches) {
- if (isValidMetaTileEntity(tHatch)) {
- tHatch.updateSlots();
+ @Override
+ public void updateSlots() {
+ for (final GT_MetaTileEntity_Hatch_InputBattery tHatch : this.mChargeHatches) {
+ if (isValidMetaTileEntity(tHatch)) {
+ tHatch.updateSlots();
+ }
}
- }
- for (final GT_MetaTileEntity_Hatch_OutputBattery tHatch : this.mDischargeHatches) {
- if (isValidMetaTileEntity(tHatch)) {
- tHatch.updateSlots();
+ for (final GT_MetaTileEntity_Hatch_OutputBattery tHatch : this.mDischargeHatches) {
+ if (isValidMetaTileEntity(tHatch)) {
+ tHatch.updateSlots();
+ }
}
+ super.updateSlots();
}
- super.updateSlots();
-}
-public boolean isToolCreative(ItemStack mStack){
- Materials t1 = GT_MetaGenerated_Tool.getPrimaryMaterial(mStack);
- Materials t2 = GT_MetaGenerated_Tool.getSecondaryMaterial(mStack);
- if (t1 == Materials._NULL && t2 == Materials._NULL){
- return true;
+ public boolean isToolCreative(ItemStack mStack){
+ Materials t1 = GT_MetaGenerated_Tool.getPrimaryMaterial(mStack);
+ Materials t2 = GT_MetaGenerated_Tool.getSecondaryMaterial(mStack);
+ if (t1 == Materials._NULL && t2 == Materials._NULL){
+ return true;
+ }
+ return false;
}
- return false;
-}
-/**
- * Causes a Random Maint. Issue.
- * @return {@link boolean} - Returns whether or not an issue was caused, should always be true.
- */
-public boolean causeMaintenanceIssue() {
- boolean b = false;
- switch (this.getBaseMetaTileEntity().getRandomNumber(6)) {
- case 0 : {
- this.mWrench = false;
- b = true;
- break;
- }
- case 1 : {
- this.mScrewdriver = false;
- b = true;
- break;
- }
- case 2 : {
- this.mSoftHammer = false;
- b = true;
- break;
- }
- case 3 : {
- this.mHardHammer = false;
- b = true;
- break;
- }
- case 4 : {
- this.mSolderingTool = false;
- b = true;
- break;
- }
- case 5 : {
- this.mCrowbar = false;
- b = true;
- break;
- }
- }
- return b;
-}
+ /**
+ * Causes a Random Maint. Issue.
+ * @return {@link boolean} - Returns whether or not an issue was caused, should always be true.
+ */
+ public boolean causeMaintenanceIssue() {
+ boolean b = false;
+ switch (this.getBaseMetaTileEntity().getRandomNumber(6)) {
+ case 0 : {
+ this.mWrench = false;
+ b = true;
+ break;
+ }
+ case 1 : {
+ this.mScrewdriver = false;
+ b = true;
+ break;
+ }
+ case 2 : {
+ this.mSoftHammer = false;
+ b = true;
+ break;
+ }
+ case 3 : {
+ this.mHardHammer = false;
+ b = true;
+ break;
+ }
+ case 4 : {
+ this.mSolderingTool = false;
+ b = true;
+ break;
+ }
+ case 5 : {
+ this.mCrowbar = false;
+ b = true;
+ break;
+ }
+ }
+ return b;
+ }
-public <E> boolean addToMachineListInternal(ArrayList<E> aList, final IMetaTileEntity aTileEntity,
- final int aBaseCasingIndex) {
- if (aList.isEmpty()) {
- if (aTileEntity instanceof GT_MetaTileEntity_Hatch) {
- log("Adding " + aTileEntity.getInventoryName() + " at " + new BlockPos(aTileEntity.getBaseMetaTileEntity()).getLocationString());
- updateTexture(aTileEntity, aBaseCasingIndex);
- return aList.add((E) aTileEntity);
- }
- } else {
- IGregTechTileEntity aCur = aTileEntity.getBaseMetaTileEntity();
- BlockPos aCurPos = new BlockPos(aCur);
- boolean aExists = false;
- for (E m : aList) {
- IGregTechTileEntity b = ((IMetaTileEntity) m).getBaseMetaTileEntity();
- BlockPos aPos = new BlockPos(b);
- if (b != null && aPos != null) {
- if (aCurPos.equals(aPos)) {
- log("Found Duplicate "+b.getInventoryName()+" at " + aPos.getLocationString());
- return false;
+ public <E> boolean addToMachineListInternal(ArrayList<E> aList, final IMetaTileEntity aTileEntity,
+ final int aBaseCasingIndex) {
+ if (aList.isEmpty()) {
+ if (aTileEntity instanceof GT_MetaTileEntity_Hatch) {
+ log("Adding " + aTileEntity.getInventoryName() + " at " + new BlockPos(aTileEntity.getBaseMetaTileEntity()).getLocationString());
+ updateTexture(aTileEntity, aBaseCasingIndex);
+ return aList.add((E) aTileEntity);
+ }
+ } else {
+ IGregTechTileEntity aCur = aTileEntity.getBaseMetaTileEntity();
+ BlockPos aCurPos = new BlockPos(aCur);
+ boolean aExists = false;
+ for (E m : aList) {
+ IGregTechTileEntity b = ((IMetaTileEntity) m).getBaseMetaTileEntity();
+ BlockPos aPos = new BlockPos(b);
+ if (b != null && aPos != null) {
+ if (aCurPos.equals(aPos)) {
+ log("Found Duplicate "+b.getInventoryName()+" at " + aPos.getLocationString());
+ return false;
+ }
}
}
+ if (aTileEntity instanceof GT_MetaTileEntity_Hatch) {
+ log("Adding " + aCur.getInventoryName() + " at " + aCurPos.getLocationString());
+ updateTexture(aTileEntity, aBaseCasingIndex);
+ return aList.add((E) aTileEntity);
+ }
}
- if (aTileEntity instanceof GT_MetaTileEntity_Hatch) {
- log("Adding " + aCur.getInventoryName() + " at " + aCurPos.getLocationString());
- updateTexture(aTileEntity, aBaseCasingIndex);
- return aList.add((E) aTileEntity);
- }
+ return false;
}
- return false;
-}
-public int getControlCoreTier() {
- if (mControlCoreBus.isEmpty()) {
- log("No Control Core Modules Found.");
+ public int getControlCoreTier() {
+ if (mControlCoreBus.isEmpty()) {
+ log("No Control Core Modules Found.");
+ return 0;
+ }
+ GT_MetaTileEntity_Hatch_ControlCore i = getControlCoreBus();
+ if (i != null) {
+ ItemStack x = i.mInventory[0];
+ if (x != null) {
+ return x.getItemDamage();
+ }
+ }
+ log("Control Core Module was null.");
return 0;
- }
- GT_MetaTileEntity_Hatch_ControlCore i = getControlCoreBus();
- if (i != null) {
- ItemStack x = i.mInventory[0];
+ }
+
+ public GT_MetaTileEntity_Hatch_ControlCore getControlCoreBus() {
+ GT_MetaTileEntity_Hatch_ControlCore x = this.mControlCoreBus.get(0);
if (x != null) {
- return x.getItemDamage();
+ log("getControlCore(ok)");
+ return x;
}
+ log("getControlCore(bad)");
+ return null;
}
- log("Control Core Module was null.");
- return 0;
-}
-public GT_MetaTileEntity_Hatch_ControlCore getControlCoreBus() {
- GT_MetaTileEntity_Hatch_ControlCore x = this.mControlCoreBus.get(0);
- if (x != null) {
- log("getControlCore(ok)");
- return x;
- }
- log("getControlCore(bad)");
- return null;
-}
+ //mControlCoreBus
+ public boolean addControlCoreToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
+ final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ log("Tried to add null module entity.");
+ return false;
+ }
+ if (!mControlCoreBus.isEmpty()) {
+ log("Tried to add a secondary control core module.");
+ return false;
+ }
-//mControlCoreBus
-public boolean addControlCoreToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
- final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity == null) {
- log("Tried to add null module entity.");
- return false;
- }
- if (!mControlCoreBus.isEmpty()) {
- log("Tried to add a secondary control core module.");
- return false;
+ log("Adding control core module.");
+ return addToMachineListInternal(mControlCoreBus, aMetaTileEntity, aBaseCasingIndex);
}
- log("Adding control core module.");
- return addToMachineListInternal(mControlCoreBus, aMetaTileEntity, aBaseCasingIndex);
-}
+ @Override
+ public boolean addToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
+ if (aTileEntity == null) {
+ return false;
+ }
+ final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ return false;
+ }
-@Override
-public boolean addToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
- if (aTileEntity == null) {
- return false;
- }
- final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity == null) {
- return false;
- }
+ //Use this to determine the correct value, then update the hatch texture after.
+ boolean aDidAdd = false;
- //Use this to determine the correct value, then update the hatch texture after.
- boolean aDidAdd = false;
-
- //Handle Custom Hustoms
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_ControlCore) {
- log("Found GT_MetaTileEntity_Hatch_ControlCore");
- aDidAdd = addControlCoreToMachineList(aTileEntity, aBaseCasingIndex);
- }
- else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBattery) {
- log("Found GT_MetaTileEntity_Hatch_InputBattery");
- aDidAdd = addToMachineListInternal(mChargeHatches, aMetaTileEntity, aBaseCasingIndex);
- }
- else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBattery) {
- log("Found GT_MetaTileEntity_Hatch_OutputBattery");
- aDidAdd = addToMachineListInternal(mDischargeHatches, aMetaTileEntity, aBaseCasingIndex);
- }
-
- //Handle TT Multi-A Dynamos
- else if (LoadedMods.TecTech && isThisHatchMultiDynamo(aMetaTileEntity)) {
- log("Found isThisHatchMultiDynamo");
- aDidAdd = addToMachineListInternal(mMultiDynamoHatches, aMetaTileEntity, aBaseCasingIndex);
- }
-
- //Handle Fluid Hatches using seperate logic
- else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input)
- aDidAdd = addFluidInputToMachineList(aMetaTileEntity, aBaseCasingIndex);
- else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output)
- aDidAdd = addToMachineListInternal(mOutputHatches, aMetaTileEntity, aBaseCasingIndex);
-
- //Process Remaining hatches using Vanilla GT Logic
- else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus)
- aDidAdd = addToMachineListInternal(mInputBusses, aMetaTileEntity, aBaseCasingIndex);
- else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus)
- aDidAdd = addToMachineListInternal(mOutputBusses, aMetaTileEntity, aBaseCasingIndex);
- else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy)
- aDidAdd = addToMachineListInternal(mEnergyHatches, aMetaTileEntity, aBaseCasingIndex);
- else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo)
- aDidAdd = addToMachineListInternal(mDynamoHatches, aMetaTileEntity, aBaseCasingIndex);
- else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance)
- aDidAdd = addToMachineListInternal(mMaintenanceHatches, aMetaTileEntity, aBaseCasingIndex);
- else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler)
- aDidAdd = addToMachineListInternal(mMufflerHatches, aMetaTileEntity, aBaseCasingIndex);
-
- //return super.addToMachineList(aTileEntity, aBaseCasingIndex);
- return aDidAdd;
-}
+ //Handle Custom Hustoms
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_ControlCore) {
+ log("Found GT_MetaTileEntity_Hatch_ControlCore");
+ aDidAdd = addControlCoreToMachineList(aTileEntity, aBaseCasingIndex);
+ }
+ else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBattery) {
+ log("Found GT_MetaTileEntity_Hatch_InputBattery");
+ aDidAdd = addToMachineListInternal(mChargeHatches, aMetaTileEntity, aBaseCasingIndex);
+ }
+ else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBattery) {
+ log("Found GT_MetaTileEntity_Hatch_OutputBattery");
+ aDidAdd = addToMachineListInternal(mDischargeHatches, aMetaTileEntity, aBaseCasingIndex);
+ }
+ //Handle TT Multi-A Dynamos
+ else if (LoadedMods.TecTech && isThisHatchMultiDynamo(aMetaTileEntity)) {
+ log("Found isThisHatchMultiDynamo");
+ aDidAdd = addToMachineListInternal(mMultiDynamoHatches, aMetaTileEntity, aBaseCasingIndex);
+ }
+ //Handle Fluid Hatches using seperate logic
+ else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input)
+ aDidAdd = addFluidInputToMachineList(aMetaTileEntity, aBaseCasingIndex);
+ else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output)
+ aDidAdd = addToMachineListInternal(mOutputHatches, aMetaTileEntity, aBaseCasingIndex);
-@Override
-public boolean addMaintenanceToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
- return addToMachineList(aTileEntity, aBaseCasingIndex);
-}
+ //Process Remaining hatches using Vanilla GT Logic
+ else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus)
+ aDidAdd = addToMachineListInternal(mInputBusses, aMetaTileEntity, aBaseCasingIndex);
+ else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus)
+ aDidAdd = addToMachineListInternal(mOutputBusses, aMetaTileEntity, aBaseCasingIndex);
+ else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy)
+ aDidAdd = addToMachineListInternal(mEnergyHatches, aMetaTileEntity, aBaseCasingIndex);
+ else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo)
+ aDidAdd = addToMachineListInternal(mDynamoHatches, aMetaTileEntity, aBaseCasingIndex);
+ else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance)
+ aDidAdd = addToMachineListInternal(mMaintenanceHatches, aMetaTileEntity, aBaseCasingIndex);
+ else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler)
+ aDidAdd = addToMachineListInternal(mMufflerHatches, aMetaTileEntity, aBaseCasingIndex);
-@Override
-public boolean addMufflerToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
- return addToMachineList(aTileEntity, aBaseCasingIndex);
-}
+ //return super.addToMachineList(aTileEntity, aBaseCasingIndex);
+ return aDidAdd;
+ }
-@Override
-public boolean addInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
- return addToMachineList(aTileEntity, aBaseCasingIndex);
-}
-@Override
-public boolean addOutputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
- return addToMachineList(aTileEntity, aBaseCasingIndex);
-}
-public boolean addFluidInputToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
- if (aTileEntity == null) {
- return false;
- }
- final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity == null) {
- return false;
+ @Override
+ public boolean addMaintenanceToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ return addToMachineList(aTileEntity, aBaseCasingIndex);
}
- return addFluidInputToMachineList(aMetaTileEntity, aBaseCasingIndex);
-}
-public boolean addFluidInputToMachineList(final IMetaTileEntity aTileEntity, final int aBaseCasingIndex) {
- if (aTileEntity == null) {
- return false;
+ @Override
+ public boolean addMufflerToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ return addToMachineList(aTileEntity, aBaseCasingIndex);
}
- final IMetaTileEntity aMetaTileEntity = aTileEntity;
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) {
- ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mRecipeMap = this.getRecipeMap();
- return addToMachineListInternal(mInputHatches, aMetaTileEntity, aBaseCasingIndex);
+
+ @Override
+ public boolean addInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ return addToMachineList(aTileEntity, aBaseCasingIndex);
}
- return false;
-}
-public boolean resetRecipeMapForAllInputHatches() {
- return resetRecipeMapForAllInputHatches(this.getRecipeMap());
-}
+ @Override
+ public boolean addOutputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ return addToMachineList(aTileEntity, aBaseCasingIndex);
+ }
-public boolean resetRecipeMapForAllInputHatches(GT_Recipe_Map aMap) {
- int cleared = 0;
- for (GT_MetaTileEntity_Hatch_Input g : this.mInputHatches) {
- if (resetRecipeMapForHatch(g, aMap)) {
- cleared++;
+ public boolean addFluidInputToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
+ if (aTileEntity == null) {
+ return false;
}
- }
- for (GT_MetaTileEntity_Hatch_InputBus g : this.mInputBusses) {
- if (resetRecipeMapForHatch(g, aMap)) {
- cleared++;
+ final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ return false;
}
+ return addFluidInputToMachineList(aMetaTileEntity, aBaseCasingIndex);
}
- return cleared > 0;
-}
-public boolean resetRecipeMapForHatch(IGregTechTileEntity aTileEntity, GT_Recipe_Map aMap) {
- if (aTileEntity == null) {
+
+ public boolean addFluidInputToMachineList(final IMetaTileEntity aTileEntity, final int aBaseCasingIndex) {
+ if (aTileEntity == null) {
+ return false;
+ }
+ final IMetaTileEntity aMetaTileEntity = aTileEntity;
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) {
+ ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mRecipeMap = this.getRecipeMap();
+ return addToMachineListInternal(mInputHatches, aMetaTileEntity, aBaseCasingIndex);
+ }
return false;
}
- final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();;
- if (aMetaTileEntity == null) {
- return false;
+
+ public boolean resetRecipeMapForAllInputHatches() {
+ return resetRecipeMapForAllInputHatches(this.getRecipeMap());
}
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input || aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) {
- return resetRecipeMapForHatch((GT_MetaTileEntity_Hatch)aMetaTileEntity, aMap);
+
+ public boolean resetRecipeMapForAllInputHatches(GT_Recipe_Map aMap) {
+ int cleared = 0;
+ for (GT_MetaTileEntity_Hatch_Input g : this.mInputHatches) {
+ if (resetRecipeMapForHatch(g, aMap)) {
+ cleared++;
+ }
+ }
+ for (GT_MetaTileEntity_Hatch_InputBus g : this.mInputBusses) {
+ if (resetRecipeMapForHatch(g, aMap)) {
+ cleared++;
+ }
+ }
+ return cleared > 0;
}
- else {
- return false;
+ public boolean resetRecipeMapForHatch(IGregTechTileEntity aTileEntity, GT_Recipe_Map aMap) {
+ if (aTileEntity == null) {
+ return false;
+ }
+ final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();;
+ if (aMetaTileEntity == null) {
+ return false;
+ }
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input || aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) {
+ return resetRecipeMapForHatch((GT_MetaTileEntity_Hatch)aMetaTileEntity, aMap);
+ }
+ else {
+ return false;
+ }
}
-}
-public boolean resetRecipeMapForHatch(GT_MetaTileEntity_Hatch aTileEntity, GT_Recipe_Map aMap) {
- if (aTileEntity == null) {
- return false;
- }
- final IMetaTileEntity aMetaTileEntity = aTileEntity;
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input || aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) {
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input){
- ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mRecipeMap = null;
- ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mRecipeMap = aMap;
+ public boolean resetRecipeMapForHatch(GT_MetaTileEntity_Hatch aTileEntity, GT_Recipe_Map aMap) {
+ if (aTileEntity == null) {
+ return false;
}
- else {
- ((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity).mRecipeMap = null;
- ((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity).mRecipeMap = aMap;
+ final IMetaTileEntity aMetaTileEntity = aTileEntity;
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input || aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) {
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input){
+ ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mRecipeMap = null;
+ ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mRecipeMap = aMap;
+ }
+ else {
+ ((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity).mRecipeMap = null;
+ ((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity).mRecipeMap = aMap;
+ }
+ return true;
+ }
+ else {
+ return false;
}
- return true;
}
- else {
- return false;
+
+ @Override
+ public final void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ);
+ resetRecipeMapForAllInputHatches();
+ onModeChangeByScrewdriver(aSide, aPlayer, aX, aY, aZ);
}
-}
-@Override
-public final void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ);
- resetRecipeMapForAllInputHatches();
- onModeChangeByScrewdriver(aSide, aPlayer, aX, aY, aZ);
-}
+ public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
-public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ }
-}
+ /**
+ * Enable Texture Casing Support if found in GT 5.09
+ */
-/**
- * Enable Texture Casing Support if found in GT 5.09
- */
+ @SuppressWarnings("deprecation")
+ public boolean updateTexture(final IGregTechTileEntity aTileEntity, int aCasingID){
+ final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ return false;
+ }
+ return updateTexture(aMetaTileEntity, aCasingID);
+ }
-@SuppressWarnings("deprecation")
-public boolean updateTexture(final IGregTechTileEntity aTileEntity, int aCasingID){
- final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity == null) {
- return false;
- }
- return updateTexture(aMetaTileEntity, aCasingID);
-}
+ /**
+ * Enable Texture Casing Support if found in GT 5.09
+ */
-/**
- * Enable Texture Casing Support if found in GT 5.09
- */
+ @SuppressWarnings("deprecation")
+ public boolean updateTexture(final IMetaTileEntity aTileEntity, int aCasingID){
+ try { //gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch.updateTexture(int)
-@SuppressWarnings("deprecation")
-public boolean updateTexture(final IMetaTileEntity aTileEntity, int aCasingID){
- try { //gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch.updateTexture(int)
+ final IMetaTileEntity aMetaTileEntity = aTileEntity;
+ if (aMetaTileEntity == null) {
+ return false;
+ }
+ Method mProper = Class.forName("gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch").getDeclaredMethod("updateTexture", int.class);
+ if (mProper != null){
+ if (GT_MetaTileEntity_Hatch.class.isInstance(aMetaTileEntity)){
+ mProper.setAccessible(true);
+ mProper.invoke(aMetaTileEntity, aCasingID);
+ log("Good Method Call for updateTexture.");
+ return true;
+ }
- final IMetaTileEntity aMetaTileEntity = aTileEntity;
- if (aMetaTileEntity == null) {
- return false;
- }
- Method mProper = Class.forName("gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch").getDeclaredMethod("updateTexture", int.class);
- if (mProper != null){
- if (GT_MetaTileEntity_Hatch.class.isInstance(aMetaTileEntity)){
- mProper.setAccessible(true);
- mProper.invoke(aMetaTileEntity, aCasingID);
- log("Good Method Call for updateTexture.");
- return true;
}
-
- }
- else {
- log("Bad Method Call for updateTexture.");
- if (GT_MetaTileEntity_Hatch.class.isInstance(aMetaTileEntity)){
- if (aCasingID <= Byte.MAX_VALUE) {
- ((GT_MetaTileEntity_Hatch) aTileEntity).mMachineBlock = (byte) aCasingID;
- log("Good Method Call for updateTexture. Used fallback method of setting mMachineBlock as casing id was <= 128.");
- return true;
+ else {
+ log("Bad Method Call for updateTexture.");
+ if (GT_MetaTileEntity_Hatch.class.isInstance(aMetaTileEntity)){
+ if (aCasingID <= Byte.MAX_VALUE) {
+ ((GT_MetaTileEntity_Hatch) aTileEntity).mMachineBlock = (byte) aCasingID;
+ log("Good Method Call for updateTexture. Used fallback method of setting mMachineBlock as casing id was <= 128.");
+ return true;
+ }
+ else {
+ log("updateTexture returning false. 1.2");
+ }
}
else {
- log("updateTexture returning false. 1.2");
+ log("updateTexture returning false. 1.3");
}
}
- else {
- log("updateTexture returning false. 1.3");
- }
+ log("updateTexture returning false. 1");
+ return false;
}
- log("updateTexture returning false. 1");
- return false;
- }
- catch (NoSuchMethodException | SecurityException | ClassNotFoundException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- log("updateTexture returning false.");
- log("updateTexture returning false. 2");
- e.printStackTrace();
- return false;
- }
+ catch (NoSuchMethodException | SecurityException | ClassNotFoundException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ log("updateTexture returning false.");
+ log("updateTexture returning false. 2");
+ e.printStackTrace();
+ return false;
+ }
-}
+ }
@@ -1148,96 +1175,95 @@ public boolean updateTexture(final IMetaTileEntity aTileEntity, int aCasingID){
-/**
- * TecTech Support
- */
+ /**
+ * TecTech Support
+ */
-/**
- * This is the array Used to Store the Tectech Multi-Amp hatches.
- */
+ /**
+ * This is the array Used to Store the Tectech Multi-Amp hatches.
+ */
-public ArrayList<GT_MetaTileEntity_Hatch> mMultiDynamoHatches = new ArrayList<GT_MetaTileEntity_Hatch>();
+ public ArrayList<GT_MetaTileEntity_Hatch> mMultiDynamoHatches = new ArrayList<GT_MetaTileEntity_Hatch>();
-/**
- * TecTech Multi-Amp Dynamo Support
- * @param aTileEntity - The Dynamo Hatch
- * @param aBaseCasingIndex - Casing Texture
- * @return
- */
+ /**
+ * TecTech Multi-Amp Dynamo Support
+ * @param aTileEntity - The Dynamo Hatch
+ * @param aBaseCasingIndex - Casing Texture
+ * @return
+ */
-public boolean addMultiAmpDynamoToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex){
- //GT_MetaTileEntity_Hatch_DynamoMulti
- if (aTileEntity == null) {
- return false;
- }
- final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity == null) {
+ public boolean addMultiAmpDynamoToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex){
+ //GT_MetaTileEntity_Hatch_DynamoMulti
+ if (aTileEntity == null) {
+ return false;
+ }
+ final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ return false;
+ }
+ if (isThisHatchMultiDynamo(aTileEntity)) {
+ updateTexture(aTileEntity, aBaseCasingIndex);
+ return this.mMultiDynamoHatches.add((GT_MetaTileEntity_Hatch) aMetaTileEntity);
+ }
return false;
}
- if (isThisHatchMultiDynamo(aTileEntity)) {
- updateTexture(aTileEntity, aBaseCasingIndex);
- return this.mMultiDynamoHatches.add((GT_MetaTileEntity_Hatch) aMetaTileEntity);
- }
- return false;
-}
-@SuppressWarnings("rawtypes")
-public boolean isThisHatchMultiDynamo(Object aMetaTileEntity){
- Class mDynamoClass;
- try {
- mDynamoClass = Class.forName("com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti");
- if (mDynamoClass != null){
- if (mDynamoClass.isInstance(aMetaTileEntity)){
- return true;
+ @SuppressWarnings("rawtypes")
+ public boolean isThisHatchMultiDynamo(Object aMetaTileEntity){
+ Class mDynamoClass;
+ try {
+ mDynamoClass = Class.forName("com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti");
+ if (mDynamoClass != null){
+ if (mDynamoClass.isInstance(aMetaTileEntity)){
+ return true;
+ }
}
}
+ catch (ClassNotFoundException e) {}
+ return false;
}
- catch (ClassNotFoundException e) {}
- return false;
-}
-@Override
-public boolean addDynamoToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
- if (LoadedMods.TecTech){
- if (isThisHatchMultiDynamo(aTileEntity)) {
- addMultiAmpDynamoToMachineList(aTileEntity, aBaseCasingIndex);
- }
+ @Override
+ public boolean addDynamoToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (LoadedMods.TecTech){
+ if (isThisHatchMultiDynamo(aTileEntity)) {
+ addMultiAmpDynamoToMachineList(aTileEntity, aBaseCasingIndex);
+ }
+ }
+ return super.addDynamoToMachineList(aTileEntity, aBaseCasingIndex);
}
- return super.addDynamoToMachineList(aTileEntity, aBaseCasingIndex);
-}
-
-/**
- * Pollution Management
- */
-public int getPollutionPerTick(ItemStack arg0) {
- return 0;
-}
+ /**
+ * Pollution Management
+ */
-public String getPollutionTooltip() {
- if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
- return "Causes " + 20 * this.getPollutionPerTick(null) + " Pollution per second";
- }
- else {
- return "";
+ public int getPollutionPerTick(ItemStack arg0) {
+ return 0;
}
-}
-@Override
-public void saveNBTData(NBTTagCompound aNBT) {
- aNBT.setLong("mTotalRunTime", this.mTotalRunTime);
- super.saveNBTData(aNBT);
-}
+ public String getPollutionTooltip() {
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ return "Causes " + 20 * this.getPollutionPerTick(null) + " Pollution per second";
+ }
+ else {
+ return "";
+ }
+ }
-@Override
-public void loadNBTData(NBTTagCompound aNBT) {
- this.mTotalRunTime = aNBT.getLong("mTotalRunTime");
- super.loadNBTData(aNBT);
-}
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ aNBT.setLong("mTotalRunTime", this.mTotalRunTime);
+ super.saveNBTData(aNBT);
+ }
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ this.mTotalRunTime = aNBT.getLong("mTotalRunTime");
+ super.loadNBTData(aNBT);
+ }
@@ -1250,219 +1276,245 @@ public void loadNBTData(NBTTagCompound aNBT) {
-/**
- * Custom Find Recipe with Debugging
- */
+ /**
+ * Custom Find Recipe with Debugging
+ */
-public GT_Recipe findRecipe(final IHasWorldObjectAndCoords aTileEntity, final boolean aNotUnificated,
- final boolean aDontCheckStackSizes, final long aVoltage, final FluidStack[] aFluids,
- final ItemStack... aInputs) {
- return this.findRecipe(aTileEntity, null, aNotUnificated, aDontCheckStackSizes, aVoltage, aFluids,
- (ItemStack) null, aInputs);
-}
-public GT_Recipe findRecipe(final IHasWorldObjectAndCoords aTileEntity, final boolean aNotUnificated,
- final long aVoltage, final FluidStack[] aFluids, final ItemStack... aInputs) {
- return this.findRecipe(aTileEntity, null, aNotUnificated, aVoltage, aFluids, (ItemStack) null, aInputs);
-}
+ public GT_Recipe findRecipe(final IHasWorldObjectAndCoords aTileEntity, final boolean aNotUnificated,
+ final boolean aDontCheckStackSizes, final long aVoltage, final FluidStack[] aFluids,
+ final ItemStack... aInputs) {
+ return this.findRecipe(aTileEntity, null, aNotUnificated, aDontCheckStackSizes, aVoltage, aFluids,
+ (ItemStack) null, aInputs);
+ }
-public GT_Recipe findRecipe(final IHasWorldObjectAndCoords aTileEntity, final GT_Recipe aRecipe,
- final boolean aNotUnificated, final boolean aDontCheckStackSizes, final long aVoltage,
- final FluidStack[] aFluids, final ItemStack... aInputs) {
- return this.findRecipe(aTileEntity, aRecipe, aNotUnificated, aDontCheckStackSizes, aVoltage, aFluids,
- (ItemStack) null, aInputs);
-}
+ public GT_Recipe findRecipe(final IHasWorldObjectAndCoords aTileEntity, final boolean aNotUnificated,
+ final long aVoltage, final FluidStack[] aFluids, final ItemStack... aInputs) {
+ return this.findRecipe(aTileEntity, null, aNotUnificated, aVoltage, aFluids, (ItemStack) null, aInputs);
+ }
-public GT_Recipe findRecipe(final IHasWorldObjectAndCoords aTileEntity, final GT_Recipe aRecipe,
- final boolean aNotUnificated, final long aVoltage, final FluidStack[] aFluids,
- final ItemStack... aInputs) {
- return this.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, (ItemStack) null, aInputs);
-}
+ public GT_Recipe findRecipe(final IHasWorldObjectAndCoords aTileEntity, final GT_Recipe aRecipe,
+ final boolean aNotUnificated, final boolean aDontCheckStackSizes, final long aVoltage,
+ final FluidStack[] aFluids, final ItemStack... aInputs) {
+ return this.findRecipe(aTileEntity, aRecipe, aNotUnificated, aDontCheckStackSizes, aVoltage, aFluids,
+ (ItemStack) null, aInputs);
+ }
-public GT_Recipe findRecipe(final IHasWorldObjectAndCoords aTileEntity, final GT_Recipe aRecipe,
- final boolean aNotUnificated, final long aVoltage, final FluidStack[] aFluids,
- final ItemStack aSpecialSlot, final ItemStack... aInputs) {
- return this.findRecipe(aTileEntity, aRecipe, aNotUnificated, true, aVoltage, aFluids, aSpecialSlot,
- aInputs);
-}
+ public GT_Recipe findRecipe(final IHasWorldObjectAndCoords aTileEntity, final GT_Recipe aRecipe,
+ final boolean aNotUnificated, final long aVoltage, final FluidStack[] aFluids,
+ final ItemStack... aInputs) {
+ return this.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, (ItemStack) null, aInputs);
+ }
-public GT_Recipe findRecipe(final IHasWorldObjectAndCoords aTileEntity, final GT_Recipe aRecipe,
- final boolean aNotUnificated, final boolean aDontCheckStackSizes, final long aVoltage,
- final FluidStack[] aFluids, final ItemStack aSpecialSlot, ItemStack... aInputs) {
- if (this.getRecipeMap().mRecipeList.isEmpty()) {
- log("No Recipes in Map to search through.");
- return null;
+ public GT_Recipe findRecipe(final IHasWorldObjectAndCoords aTileEntity, final GT_Recipe aRecipe,
+ final boolean aNotUnificated, final long aVoltage, final FluidStack[] aFluids,
+ final ItemStack aSpecialSlot, final ItemStack... aInputs) {
+ return this.findRecipe(aTileEntity, aRecipe, aNotUnificated, true, aVoltage, aFluids, aSpecialSlot,
+ aInputs);
}
- GT_Recipe mRecipeResult = null;
- try {
- if (GregTech_API.sPostloadFinished) {
- if (this.getRecipeMap().mMinimalInputFluids > 0) {
- if (aFluids == null) {
- log("aFluids == null && minFluids > 0");
- return null;
- }
- int tAmount = 0;
- for (final FluidStack aFluid : aFluids) {
- if (aFluid != null) {
- ++tAmount;
+
+ public GT_Recipe findRecipe(final IHasWorldObjectAndCoords aTileEntity, final GT_Recipe aRecipe,
+ final boolean aNotUnificated, final boolean aDontCheckStackSizes, final long aVoltage,
+ final FluidStack[] aFluids, final ItemStack aSpecialSlot, ItemStack... aInputs) {
+ if (this.getRecipeMap().mRecipeList.isEmpty()) {
+ log("No Recipes in Map to search through.");
+ return null;
+ }
+ GT_Recipe mRecipeResult = null;
+ try {
+ if (GregTech_API.sPostloadFinished) {
+ if (this.getRecipeMap().mMinimalInputFluids > 0) {
+ if (aFluids == null) {
+ log("aFluids == null && minFluids > 0");
+ return null;
}
- }
- if (tAmount < this.getRecipeMap().mMinimalInputFluids) {
- log("Not enough fluids?");
- return null;
- }
- }
- if (this.getRecipeMap().mMinimalInputItems > 0) {
- if (aInputs == null) {
- log("No inputs and minItems > 0");
- return null;
- }
- int tAmount = 0;
- for (final ItemStack aInput : aInputs) {
- if (aInput != null) {
- ++tAmount;
+ int tAmount = 0;
+ for (final FluidStack aFluid : aFluids) {
+ if (aFluid != null) {
+ ++tAmount;
+ }
+ }
+ if (tAmount < this.getRecipeMap().mMinimalInputFluids) {
+ log("Not enough fluids?");
+ return null;
}
}
- if (tAmount < this.getRecipeMap().mMinimalInputItems) {
- log("Not enough items?");
- return null;
+ if (this.getRecipeMap().mMinimalInputItems > 0) {
+ if (aInputs == null) {
+ log("No inputs and minItems > 0");
+ return null;
+ }
+ int tAmount = 0;
+ for (final ItemStack aInput : aInputs) {
+ if (aInput != null) {
+ ++tAmount;
+ }
+ }
+ if (tAmount < this.getRecipeMap().mMinimalInputItems) {
+ log("Not enough items?");
+ return null;
+ }
}
}
- }
- else {
- log("Game Not Loaded properly for recipe lookup.");
- }
- if (aNotUnificated) {
- aInputs = GT_OreDictUnificator.getStackArray(true, (Object[]) aInputs);
- }
- if (aRecipe != null && !aRecipe.mFakeRecipe && aRecipe.mCanBeBuffered
- && aRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) {
- mRecipeResult = (aRecipe.mEnabled/* && aVoltage * this.getRecipeMap().mAmperage >= aRecipe.mEUt*/) ? aRecipe : null;
- log("x) Found Recipe? "+(mRecipeResult != null ? "true" : "false"));
- if (mRecipeResult != null) {
- return mRecipeResult;
+ else {
+ log("Game Not Loaded properly for recipe lookup.");
}
- }
- if (mRecipeResult == null && this.getRecipeMap().mUsualInputCount >= 0 && aInputs != null && aInputs.length > 0) {
- for (final ItemStack tStack : aInputs) {
- if (tStack != null) {
- Collection<GT_Recipe> tRecipes = this.getRecipeMap().mRecipeItemMap.get(new GT_ItemStack(tStack));
- if (tRecipes != null) {
- for (final GT_Recipe tRecipe : tRecipes) {
- if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) {
- mRecipeResult = (tRecipe.mEnabled/* && aVoltage * this.getRecipeMap().mAmperage >= tRecipe.mEUt*/)
- ? tRecipe
- : null;
- log("1) Found Recipe? "+(mRecipeResult != null ? "true" : "false"));
- //return mRecipeResult;
+ if (aNotUnificated) {
+ aInputs = GT_OreDictUnificator.getStackArray(true, (Object[]) aInputs);
+ }
+ if (aRecipe != null && !aRecipe.mFakeRecipe && aRecipe.mCanBeBuffered
+ && aRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) {
+ mRecipeResult = (aRecipe.mEnabled/* && aVoltage * this.getRecipeMap().mAmperage >= aRecipe.mEUt*/) ? aRecipe : null;
+ log("x) Found Recipe? "+(mRecipeResult != null ? "true" : "false"));
+ if (mRecipeResult != null) {
+ return mRecipeResult;
+ }
+ }
+ if (mRecipeResult == null && this.getRecipeMap().mUsualInputCount >= 0 && aInputs != null && aInputs.length > 0) {
+ for (final ItemStack tStack : aInputs) {
+ if (tStack != null) {
+ Collection<GT_Recipe> tRecipes = this.getRecipeMap().mRecipeItemMap.get(new GT_ItemStack(tStack));
+ if (tRecipes != null) {
+ for (final GT_Recipe tRecipe : tRecipes) {
+ if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) {
+ mRecipeResult = (tRecipe.mEnabled/* && aVoltage * this.getRecipeMap().mAmperage >= tRecipe.mEUt*/)
+ ? tRecipe
+ : null;
+ log("1) Found Recipe? "+(mRecipeResult != null ? "true" : "false"));
+ //return mRecipeResult;
+ }
}
}
- }
- //TODO - Investigate if this requires to be in it's own block
- tRecipes = this.getRecipeMap().mRecipeItemMap
- .get(new GT_ItemStack(GT_Utility.copyMetaData(32767L, new Object[]{tStack})));
- if (tRecipes != null) {
- for (final GT_Recipe tRecipe : tRecipes) {
- if (!tRecipe.mFakeRecipe
- && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) {
- mRecipeResult = (tRecipe.mEnabled /*&& aVoltage * this.getRecipeMap().mAmperage >= tRecipe.mEUt*/)
- ? tRecipe
- : null;
- log("2) Found Recipe? "+(mRecipeResult != null ? "true" : "false"));
- //return mRecipeResult;
+ //TODO - Investigate if this requires to be in it's own block
+ tRecipes = this.getRecipeMap().mRecipeItemMap
+ .get(new GT_ItemStack(GT_Utility.copyMetaData(32767L, new Object[]{tStack})));
+ if (tRecipes != null) {
+ for (final GT_Recipe tRecipe : tRecipes) {
+ if (!tRecipe.mFakeRecipe
+ && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) {
+ mRecipeResult = (tRecipe.mEnabled /*&& aVoltage * this.getRecipeMap().mAmperage >= tRecipe.mEUt*/)
+ ? tRecipe
+ : null;
+ log("2) Found Recipe? "+(mRecipeResult != null ? "true" : "false"));
+ //return mRecipeResult;
+ }
}
}
}
}
}
- }
- if (mRecipeResult == null && this.getRecipeMap().mMinimalInputItems == 0 && aFluids != null && aFluids.length > 0) {
- for (final FluidStack aFluid2 : aFluids) {
- if (aFluid2 != null) {
- final Collection<GT_Recipe> tRecipes = this.getRecipeMap().mRecipeFluidMap.get(aFluid2.getFluid());
- if (tRecipes != null) {
- for (final GT_Recipe tRecipe : tRecipes) {
- if (!tRecipe.mFakeRecipe
- && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) {
- mRecipeResult = (tRecipe.mEnabled/* && aVoltage * this.getRecipeMap().mAmperage >= tRecipe.mEUt*/)
- ? tRecipe
- : null;
- log("3) Found Recipe? "+(mRecipeResult != null ? "true" : "false"));
- //return mRecipeResult;
+ if (mRecipeResult == null && this.getRecipeMap().mMinimalInputItems == 0 && aFluids != null && aFluids.length > 0) {
+ for (final FluidStack aFluid2 : aFluids) {
+ if (aFluid2 != null) {
+ final Collection<GT_Recipe> tRecipes = this.getRecipeMap().mRecipeFluidMap.get(aFluid2.getFluid());
+ if (tRecipes != null) {
+ for (final GT_Recipe tRecipe : tRecipes) {
+ if (!tRecipe.mFakeRecipe
+ && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) {
+ mRecipeResult = (tRecipe.mEnabled/* && aVoltage * this.getRecipeMap().mAmperage >= tRecipe.mEUt*/)
+ ? tRecipe
+ : null;
+ log("3) Found Recipe? "+(mRecipeResult != null ? "true" : "false"));
+ //return mRecipeResult;
+ }
}
}
}
}
}
}
- }
- catch (Throwable t) {
- log("Invalid recipe lookup.");
- }
+ catch (Throwable t) {
+ log("Invalid recipe lookup.");
+ }
- if (mRecipeResult == null) {
- log("Invalid recipe, Fallback lookup. "+this.getRecipeMap().mRecipeList.size()+" | "+this.getRecipeMap().mNEIName);
- if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
- try {
- return (GT_Recipe) findRecipe08.invoke(getRecipeMap(), aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot, aInputs);
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- e.printStackTrace();
- return null;
+ if (mRecipeResult == null) {
+ log("Invalid recipe, Fallback lookup. "+this.getRecipeMap().mRecipeList.size()+" | "+this.getRecipeMap().mNEIName);
+ if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ try {
+ return (GT_Recipe) findRecipe08.invoke(getRecipeMap(), aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot, aInputs);
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+ else {
+ try {
+ return (GT_Recipe) findRecipe09.invoke(getRecipeMap(), aTileEntity, aRecipe, aNotUnificated, aDontCheckStackSizes, aVoltage, aFluids, aSpecialSlot, aInputs);
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ e.printStackTrace();
+ return null;
+ }
}
}
else {
- try {
- return (GT_Recipe) findRecipe09.invoke(getRecipeMap(), aTileEntity, aRecipe, aNotUnificated, aDontCheckStackSizes, aVoltage, aFluids, aSpecialSlot, aInputs);
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- e.printStackTrace();
- return null;
- }
+ return mRecipeResult;
}
- }
- else {
- return mRecipeResult;
- }
-}
+ }
-/**
- * Custom Tool Handling
- */
+ /**
+ * Custom Tool Handling
+ */
-@Override
-public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX,
- float aY, float aZ) {
- //Do Super
- boolean aSuper = super.onRightclick(aBaseMetaTileEntity, aPlayer, aSide, aX, aY, aZ);
- // Do Things
- if (this.getBaseMetaTileEntity().isServerSide()) {
- ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem();
- if (tCurrentItem != null) {
- if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSoftHammerList)) {
+ @Override
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX,
+ float aY, float aZ) {
+ //Do Super
+ boolean aSuper = super.onRightclick(aBaseMetaTileEntity, aPlayer, aSide, aX, aY, aZ);
+ // Do Things
+ if (this.getBaseMetaTileEntity().isServerSide()) {
+ ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem();
+ if (tCurrentItem != null) {
+ if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSoftHammerList)) {
+ }
}
}
+ return aSuper;
}
- return aSuper;
-}
-public final boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- boolean aStructureCheck = checkMultiblock(aBaseMetaTileEntity, aStack);
- boolean aHasCore = this.getControlCoreBus() != null;
- return aStructureCheck && aHasCore;
-}
+ public final boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ boolean aStructureCheck = checkMultiblock(aBaseMetaTileEntity, aStack);
+ boolean aHasCore = this.getControlCoreBus() != null;
+ return aStructureCheck && aHasCore;
+ }
-public abstract boolean checkMultiblock(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack);
+ public abstract boolean checkMultiblock(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack);
+
+
+ public boolean isValidBlockForStructure(IGregTechTileEntity aBaseMetaTileEntity, int aCasingID, boolean canBeHatch, Block aFoundBlock, int aFoundMeta, Block aExpectedBlock, int aExpectedMeta) {
+ boolean isHatch = false;
+ if (aBaseMetaTileEntity != null) {
+ isHatch = this.addToMachineList(aBaseMetaTileEntity, aCasingID);
+ if (isHatch) {
+ return true;
+ }
+ }
+ if (!isHatch) {
+ if (aFoundBlock != aExpectedBlock || aFoundMeta != aExpectedMeta) {
+ return false;
+ }
+ else {
+ return true;
+ }
+ }
+ else {
+ return true;
+ }
+
+
+
+ }
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCentrifuge.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCentrifuge.java
index 85a8c34900..e3c05a8388 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCentrifuge.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCentrifuge.java
@@ -1,5 +1,6 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing;
+import gregtech.api.GregTech_API;
import gregtech.api.enums.TAE;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
@@ -61,16 +62,13 @@ extends GregtechMeta_MultiBlockBase {
"Only uses 90% of the eu/t normally required",
"Processes six items per voltage tier",
"Size: 3x3x3 (Hollow)",
- "Controller (Front Center) [Orange]",
- "1x Maintenance Hatch (Rear Center) [Green]",
- "The rest can be placed anywhere except the Front [Red]",
+ "Centrifuge Casings (10 at least)",
+ "Controller (Front Center)",
"1x Input Hatch",
"1x Output Hatch",
"1x Input Bus",
"1x Output Bus",
- "1x Muffler Hatch",
- "1x Energy Hatch [Blue]",
- "Centrifuge Casings for the rest (10 at least)",
+ "1x Energy Hatch",
};
}
@@ -128,59 +126,35 @@ extends GregtechMeta_MultiBlockBase {
@Override
public boolean checkMultiblock(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) {
- /*if (ConfigSwitches.disableCentrifugeFormation){
- EntityPlayerMP player = MinecraftServer.getServer().getConfigurationManager().func_152612_a(this.getBaseMetaTileEntity().getOwnerName());
- if (!player.getEntityWorld().isRemote && isDisabled == false)
- PlayerUtils.messagePlayer(player, "This Multiblock is disabled via the config. [Only re-enable if you're bugtesting.]");
- isDisabled = true;
- return false;
- }*/
- final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
- final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
- //Utils.LOG_WARNING("X:"+xDir+" Z:"+zDir);
- if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) {
- return false;
- }
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
int tAmount = 0;
- for (int i = -1; i < 2; i++) { //X-Dir
- for (int j = -1; j < 2; j++) { //Z-Dir
- for (int h = -1; h < 2; h++) { //Y-Dir
- if ((h != 0) || ((((xDir + i) != 0) || ((zDir + j) != 0)) && ((i != 0) || (j != 0)))) {
-
- final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
- //Utils.LOG_WARNING("X:"+tTileEntity.getXCoord()+" Y:"+tTileEntity.getYCoord()+" Z:"+tTileEntity.getZCoord());
- if ((!this.addToMachineList(tTileEntity, getCasingTextureIndex())) && (!this.addInputToMachineList(tTileEntity, getCasingTextureIndex())) && (!this.addOutputToMachineList(tTileEntity, getCasingTextureIndex())) && (!this.addEnergyInputToMachineList(tTileEntity, getCasingTextureIndex()))) {
-
- //Maintenance Hatch
- if ((tTileEntity != null) && (tTileEntity.getMetaTileEntity() != null)) {
- if ((tTileEntity.getXCoord() == aBaseMetaTileEntity.getXCoord()) && (tTileEntity.getYCoord() == aBaseMetaTileEntity.getYCoord()) && (tTileEntity.getZCoord() == (aBaseMetaTileEntity.getZCoord()+2))) {
- if ((tTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Maintenance)) {
- Logger.WARNING("MAINT HATCH IN CORRECT PLACE");
- this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) tTileEntity.getMetaTileEntity());
- ((GT_MetaTileEntity_Hatch) tTileEntity.getMetaTileEntity()).mMachineBlock = this.getCasingTextureIndex();
- } else {
- return false;
- }
- }
- else {
- Logger.WARNING("MAINT HATCH IN WRONG PLACE");
- }
- }
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 0) {
+ if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) {
+ return false;
+ } else {
+ for (int i = -1; i < 2; ++i) {
+ for (int j = -1; j < 2; ++j) {
+ for (int h = -1; h < 2; ++h) {
+ if (h != 0 || (xDir + i != 0 || zDir + j != 0) && (i != 0 || j != 0)) {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i,
+ h, zDir + j);
+ Block aBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j);
+ int aMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j);
+
+ if (!isValidBlockForStructure(tTileEntity, getCasingTextureIndex(), true, aBlock, aMeta,
+ ModBlocks.blockCasingsMisc, 0)) {
+ Logger.INFO("Bad centrifuge casing");
return false;
}
- tAmount++;
+ ++tAmount;
}
}
}
}
+ return tAmount >= 10;
}
- return tAmount >= 10;
}
@Override
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCokeOven.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCokeOven.java
index 94ebdef132..4d048b5903 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCokeOven.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCokeOven.java
@@ -10,6 +10,7 @@ import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import gregtech.api.util.Recipe_GT;
+import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
@@ -46,16 +47,14 @@ extends GregtechMeta_MultiBlockBase {
"Process 12x materials with Heat Resistant Casings",
"Or 24x materials with Heat Proof Casings",
"Size: 3x3x3 (Hollow)",
+ "Structural Coke Oven Casings (8 at least!)",
"Controller (front middle at bottom)",
"8x Heat Resistant/Proof Coke Oven Casings (middle Layer, hollow)",
- "1x Input Hatch (one of bottom)",
- "1x Output Hatch (one of bottom)",
- "1x Input Bus (one of bottom)",
- "1x Output Bus (one of bottom)",
- "1x Energy Hatch (one of bottom) [EV or better recommended]",
- "1x Maintenance Hatch (one of bottom)",
- "1x Muffler Hatch (top middle)",
- "Structural Coke Oven Casings for the rest",
+ "1x Input Hatch",
+ "1x Output Hatch",
+ "1x Input Bus",
+ "1x Output Bus",
+ "1x Energy Hatch"
};
}
@@ -121,7 +120,6 @@ extends GregtechMeta_MultiBlockBase {
if (!aBaseMetaTileEntity.getAirOffset(xDir, 1, zDir)) {
return false;
}
- this.addMufflerToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, 2, zDir), TAE.GTPP_INDEX(1));
final byte tUsedMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + 1, 1, zDir);
switch (tUsedMeta) {
@@ -137,16 +135,14 @@ extends GregtechMeta_MultiBlockBase {
for (int i = -1; i < 2; i++) {
for (int j = -1; j < 2; j++) {
if ((i != 0) || (j != 0)) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 1, zDir + j) != ModBlocks.blockCasingsMisc) {
+ final IGregTechTileEntity tTileEntity2 = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 2, zDir + j);
+ if (!isValidBlockForStructure(null, TAE.GTPP_INDEX(1), false, aBaseMetaTileEntity.getBlockOffset(xDir + i, 1, zDir + j), (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 1, zDir + j), ModBlocks.blockCasingsMisc, tUsedMeta)) {
+ Logger.INFO("Heating Coils missing.");
return false;
}
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 1, zDir + j) != tUsedMeta) {
- return false;
- }
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 2, zDir + j) != ModBlocks.blockCasingsMisc) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 2, zDir + j) != 1) {
+
+ if (!isValidBlockForStructure(tTileEntity2, TAE.GTPP_INDEX(1), true, aBaseMetaTileEntity.getBlockOffset(xDir + i, 2, zDir + j), (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 2, zDir + j), ModBlocks.blockCasingsMisc, 1)) {
+ Logger.INFO("Casings missing from top layer of coke oven.");
return false;
}
}
@@ -156,13 +152,9 @@ extends GregtechMeta_MultiBlockBase {
for (int j = -1; j < 2; j++) {
if (((xDir + i) != 0) || ((zDir + j) != 0)) {
final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 0, zDir + j);
- if ((!this.addMaintenanceToMachineList(tTileEntity, TAE.GTPP_INDEX(1))) && (!this.addInputToMachineList(tTileEntity, TAE.GTPP_INDEX(1))) && (!this.addOutputToMachineList(tTileEntity, TAE.GTPP_INDEX(1))) && (!this.addEnergyInputToMachineList(tTileEntity, TAE.GTPP_INDEX(1)))) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j) != ModBlocks.blockCasingsMisc) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j) != 1) {
- return false;
- }
+ if (!isValidBlockForStructure(tTileEntity, TAE.GTPP_INDEX(1), true, aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j), (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j), ModBlocks.blockCasingsMisc, 1)) {
+ Logger.INFO("Casings missing from bottom layer of coke oven.");
+ return false;
}
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCuttingMachine.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCuttingMachine.java
index 0dddcbcce1..e627e99aa7 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCuttingMachine.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCuttingMachine.java
@@ -15,7 +15,6 @@ import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.block.ModBlocks;
-import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
@@ -47,13 +46,12 @@ extends GregtechMeta_MultiBlockBase {
"Only uses 75% of the eu/t normally required",
"Processes four items per voltage tier",
"Size: 3x3x5 [WxHxL] (Hollow)", "Controller (front centered)",
- "1x Input Bus (side centered)",
- "1x Output Bus (side centered)",
- "1x Energy Hatch (top or bottom centered)",
- "1x Input Hatch (top or bottom centered)",
- "1x Muffler Hatch (top)",
- "1x Maintenance Hatch (back centered)",
- "Cutting Factory Frames for the rest (26 at least!)"
+ "Cutting Factory Frames (26 at least!)",
+ "1x Input Bus",
+ "1x Output Bus",
+ "1x Input Hatch",
+ "1x Energy Hatch",
+ "Maintenance Hatch must be at the back, centered",
};
}
@@ -119,30 +117,23 @@ extends GregtechMeta_MultiBlockBase {
for (byte i = -1; i < 2; i = (byte) (i + 1)) {
for (byte j = -1; j < 2; j = (byte) (j + 1)) {
if ((i != 0) || (j != 0)) {
- for (byte k = 0; k < 5; k = (byte) (k + 1)) {
- if (((i == 0) || (j == 0)) && ((k == 1) || (k == 2) || (k == 3))) {
- if ((this.getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == this.getCasingBlock()) && (this.getBaseMetaTileEntity().getMetaID(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == this.getCasingMeta())) {
- }
- else if (!this.addToMachineList(this.getBaseMetaTileEntity().getIGregTechTileEntity(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i))) && (!this.addEnergyInputToMachineList(this.getBaseMetaTileEntity().getIGregTechTileEntity(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i))))) {
- Logger.INFO("False 2");
+ for (byte k = 0; k < 5; k = (byte) (k + 1)) {
+ Block aBlock = this.getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i));
+ int aMeta = this.getBaseMetaTileEntity().getMetaID(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i));
+ IGregTechTileEntity aTile = this.getBaseMetaTileEntity().getIGregTechTileEntity(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i));
+ if (!isValidBlockForStructure(aTile, getCasingTextureIndex(), true, aBlock, aMeta, getCasingBlock(), getCasingMeta())) {
+ Logger.INFO("Bad Casing on Cutting Machine.");
return false;
- }
- }
- else if ((this.getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == this.getCasingBlock()) && (this.getBaseMetaTileEntity().getMetaID(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == this.getCasingMeta())) {
- }
- else {
- Logger.INFO("False 3");
- return false;
- }
+ }
}
}
}
}
- if ((this.mOutputHatches.size() != 0)) {
- Logger.INFO("Use Busses, Not Hatches for Output.");
+ if ((this.mOutputHatches.size() != 0) || (this.mInputHatches.size() != 0)) {
+ Logger.INFO("Use Busses, Not Hatches for Input/Output.");
return false;
}
- if ((this.mInputBusses.size() < 1) || (this.mOutputBusses.size() < 1)) {
+ if ((this.mInputBusses.size() == 0) || (this.mOutputBusses.size() == 0)) {
Logger.INFO("Incorrect amount of Input & Output busses.");
return false;
}
@@ -157,8 +148,8 @@ extends GregtechMeta_MultiBlockBase {
return false;
}
}
- if ((this.mMaintenanceHatches.size() != 1) || (this.mMufflerHatches.size() < 1) || (this.mEnergyHatches.size() < 1)) {
- Logger.INFO("Incorrect amount of Maintenance or Energy or Muffler hatches.");
+ if ((this.mMaintenanceHatches.size() != 1)) {
+ Logger.INFO("Incorrect amount of Maintenance or Energy hatches.");
return false;
}
} else {
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialElectrolyzer.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialElectrolyzer.java
index 5af8ec027a..aca635fa84 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialElectrolyzer.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialElectrolyzer.java
@@ -8,6 +8,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
+import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.Pair;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
@@ -44,15 +45,13 @@ extends GregtechMeta_MultiBlockBase {
"Only uses 90% of the eu/t normally required",
"Processes two items per voltage tier",
"Size: 3x3x3 (Hollow)",
+ "Electrolyzer Casings for the rest (10 at least!)",
"Controller (front centered)",
- "1x Input Bus (anywhere)",
- "1x Output Bus (anywhere)",
- "1x Input Hatch (anywhere)",
- "1x Output Hatch (anywhere)",
- "1x Energy Hatch (anywhere)",
- "1x Maintenance Hatch (anywhere)",
- "1x Muffler (anywhere)",
- "Electrolyzer Casings for the rest (10 at least!)"
+ "1x Input Bus",
+ "1x Output Bus",
+ "1x Input Hatch",
+ "1x Output Hatch",
+ "1x Energy Hatch",
};
}
@@ -121,38 +120,35 @@ extends GregtechMeta_MultiBlockBase {
@Override
public boolean checkMultiblock(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) {
- /*if (mBluePrint == null) {
- mBluePrint = new Blueprint_Electrolyzer();
- }
- return mBluePrint.checkMachine(aBaseMetaTileEntity);*/
-
- final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
- final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+ int tAmount = 0;
+
if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) {
return false;
- }
-
- int tAmount = 0;
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- for (int h = -1; h < 2; h++) {
- if ((h != 0) || ((((xDir + i) != 0) || ((zDir + j) != 0)) && ((i != 0) || (j != 0)))) {
- final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
- if ((!this.addToMachineList(tTileEntity, TAE.GTPP_INDEX(5)))) {
- final Block tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j);
- final byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j);
- if (((tBlock != ModBlocks.blockCasingsMisc) || (tMeta != 5))) {
+ } else {
+ for (int i = -1; i < 2; ++i) {
+ for (int j = -1; j < 2; ++j) {
+ for (int h = -1; h < 2; ++h) {
+ if (h != 0 || (xDir + i != 0 || zDir + j != 0) && (i != 0 || j != 0)) {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i,
+ h, zDir + j);
+ Block aBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j);
+ int aMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j);
+
+ if (!isValidBlockForStructure(tTileEntity, TAE.GTPP_INDEX(5), true, aBlock, aMeta,
+ ModBlocks.blockCasingsMisc, 5)) {
+ Logger.INFO("Bad Electrolyzer casing");
return false;
}
- tAmount++;
+ ++tAmount;
+
}
}
}
}
+ return tAmount >= 10;
}
- return tAmount >= 10;
-
-
}
@Override
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialExtruder.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialExtruder.java
index 76c738ffe7..0b1691358c 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialExtruder.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialExtruder.java
@@ -52,14 +52,13 @@ extends GregtechMeta_MultiBlockBase {
"Each Input Bus can have a different shape!",
"You can use several input busses per multiblock",
"Size: 3x3x5 [WxHxL] (Hollow)",
+ "Inconel Reinforced Casings (28 at least!)",
"Controller (front centered)",
- "Busses & Hatches cannot replace edge casings",
- "1x Input Bus (anywhere)",
- "1x Output Bus (anywhere)",
- "1x Energy Hatch (anywhere)",
- "1x Muffler Hatch (anywhere)",
- "1x Maintenance Hatch (Back Center)",
- "Inconel Reinforced Casings for the rest (28 at least!)"
+ "1x Input Bus",
+ "1x Output Bus",
+ "1x Input Hatch",
+ "1x Energy Hatch",
+ "Maintenance Hatch must be at the back, centered",
};
}
@@ -160,18 +159,15 @@ extends GregtechMeta_MultiBlockBase {
for (byte j = -1; j < 2; j = (byte) (j + 1)) {
if ((i != 0) || (j != 0)) {
for (byte k = 0; k < 5; k = (byte) (k + 1)) {
- //if (((i == 0) || (j == 0)) && ((k == 1) || (k == 2) || (k == 3))) {
- if ((this.getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == this.getCasingBlock()) && (this.getBaseMetaTileEntity().getMetaID(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == this.getCasingMeta())) {
- }
- else if (!this.addToMachineList(this.getBaseMetaTileEntity().getIGregTechTileEntity(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)), getCasingTextureIndex()) && (!this.addEnergyInputToMachineList(this.getBaseMetaTileEntity().getIGregTechTileEntity(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)), getCasingTextureIndex()))) {
- Logger.WARNING("False 2");
+
+ Block aBlock = this.getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i));
+ int aMeta = this.getBaseMetaTileEntity().getMetaID(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i));
+ IGregTechTileEntity aTile = this.getBaseMetaTileEntity().getIGregTechTileEntity(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i));
+ if (!isValidBlockForStructure(aTile, getCasingTextureIndex(), true, aBlock, aMeta, getCasingBlock(), getCasingMeta())) {
+ Logger.INFO("Bad Casing on Extruder.");
return false;
}
- /*}
- else {
- Logger.WARNING("False 3");
- return false;
- }*/
+
}
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMacerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMacerator.java
index 1b393989cd..93593ad0a8 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMacerator.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMacerator.java
@@ -52,13 +52,11 @@ extends GregtechMeta_MultiBlockBase {
"ULV = Tier 0, LV = Tier 1, etc.",
"-------------------------------------------------------",
"Size[WxHxL]: 3x6x3 (Hollow)",
+ "Maceration Stack Casings (26 at least!)",
"Controller (Center Bottom)",
"1x Input Bus (Any bottom layer casing)",
"5x Output Bus (One per layer except bottom layer)",
- "1x Maintenance Hatch (Any casing)",
- "1x Energy Hatch (Any casing)",
- "1x Muffler Hatch (Any casing)",
- "Maceration Stack Casings for the rest (26 at least!)"
+ "1x Energy Hatch (Any bottom layer casing)",
};
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMixer.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMixer.java
index 1d78f048c4..c4ef545b09 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMixer.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMixer.java
@@ -67,14 +67,12 @@ extends GregtechMeta_MultiBlockBase {
"250% faster than using single block machines of the same voltage",
"Processes eight recipes per voltage tier",
"Size: 3x4x3 (LxHxW)",
- "Controller (front centered)",
- "1x Input Bus (anywhere)",
- "1x Output Bus (anywhere)",
- "1x Energy Hatch (anywhere)",
- "1x Maintenance Hatch (anywhere)",
- "1x Muffler Hatch (anywhere)",
- mCasingName+"s for the rest (16 at least!)",
+ mCasingName+"s (16 at least!)",
mCasingName2+"s for the internal blocks (2)",
+ "Controller (front centered)",
+ "1x Input Bus",
+ "1x Output Bus",
+ "1x Energy Hatch",
};
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java
index fdfb395a0c..e6a043f29f 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java
@@ -169,30 +169,36 @@ extends GregtechMeta_MultiBlockBase {
@Override
public boolean checkMultiblock(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) {
- final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
- final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+ int tAmount = 0;
+
if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) {
return false;
- }
- int tAmount = 0;
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- for (int h = -1; h < 2; h++) {
- if ((h != 0) || ((((xDir + i) != 0) || ((zDir + j) != 0)) && ((i != 0) || (j != 0)))) {
- final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
- if (!this.addToMachineList(tTileEntity, getTextureIndex())) {
- final Block tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j);
- final byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j);
- if (((tBlock != ModBlocks.blockCasings3Misc) || (tMeta != 2))) {
+ } else {
+ for (int i = -1; i < 2; ++i) {
+ for (int j = -1; j < 2; ++j) {
+ for (int h = -1; h < 2; ++h) {
+ if (h != 0 || (xDir + i != 0 || zDir + j != 0) && (i != 0 || j != 0)) {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i,
+ h, zDir + j);
+ Block aBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j);
+ int aMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j);
+
+ if (!isValidBlockForStructure(tTileEntity, getTextureIndex(), true, aBlock, aMeta,
+ ModBlocks.blockCasings3Misc, 2)) {
+ Logger.INFO("Bad centrifuge casing");
return false;
}
- tAmount++;
+ ++tAmount;
+
}
}
}
}
- }
- return tAmount >= 6 && this.mMufflerHatches.size() > 0;
+ return tAmount >= 6;
+ }
}
@Override
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialPlatePress.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialPlatePress.java
index e3eceab2a2..0939a9e6be 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialPlatePress.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialPlatePress.java
@@ -12,6 +12,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
+import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
@@ -55,13 +56,11 @@ public class GregtechMetaTileEntity_IndustrialPlatePress extends GregtechMeta_Mu
"Circuit for recipe goes in the Input Bus",
"Each Input Bus can have a different Circuit/Shape!",
"Size: 3x3x3 (Hollow)",
+ "Material Press Machine Casings (10 at least!)",
"Controller (front centered)",
- "1x Input Bus (anywhere)",
- "1x Output Bus (anywhere)",
- "1x Energy Hatch (anywhere)",
- "1x Maintenance Hatch (anywhere)",
- "1x Muffler Hatch (anywhere)",
- "Material Press Machine Casings for the rest (12 at least!)"
+ "1x Input Bus",
+ "1x Output Bus",
+ "1x Energy Hatch",
};
}
@@ -133,30 +132,35 @@ public class GregtechMetaTileEntity_IndustrialPlatePress extends GregtechMeta_Mu
@Override
public boolean checkMultiblock(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) {
- final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
- final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+ int tAmount = 0;
+
if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) {
return false;
- }
- int tAmount = 0;
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- for (int h = -1; h < 2; h++) {
- if ((h != 0) || ((((xDir + i) != 0) || ((zDir + j) != 0)) && ((i != 0) || (j != 0)))) {
- final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
- if ((!this.addMaintenanceToMachineList(tTileEntity, TAE.GTPP_INDEX(4))) && (!this.addMufflerToMachineList(tTileEntity, TAE.GTPP_INDEX(4))) && (!this.addInputToMachineList(tTileEntity, TAE.GTPP_INDEX(4))) && (!this.addOutputToMachineList(tTileEntity, TAE.GTPP_INDEX(4))) && (!this.addEnergyInputToMachineList(tTileEntity, TAE.GTPP_INDEX(4)))) {
- final Block tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j);
- final byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j);
- if (((tBlock != ModBlocks.blockCasingsMisc) || (tMeta != 4))) {
+ } else {
+ for (int i = -1; i < 2; ++i) {
+ for (int j = -1; j < 2; ++j) {
+ for (int h = -1; h < 2; ++h) {
+ if (h != 0 || (xDir + i != 0 || zDir + j != 0) && (i != 0 || j != 0)) {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i,
+ h, zDir + j);
+ Block aBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j);
+ int aMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j);
+
+ if (!isValidBlockForStructure(tTileEntity, 4, true, aBlock, aMeta,
+ ModBlocks.blockCasingsMisc, 4)) {
+ Logger.INFO("Bad material press casing");
return false;
}
- tAmount++;
+ ++tAmount;
+
}
}
}
}
+ return tAmount >= 10;
}
- return tAmount >= 12;
}
@Override
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSifter.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSifter.java
index b0ee87ea13..bd36e4429e 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSifter.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSifter.java
@@ -131,7 +131,7 @@ extends GregtechMeta_MultiBlockBase {
@Override
public boolean checkMultiblock(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) {
- Logger.MACHINE_INFO("Checking structure for Industrial Sifter.");
+ log("Checking structure for Industrial Sifter.");
final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 2;
final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 2;
@@ -157,31 +157,21 @@ extends GregtechMeta_MultiBlockBase {
// Sifter Floor/Roof inner 3x3
if (((i != -2) && (i != 2)) && ((j != -2) && (j != 2))) {
if (h != 0){
- if (!this.addToMachineList(tTileEntity, TAE.GTPP_INDEX(21))) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasings2Misc) {
- Logger.MACHINE_INFO("Sifter Casing(s) Missing from one of the "+sHeight+" layers inner 3x3.");
- Logger.MACHINE_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName());
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 6) {
- Logger.MACHINE_INFO("Sifter Casing(s) Missing from one of the "+sHeight+" layers inner 3x3. Wrong Meta for Casing. Found:"+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()+" with meta:"+aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j));
- return false;
- }
+
+ if (!isValidBlockForStructure(tTileEntity, TAE.GTPP_INDEX(21), false, aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j), (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j), ModBlocks.blockCasings2Misc, 6)) {
+ log("Sifter Casing(s) Missing from one of the "+sHeight+" layers inner 3x3.");
+ log("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName());
+ return false;
}
+
}
- else {
- if (!this.addToMachineList(tTileEntity, TAE.GTPP_INDEX(21))) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasings2Misc) {
- Logger.MACHINE_INFO("Sifter Casing(s) Missing from one of the "+sHeight+" layers inner 3x3.");
- Logger.MACHINE_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName());
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 5) {
- Logger.MACHINE_INFO("Sifter Casing(s) Missing from one of the "+sHeight+" layers inner 3x3. Wrong Meta for Casing. Found:"+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()+" with meta:"+aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j));
- return false;
- }
- tAmount++;
+ else {
+ if (!isValidBlockForStructure(tTileEntity, TAE.GTPP_INDEX(21), false, aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j), (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j), ModBlocks.blockCasings2Misc, 5)) {
+ log("Sifter Casing(s) Missing from one of the "+sHeight+" layers inner 3x3.");
+ log("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName());
+ return false;
}
+ tAmount++;
}
}
else {
@@ -193,32 +183,19 @@ extends GregtechMeta_MultiBlockBase {
}
else {
checkController = false;
- }
-
- if (!this.addToMachineList(tTileEntity, TAE.GTPP_INDEX(21))) {
- if (!checkController){
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasings2Misc) {
+ }
+ if (!this.addToMachineList(tTileEntity, TAE.GTPP_INDEX(21))) {
+ if (!checkController){
+ if (!isValidBlockForStructure(null, TAE.GTPP_INDEX(21), false, aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j), (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j), ModBlocks.blockCasings2Misc, 5)) {
if ((tTileEntity instanceof GregtechMetaTileEntity_IndustrialSifter) || (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) == GregTech_API.sBlockMachines)){
if (h != 0){
- Logger.MACHINE_INFO("Found a secondary controller at the wrong Y level.");
+ log("Found a secondary controller at the wrong Y level.");
return false;
}
}
else {
- Logger.MACHINE_INFO("Sifter Casings Missing from somewhere in the "+sHeight+" layer edge.");
- Logger.MACHINE_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName());
- return false;
- }
- }
-
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 5) {
- if ((tTileEntity instanceof GregtechMetaTileEntity_IndustrialSifter) || (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) == GregTech_API.sBlockMachines)){
-
- }
- else {
- Logger.MACHINE_INFO("Sifter Casings Missing from somewhere in the "+sHeight+" layer edge.");
- Logger.MACHINE_INFO("Incorrect Meta value for block, expected 5.");
- Logger.MACHINE_INFO("Instead, found "+aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j)+".");
+ log("Sifter Casings Missing from somewhere in the "+sHeight+" layer edge.");
+ log("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName());
return false;
}
}
@@ -234,11 +211,11 @@ extends GregtechMeta_MultiBlockBase {
}
if ((this.mInputBusses.size() < 1) || (this.mOutputBusses.size() < 4)
|| (this.mMaintenanceHatches.size() != 1) || (this.mEnergyHatches.size() < 1)) {
- Logger.MACHINE_INFO("Returned False 3");
- Logger.MACHINE_INFO("Input Buses: "+this.mInputBusses.size()+" | expected: 1");
- Logger.MACHINE_INFO("Output Buses: "+this.mOutputBusses.size()+" | expected: 4");
- Logger.MACHINE_INFO("Energy Hatches: "+this.mEnergyHatches.size()+" | expected: 1");
- Logger.MACHINE_INFO("Maint. hatches: "+this.mMaintenanceHatches.size()+" | expected: 1");
+ log("Returned False 3");
+ log("Input Buses: "+this.mInputBusses.size()+" | expected: 1");
+ log("Output Buses: "+this.mOutputBusses.size()+" | expected: 4");
+ log("Energy Hatches: "+this.mEnergyHatches.size()+" | expected: 1");
+ log("Maint. hatches: "+this.mMaintenanceHatches.size()+" | expected: 1");
return false;
}
final int height = this.getBaseMetaTileEntity().getYCoord();
@@ -249,7 +226,7 @@ extends GregtechMeta_MultiBlockBase {
if (tmpHatches[i] == null) {
tmpHatches[i] = this.mOutputBusses.get(i);
} else {
- Logger.MACHINE_INFO("Returned False 5 - "+this.mOutputBusses.size());
+ log("Returned False 5 - "+this.mOutputBusses.size());
return false;
}
}
@@ -258,7 +235,7 @@ extends GregtechMeta_MultiBlockBase {
this.mOutputBusses.add(tmpHatches[i]);
}
- Logger.MACHINE_INFO("Industrial Sifter - Structure Built? "+(tAmount>=35));
+ log("Industrial Sifter - Structure Built? "+(tAmount>=35));
return tAmount >= 35;
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialThermalCentrifuge.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialThermalCentrifuge.java
index dc928e3bfb..fd23e04c5f 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialThermalCentrifuge.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialThermalCentrifuge.java
@@ -44,14 +44,13 @@ extends GregtechMeta_MultiBlockBase {
"150% faster than using single block machines of the same voltage",
"Only uses 80% of the eu/t normally required",
"Processes eight items per voltage tier",
- "Size: 3x2x3 [WxHxL]", "Controller (front centered, top layer)",
+ "Size: 3x2x3 [WxHxL]",
+ "Thermal processing Casings (8 at least!)",
+ "Noise Hazard Sign Blocks also count as valid casings",
+ "Controller (front centered, top layer)",
"1x Input Bus (Any bottom layer casing)",
"1x Output Bus (Any bottom layer casing)",
- "1x Maintenance Hatch (Any bottom layer casing)",
- "1x Muffler Hatch (Casing under controller)",
"1x Energy Hatch (Any bottom layer casing)",
- "Thermal processing Casings for the rest (8 at least!)",
- "Noise Hazard Sign Blocks also count as valid casings",
};
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialVacuumFreezer.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialVacuumFreezer.java
index 7b3b652c92..240cf657cd 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialVacuumFreezer.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialVacuumFreezer.java
@@ -1,27 +1,27 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.FluidStack;
+import static gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map.sAdvFreezerRecipes;
+import static gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map.sAdvFreezerRecipes_GT;
import gregtech.api.enums.TAE;
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.IIconContainer;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.Recipe_GT;
+import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.block.ModBlocks;
-import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
-import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Utility;
-import gregtech.api.util.Recipe_GT;
-import static gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map.*;
-
-import gregtech.api.interfaces.IIconContainer;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.enums.Textures;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
public class GregtechMetaTileEntity_IndustrialVacuumFreezer extends GregtechMeta_MultiBlockBase {
@@ -69,14 +69,14 @@ public class GregtechMetaTileEntity_IndustrialVacuumFreezer extends GregtechMeta
"Super cools hot ingots and cells",
"Processes four Vacuum Freezer Recipes at 200% speed",
"Consumes 1L of "+mCryoFuelName+"/t during operation",
- "Size(WxHxD): 3x3x3 (Hollow), Controller (Front centered)",
- "1x Input Bus (Any casing)",
- "1x Output Bus (Any casing)",
- "1x Input Hatch (Any casing, optional)",
- "1x Output Hatch (Any casing, optional)",
- "1x Maintenance Hatch (Any casing)",
- "1x Energy Hatch (Any casing)",
+ "Size(WxHxD): 3x3x3 (Hollow)",
mCasingName+"s for the rest (10 at least!)",
+ "Controller (Front centered)",
+ "1x Input Bus",
+ "1x Output Bus",
+ "1x Input Hatch",
+ "1x Output Hatch (optional)",
+ "1x Energy Hatch",
};
}
@@ -136,32 +136,34 @@ public class GregtechMetaTileEntity_IndustrialVacuumFreezer extends GregtechMeta
}
public boolean checkMultiblock(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) {
- final int xDir = ForgeDirection.getOrientation((int) aBaseMetaTileEntity.getBackFacing()).offsetX;
- final int zDir = ForgeDirection.getOrientation((int) aBaseMetaTileEntity.getBackFacing()).offsetZ;
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+ int tAmount = 0;
if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) {
return false;
- }
- int tAmount = 0;
- for (int i = -1; i < 2; ++i) {
- for (int j = -1; j < 2; ++j) {
- for (int h = -1; h < 2; ++h) {
- if (h != 0 || ((xDir + i != 0 || zDir + j != 0) && (i != 0 || j != 0))) {
- final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity
- .getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
- if (!this.addToMachineList(tTileEntity, CASING_TEXTURE_ID)) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasings3Misc) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 10) {
+ } else {
+ for (int i = -1; i < 2; ++i) {
+ for (int j = -1; j < 2; ++j) {
+ for (int h = -1; h < 2; ++h) {
+ if (h != 0 || (xDir + i != 0 || zDir + j != 0) && (i != 0 || j != 0)) {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i,
+ h, zDir + j);
+ Block aBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j);
+ int aMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j);
+
+ if (!isValidBlockForStructure(tTileEntity, CASING_TEXTURE_ID, true, aBlock, aMeta,
+ ModBlocks.blockCasings3Misc, 10)) {
+ Logger.INFO("Bad centrifuge casing");
return false;
}
++tAmount;
+
}
}
}
}
+ return tAmount >= 10;
}
- return tAmount >= 10;
}
public int getMaxEfficiency(final ItemStack aStack) {
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWashPlant.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWashPlant.java
index 172c293235..ce1fe57e63 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWashPlant.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWashPlant.java
@@ -64,8 +64,6 @@ extends GregtechMeta_MultiBlockBase {
"1x Input Bus (Any casing)",
"1x Input Hatch (Any casing)",
"1x Output Bus (Any casing)",
- "1x Muffler Hatch (Any casing)",
- "1x Maintenance Hatch (Any casing)",
"1x Energy Hatch (Any casing)",
"Wash Plant Casings for the rest"
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWireMill.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWireMill.java
index 0510a554c8..bf33892420 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWireMill.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWireMill.java
@@ -47,16 +47,16 @@ extends GregtechMeta_MultiBlockBase {
"200% faster than using single block machines of the same voltage",
"Only uses 75% of the eu/t normally required",
"Processes four items per voltage tier",
- "Size: 3x3x5 [WxHxL] (Hollow)", "Controller (front centered)",
- "2x Input Bus (side centered)",
- "2x Output Bus (side centered)",
- "1x Energy Hatch (top or bottom centered)",
- "1x Muffler Hatch (top or bottom centered)",
- "1x Maintenance Hatch (back centered)",
- "Wire Factory Casings for the rest (32 at least!)"
+ "Size: 3x3x5 [WxHxL] (Hollow)",
+ "Wire Factory Casings (32 at least!)",
+ "Controller (front centered)",
+ "1x Input Bus",
+ "1x Output Bus",
+ "1x Energy Hatch",
+ "Maintenance Hatch must be at the back, centered",
};
}
-
+
@Override
public String getSound() {
return GregTech_API.sSoundList.get(Integer.valueOf(204));
@@ -124,21 +124,14 @@ extends GregtechMeta_MultiBlockBase {
for (byte i = -1; i < 2; i = (byte) (i + 1)) {
for (byte j = -1; j < 2; j = (byte) (j + 1)) {
if ((i != 0) || (j != 0)) {
- for (byte k = 0; k < 5; k = (byte) (k + 1)) {
- //if (((i == 0) || (j == 0)) && ((k == 1) || (k == 2) || (k == 3))) {
- if ((this.getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == this.getCasingBlock()) && (this.getBaseMetaTileEntity().getMetaID(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == this.getCasingMeta())) {
- }
- else if (!this.addToMachineList(this.getBaseMetaTileEntity().getIGregTechTileEntity(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i))) && (!this.addEnergyInputToMachineList(this.getBaseMetaTileEntity().getIGregTechTileEntity(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i))))) {
- Logger.INFO("False 2");
+ for (byte k = 0; k < 5; k = (byte) (k + 1)) {
+ Block aBlock = this.getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i));
+ int aMeta = this.getBaseMetaTileEntity().getMetaID(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i));
+ IGregTechTileEntity aTile = this.getBaseMetaTileEntity().getIGregTechTileEntity(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i));
+ if (!isValidBlockForStructure(aTile, getCasingTextureIndex(), true, aBlock, aMeta, getCasingBlock(), getCasingMeta())) {
+ Logger.INFO("Bad Casing on Wiremill.");
return false;
- }
- /*}
- else if ((this.getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == this.getCasingBlock()) && (this.getBaseMetaTileEntity().getMetaID(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == this.getCasingMeta())) {
- }
- else {
- Logger.INFO("False 3");
- return false;
- }*/
+ }
}
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java
index f21c4e0554..305ed1b64d 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java
@@ -104,17 +104,19 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase
return new String[] { "Controller Block for the Advanced Electric Blast Furnace",
"120% faster than using an equal tier EBF", "Only uses 90% of the eu/t normally required",
- "Processes upto 8 recipes at once", "Consumes 10L of " + mHotFuelName + "/s during operation",
+ "Processes upto 8 recipes at once",
+ "Consumes 10L of " + mHotFuelName + "/s during operation",
+ "Each 900K over the min. Heat Capacity grants 5% speedup (multiplicatively)",
+ "Each 1800K over the min. Heat Capacity allows for one upgraded overclock",
+ "Upgraded overclocks reduce recipe time to 25% and increase EU/t to 400%",
"Size(WxHxD): 3x4x3 (Hollow), Controller (Front middle bottom)",
- "16x Heating Coils (Two middle Layers, hollow)", "1x " + mHatchName + " (Any bottom layer casing)",
- "1x Input Hatch/Bus (Any bottom layer casing)", "1x Output Hatch/Bus (Any bottom layer casing)",
- "1x Energy Hatch (Any bottom layer casing)", "1x Maintenance Hatch (Any bottom layer casing)",
- "1x Muffler Hatch (Top middle)",
+ "16x Heating Coils (Two middle Layers, hollow)",
+ "1x " + mHatchName,
+ "1x Input Hatch/Bus",
+ "1x Output Hatch/Bus (Bottom Layer)",
"1x Output Hatch to recover CO2/CO/SO2 (optional, any top layer casing),",
" Recovery scales with Muffler Hatch tier", mCasingName + "s for the rest",
- "Each 900K over the min. Heat Capacity grants 5% speedup (multiplicatively)",
- "Each 1800K over the min. Heat Capacity allows for one upgraded overclock",
- "Upgraded overclocks reduce recipe time to 25% and increase EU/t to 400%"
+ "1x Energy Hatch",
};
}
@@ -254,34 +256,21 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase
}
if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 1, zDir + j) != tUsedMeta) {
return false;
- }
- if (!addOutputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 3, zDir + j),
- CASING_TEXTURE_ID)) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 3, zDir + j) != ModBlocks.blockCasings3Misc) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 3, zDir + j) != 11) {
- return false;
- }
- }
+ }
+ if (!isValidBlockForStructure(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 3, zDir + j), CASING_TEXTURE_ID, true, aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j), (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j), ModBlocks.blockCasings3Misc, 11)) {
+ Logger.INFO("Matter Fabricator Casings Missing from one of the top layers inner 3x3.");
+ return false;
+ }
}
}
}
for (int i = -1; i < 2; i++) {
for (int j = -1; j < 2; j++) {
if ((xDir + i != 0) || (zDir + j != 0)) {
- IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 0,
- zDir + j);
- if ((!addMaintenanceToMachineList(tTileEntity, CASING_TEXTURE_ID))
- && (!addInputToMachineList(tTileEntity, CASING_TEXTURE_ID))
- && (!addOutputToMachineList(tTileEntity, CASING_TEXTURE_ID))
- && (!addEnergyInputToMachineList(tTileEntity, CASING_TEXTURE_ID))) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j) != ModBlocks.blockCasings3Misc) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j) != 11) {
- return false;
- }
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 0,zDir + j);
+ if (!isValidBlockForStructure(tTileEntity, CASING_TEXTURE_ID, true, aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j), (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j), ModBlocks.blockCasings3Misc, 11)) {
+ Logger.INFO("Matter Fabricator Casings Missing from one of the top layers inner 3x3.");
+ return false;
}
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Implosion.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Implosion.java
index 3f292b8313..78dd5e8b7a 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Implosion.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Implosion.java
@@ -9,6 +9,8 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
@@ -48,13 +50,12 @@ extends GregtechMeta_MultiBlockBase {
return new String[]{
"Controller Block for the Advanced Implosion Compressor",
"Processes upto ((Tier/2)+1) recipes at once",
- "Size(WxHxD): 3x3x3 (Hollow), Controller (Front centered)",
- "1x Input Bus (Any casing)",
- "1x Output Bus (Any casing)",
- "1x Maintenance Hatch (Any casing)",
- "1x Muffler Hatch (Any casing)",
- "1x Energy Hatch (Any casing)",
- mCasingName+"s for the rest (16 at least!)"
+ "Size(WxHxD): 3x3x3 (Hollow)",
+ mCasingName+"s (10 at least!)",
+ "Controller (Front centered)",
+ "1x Input Bus",
+ "1x Output Bus",
+ "1x Energy Hatch",
};
}
@@ -103,32 +104,35 @@ extends GregtechMeta_MultiBlockBase {
}
}
- public boolean checkMultiblock(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ public boolean checkMultiblock(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+ int tAmount = 0;
if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) {
return false;
- }
- int tAmount = 0;
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- for (int h = -1; h < 2; h++) {
- if ((h != 0) || (((xDir + i != 0) || (zDir + j != 0)) && ((i != 0) || (j != 0)))) {
- IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
-
- if ((!addMaintenanceToMachineList(tTileEntity, 48)) && (!addMufflerToMachineList(tTileEntity, 48)) && (!addInputToMachineList(tTileEntity, 48)) && (!addOutputToMachineList(tTileEntity, 48)) && (!addEnergyInputToMachineList(tTileEntity, 48))) {
- Block tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j);
- byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j);
- if ((tBlock != sBlockCasings4) || (tMeta != 0)) {
+ } else {
+ for (int i = -1; i < 2; ++i) {
+ for (int j = -1; j < 2; ++j) {
+ for (int h = -1; h < 2; ++h) {
+ if (h != 0 || (xDir + i != 0 || zDir + j != 0) && (i != 0 || j != 0)) {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i,
+ h, zDir + j);
+ Block aBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j);
+ int aMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j);
+
+ if (!isValidBlockForStructure(tTileEntity, 48, true, aBlock, aMeta,
+ sBlockCasings4, 0)) {
+ Logger.INFO("Bad centrifuge casing");
return false;
}
- tAmount++;
+ ++tAmount;
+
}
}
}
}
+ return tAmount >= 10;
}
- return tAmount >= 16;
}
public int getMaxEfficiency(ItemStack aStack) {
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_AutoCrafter.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_AutoCrafter.java
index 038b8f9297..a39bc5d31b 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_AutoCrafter.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_AutoCrafter.java
@@ -4,6 +4,7 @@ import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
+import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -127,16 +128,25 @@ public class GT4Entity_AutoCrafter extends GregtechMeta_MultiBlockBase {
@Override
public String[] getTooltip() {
- return new String[] { "Highly Advanced Autocrafter", "Right Click with a Screwdriver to change mode",
+ return new String[] {
+ "Highly Advanced Autocrafter",
+ "Right Click with a Screwdriver to change mode",
"This Machine Can Autocraft, Assemble, Disassemble or Circuit Assemble",
"200% faster than using single block machines of the same voltage",
- "Processes two items per voltage tier", "--------------------------------------",
- "Insert a Memory stick into the GUI", "to automate a crafting table recipe",
- "Requires recipe to be scanned in a project table", "--------------------------------------",
- "Size: 3x3x3 (Hollow)", "1x Input Bus", "1x Input Hatch", "1x Output Bus", "1x Output Hatch",
- "1x Muffler Hatch", "1x Maintenance Hatch", "1x Energy Hatch",
- "Hatches & Busses can be placed anywhere", "Rest is Autocrafter Frame",
- "--------------------------------------",
+ "Processes two items per voltage tier",
+ "--------------------------------------",
+ "Insert a Memory stick into the GUI",
+ "to automate a crafting table recipe",
+ "Requires recipe to be scanned in a project table",
+ "--------------------------------------",
+ "Size: 3x3x3 (Hollow)",
+ "Autocrafter Frame (10 at least!)",
+ "Controller (Front Center)",
+ "1x Input Bus",
+ "1x Input Hatch",
+ "1x Output Bus",
+ "1x Output Hatch",
+ "1x Energy Hatch",
};
}
@@ -153,51 +163,41 @@ public class GT4Entity_AutoCrafter extends GregtechMeta_MultiBlockBase {
@Override
public boolean checkMultiblock(IGregTechTileEntity aBaseMetaTileEntity, ItemStack p1) {
- final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
- final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+ int tAmount = 0;
+
if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) {
return false;
- }
- int tAmount = 0;
- for (int i = -1; i < 2; ++i) {
- for (int j = -1; j < 2; ++j) {
- for (int h = -1; h < 2; ++h) {
- if (h != 0 || ((xDir + i != 0 || zDir + j != 0) && (i != 0 || j != 0))) {
- final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity
- .getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
- if (!this.addToMachineList(tTileEntity, TAE.GTPP_INDEX(28))) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h,
- zDir + j) != ModBlocks.blockCasings2Misc) {
- Logger.WARNING("Bad Block. Found "
- + aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName());
- Logger.WARNING("Block Found at x:" + (aBaseMetaTileEntity.getXCoord() + xDir + i)
- + " | y:" + (aBaseMetaTileEntity.getYCoord() + h) + " | z:"
- + (aBaseMetaTileEntity.getZCoord() + zDir + j));
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 12) {
- Logger.WARNING("Bad Meta.");
+ } else {
+ for (int i = -1; i < 2; ++i) {
+ for (int j = -1; j < 2; ++j) {
+ for (int h = -1; h < 2; ++h) {
+ if (h != 0 || (xDir + i != 0 || zDir + j != 0) && (i != 0 || j != 0)) {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i,
+ h, zDir + j);
+ Block aBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j);
+ int aMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j);
+
+ if (!isValidBlockForStructure(tTileEntity, TAE.GTPP_INDEX(28), true, aBlock, aMeta,
+ ModBlocks.blockCasings2Misc, 12)) {
+ Logger.INFO("Bad Autcrafter casing");
return false;
}
++tAmount;
+
}
}
}
}
}
- if ((this.mInputHatches.size() == 0) || (this.mOutputHatches.size() == 0) || (this.mInputBusses.size() == 0)
- || (this.mOutputBusses.size() == 0) || (this.mMufflerHatches.size() != 1)
- || (this.mMaintenanceHatches.size() != 1) || (this.mEnergyHatches.size() == 0)) {
+ if ((this.mMaintenanceHatches.size() != 1) || (this.mEnergyHatches.size() == 0)) {
Logger.WARNING("Wrong Hatch count.");
- Logger.WARNING("|" + this.mInputHatches.size() + "|" + this.mOutputHatches.size() + "|"
- + this.mInputBusses.size() + "|" + this.mOutputBusses.size() + "|" + this.mMufflerHatches.size()
- + "|" + this.mMaintenanceHatches.size() + "|" + this.mEnergyHatches.size() + "|");
return false;
}
-
// mInventoryCrafter = new CraftingHelper(this);
- return tAmount >= 16;
+ return tAmount >= 10;
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java
index 2cbb4a9fd2..6103375bcf 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java
@@ -16,6 +16,7 @@ import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.item.general.ItemLavaFilter;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
+import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
@@ -192,15 +193,14 @@ extends GregtechMeta_MultiBlockBase
{
return new String[]{
"Thermal Boiler Controller",
- "Converts Heat into Steam",
+ "Converts Water & Heat into Steam",
+ "Consult user manual for more information",
"Size: 3x3x3 (Hollow)",
+ "Thermal Containment Casings (10 at least!)",
"Controller (front middle)",
- "2x Output Hatch/Bus",
"2x Input Hatch",
- "1x Maintenance Hatch",
- "Thermal Containment Casings for the rest",
- "Use 2 Output Hatches by default, change one to a Bus if filtering Lava",
- "Consult user manual for more information",
+ "1x Output Hatch (Steam)",
+ "1x Output Bus (Filter results, optional)",
};
}
@@ -215,32 +215,35 @@ extends GregtechMeta_MultiBlockBase
@Override
public boolean checkMultiblock(IGregTechTileEntity aBaseMetaTileEntity, ItemStack arg1) {
- final int xDir = ForgeDirection.getOrientation((int) aBaseMetaTileEntity.getBackFacing()).offsetX;
- final int zDir = ForgeDirection.getOrientation((int) aBaseMetaTileEntity.getBackFacing()).offsetZ;
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+ int tAmount = 0;
+
if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) {
return false;
- }
- int tAmount = 0;
- for (int i = -1; i < 2; ++i) {
- for (int j = -1; j < 2; ++j) {
- for (int h = -1; h < 2; ++h) {
- if (h != 0 || ((xDir + i != 0 || zDir + j != 0) && (i != 0 || j != 0))) {
- final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity
- .getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
- if (!this.addToMachineList(tTileEntity, TAE.GTPP_INDEX(1))) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasings2Misc) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 11) {
+ } else {
+ for (int i = -1; i < 2; ++i) {
+ for (int j = -1; j < 2; ++j) {
+ for (int h = -1; h < 2; ++h) {
+ if (h != 0 || (xDir + i != 0 || zDir + j != 0) && (i != 0 || j != 0)) {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i,
+ h, zDir + j);
+ Block aBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j);
+ int aMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j);
+
+ if (!isValidBlockForStructure(tTileEntity, 1, true, aBlock, aMeta,
+ ModBlocks.blockCasings2Misc, 11)) {
+ Logger.INFO("Bad Thermal Boiler casing");
return false;
}
++tAmount;
+
}
}
}
}
+ return tAmount >= 10;
}
- return tAmount >= 10;
}
public boolean damageFilter(){
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java
index d72a8da0fc..ee3207a4aa 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java
@@ -17,6 +17,7 @@ import gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
+import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
@@ -46,13 +47,13 @@ public class GregtechMetaTileEntityGeneratorArray extends GregtechMeta_MultiBloc
return new String[]{
"Controller Block for the Generator Array",
"Runs supplied generators as if placed in the world",
- "Size(WxHxD): 3x3x3 (Hollow), Controller (Front centered)",
- "1x Input Hatch/Bus (Any casing)",
- "1x Output Hatch/Bus (Any casing)",
- "1x Maintenance Hatch (Any casing)",
- "1x Energy Hatch (Any casing)",
- "Robust Tungstensteel Machine Casings for the rest (16 at least!)",
- "Place up to 16 Single Block GT Generators into the Controller Inventory",
+ "Size(WxHxD): 3x3x3 (Hollow)",
+ "Robust Tungstensteel Machine Casings (10 at least!)",
+ "Place up to 16 Single Block GT Generators into the Controller",
+ "Controller (Front centered)",
+ "1x Input Hatch/Bus",
+ "1x Output Hatch/Bus",
+ "1x Energy Hatch",
};
}
@@ -207,32 +208,35 @@ public class GregtechMetaTileEntityGeneratorArray extends GregtechMeta_MultiBloc
}
@Override
- public boolean checkMultiblock(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ public boolean checkMultiblock(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+ int tAmount = 0;
if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) {
return false;
- }
- int tAmount = 0;
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- for (int h = -1; h < 2; h++) {
- if ((h != 0) || (((xDir + i != 0) || (zDir + j != 0)) && ((i != 0) || (j != 0)))) {
- IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
- if ((!addMaintenanceToMachineList(tTileEntity, 48)) && (!addInputToMachineList(tTileEntity, 48)) && (!addOutputToMachineList(tTileEntity, 48)) && (!addDynamoToMachineList(tTileEntity, 48))) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != GregTech_API.sBlockCasings4) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 0) {
+ } else {
+ for (int i = -1; i < 2; ++i) {
+ for (int j = -1; j < 2; ++j) {
+ for (int h = -1; h < 2; ++h) {
+ if (h != 0 || (xDir + i != 0 || zDir + j != 0) && (i != 0 || j != 0)) {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i,
+ h, zDir + j);
+ Block aBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j);
+ int aMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j);
+
+ if (!isValidBlockForStructure(tTileEntity, 48, true, aBlock, aMeta,
+ GregTech_API.sBlockCasings4, 0)) {
+ Logger.INFO("Bad centrifuge casing");
return false;
}
- tAmount++;
+ ++tAmount;
+
}
}
}
}
+ return tAmount >= 10;
}
- return tAmount >= 16;
}
@Override
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java
index 4eec84439f..9081e6bc64 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java
@@ -10,7 +10,6 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energ
import gregtech.api.objects.GT_ItemStack;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Utility;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.minecraft.BlockPos;
import gtPlusPlus.core.block.ModBlocks;
@@ -55,18 +54,6 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase
public String[] getTooltip() {
return new String[]{
"THIS MULTIBLOCK IS DISABLED - DO NOT BUILD",
- "Controller Block for the Tree Farmer",
- "How to get your first logs without an axe.",
- "Size(WxHxD): 15x2x15",
- "Purple: Farm Keeper Blocks",
- "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)",
};
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_AlloyBlastSmelter.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_AlloyBlastSmelter.java
index a7f7be4faa..85bc4c4c17 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_AlloyBlastSmelter.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_AlloyBlastSmelter.java
@@ -56,15 +56,13 @@ extends GregtechMeta_MultiBlockBase {
"Allows Complex GT++ alloys to be created",
"Circuit for recipe goes in the Input Bus or GUI slot",
"Size: 3x4x3 (Hollow)",
+ "Blast Smelter Casings (10 at least!)",
"Controller (front middle at bottom)",
"16x Blast Smelter Heat Containment Coils (two middle Layers, hollow)",
- "1x Input bus (one of bottom)",
- "1x Output Hatch (one of bottom)",
- "1x Energy Hatch (one of bottom)",
- "1x Maintenance Hatch (one of bottom)",
- "1x Muffler Hatch (top middle)",
- "1x Fluid Input Hatch (optional, top layer)",
- "Blast Smelter Casings for the rest",
+ "1x Input bus",
+ "1x Input Hatch (optional)",
+ "1x Output Hatch",
+ "1x Energy Hatch",
};
}
@@ -178,7 +176,7 @@ extends GregtechMeta_MultiBlockBase {
final long tVoltage = this.getMaxInputVoltage();
final byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
final GT_Recipe tRecipe = Recipe_GT.Gregtech_Recipe_Map.sAlloyBlastSmelterRecipes.findRecipe(this.getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs);
- if ((tRecipe != null) && (this.mHeatingCapacity >= tRecipe.mSpecialValue) && (tRecipe.isRecipeInputEqual(true, tFluids, tInputs))) {
+ if ((tRecipe != null) && (tRecipe.isRecipeInputEqual(true, tFluids, tInputs))) {
Logger.WARNING("Found some Valid Inputs.");
this.mEfficiency = (10000 - ((this.getIdealStatus() - this.getRepairStatus()) * 1000));
this.mEfficiencyIncrease = 10000;
@@ -222,55 +220,50 @@ extends GregtechMeta_MultiBlockBase {
final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
- //this.mHeatingCapacity = 0;
+ this.mHeatingCapacity = 0;
if (!aBaseMetaTileEntity.getAirOffset(xDir, 1, zDir)) {
return false;
}
if (!aBaseMetaTileEntity.getAirOffset(xDir, 2, zDir)) {
return false;
}
- this.addMufflerToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, 3, zDir), TAE.GTPP_INDEX(15));
this.mHeatingCapacity = 20000;
for (int i = -1; i < 2; i++) {
for (int j = -1; j < 2; j++) {
if ((i != 0) || (j != 0)) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 2, zDir + j) != ModBlocks.blockCasingsMisc) {
+
+ //Coils 1
+ if (!isValidBlockForStructure(null, TAE.GTPP_INDEX(1), false, aBaseMetaTileEntity.getBlockOffset(xDir + i, 1, zDir + j), (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 1, zDir + j), ModBlocks.blockCasingsMisc, 14)) {
+ Logger.INFO("Heating Coils missing.");
return false;
}
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 2, zDir + j) != 14) {
+
+ //Coils 2
+ if (!isValidBlockForStructure(null, TAE.GTPP_INDEX(1), false, aBaseMetaTileEntity.getBlockOffset(xDir + i, 2, zDir + j), (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 2, zDir + j), ModBlocks.blockCasingsMisc, 14)) {
+ Logger.INFO("Heating Coils missing.");
return false;
- }
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 1, zDir + j) != ModBlocks.blockCasingsMisc) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 1, zDir + j) != 14) {
+ }
+
+ //Top Layer
+ final IGregTechTileEntity tTileEntity2 = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 2, zDir + j);
+ if (!isValidBlockForStructure(tTileEntity2, TAE.GTPP_INDEX(15), false, aBaseMetaTileEntity.getBlockOffset(xDir + i, 3, zDir + j), (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 3, zDir + j), ModBlocks.blockCasingsMisc, 15)) {
+ Logger.INFO("Heating Coils missing.");
return false;
}
- if (!this.addFluidInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 3, zDir + j), TAE.GTPP_INDEX(15))) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 3, zDir + j) != ModBlocks.blockCasingsMisc) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 3, zDir + j) != 15) {
- return false;
- }
- }
}
}
}
for (int i = -1; i < 2; i++) {
for (int j = -1; j < 2; j++) {
- if (((xDir + i) != 0) || ((zDir + j) != 0)) {
- final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 0, zDir + j);
- if ((!this.addMaintenanceToMachineList(tTileEntity, TAE.GTPP_INDEX(15))) && (!this.addInputToMachineList(tTileEntity, TAE.GTPP_INDEX(15))) && (!this.addOutputToMachineList(tTileEntity, TAE.GTPP_INDEX(15))) && (!this.addEnergyInputToMachineList(tTileEntity, TAE.GTPP_INDEX(15)))) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j) != ModBlocks.blockCasingsMisc) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j) != 15) {
- return false;
- }
- }
+ if (((xDir + i) != 0) || ((zDir + j) != 0)) {
+ //Bottom Layer
+ final IGregTechTileEntity tTileEntity2 = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 2, zDir + j);
+ if (!isValidBlockForStructure(tTileEntity2, TAE.GTPP_INDEX(15), false, aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j), (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j), ModBlocks.blockCasingsMisc, 15)) {
+ Logger.INFO("Heating Coils missing.");
+ return false;
+ }
}
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java
index f3328e4656..25e838e57a 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java
@@ -234,7 +234,10 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas
}
private boolean isAdvancedMachineCasing(int aX, int aY, int aZ) {
- return (getBaseMetaTileEntity().getBlock(aX, aY, aZ) == getCasing()) && (getBaseMetaTileEntity().getMetaID(aX, aY, aZ) == getCasingMeta());
+ final Block aBlock = getBaseMetaTileEntity().getBlock(aX, aY, aZ);
+ final int aMeta = getBaseMetaTileEntity().getMetaID(aX, aY, aZ);
+ final IGregTechTileEntity tTileEntity2 = getBaseMetaTileEntity().getIGregTechTileEntity(aX, aY, aZ);
+ return isValidBlockForStructure(tTileEntity2, TAE.GTPP_INDEX(26), true, aBlock, aMeta, getCasing(), getCasingMeta());
}
private boolean isCyclotronCoil(int aX, int aY, int aZ) {
@@ -268,11 +271,11 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas
"------------------------------------------------------------",
"Consists of the same layout as a Fusion Reactor",
"Cyclotron Machine Casings around Cyclotron Coil Blocks",
+ "All Hatches must be IV or better",
"1-16 Input Hatches",
"1-16 Input Busses",
"1-16 Output Busses",
"1-16 Energy Hatches",
- "All Hatches must be IV or better",
};
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java
index c96a6636ff..17e6430f99 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java
@@ -63,12 +63,23 @@ public class GregtechMetaTileEntity_IndustrialFishingPond extends GregtechMeta_M
@Override
public String[] getTooltip() {
- return new String[] { "Controller Block for the Fishing Pond", "Size: 9x3x9 [WxHxL] (open)", "X X",
- "X X", "XXXXXXXXX", "Put a numbered circuit into the input bus.", "Circuit 14 for Fish",
- "Circuit 15 for Junk", "Circuit 16 for Treasure", "Controller (front centered)",
- "1x Output Bus (Any casing)", "1x Input Bus (Any casing)",
- "1x Input Hatch (Any casing, fill with water)", "1x Maintenance Hatch (Any casing)",
- "1x Energy Hatch (Any casing)", "Aquatic Casings for the rest", };
+ return new String[] {
+ "Controller Block for the Fishing Pond",
+ "Size: 9x3x9 [WxHxL] (open)",
+ "X X",
+ "X X",
+ "XXXXXXXXX",
+ "Put a numbered circuit into the input bus.",
+ "Circuit 14 for Fish",
+ "Circuit 15 for Junk",
+ "Circuit 16 for Treasure",
+ "Aquatic Casings (all non-hatches)",
+ "Controller (front centered)",
+ "1x Output Bus",
+ "1x Input Bus",
+ "1x Input Hatch (fill with water)",
+ "1x Energy Hatch",
+ };
}
@Override
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java
index 3aba5108ed..f052d64a34 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java
@@ -89,29 +89,27 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo
@Override
public String[] getTooltip() {
- //if (mCasingName1.toLowerCase().contains(".name")) {
+ if (mCasingName1.toLowerCase().contains(".name")) {
mCasingName1 = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasingsMisc, 9);
- //}
- //if (mCasingName2.toLowerCase().contains(".name")) {
+ }
+ if (mCasingName2.toLowerCase().contains(".name")) {
mCasingName2 = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings3Misc, 15);
- //}
- //if (mCasingName3.toLowerCase().contains(".name")) {
+ }
+ if (mCasingName3.toLowerCase().contains(".name")) {
mCasingName3 = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasingsMisc, 8);
- //}
+ }
return new String[]{
"Controller Block for the Matter Fabricator",
- "Produces UU-A, UU-m & Scrap",
+ "Produces UU-A, UU-M & Scrap",
"Size(WxHxD): 5x4x5, Controller (Bottom center)",
"3x1x3 "+mCasingName3+"s (Inside bottom 5x1x5 layer)",
"9x "+mCasingName3+" (Centered 3x1x3 area in Bottom layer)",
- "1x Input Hatch (Any bottom layer casing)",
- "1x Output Hatch (Any bottom layer casing)",
- "1x Maintenance Hatch (Any bottom layer casing)",
- "1x Muffler Hatch (Centered 3x1x3 area in Top layer)",
- "1x Energy Hatch (Any bottom layer casing)",
"24x "+mCasingName2+" for the walls",
mCasingName1+"s for the edges & top (40 at least!)",
+ "1x Input Hatch/Bus",
+ "1x Output Hatch/Bus",
+ "1x Energy Hatch",
};
}
@@ -187,110 +185,63 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo
//Utils.LOG_INFO("Logging Variables - xDir:"+xDir+" zDir:"+zDir+" h:"+h+" i:"+i+" j:"+j);
final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
- /*if (tTileEntity != Block.getBlockFromItem(UtilsItems.getItem("IC2:blockAlloyGlass"))) {
- Utils.LOG_INFO("h:"+h+" i:"+i+" j:"+j);
- double tX = tTileEntity.getXCoord();
- double tY = tTileEntity.getYCoord();
- double tZ = tTileEntity.getZCoord();
- Utils.LOG_INFO("Found Glass at X:"+tX+" Y:"+tY+" Z:"+tZ);
- //return false;
- }*/
- if (((i != -2) && (i != 2)) && ((j != -2) && (j != 2))) {// innerer 3x3 ohne h�he
- if (h == 0) {// innen boden (kantal coils)
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
+
+ if (((i != -2) && (i != 2)) && ((j != -2) && (j != 2))) {
+ if (h == 0) {
+ if (!isValidBlockForStructure(null, TAE.GTPP_INDEX(9), false, aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j), (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j), ModBlocks.blockCasingsMisc, 8)) {
Logger.INFO("Matter Generation Coils missings from the bottom layer, inner 3x3.");
return false;
}
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 8) {
- Logger.INFO("Matter Generation Coils missings from the bottom layer, inner 3x3.");
+ } else if (h == 3) {
+ if (!isValidBlockForStructure(tTileEntity, TAE.GTPP_INDEX(9), true, aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j), (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j), ModBlocks.blockCasingsMisc, 9)) {
+ Logger.INFO("Matter Fabricator Casings Missing from one of the top layers inner 3x3.");
return false;
}
- } else if (h == 3) {// innen decke (ulv casings + input + muffler)
- if ((!this.addMufflerToMachineList(tTileEntity, TAE.GTPP_INDEX(9)))) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
- Logger.INFO("Matter Fabricator Casings Missing from one of the top layers inner 3x3.");
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 9) {
- Logger.INFO("Matter Fabricator Casings Missing from one of the top layers inner 3x3.");
- return false;
- }
- }
- } else {// innen air
+ } else {
if (!aBaseMetaTileEntity.getAirOffset(xDir + i, h, zDir + j)) {
Logger.INFO("Make sure the inner 3x3 of the Multiblock is Air.");
return false;
}
}
- } else {// Outer 5x5
- if (h == 0) {// au�en boden (controller, output, energy, maintainance, rest ulv casings)
- if ((!this.addMaintenanceToMachineList(tTileEntity, TAE.GTPP_INDEX(9))) && (!this.addInputToMachineList(tTileEntity, TAE.GTPP_INDEX(9))) && (!this.addOutputToMachineList(tTileEntity, TAE.GTPP_INDEX(9))) && (!this.addEnergyInputToMachineList(tTileEntity, TAE.GTPP_INDEX(9)))) {
- if (((xDir + i) != 0) || ((zDir + j) != 0)) {//no controller
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
- Logger.INFO("Matter Fabricator Casings Missing from one of the edges of the bottom layer.");
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 9) {
- Logger.INFO("Matter Fabricator Casings Missing from one of the edges of the bottom layer.");
- return false;
- }
- }
+ } else {
+ if (h == 0) {
+ if (!isValidBlockForStructure(tTileEntity, TAE.GTPP_INDEX(9), true, aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j), (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j), ModBlocks.blockCasingsMisc, 9)) {
+ Logger.INFO("Matter Fabricator Casings Missing from one of the edges of the bottom layer.");
+ return false;
}
- } else {// au�en �ber boden (ulv casings)
+ } else {
if (h == 1) {
-
- if (((i == -2) || (i == 2)) && ((j == -2) || (j == 2))){
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
- Logger.INFO("Matter Fabricator Casings Missing from one of the corners in the second layer.");
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 9) {
+ if (((i == -2) || (i == 2)) && ((j == -2) || (j == 2))){
+ if (!isValidBlockForStructure(tTileEntity, TAE.GTPP_INDEX(9), true, aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j), (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j), ModBlocks.blockCasingsMisc, 9)) {
Logger.INFO("Matter Fabricator Casings Missing from one of the corners in the second layer.");
return false;
}
}
- else if (((i != -2) || (i != 2)) && ((j != -2) || (j != 2))){
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != aContainmentGlass) {
+ else if (((i != -2) || (i != 2)) && ((j != -2) || (j != 2))){
+ if (!isValidBlockForStructure(tTileEntity, TAE.GTPP_INDEX(9), true, aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j), (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j), aContainmentGlass, aContainmentMeta)) {
Logger.INFO("Glass Casings Missing from somewhere in the second layer.");
return false;
}
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != aContainmentMeta) {
- Logger.INFO("Glass Casings wrong meta from the second layer.");
- return false;
- }
}
}
if (h == 2) {
- if (((i == -2) || (i == 2)) && ((j == -2) || (j == 2))){
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
- Logger.INFO("Matter Fabricator Casings Missing from one of the corners in the third layer.");
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 9) {
+ if (((i == -2) || (i == 2)) && ((j == -2) || (j == 2))){
+ if (!isValidBlockForStructure(tTileEntity, TAE.GTPP_INDEX(9), true, aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j), (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j), ModBlocks.blockCasingsMisc, 9)) {
Logger.INFO("Matter Fabricator Casings Missing from one of the corners in the third layer.");
return false;
}
}
- else if (((i != -2) || (i != 2)) && ((j != -2) || (j != 2))){
-
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != aContainmentGlass) {
+ else if (((i != -2) || (i != 2)) && ((j != -2) || (j != 2))){
+ if (!isValidBlockForStructure(null, TAE.GTPP_INDEX(9), false, aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j), (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j), aContainmentGlass, aContainmentMeta)) {
Logger.INFO("Glass Casings Missing from somewhere in the third layer.");
return false;
}
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != aContainmentMeta) {
- Logger.INFO("Glass Casings wrong meta from the third layer.");
- return false;
- }
}
}
- if (h == 3) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
- Logger.INFO("Matter Fabricator Casings Missing from one of the edges on the top layer.");
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 9) {
+ if (h == 3) {
+ if (!isValidBlockForStructure(tTileEntity, TAE.GTPP_INDEX(9), true, aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j), (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j), ModBlocks.blockCasingsMisc, 9)) {
Logger.INFO("Matter Fabricator Casings Missing from one of the edges on the top layer.");
return false;
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_SolarTower.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_SolarTower.java
index 0300508147..a38c6540fc 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_SolarTower.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_SolarTower.java
@@ -13,7 +13,6 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Utility;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.minecraft.BlockPos;
import gtPlusPlus.core.block.ModBlocks;
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_MultiTank.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_MultiTank.java
index 10fcc21222..c1e0ab4911 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_MultiTank.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_MultiTank.java
@@ -207,12 +207,11 @@ extends GregtechMeta_MultiBlockBase {
"Size: 3xHx3 (Block behind controller must be air)",
"Structure must be at least 4 blocks tall, maximum 20.",
"Each casing within the structure adds 128000L storage.",
+ "Multitank Exterior Casings (16 at least!)",
"Controller (front centered)",
- "1x Input hatch (anywhere)",
- "1x Output hatch (anywhere)",
- "1x Energy Hatch (anywhere)",
- "1x Maintenance Hatch (anywhere)",
- "Multitank Exterior Casings for the rest (16 at least!)"
+ "1x Input hatch",
+ "1x Output hatch",
+ "1x Energy Hatch",
};
}