mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-23 05:19:49 +00:00
Compare commits
37
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b36215c817 | ||
|
|
2b53beff01 | ||
|
|
f25928c014 | ||
|
|
9b142a9ee4 | ||
|
|
ec02446519 | ||
|
|
0cf0eb151c | ||
|
|
bd128f59db | ||
|
|
e187ef370e | ||
|
|
36644fa59a | ||
|
|
43b3b619e8 | ||
|
|
29b000ff59 | ||
|
|
6cdc253867 | ||
|
|
3f3be51fc4 | ||
|
|
c74d7cabd3 | ||
|
|
3ff6d7e9d6 | ||
|
|
424721a1b9 | ||
|
|
504dfb51af | ||
|
|
86e421a4c0 | ||
|
|
892112756a | ||
|
|
a716f528c2 | ||
|
|
91b8e2b25c | ||
|
|
94be0bc52c | ||
|
|
24b2e0a20b | ||
|
|
9d8447c002 | ||
|
|
486bd52417 | ||
|
|
8069a1cf5f | ||
|
|
ff70fc4264 | ||
|
|
2876db6772 | ||
|
|
51d6de3242 | ||
|
|
d7e034dcf7 | ||
|
|
30c3ab100d | ||
|
|
05995607bc | ||
|
|
d0005adcf8 | ||
|
|
0e9652af56 | ||
|
|
0cd4f49d50 | ||
|
|
b6b03cfbd8 | ||
|
|
66e2a15331 |
No files matched your search
+11
-11
@@ -34,32 +34,32 @@
|
||||
* For more details, see https://docs.gradle.org/8.0.1/userguide/java_library_plugin.html#sec:java_library_configurations_graph
|
||||
*/
|
||||
dependencies {
|
||||
api('com.github.GTNewHorizons:NotEnoughItems:2.7.18-GTNH:dev')
|
||||
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-518-GTNH:dev')
|
||||
api('com.github.GTNewHorizons:NotEnoughItems:2.7.4-GTNH:dev')
|
||||
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-512-GTNH-pre:dev')
|
||||
api('curse.maven:cofh-core-69162:2388751')
|
||||
api('com.github.GTNewHorizons:waila:1.8.2:dev')
|
||||
api("com.github.GTNewHorizons:GTNHLib:0.6.1:dev")
|
||||
api("com.github.GTNewHorizons:GTNHLib:0.6.0:dev")
|
||||
|
||||
implementation("com.github.GTNewHorizons:WirelessCraftingTerminal:1.11.7:dev") {
|
||||
exclude group: 'com.github.GTNewHorizons', module: 'Applied-Energistics-2-Unofficial'
|
||||
}
|
||||
|
||||
compileOnly("com.github.GTNewHorizons:GTNHLib:0.6.1:dev") { transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:GTNHLib:0.6.0:dev") { transitive = false }
|
||||
compileOnly('com.github.GTNewHorizons:Baubles-Expanded:2.0.3:dev')
|
||||
compileOnly('com.github.GTNewHorizons:ExtraCells2:2.5.35:dev') { transitive = false }
|
||||
compileOnly('com.github.GTNewHorizons:ForestryMC:4.10.1:dev')
|
||||
compileOnly('com.github.GTNewHorizons:EnderIO:2.9.2:dev')
|
||||
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.51.67:dev') {
|
||||
compileOnly('com.github.GTNewHorizons:ForestryMC:4.10.0:dev')
|
||||
compileOnly('com.github.GTNewHorizons:EnderIO:2.9.1:dev')
|
||||
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.51.40:dev') {
|
||||
exclude group: 'com.github.GTNewHorizons', module: 'AE2FluidCraft-Rework'
|
||||
exclude group: 'com.github.GTNewHorizons', module: 'Applied-Energistics-2-Unofficial'
|
||||
}
|
||||
|
||||
compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
|
||||
compileOnly('com.gregoriust.gregtech:gregtech_1.7.10:6.14.23:dev') { transitive = false }
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.11.4-GTNH:dev') { transitive = false }
|
||||
compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.7.4-GTNH:dev') { transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.6.13:dev") { transitive = false }
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.11.1-GTNH:dev') { transitive = false }
|
||||
compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.7.0-GTNH:dev') { transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.6.11:dev") { transitive = false }
|
||||
|
||||
runtimeOnlyNonPublishable("com.github.GTNewHorizons:DuraDisplay:1.3.4:dev")
|
||||
runtimeOnlyNonPublishable("com.github.GTNewHorizons:GTNHLib:0.6.1:dev")
|
||||
runtimeOnlyNonPublishable("com.github.GTNewHorizons:GTNHLib:0.6.0:dev")
|
||||
}
|
||||
@@ -81,7 +81,6 @@ public class FluidCraft {
|
||||
RecipeLoader.addInfiniteWaterCell();
|
||||
}
|
||||
RecipeLoader.runTerminalRecipe();
|
||||
RecipeLoader.addDisassembleRecipe();
|
||||
|
||||
if (ModAndClassUtil.isV2) {
|
||||
CalculatorV2PluginLoader.installCalculatorV2Plugins();
|
||||
|
||||
@@ -64,6 +64,7 @@ import appeng.helpers.IPriorityHost;
|
||||
import appeng.me.GridAccessException;
|
||||
import appeng.me.cache.GridStorageCache;
|
||||
import appeng.me.storage.MEInventoryHandler;
|
||||
import appeng.me.storage.StorageBusInventoryHandler;
|
||||
import appeng.parts.automation.PartUpgradeable;
|
||||
import appeng.tile.inventory.AppEngInternalAEInventory;
|
||||
import appeng.tile.inventory.InvOperation;
|
||||
@@ -374,7 +375,7 @@ public class PartFluidStorageBus extends PartUpgradeable
|
||||
this.monitor = h;
|
||||
}
|
||||
if (inv != null) {
|
||||
this.handler = new MEInventoryHandler(inv, StorageChannel.FLUIDS);
|
||||
this.handler = new StorageBusInventoryHandler(inv, StorageChannel.FLUIDS);
|
||||
AccessRestriction currentAccess = (AccessRestriction) this.getConfigManager().getSetting(Settings.ACCESS);
|
||||
this.handler.setBaseAccess(currentAccess);
|
||||
this.handler.setWhitelist(
|
||||
|
||||
@@ -14,6 +14,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
import com.glodblock.github.api.registries.ILevelViewable;
|
||||
import com.glodblock.github.common.Config;
|
||||
import com.glodblock.github.common.item.ItemFluidDrop;
|
||||
import com.glodblock.github.crossmod.thaumcraft.ThaumicEnergisticsCrafting;
|
||||
import com.glodblock.github.inventory.AeItemStackHandler;
|
||||
import com.glodblock.github.inventory.AeStackInventory;
|
||||
import com.glodblock.github.inventory.AeStackInventoryImpl;
|
||||
@@ -169,19 +170,41 @@ public class TileLevelMaintainer extends AENetworkTile
|
||||
if (!isEnable || batchSize == 0) requests.updateState(i, State.None);
|
||||
if (batchSize > 0) {
|
||||
IAEItemStack craftItem = requests.getCraftItem(i);
|
||||
|
||||
if (ThaumicEnergisticsCrafting.isAspectStack(craftItem.getItemStack())) {
|
||||
craftItem = ThaumicEnergisticsCrafting.convertAspectStack(craftItem);
|
||||
}
|
||||
|
||||
IAEItemStack aeItem = inv.findPrecise(craftItem);
|
||||
|
||||
long stackSize = aeItem == null ? 0 : aeItem.getStackSize();
|
||||
|
||||
if (aeItem != null && ThaumicEnergisticsCrafting.isAspectStack(aeItem.getItemStack())) {
|
||||
stackSize = ThaumicEnergisticsCrafting.getEssentiaAmount(aeItem, grid);
|
||||
}
|
||||
|
||||
boolean isDone = requests.isDone(i);
|
||||
boolean isCraftable = aeItem != null && aeItem.isCraftable();
|
||||
boolean shouldCraft = isCraftable && aeItem.getStackSize() < quantity;
|
||||
boolean shouldCraft = isCraftable && stackSize < quantity;
|
||||
|
||||
if (isDone) requests.updateState(i, State.Idle);
|
||||
if (!isCraftable) requests.updateState(i, State.Error);
|
||||
if (allBusy || !isDone
|
||||
|| !shouldCraft
|
||||
|| craftingGrid.canEmitFor(craftItem)
|
||||
|| craftingGrid.isRequesting(craftItem))
|
||||
|
||||
if (allBusy || !isDone || !shouldCraft) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (craftingGrid.canEmitFor(craftItem)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (craftingGrid.isRequesting(craftItem)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// do crafting
|
||||
Future<ICraftingJob> jobTask = requests.getJob(i);
|
||||
|
||||
if (jobTask == null) {
|
||||
if (itemToBegin == null) {
|
||||
itemToBegin = craftItem;
|
||||
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
package com.glodblock.github.crossmod.thaumcraft;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
|
||||
import appeng.api.networking.IGrid;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.util.item.AEItemStack;
|
||||
import cpw.mods.fml.common.Optional.Method;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumicenergistics.api.grid.IEssentiaGrid;
|
||||
import thaumicenergistics.common.items.ItemCraftingAspect;
|
||||
|
||||
public class ThaumicEnergisticsCrafting {
|
||||
|
||||
public static Item neiAddonAspect, thaumicEnergisticsAspect;
|
||||
|
||||
public static void postInit() {
|
||||
neiAddonAspect = GameRegistry.findItem("thaumcraftneiplugin", "Aspect");
|
||||
thaumicEnergisticsAspect = GameRegistry.findItem("thaumicenergistics", "crafting.aspect");
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a stack is an aspect preview (nei addon or thaumic energistics). Does not mean that the stack contains
|
||||
* an aspect.
|
||||
*/
|
||||
public static boolean isAspectStack(ItemStack stack) {
|
||||
if (stack == null) return false;
|
||||
|
||||
return stack.getItem() == neiAddonAspect || stack.getItem() == thaumicEnergisticsAspect;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Method(modid = "thaumicenergistics")
|
||||
public static String getAspectName(ItemStack stack) {
|
||||
if (stack == null) return null;
|
||||
|
||||
if (stack.getItem() == neiAddonAspect) {
|
||||
NBTTagCompound tag = stack.getTagCompound();
|
||||
if (tag == null || !(tag.getTag("Aspects") instanceof NBTTagList aspects)) return null;
|
||||
if (aspects.tagCount() != 1) return null;
|
||||
String aspect = aspects.getCompoundTagAt(0).getString("key");
|
||||
if (aspect.isEmpty()) return null;
|
||||
|
||||
return aspect;
|
||||
}
|
||||
|
||||
if (stack.getItem() == thaumicEnergisticsAspect) {
|
||||
return ItemCraftingAspect.getAspect(stack).getTag();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Method(modid = "thaumicenergistics")
|
||||
public static ItemStack getAspectStack(String aspectName, int stackSize) {
|
||||
return ItemCraftingAspect.createStackForAspect(Aspect.getAspect(aspectName), stackSize);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts an aspect stack into a thaumic energistics stack.
|
||||
*/
|
||||
public static IAEItemStack convertAspectStack(IAEItemStack stack) {
|
||||
if (stack == null) return null;
|
||||
|
||||
String aspect = getAspectName(stack.getItemStack());
|
||||
|
||||
if (aspect == null) return stack;
|
||||
|
||||
return Objects.requireNonNull(AEItemStack.create(getAspectStack(aspect, 1))).setStackSize(stack.getStackSize());
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the amount of essentia stored in a grid for a given aspect preview.
|
||||
*/
|
||||
@Method(modid = "thaumicenergistics")
|
||||
public static long getEssentiaAmount(IAEItemStack stack, IGrid grid) {
|
||||
String aspectName = getAspectName(stack.getItemStack());
|
||||
|
||||
if (aspectName == null) return 0;
|
||||
|
||||
Aspect aspect = Aspect.getAspect(aspectName);
|
||||
|
||||
if (aspect == null) return 0;
|
||||
|
||||
IEssentiaGrid essentiaGrid = grid.getCache(IEssentiaGrid.class);
|
||||
|
||||
return essentiaGrid.getEssentiaAmount(aspect);
|
||||
}
|
||||
}
|
||||
@@ -366,8 +366,7 @@ public class FluidConvertingInventoryAdaptor extends InventoryAdaptor {
|
||||
private boolean isFluidConduitConnected(TileEntity te, ForgeDirection dir) {
|
||||
try {
|
||||
ILiquidConduit liquidConduit = (ILiquidConduit) eioTypeCheck.invoke(te, ILiquidConduit.class);
|
||||
return liquidConduit != null
|
||||
&& liquidConduit.getConnectionMode(dir.getOpposite()) != ConnectionMode.DISABLED;
|
||||
return liquidConduit.getConnectionMode(dir.getOpposite()) != ConnectionMode.DISABLED;
|
||||
} catch (IllegalAccessException | InvocationTargetException e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -71,7 +71,6 @@ import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
import com.glodblock.github.common.Config;
|
||||
import com.glodblock.github.common.item.FCBaseItemCell;
|
||||
import com.glodblock.github.common.storage.CellType;
|
||||
import com.glodblock.github.loader.recipe.DisassembleRecipe;
|
||||
import com.glodblock.github.loader.recipe.WirelessTerminalEnergyRecipe;
|
||||
import com.glodblock.github.loader.recipe.WirelessTerminalQuantumBridgeRecipe;
|
||||
import com.glodblock.github.loader.recipe.WirelessTerminalRecipe;
|
||||
@@ -758,8 +757,4 @@ public class RecipeLoader implements Runnable {
|
||||
Arrays.stream(term).filter(Objects::nonNull).toArray());
|
||||
|
||||
}
|
||||
|
||||
public static void addDisassembleRecipe() {
|
||||
GameRegistry.addRecipe(new DisassembleRecipe());
|
||||
}
|
||||
}
|
||||
@@ -1,140 +0,0 @@
|
||||
package com.glodblock.github.loader.recipe;
|
||||
|
||||
import static com.glodblock.github.loader.ItemAndBlockHolder.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.storage.IMEInventory;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.util.IterationCounter;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class DisassembleRecipe implements IRecipe {
|
||||
|
||||
private final Map<ItemStack, ItemStack> cellMappings;
|
||||
private final Map<ItemStack, ItemStack> nonCellMappings;
|
||||
|
||||
public DisassembleRecipe() {
|
||||
this.cellMappings = new HashMap<>(16);
|
||||
this.nonCellMappings = new HashMap<>(1);
|
||||
|
||||
this.cellMappings.put(new ItemStack(CELL1K), new ItemStack(CELL_PART, 1, 0));
|
||||
this.cellMappings.put(new ItemStack(CELL4K), new ItemStack(CELL_PART, 1, 1));
|
||||
this.cellMappings.put(new ItemStack(CELL16K), new ItemStack(CELL_PART, 1, 2));
|
||||
this.cellMappings.put(new ItemStack(CELL64K), new ItemStack(CELL_PART, 1, 3));
|
||||
this.cellMappings.put(new ItemStack(CELL256K), new ItemStack(CELL_PART, 1, 4));
|
||||
this.cellMappings.put(new ItemStack(CELL1024K), new ItemStack(CELL_PART, 1, 5));
|
||||
this.cellMappings.put(new ItemStack(CELL4096K), new ItemStack(CELL_PART, 1, 6));
|
||||
this.cellMappings.put(new ItemStack(CELL16384K), new ItemStack(CELL_PART, 1, 7));
|
||||
|
||||
this.cellMappings.put(new ItemStack(CELL1KM), new ItemStack(CELL_PART, 1, 0));
|
||||
this.cellMappings.put(new ItemStack(CELL4KM), new ItemStack(CELL_PART, 1, 1));
|
||||
this.cellMappings.put(new ItemStack(CELL16KM), new ItemStack(CELL_PART, 1, 2));
|
||||
this.cellMappings.put(new ItemStack(CELL64KM), new ItemStack(CELL_PART, 1, 3));
|
||||
this.cellMappings.put(new ItemStack(CELL256KM), new ItemStack(CELL_PART, 1, 4));
|
||||
this.cellMappings.put(new ItemStack(CELL1024KM), new ItemStack(CELL_PART, 1, 5));
|
||||
this.cellMappings.put(new ItemStack(CELL4096KM), new ItemStack(CELL_PART, 1, 6));
|
||||
this.cellMappings.put(new ItemStack(CELL16384KM), new ItemStack(CELL_PART, 1, 7));
|
||||
|
||||
this.nonCellMappings.put(
|
||||
new ItemStack(PATTERN),
|
||||
AEApi.instance().definitions().materials().blankPattern().maybeStack(1).get());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(final InventoryCrafting inv, final World w) {
|
||||
return this.getOutput(inv) != null;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private ItemStack getOutput(final IInventory inventory) {
|
||||
int itemCount = 0;
|
||||
ItemStack output = null;
|
||||
|
||||
for (int slotIndex = 0; slotIndex < inventory.getSizeInventory(); slotIndex++) {
|
||||
final ItemStack stackInSlot = inventory.getStackInSlot(slotIndex);
|
||||
if (stackInSlot != null) {
|
||||
// needs a single input in the recipe
|
||||
itemCount++;
|
||||
if (itemCount > 1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// handle storage cells
|
||||
final ItemStack storageCellStack = this.getCellOutput(stackInSlot);
|
||||
if (storageCellStack != null) {
|
||||
// make sure the storage cell stackInSlot empty...
|
||||
final IMEInventory<IAEFluidStack> cellInv = AEApi.instance().registries().cell()
|
||||
.getCellInventory(stackInSlot, null, StorageChannel.FLUIDS);
|
||||
if (cellInv != null) {
|
||||
final IItemList<IAEFluidStack> list = cellInv
|
||||
.getAvailableItems(StorageChannel.FLUIDS.createList(), IterationCounter.fetchNewId());
|
||||
if (!list.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
output = storageCellStack;
|
||||
}
|
||||
|
||||
// handle crafting storage blocks
|
||||
final ItemStack craftingStorageStack = this.getNonCellOutput(stackInSlot);
|
||||
if (craftingStorageStack != null) {
|
||||
output = craftingStorageStack;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
private ItemStack getCellOutput(final ItemStack compared) {
|
||||
for (final Map.Entry<ItemStack, ItemStack> entry : this.cellMappings.entrySet()) {
|
||||
if (Platform.isSameItemType(compared, entry.getKey())) {
|
||||
return entry.getValue().copy();
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private ItemStack getNonCellOutput(final ItemStack compared) {
|
||||
for (final Map.Entry<ItemStack, ItemStack> entry : this.nonCellMappings.entrySet()) {
|
||||
if (Platform.isSameItemType(compared, entry.getKey())) {
|
||||
return entry.getValue().copy();
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public ItemStack getCraftingResult(final InventoryCrafting inv) {
|
||||
return this.getOutput(inv);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRecipeSize() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public ItemStack getRecipeOutput() // no default output..
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,7 @@ import com.glodblock.github.common.tile.TileFluidInterface;
|
||||
import com.glodblock.github.common.tile.TileWalrus;
|
||||
import com.glodblock.github.crossmod.extracells.EC2Replacer;
|
||||
import com.glodblock.github.crossmod.thaumcraft.AspectUtil;
|
||||
import com.glodblock.github.crossmod.thaumcraft.ThaumicEnergisticsCrafting;
|
||||
import com.glodblock.github.inventory.external.AEFluidInterfaceHandler;
|
||||
import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.network.SPacketMEUpdateBuffer;
|
||||
@@ -46,6 +47,9 @@ public class CommonProxy {
|
||||
if (!ModAndClassUtil.EC2 && Config.replaceEC2) {
|
||||
EC2Replacer.initReplacer();
|
||||
}
|
||||
if (ModAndClassUtil.ThE) {
|
||||
ThaumicEnergisticsCrafting.postInit();
|
||||
}
|
||||
if (ModAndClassUtil.isBigInterface) {
|
||||
Upgrades.PATTERN_CAPACITY.registerItem(new ItemStack(ItemAndBlockHolder.FLUID_INTERFACE), 3);
|
||||
Upgrades.PATTERN_CAPACITY.registerItem(new ItemStack(ItemAndBlockHolder.INTERFACE), 3);
|
||||
|
||||
Reference in new issue
Block a user