diff options
| author | Maxim <maxim235@gmx.de> | 2023-04-22 17:38:49 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-22 08:38:49 -0700 |
| commit | fdde96ab6fef30064b67e28390008ee4ba455655 (patch) | |
| tree | ee169d0d4a8432433c4ec01eada1e24049a0e47a /src/main | |
| parent | de864236f83dc31c53ca77a6939357a0959bca75 (diff) | |
| download | GT5-Unofficial-fdde96ab6fef30064b67e28390008ee4ba455655.tar.gz GT5-Unofficial-fdde96ab6fef30064b67e28390008ee4ba455655.tar.bz2 GT5-Unofficial-fdde96ab6fef30064b67e28390008ee4ba455655.zip | |
MuTE overhaul and ACR (#1883)
* complex controller start
* Added methods to get input fluids and items
* Added logic to complex parallel mute
* Added ACR and fixed many, many, many, many bugs
* Added void protection setting to checkRecipe
* do not init nbt, if mteID and mteRegistry are the same
* Improved GUI design
* Force structure check when pressing power switch
* ACR Textures
* Added T1 structure
* Added perfect OC
* Added WAILA
* fix mutes resetting their nbt
* Fix ACR GUI
* fix npe
* Added void protection for MuTEs
* Fixed ACR starting recipe while another one is ongoing
* nbt saving
* maybe fix structure breaking
* Fix complex machine disabling on startup
* correctly update input tanks
* move casings over
* Changed logic of casings to change mode and facing in one go by sneaking
* Fixed the casing target not resetting
* Added side only annotations
* don't leave it empty
* Added power logic and tiered blocks to ACR
* Change facing to wrench side if casing mode is currently none
* lasers anyone?
* Added ACR item chaining
* Remove unncessary item lists
* Use HashSet for process whitelists
* Optimize list capacities
* Fix potential recipe voiding bug
* Rename methods for consistancy
* Fix NPE
* Duct tape fix structure check
* allow MuTEs to connect to cables
* Added separate tank inventories for input separation (#1887)
* Fixed unregistering tank function
* Fixed input busses not being automatable
* Added fluid chaining
* Fixed saving of input tanks
* Forbid inventory registering with empty name
* Display all input tanks in controller GUI
* Fixed fluid hatch GUI height
* Reset casing lists when checking the structure
* Make inventory GUI size consistant
* Make use of the tooltip cache
* rename thing clean up
* Forgot to put tooltip into map
* Added tooltip to ACR
* Reset whitelists when one whitelist window was opened
* Refined scanner string
* Fixed progress times
* Fixed MuTE not consuming fluids
* Properly register controller inventories
* switch to ForgeDirection
* switch to new Renderer
* Added missing contains check on registerInventory
* Fixed output tanks not registering
* Fixed upgrade tank loading
* fix machines not having active/inactive textures
* fix overlays not loading correctly
* Don't register controller directly
* Remove magic strings all
* fix active not setting to inactive
* allow glow
* item renderer
* fix glow
* MuTE improved hatch GUI and fluid output locking (#1889)
* Allow output hatches to be fluid locked
* Reworked hatch GUI
* Check target before trying to open GUI
* Make ACR GUI easier to look at
* fix covers not rendering on mutes
* fix covers not displaying above the item/fluid in/out
* new folder texture structure
* Reduce network traffic caused by covers
* Fixed WAILA fluid locking display
* Don't save everything to the itemstack NBT
* Added possibility to save NBT of MuTE to its itemstack
* fix textures, but make sacrifices
* mah textures
* Removed the need for all textures to be present
* Added glow texture for active coke oven
* Removed unncesssary upgrade casing textures
* shorten nbt tags
---------
Co-authored-by: BlueWeabo <76872108+BlueWeabo@users.noreply.github.com>
Co-authored-by: Martin Robertz <dream-master@gmx.net>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'src/main')
82 files changed, 3817 insertions, 861 deletions
diff --git a/src/main/java/gregtech/api/enums/GT_Values.java b/src/main/java/gregtech/api/enums/GT_Values.java index a6a7d6d45c..8406018707 100644 --- a/src/main/java/gregtech/api/enums/GT_Values.java +++ b/src/main/java/gregtech/api/enums/GT_Values.java @@ -307,7 +307,7 @@ public class GT_Values { TANK_CAPACITY = "gt.tankcap", // Number TANK_IN = "gt.tank.in.", // FluidStack TANK_OUT = "gt.tank.out.", // FluidStack - TEXTURE = "gt.texture", // String + TEXTURE_FOLDER = "gt.texture.folder", // String INV_INPUT_SIZE = "gt.invsize.in", // Number INV_OUTPUT_SIZE = "gt.invsize.out", // Number INV_INPUT_LIST = "gt.invlist.in", // NBT List @@ -326,22 +326,34 @@ public class GT_Values { TARGET_X = "gt.target.x", // Number TARGET_Y = "gt.target.y", // Number TARGET_Z = "gt.target.z", // Number - LOCKED_INVENTORY = "gt.locked.inventory", // String - LOCKED_INVENTORY_INDEX = "gt.locked.inventory.index", // Number + LOCKED_FLUID = "gt.locked.fluid", // String + LOCKED_INVENTORY = "gt.locked.inv", // String + LOCKED_INVENTORY_INDEX = "gt.locked.inv.index", // Number UPGRADE_INVENTORY_SIZE = "gt.invsize.upg", // String UPGRADE_INVENTORY_UUID = "gt.invuuid.upg", // String UPGRADE_INVENTORY_NAME = "gt.invname.upg", // String UPGRADE_INVENTORIES_INPUT = "gt.invlist.upg.in", // NBT List UPGRADE_INVENTORIES_OUTPUT = "gt.invlist.upg.out", // NBT List + UPGRADE_TANK_CAPACITY = "gt.tank.cap.upg", // Long + UPGRADE_TANK_CAPACITY_MULTIPLIER = "gt.tank.cap.mult.upg", // Long + UPGRADE_TANK_UUID = "gt.tankuuid.upg", // String + UPGRADE_TANK_NAME = "gt.tankname.upg", // String + UPGRADE_TANKS_INPUT = "gt.tanklist.upg.in", // NBT List + UPGRADE_TANKS_OUTPUT = "gt.tanklist.upg.out", // NBT List + UPGRADE_TANKS_COUNT = "gt.tankcount.upg", // Int + UPGRADE_TANKS_PREFIX = "gt.tank.upg", // NBT Tag SEPARATE_INPUTS = "gt.separate.inputs", // Boolean + VOID_EXCESS = "gt.void.excess", // Boolean + BATCH_MODE = "gt.batch.mode", // Boolean + RECIPE_LOCK = "gt.recipe.lock", // Boolean // Logic - POWER_LOGIC = "gt.power.logic", // NBT Tag - POWER_LOGIC_STORED_ENERGY = "gt.power.logic.stored.energy", // Number - POWER_LOGIC_ENERGY_CAPACITY = "gt.power.logic.energy.capacity", // Number - POWER_LOGIC_VOLTAGE = "gt.power.logic.voltage", // Number - POWER_LOGIC_AMPERAGE = "gt.power.logic.voltage", // Number - POWER_LOGIC_TYPE = "gt.power.logic.type", // Number + POWER_LOGIC = "gt.pow.logic", // NBT Tag + POWER_LOGIC_STORED_ENERGY = "gt.pow.energy", // Number + POWER_LOGIC_ENERGY_CAPACITY = "gt.pow.energy.cap", // Number + POWER_LOGIC_VOLTAGE = "gt.pow.volt", // Number + POWER_LOGIC_AMPERAGE = "gt.pow.amp", // Number + POWER_LOGIC_TYPE = "gt.pow.type", // Number empty_ = ""; } @@ -588,6 +600,10 @@ public class GT_Values { + EnumChatFormatting.BOLD + "Weabo"; + public static final String Authorminecraft7771 = "Author: " + EnumChatFormatting.BLUE + + EnumChatFormatting.LIGHT_PURPLE + + "minecraft7771"; + // 7.5F comes from GT_Tool_Turbine_Large#getBaseDamage() given huge turbines are the most efficient now. public static double getMaxPlasmaTurbineEfficiencyFromMaterial(Materials material) { return (5F + (7.5F + material.mToolQuality)) / 10.0; diff --git a/src/main/java/gregtech/api/fluid/FluidTankGT.java b/src/main/java/gregtech/api/fluid/FluidTankGT.java index 801354ac86..2102f725ae 100644 --- a/src/main/java/gregtech/api/fluid/FluidTankGT.java +++ b/src/main/java/gregtech/api/fluid/FluidTankGT.java @@ -2,6 +2,8 @@ package gregtech.api.fluid; import static com.google.common.primitives.Ints.saturatedCast; +import java.util.ArrayList; +import java.util.List; import java.util.Map; import net.minecraft.nbt.NBTTagCompound; @@ -446,8 +448,25 @@ public class FluidTankGT implements IFluidTank { return saturatedCast(capacity()); } + public long getCapacityMultiplier() { + return mAdjustableMultiplier; + } + @Override public FluidTankInfo getInfo() { return new FluidTankInfo(isEmpty() ? null : mFluid.copy(), saturatedCast(capacity())); } + + public static FluidStack[] getFluidsFromTanks(FluidTankGT[] tanks) { + if (tanks == null) { + return null; + } + List<FluidStack> fluidStacks = new ArrayList<>(); + for (FluidTankGT tank : tanks) { + if (tank.getFluid() != null) { + fluidStacks.add(tank.getFluid()); + } + } + return fluidStacks.toArray(new FluidStack[0]); + } } diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java b/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java index 14ead4e4ee..55de2db088 100644 --- a/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java +++ b/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java @@ -73,7 +73,7 @@ public interface IEnergyConnected extends IColoredTileEntity { final TileEntity tTileEntity = emitterTile.getTileEntityAtSide(i); if (tTileEntity instanceof PowerLogicHost host) { - PowerLogic logic = host.getPowerLogic(j); + PowerLogic logic = host.getPowerLogic(ForgeDirection.getOrientation(j)); if (logic == null || logic.isEnergyReceiver()) { continue; } diff --git a/src/main/java/gregtech/api/logic/ComplexParallelProcessingLogic.java b/src/main/java/gregtech/api/logic/ComplexParallelProcessingLogic.java new file mode 100644 index 0000000000..d38a3d98fd --- /dev/null +++ b/src/main/java/gregtech/api/logic/ComplexParallelProcessingLogic.java @@ -0,0 +1,183 @@ +package gregtech.api.logic; + +import java.util.stream.LongStream; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +import gregtech.api.multitileentity.multiblock.base.Controller; +import gregtech.api.util.GT_OverclockCalculator; +import gregtech.api.util.GT_ParallelHelper; +import gregtech.api.util.GT_Recipe; + +public class ComplexParallelProcessingLogic { + + protected Controller<?> tileEntity; + protected GT_Recipe.GT_Recipe_Map recipeMap; + protected boolean hasPerfectOverclock; + protected final int maxComplexParallels; + protected final ItemStack[][] outputItems; + protected final ItemStack[][] inputItems; + protected final FluidStack[][] inputFluids; + protected final FluidStack[][] outputFluids; + protected final long[] availableEut; + protected final long[] eut; + protected final long[] durations; + protected boolean[] isVoidProtected; + + public ComplexParallelProcessingLogic(int maxComplexParallels) { + this(null, maxComplexParallels); + } + + public ComplexParallelProcessingLogic(GT_Recipe.GT_Recipe_Map recipeMap, int maxComplexParallels) { + this.maxComplexParallels = maxComplexParallels; + this.recipeMap = recipeMap; + inputItems = new ItemStack[maxComplexParallels][]; + outputItems = new ItemStack[maxComplexParallels][]; + inputFluids = new FluidStack[maxComplexParallels][]; + outputFluids = new FluidStack[maxComplexParallels][]; + eut = new long[maxComplexParallels]; + availableEut = new long[maxComplexParallels]; + durations = new long[maxComplexParallels]; + isVoidProtected = new boolean[maxComplexParallels]; + } + + public ComplexParallelProcessingLogic setRecipeMap(GT_Recipe.GT_Recipe_Map recipeMap) { + this.recipeMap = recipeMap; + return this; + } + + public ComplexParallelProcessingLogic setInputItems(int index, ItemStack... itemInputs) { + if (index >= 0 && index < maxComplexParallels) { + inputItems[index] = itemInputs; + } + return this; + } + + public ComplexParallelProcessingLogic setInputFluids(int index, FluidStack... inputFluids) { + if (index >= 0 && index < maxComplexParallels) { + this.inputFluids[index] = inputFluids; + } + return this; + } + + public ComplexParallelProcessingLogic setTileEntity(Controller<?> tileEntity) { + this.tileEntity = tileEntity; + return this; + } + + public ComplexParallelProcessingLogic setEut(int index, long eut) { + if (index >= 0 && index < maxComplexParallels) { + availableEut[index] = eut; + } + return this; + } + + public ComplexParallelProcessingLogic setVoidProtection(int index, boolean shouldVoidProtect) { + if (index >= 0 && index < maxComplexParallels) { + isVoidProtected[index] = shouldVoidProtect; + } + return this; + } + + public ComplexParallelProcessingLogic setPerfectOverclock(boolean shouldOverclockPerfectly) { + this.hasPerfectOverclock = shouldOverclockPerfectly; + return this; + } + + public ComplexParallelProcessingLogic clear() { + for (int i = 0; i < maxComplexParallels; i++) { + outputItems[i] = null; + outputFluids[i] = null; + durations[i] = 0; + |
