aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/gregtech
diff options
context:
space:
mode:
authorAlkalus <3060479+draknyte1@users.noreply.github.com>2019-12-08 02:00:35 +0000
committerAlkalus <3060479+draknyte1@users.noreply.github.com>2019-12-08 02:00:35 +0000
commit10d4c7d4b4fd651d64f17936a916785b36a43f92 (patch)
tree88f09ab780bd2271cdf7abb282ba8cc42bfb7e4b /src/Java/gtPlusPlus/xmod/gregtech
parent7fbe8a8aae1cc923ec4a0a9f5b7075d30568d94c (diff)
downloadGT5-Unofficial-10d4c7d4b4fd651d64f17936a916785b36a43f92.tar.gz
GT5-Unofficial-10d4c7d4b4fd651d64f17936a916785b36a43f92.tar.bz2
GT5-Unofficial-10d4c7d4b4fd651d64f17936a916785b36a43f92.zip
+ Added an assembly recipe for tier 1 Round Robinators.
+ Added localization for Rotor Housing achievement. + Added the Algae Farm (WIP). - Removed Durability bar on Iridium Rotors. - Reverted 2A hatch fix on Multiblocks. % Adjusted all Robinator recipes, removing the fluid requirements. $ Fixed Robinators Crashing on Servers. $ Implemented new backend for all future non-GT tile entities.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech')
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java3
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java51
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java128
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAlgaeContent.java24
4 files changed, 171 insertions, 35 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java
index 3ea2851a85..3fc6d9d667 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java
@@ -228,6 +228,9 @@ public enum GregtechItemList implements GregtechItemContainer {
//Fish Pond
Industrial_FishingPond,
Casing_FishPond,
+
+ //Algae
+ AlgaeFarm_Controller,
//GT4 autoCrafter
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 e5d7f58dc6..ece8dfaa87 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
@@ -474,7 +474,7 @@ GT_MetaTileEntity_MultiBlockBase {
public boolean canBufferOutputs(final GT_Recipe aRecipe, int aParallelRecipes) {
Logger.INFO("Determining if we have space to buffer outputs.");
-
+
// Null recipe or a recipe with lots of outputs?
// E.G. Gendustry custom comb with a billion centrifuge outputs?
// Do it anyway.
@@ -736,7 +736,7 @@ GT_MetaTileEntity_MultiBlockBase {
// Check next fluid
continue aFluidMatch;
}
-
+
}
else {
continue aFluidMatch;
@@ -744,14 +744,14 @@ GT_MetaTileEntity_MultiBlockBase {
}
}
}
-
+
for (Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer> aFreeHatchCheck : aOutputHatches) {
// Free Hatch
if (aFreeHatchCheck.getValue_2() == null || aFreeHatchCheck.getValue_3() == 0 || aFreeHatchCheck.getValue_1().getFluid() == null) {
aEmptyFluidHatches++;
}
}
-
+
// We have Fluid Stacks we did not merge. Do we have space?
if (aOutputFluids.size() > 0) {
// Not enough space to add fluids.
@@ -760,7 +760,7 @@ GT_MetaTileEntity_MultiBlockBase {
return false;
}
}
-
+
/*
* End Fluid Management
*/
@@ -978,41 +978,22 @@ GT_MetaTileEntity_MultiBlockBase {
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.
-
-
+ // Based on the Processing Array. A bit overkill, but very flexible.
// Reset outputs and progress stats
this.mEUt = 0;
this.mMaxProgresstime = 0;
this.mOutputItems = new ItemStack[]{};
this.mOutputFluids = new FluidStack[]{};
-
-
-
- // Get input Voltage
+
long tVoltage = getMaxInputVoltage();
-
- // Get total Amps available to this multiblock
- long tAmpsIn = 0;
- for (GT_MetaTileEntity_Hatch_Energy aHatch : this.mEnergyHatches) {
- tAmpsIn += aHatch.maxAmperesIn();
- }
-
- // How much voltage can actually go in
- long tEffectiveVoltage = tVoltage * tAmpsIn;
-
- byte tTierInputVoltage = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
- byte tTier = (byte) Math.max(1, GT_Utility.getTier(tEffectiveVoltage));
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
log("Running checkRecipeGeneric(0)");
- log("Amps: "+tAmpsIn);
- log("Input Voltage: "+tVoltage+", Tier: "+tTierInputVoltage);
- log("Effective Voltage: "+tEffectiveVoltage+", Effective Tier: "+tTier);
GT_Recipe tRecipe = findRecipe(
getBaseMetaTileEntity(), mLastRecipe, false,
- gregtech.api.enums.GT_Values.V[tTierInputVoltage], aFluidInputs, aItemInputs);
+ gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs);
log("Running checkRecipeGeneric(1)");
// Remember last recipe - an optimization for findRecipe()
@@ -1024,8 +1005,7 @@ GT_MetaTileEntity_MultiBlockBase {
}
if (!this.canBufferOutputs(tRecipe, aMaxParallelRecipes)) {
- log("BAD RETURN - 2"); // TODO
- Logger.INFO("No Output Space.");
+ log("BAD RETURN - 2");
return false;
}
@@ -1041,12 +1021,12 @@ GT_MetaTileEntity_MultiBlockBase {
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 < (tEffectiveVoltage - tRecipeEUt); parallelRecipes++) {
+ 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)+". Can use "+tEffectiveVoltage);
+ log("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+".");
tTotalEUt += tRecipeEUt;
}
@@ -1058,6 +1038,7 @@ GT_MetaTileEntity_MultiBlockBase {
// -- 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);
@@ -1071,10 +1052,10 @@ GT_MetaTileEntity_MultiBlockBase {
// Overclock
if (this.mEUt <= 16) {
- this.mEUt = (this.mEUt * (1 << tTierInputVoltage - 1) * (1 << tTierInputVoltage - 1));
- this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTierInputVoltage - 1));
+ 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[(tTierInputVoltage - 1)]) {
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
this.mEUt *= 4;
this.mMaxProgresstime /= 2;
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java
new file mode 100644
index 0000000000..332c46dc3e
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java
@@ -0,0 +1,128 @@
+package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.algae;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.TAE;
+import gregtech.api.enums.Textures;
+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 gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
+import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.common.util.ForgeDirection;
+
+public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase {
+
+ private int mLevel = 0;
+
+ public GregtechMTE_AlgaePondBase(final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMTE_AlgaePondBase(final String aName) {
+ super(aName);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMTE_AlgaePondBase(this.mName);
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Algae Pond";
+ }
+
+ @Override
+ public String[] getTooltip() {
+ return new String[]{
+ "Grows Algae!",
+ "Controller Block for the Algae Farm",
+ "Size: 3x3x3 (Hollow)",
+ "Controller (front middle)",
+ "1x Input Hatch",
+ "1x Output Hatch",
+ "1x Input Bus",
+ "1x Output Bus"
+ };
+ }
+
+ @Override
+ public String getSound() {
+ return GregTech_API.sSoundList.get(Integer.valueOf(207));
+ }
+
+ @Override
+ 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[TAE.GTPP_INDEX(1)], new GT_RenderedTexture(aActive ? TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active : TexturesGtBlock.Overlay_Machine_Controller_Advanced)};
+ }
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[TAE.GTPP_INDEX(1)]};
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return true;
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return null;
+ }
+
+ @Override
+ public boolean isFacingValid(final byte aFacing) {
+ return aFacing > 1;
+ }
+
+ @Override
+ public boolean checkRecipe(final ItemStack aStack) {
+ return checkRecipeGeneric(getMaxParallelRecipes(), getEuDiscountForParallelism(), 0);
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return this.mLevel * 10;
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 0;
+ }
+
+ @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;
+ this.mLevel = 0;
+ return true;
+ }
+
+ @Override
+ public int getMaxEfficiency(final ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerTick(final ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 1;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return null;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAlgaeContent.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAlgaeContent.java
new file mode 100644
index 0000000000..57a726f7e8
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAlgaeContent.java
@@ -0,0 +1,24 @@
+package gtPlusPlus.xmod.gregtech.registration.gregtech;
+
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.lib.LoadedMods;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.algae.GregtechMTE_AlgaePondBase;
+
+public class GregtechAlgaeContent {
+
+ public static void run() {
+ if (LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Algae Content.");
+ run1();
+ }
+ }
+
+ private static void run1() {
+ // Industrial Centrifuge Multiblock
+ GregtechItemList.AlgaeFarm_Controller.set(
+ new GregtechMTE_AlgaePondBase(997, "algaefarm.controller.tier.single", "Algae Farm").getStackForm(1L));
+
+ }
+
+}