aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java1
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWashPlant.java14
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java288
3 files changed, 148 insertions, 155 deletions
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 6b866b1a3f..09bda70681 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
@@ -132,6 +132,7 @@ GT_MetaTileEntity_MultiBlockBase {
mInfo.add("Progress: " + Integer.toString((this.mProgresstime / 20)) +" / "+ Integer.toString((this.mMaxProgresstime / 20)) + " secs");
mInfo.add("Efficiency: " + Float.toString((this.mEfficiency / 100.0F)) + "%");
mInfo.add("Problems: " + Integer.toString((this.getIdealStatus() - this.getRepairStatus())));
+ mInfo.add("Pollution: "+this.getPollutionPerTick(null)*20+"/second");
mInfo.add("Total Time Since Built: " + Integer.toString(weeks)+" Weeks, " + Integer.toString(days) + " Days, ");
mInfo.add(Long.toString(hours) + " Hours, " + Long.toString(minutes) + " Minutes, " + Long.toString(second) + " Seconds.");
mInfo.add("Total Time in ticks: " + Long.toString(this.mTotalRunTime));
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 2741aed520..6c7f8f26a8 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
@@ -60,6 +60,7 @@ 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",
@@ -162,7 +163,10 @@ extends GregtechMeta_MultiBlockBase {
Logger.WARNING("X: "+i+" | Z: "+j);
Block tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j);
byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j);
- if ((tBlock != getCasingBlock()) && (tMeta != getCasingMeta())) {
+ if ((tBlock == getCasingBlock()) && (tMeta == getCasingMeta())) {
+ ++tAmount;
+ }
+ else {
if ((i != mOffsetX_Lower && j != mOffsetZ_Lower
&& i != mOffsetX_Upper && j != mOffsetZ_Upper) && (h == 0 || h == 1)){
if (tBlock == Blocks.air){
@@ -177,21 +181,19 @@ extends GregtechMeta_MultiBlockBase {
Logger.WARNING("[x] Did not form - Found: "+(aBaseMetaTileEntity.getXCoord()+xDir + i) +" | "+ aBaseMetaTileEntity.getYCoord()+" | "+ (aBaseMetaTileEntity.getZCoord()+zDir + j));
return false;
}
-
}
- ++tAmount;
}
}
}
}
}
- if ((tAmount >= 8)){
+ if ((tAmount >= 40)){
Logger.WARNING("Made structure.");
}
else {
Logger.WARNING("Did not make structure.");
}
- return (tAmount >= 8);
+ return (tAmount >= 40);
}
@Override
@@ -318,7 +320,7 @@ extends GregtechMeta_MultiBlockBase {
}
return (tAmount >= 45);
}
-
+
public boolean addSludge() {
/*if (MathUtils.randInt(0, 100) <= 4) {
if (this.mOutputHatches.size() > 0) {
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 4eb239ee21..f43c077dd8 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
@@ -39,8 +39,7 @@ import ic2.core.init.InternalName;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
-public class GregtechMetaTileEntity_IndustrialFishingPond
-extends GregtechMeta_MultiBlockBase {
+public class GregtechMetaTileEntity_IndustrialFishingPond extends GregtechMeta_MultiBlockBase {
private boolean isUsingControllerCircuit = false;
private static final Item circuit = CI.getNumberedCircuit(0).getItem();
@@ -60,34 +59,24 @@ extends GregtechMeta_MultiBlockBase {
@Override
public String[] getDescription() {
- 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",
- getPollutionTooltip(),
- CORE.GT_Tooltip
- };
+ 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", getPollutionTooltip(),
+ CORE.GT_Tooltip };
}
@Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
+ public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing,
+ final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
if (aSide == aFacing) {
- return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[getCasingTextureIndex()], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER)};
+ return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[getCasingTextureIndex()],
+ new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE
+ : Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER) };
}
- return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[getCasingTextureIndex()]};
+ return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[getCasingTextureIndex()] };
}
@Override
@@ -96,8 +85,10 @@ extends GregtechMeta_MultiBlockBase {
}
@Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), "ProcessingArray.png");
+ public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory,
+ final IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(),
+ "ProcessingArray.png");
}
@Override
@@ -113,34 +104,32 @@ extends GregtechMeta_MultiBlockBase {
@Override
public boolean checkRecipe(final ItemStack aStack) {
if (aStack != null) {
- Logger.WARNING("Found "+aStack.getDisplayName());
+ Logger.WARNING("Found " + aStack.getDisplayName());
if (aStack.getItem() == circuit) {
this.isUsingControllerCircuit = true;
this.mMode = aStack.getItemDamage();
Logger.WARNING("Found Circuit!");
+ } else {
+ this.isUsingControllerCircuit = false;
}
- else {
- this.isUsingControllerCircuit = false;
- }
- }
- else {
- this.isUsingControllerCircuit = false;
+ } else {
+ this.isUsingControllerCircuit = false;
}
if (!hasGenerateRecipes) {
Logger.WARNING("Generating Recipes.");
generateRecipes();
- }
+ }
if (hasGenerateRecipes && checkForWater()) {
Logger.WARNING("Trying to run recipe.");
ArrayList<ItemStack> tItems = getStoredInputs();
ArrayList<FluidStack> tFluids = getStoredFluids();
ItemStack[] tItemInputs = tItems.toArray(new ItemStack[tItems.size()]);
FluidStack[] tFluidInputs = tFluids.toArray(new FluidStack[tFluids.size()]);
-
+
if (!isUsingControllerCircuit && tItems.size() == 0) {
return false;
}
-
+
return checkRecipeGeneric(tItemInputs, tFluidInputs, 1, 100, 80, 100);
}
return true;
@@ -148,8 +137,8 @@ extends GregtechMeta_MultiBlockBase {
@Override
public boolean checkMachine(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) {
- //Get Facing direction
- int mDirectionX = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ // Get Facing direction
+ int mDirectionX = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
int mCurrentDirectionX;
int mCurrentDirectionZ;
int mOffsetX_Lower = 0;
@@ -157,13 +146,12 @@ extends GregtechMeta_MultiBlockBase {
int mOffsetZ_Lower = 0;
int mOffsetZ_Upper = 0;
- if (mDirectionX == 0){
+ if (mDirectionX == 0) {
mCurrentDirectionX = 2;
mCurrentDirectionZ = 3;
- }
- else {
+ } else {
mCurrentDirectionX = 3;
- mCurrentDirectionZ = 2;
+ mCurrentDirectionZ = 2;
}
mOffsetX_Lower = -4;
@@ -171,57 +159,68 @@ extends GregtechMeta_MultiBlockBase {
mOffsetZ_Lower = -4;
mOffsetZ_Upper = 4;
- final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * mCurrentDirectionX;
- final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * mCurrentDirectionZ;
+ final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX
+ * mCurrentDirectionX;
+ final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ
+ * mCurrentDirectionZ;
- Logger.WARNING("xDir"+(xDir));
- Logger.WARNING("zDir"+(zDir));
- /*if (!(aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir))) {
- return false;
- }*/
+ Logger.WARNING("xDir" + (xDir));
+ Logger.WARNING("zDir" + (zDir));
+ /*
+ * if (!(aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir))) { return false; }
+ */
int tAmount = 0;
- for (int i = mOffsetX_Lower; i <=mOffsetX_Upper; ++i) {
+ for (int i = mOffsetX_Lower; i <= mOffsetX_Upper; ++i) {
for (int j = mOffsetZ_Lower; j <= mOffsetZ_Upper; ++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 (!addToMachineList(tTileEntity)) {
- Logger.WARNING("X: "+i+" | Z: "+j);
+ Logger.WARNING("X: " + i + " | Z: " + j);
Block tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j);
byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j);
- if ((tBlock != getCasingBlock()) && (tMeta != getCasingMeta())) {
- if ((i != mOffsetX_Lower && j != mOffsetZ_Lower
- && i != mOffsetX_Upper && j != mOffsetZ_Upper) && (h == 0 || h == 1)){
- if (tBlock == Blocks.air){
+
+ if ((tBlock == getCasingBlock()) && (tMeta == getCasingMeta())) {
+ ++tAmount;
+ } else {
+ if ((i != mOffsetX_Lower && j != mOffsetZ_Lower && i != mOffsetX_Upper
+ && j != mOffsetZ_Upper) && (h == 0 || h == 1)) {
+ if (tBlock == Blocks.air) {
Logger.WARNING("Found Air");
- }
- else if (tBlock == Blocks.water){
+ } else if (tBlock == Blocks.water) {
Logger.WARNING("Found Water");
}
- }
- else {
- if (tBlock.getLocalizedName().contains("gt.blockmachines") || tBlock == Blocks.water || tBlock == Blocks.flowing_water || tBlock == BlocksItems.getFluidBlock(InternalName.fluidDistilledWater)) {
-
- }
- else {
- Logger.WARNING("[x] Did not form - Found: "+tBlock.getLocalizedName() + " | "+tBlock.getDamageValue(aBaseMetaTileEntity.getWorld(), aBaseMetaTileEntity.getXCoord()+ i, aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord() + j) + " | Special Meta: "+(tTileEntity == null ? "0" : tTileEntity.getMetaTileID()));
- Logger.WARNING("[x] Did not form - Found: "+(aBaseMetaTileEntity.getXCoord()+xDir + i) +" | "+ aBaseMetaTileEntity.getYCoord()+" | "+ (aBaseMetaTileEntity.getZCoord()+zDir + j));
+ } else {
+ if (tBlock.getLocalizedName().contains("gt.blockmachines") || tBlock == Blocks.water
+ || tBlock == Blocks.flowing_water
+ || tBlock == BlocksItems.getFluidBlock(InternalName.fluidDistilledWater)) {
+
+ } else {
+ Logger.WARNING("[x] Did not form - Found: " + tBlock.getLocalizedName() + " | "
+ + tBlock.getDamageValue(aBaseMetaTileEntity.getWorld(),
+ aBaseMetaTileEntity.getXCoord() + i,
+ aBaseMetaTileEntity.getYCoord(),
+ aBaseMetaTileEntity.getZCoord() + j)
+ + " | Special Meta: "
+ + (tTileEntity == null ? "0" : tTileEntity.getMetaTileID()));
+ Logger.WARNING("[x] Did not form - Found: "
+ + (aBaseMetaTileEntity.getXCoord() + xDir + i) + " | "
+ + aBaseMetaTileEntity.getYCoord() + " | "
+ + (aBaseMetaTileEntity.getZCoord() + zDir + j));
return false;
}
}
}
- ++tAmount;
}
}
}
}
}
- if ((tAmount >= 64)){
+ if ((tAmount >= 64)) {
Logger.WARNING("Made structure.");
- }
- else {
+ } else {
Logger.WARNING("Did not make structure.");
}
return (tAmount >= 64);
@@ -251,29 +250,27 @@ extends GregtechMeta_MultiBlockBase {
return ModBlocks.blockCasings3Misc;
}
-
public byte getCasingMeta() {
return 0;
}
-
public byte getCasingTextureIndex() {
return (byte) TAE.GTPP_INDEX(32);
}
private boolean addToMachineList(final IGregTechTileEntity tTileEntity) {
- return ((this.addMaintenanceToMachineList(tTileEntity, this.getCasingTextureIndex()))
- || (this.addInputToMachineList(tTileEntity, this.getCasingTextureIndex()))
- || (this.addOutputToMachineList(tTileEntity, this.getCasingTextureIndex()))
+ return ((this.addMaintenanceToMachineList(tTileEntity, this.getCasingTextureIndex()))
+ || (this.addInputToMachineList(tTileEntity, this.getCasingTextureIndex()))
+ || (this.addOutputToMachineList(tTileEntity, this.getCasingTextureIndex()))
|| (this.addMufflerToMachineList(tTileEntity, this.getCasingTextureIndex()))
|| (this.addEnergyInputToMachineList(tTileEntity, this.getCasingTextureIndex())));
}
public boolean checkForWater() {
- //Get Facing direction
+ // Get Facing direction
IGregTechTileEntity aBaseMetaTileEntity = this.getBaseMetaTileEntity();
- int mDirectionX = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ int mDirectionX = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
int mCurrentDirectionX;
int mCurrentDirectionZ;
int mOffsetX_Lower = 0;
@@ -281,37 +278,37 @@ extends GregtechMeta_MultiBlockBase {
int mOffsetZ_Lower = 0;
int mOffsetZ_Upper = 0;
-
- if (mDirectionX == 0){
+ if (mDirectionX == 0) {
mCurrentDirectionX = 2;
mCurrentDirectionZ = 3;
- }
- else {
+ } else {
mCurrentDirectionX = 3;
- mCurrentDirectionZ = 2;
+ mCurrentDirectionZ = 2;
}
mOffsetX_Lower = -4;
mOffsetX_Upper = 4;
mOffsetZ_Lower = -4;
mOffsetZ_Upper = 4;
- //if (aBaseMetaTileEntity.fac)
+ // if (aBaseMetaTileEntity.fac)
- final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * mCurrentDirectionX;
- final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * mCurrentDirectionZ;
+ final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX
+ * mCurrentDirectionX;
+ final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ
+ * mCurrentDirectionZ;
int tAmount = 0;
for (int i = mOffsetX_Lower + 1; i <= mOffsetX_Upper - 1; ++i) {
for (int j = mOffsetZ_Lower + 1; j <= mOffsetZ_Upper - 1; ++j) {
for (int h = 0; h < 2; ++h) {
Block tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j);
- //byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j);
+ // byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j);
if (tBlock == Blocks.air || tBlock == Blocks.flowing_water || tBlock == Blocks.water) {
if (this.getStoredFluids() != null) {
for (FluidStack stored : this.getStoredFluids()) {
if (stored.isFluidEqual(FluidUtils.getFluidStack("water", 1))) {
if (stored.amount >= 1000) {
- //Utils.LOG_WARNING("Going to try swap an air block for water from inut bus.");
+ // Utils.LOG_WARNING("Going to try swap an air block for water from inut bus.");
stored.amount -= 1000;
Block fluidUsed = null;
if (tBlock == Blocks.air || tBlock == Blocks.flowing_water) {
@@ -320,8 +317,10 @@ extends GregtechMeta_MultiBlockBase {
if (tBlock == Blocks.water) {
fluidUsed = BlocksItems.getFluidBlock(InternalName.fluidDistilledWater);
}
- aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getXCoord() + xDir + i, aBaseMetaTileEntity.getYCoord() + h, aBaseMetaTileEntity.getZCoord() + zDir + j, fluidUsed);
-
+ aBaseMetaTileEntity.getWorld().setBlock(
+ aBaseMetaTileEntity.getXCoord() + xDir + i,
+ aBaseMetaTileEntity.getYCoord() + h,
+ aBaseMetaTileEntity.getZCoord() + zDir + j, fluidUsed);
}
}
@@ -330,19 +329,18 @@ extends GregtechMeta_MultiBlockBase {
}
if (tBlock == Blocks.water) {
++tAmount;
- //Logger.WARNING("Found Water");
+ // Logger.WARNING("Found Water");
} else if (tBlock == BlocksItems.getFluidBlock(InternalName.fluidDistilledWater)) {
++tAmount;
++tAmount;
- //Logger.WARNING("Found Distilled Water");
+ // Logger.WARNING("Found Distilled Water");
}
}
}
}
- if ((tAmount >= 80)){
+ if ((tAmount >= 80)) {
Logger.WARNING("Filled structure.");
- }
- else {
+ } else {
Logger.WARNING("Did not fill structure.");
}
return (tAmount >= 80);
@@ -370,43 +368,40 @@ extends GregtechMeta_MultiBlockBase {
for (WeightedRandomFishable h : FishPondFakeRecipe.treasure) {
categoryLoot.put(h);
}
- hasGenerateRecipes = true;
+ hasGenerateRecipes = true;
return true;
- }
- else {
+ } else {
return true;
- }
+ }
}
private int getCircuit(ItemStack[] t) {
if (!this.isUsingControllerCircuit) {
for (ItemStack j : t) {
if (j.getItem() == CI.getNumberedCircuit(0).getItem()) {
- //Fish
+ // Fish
if (j.getItemDamage() == 14) {
- mMax = 8;
+ mMax = 8;
this.mMode = 14;
break;
}
- //Junk
+ // Junk
else if (j.getItemDamage() == 15) {
this.mMode = 15;
- mMax = 4;
- break;
+ mMax = 4;
+ break;
}
- //Loot
+ // Loot
else if (j.getItemDamage() == 16) {
this.mMode = 16;
mMax = 4;
- break;
- }
- else {
+ break;
+ } else {
this.mMode = 0;
mMax = 0;
break;
}
- }
- else {
+ } else {
this.mMode = 0;
mMax = 0;
break;
@@ -416,8 +411,9 @@ extends GregtechMeta_MultiBlockBase {
return this.mMode;
}
- //reflection map
+ // reflection map
private static Map<WeightedRandomFishable, ItemStack> reflectiveFishMap = new HashMap<WeightedRandomFishable, ItemStack>();
+
private ItemStack reflectiveFish(WeightedRandomFishable y) {
if (reflectiveFishMap.containsKey(y)) {
return reflectiveFishMap.get(y);
@@ -428,15 +424,15 @@ extends GregtechMeta_MultiBlockBase {
ItemStack k = ItemUtils.getSimpleStack(t, 1);
reflectiveFishMap.put(y, k);
return t;
+ } catch (IllegalArgumentException | IllegalAccessException | NoSuchFieldException e) {
}
- catch (IllegalArgumentException | IllegalAccessException | NoSuchFieldException e) {}
return null;
}
private ItemStack[] generateLoot(int mode) {
ItemStack[] mFishOutput = new ItemStack[this.mMax];
if (this.mMode == 14) {
- for (int k=0;k<this.mMax;k++) {
+ for (int k = 0; k < this.mMax; k++) {
if (mFishOutput[k] == null)
for (WeightedRandomFishable g : categoryFish.values()) {
if (MathUtils.randInt(0, 75) <= 2) {
@@ -444,12 +440,11 @@ extends GregtechMeta_MultiBlockBase {
if (t != null) {
mFishOutput[k] = ItemUtils.getSimpleStack(t, 1);
}
- }
+ }
}
}
- }
- else if (this.mMode == 15) {
- for (int k=0;k<this.mMax;k++) {
+ } else if (this.mMode == 15) {
+ for (int k = 0; k < this.mMax; k++) {
if (mFishOutput[k] == null)
for (WeightedRandomFishable g : categoryJunk.values()) {
if (MathUtils.randInt(0, 100) <= 1) {
@@ -457,12 +452,11 @@ extends GregtechMeta_MultiBlockBase {
if (t != null) {
mFishOutput[k] = ItemUtils.getSimpleStack(t, 1);
}
- }
+ }
}
}
- }
- else if (this.mMode == 16) {
- for (int k=0;k<this.mMax;k++) {
+ } else if (this.mMode == 16) {
+ for (int k = 0; k < this.mMax; k++) {
if (mFishOutput[k] == null)
for (WeightedRandomFishable g : categoryLoot.values()) {
if (MathUtils.randInt(0, 1000) <= 2) {
@@ -470,23 +464,18 @@ extends GregtechMeta_MultiBlockBase {
if (t != null) {
mFishOutput[k] = ItemUtils.getSimpleStack(t, 1);
}
- }
+ }
}
}
- }
- else {
+ } else {
mFishOutput = null;
}
return mFishOutput;
}
@Override
- public boolean checkRecipeGeneric(
- ItemStack[] aItemInputs, FluidStack[] aFluidInputs,
- int aMaxParallelRecipes, int aEUPercent,
- int aSpeedBonusPercent, int aOutputChanceRoll) {
-
-
+ public boolean checkRecipeGeneric(ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes,
+ int aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll) {
// Based on the Processing Array. A bit overkill, but very flexible.
long tVoltage = getMaxInputVoltage();
@@ -495,33 +484,35 @@ extends GregtechMeta_MultiBlockBase {
int parallelRecipes = 1;
getCircuit(aItemInputs);
- /*GT_Recipe tRecipe = this.getRecipeMap().findRecipe(
- getBaseMetaTileEntity(), mLastRecipe, false,
- gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs);*/
+ /*
+ * GT_Recipe tRecipe = this.getRecipeMap().findRecipe( getBaseMetaTileEntity(),
+ * mLastRecipe, false, gregtech.api.enums.GT_Values.V[tTier], aFluidInputs,
+ * aItemInputs);
+ */
ItemStack[] mFishOutput = generateLoot(this.mMode);
- Logger.WARNING("Mode: "+this.mMode+" | Is loot valid? "+(mFishOutput != null));
+ Logger.WARNING("Mode: " + this.mMode + " | Is loot valid? " + (mFishOutput != null));
int jslot = 0;
for (ItemStack x : mFishOutput) {
if (x != null) {
- Logger.WARNING("Slot "+jslot+" in mFishOutput contains "+x.stackSize+"x "+x.getDisplayName()+".");
- }
- else {
- Logger.WARNING("Slot "+jslot+" in mFishOutput was null.");
+ Logger.WARNING(
+ "Slot " + jslot + " in mFishOutput contains " + x.stackSize + "x " + x.getDisplayName() + ".");
+ } else {
+ Logger.WARNING("Slot " + jslot + " in mFishOutput was null.");
}
jslot++;
}
// EU discount
- //float tRecipeEUt = (32 * aEUPercent) / 100.0f;
+ // float tRecipeEUt = (32 * aEUPercent) / 100.0f;
float tTotalEUt = 0.0f;
// Reset outputs and progress stats
this.mEUt = 0;
this.mMaxProgresstime = 0;
- this.mOutputItems = new ItemStack[]{};
- this.mOutputFluids = new FluidStack[]{};
+ this.mOutputItems = new ItemStack[] {};
+ this.mOutputFluids = new FluidStack[] {};
tTotalEUt = 8;
Logger.WARNING("Recipe Step. [1]");
@@ -537,9 +528,9 @@ extends GregtechMeta_MultiBlockBase {
float modeMulti = 1;
modeMulti = (this.mMode == 14 ? 5 : (this.mMode == 15 ? 1 : 20));
- this.mMaxProgresstime = (int)((60*modeMulti) * tTimeFactor);
+ this.mMaxProgresstime = (int) ((60 * modeMulti) * tTimeFactor);
- this.mEUt = (int)Math.ceil(tTotalEUt);
+ this.mEUt = (int) Math.ceil(tTotalEUt);
this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
this.mEfficiencyIncrease = 10000;
@@ -566,19 +557,18 @@ extends GregtechMeta_MultiBlockBase {
// Collect output item types
ItemStack[] tOutputItems = mFishOutput;
-
- int rslot = 0;
+ int rslot = 0;
tOutputItems = removeNulls(mFishOutput);
for (ItemStack x : tOutputItems) {
if (x != null) {
- Logger.WARNING("rSlot "+rslot+" in mFishOutput contains "+x.stackSize+"x "+x.getDisplayName()+".");
- }
- else {
- Logger.WARNING("rSlot "+rslot+" in mFishOutput was null.");
+ Logger.WARNING(
+ "rSlot " + rslot + " in mFishOutput contains " + x.stackSize + "x " + x.getDisplayName() + ".");
+ } else {
+ Logger.WARNING("rSlot " + rslot + " in mFishOutput was null.");
}
rslot++;
- }
+ }
// Commit outputs
this.mOutputItems = tOutputItems;