Compare commits

..
Author SHA1 Message Date
Martin Robertz dbbdf72230 update 2024-10-20 15:58:07 +02:00
lordIcocainandMartin Robertz 25da378a51 Fix: Adv blocking card for omni. False positive when getAdaptor() return null. (#231)
* fix_getadaptor

* spotless

* allow certus tank & buffers

* better check

* spotless

* better blocking behavior

---------

Co-authored-by: Martin Robertz <[email protected]>
2024-10-20 15:00:14 +02:00
lordIcocain f8e7aba55a Add Smart Blocking Mode GUI for DualInterface (#232) 2024-10-19 10:03:07 -05:00
Martin Robertz d68adac1cc update 2024-10-05 12:28:43 +02:00
hiroscho d411d4f18a Fix fluid storage bus does full reset on every neighbor change (#230) 2024-10-05 12:16:24 +02:00
Martin Robertz eda554a200 update 2024-10-02 15:25:58 +02:00
hiroscho c7f2ea5797 Fix isAutoCraftingInventory returns false (#229) 2024-09-29 18:47:27 +02:00
Martin Robertz e27a8de392 update 2024-09-10 17:30:33 +02:00
MCTBL 9448540466 add blue light for drive and ME chest (#228) 2024-09-08 16:15:15 +02:00
NotAPenguin 41963430dd rename (#227) 2024-09-03 11:37:40 +02:00
Martin Robertz 7deb868713 update 2024-09-02 21:47:56 +02:00
Martin Robertz 5e723f4813 Update dependencies.gradle 2024-09-02 21:09:19 +02:00
Demiu b2e74d8ea0 Complete crafting jobs on networks without discretizer (#225) 2024-08-27 11:30:49 +02:00
Martin Robertz a3eee96d75 update 2024-08-27 10:50:59 +02:00
hiroscho 6bba29a007 Fix inverter card for fluid storage bus (#224) 2024-08-27 10:50:07 +02:00
Martin Robertz 437bb60af3 update 2024-08-27 10:22:56 +02:00
MCTBL 9ca192722b add ignore crafting mode button for wireless terminal (#226) 2024-08-27 07:48:32 +02:00
Martin Robertz 1546f5f505 update 2024-08-23 22:49:05 +02:00
Thomasandhiroscho b4bc6fa0ff add fluid storage bus extract filter (#223)
Co-authored-by: hiroscho <[email protected]>
2024-08-23 22:47:48 +02:00
Martin Robertz 767c6e99da update 2024-08-18 14:31:00 +02:00
c6c5d162a1 Fix fluid autocrafting (#221)
* Fix fluid autocrafting

Depends on https://github.com/GTNewHorizons/Applied-Energistics-2-Unofficial/pull/545

* update

* update

* rename

* Add FluidCraftingInventoryHandler so that fluid crafting isn't handled in Pass 2

* update deps

---------

Co-authored-by: hiroscho <[email protected]>
Co-authored-by: Dream Master <[email protected]>
2024-08-18 14:29:36 +02:00
Thomasandhiroscho e09525bc88 Fix fluid storage bus that undergoes a full reset returns amount 0 (#222)
Co-authored-by: hiroscho <[email protected]>
2024-08-18 10:11:35 +02:00
Dream Master 131747335f update 2024-08-04 19:06:50 +07:00
Pasha BouzarjomehriandMartin Robertz 6f05a1dd42 setItemToCraft (crash fix) (#219)
Fixes GTNewHorizons/GT-New-Horizons-Modpack#16769 for change GTNewHorizons/Applied-Energistics-2-Unofficial#523

Co-authored-by: Martin Robertz <[email protected]>
2024-08-04 19:04:58 +07:00
DemiuandDream Master e983a5e87c Adjust to AE2 api changes (#220)
* Adjust to AE2 api changes

* update

* update

---------

Co-authored-by: Dream Master <[email protected]>
2024-07-31 00:39:16 +07:00
Dream Master f63435403b update 2024-07-28 19:40:24 +07:00
MCTBL a0db8e38e6 Add Fluid Artificial Universe Cell (#218)
* Add Fluid Artificial Universe Cell

* reduce type from 63 to 5

* change the internal name of cell
2024-07-28 19:32:26 +07:00
30 changed files with 413 additions and 170 deletions

No files matched your search

+14 -14
View File
@@ -34,28 +34,28 @@
* 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.6.14-GTNH:dev')
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-412-GTNH:dev')
api('com.github.GTNewHorizons:NotEnoughItems:2.6.42-GTNH:dev')
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-469-GTNH:dev')
api('curse.maven:cofh-core-69162:2388751')
api('com.github.GTNewHorizons:waila:1.8.1:dev')
implementation("com.github.GTNewHorizons:WirelessCraftingTerminal:1.11.2:dev")
implementation("com.github.GTNewHorizons:WirelessCraftingTerminal:1.11.7:dev")
compileOnly("com.github.GTNewHorizons:GTNHLib:0.3.2:dev") { transitive = false }
compileOnly('com.github.GTNewHorizons:Baubles:1.0.4:dev')
compileOnly('com.github.GTNewHorizons:ExtraCells2:2.5.34:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:ForestryMC:4.9.7:dev')
compileOnly('com.github.GTNewHorizons:EnderIO:2.8.17:dev')
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.48.92:dev') {
compileOnly("com.github.GTNewHorizons:GTNHLib:0.5.15: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.9.16:dev')
compileOnly('com.github.GTNewHorizons:EnderIO:2.8.18:dev')
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.50.46:dev') {
exclude group: 'com.github.GTNewHorizons', module: 'AE2FluidCraft-Rework'
}
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.10.16-GTNH:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.6.18-GTNH:dev') { transitive = false }
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.5.36:dev") { transitive = false }
compileOnly('com.github.GTNewHorizons:OpenComputers:1.10.26-GTNH:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.6.26-GTNH:dev') { transitive = false }
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.5.73:dev") { transitive = false }
runtimeOnlyNonPublishable("com.github.GTNewHorizons:DuraDisplay:1.3.2:dev")
runtimeOnlyNonPublishable("com.github.GTNewHorizons:GTNHLib:0.3.2:dev")
runtimeOnlyNonPublishable("com.github.GTNewHorizons:DuraDisplay:1.3.4:dev")
runtimeOnlyNonPublishable("com.github.GTNewHorizons:GTNHLib:0.5.15:dev")
}
+12 -1
View File
@@ -85,6 +85,11 @@ accessTransformersFile = ae2fc_at.cfg
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
usesMixins = false
# Set to a non-empty string to configure mixins in a separate source set under src/VALUE, instead of src/main.
# This can speed up compile times thanks to not running the mixin annotation processor on all input sources.
# Mixin classes will have access to "main" classes, but not the other way around.
separateMixinSourceSet =
# Adds some debug arguments like verbose output and class export.
usesMixinDebug = false
@@ -117,9 +122,15 @@ minimizeShadowedDependencies = true
# If disabled, won't rename the shadowed classes.
relocateShadowedDependencies = true
# Adds the GTNH maven, CurseMaven, Modrinth, and some more well-known 1.7.10 repositories.
# Adds CurseMaven, Modrinth, and some more well-known 1.7.10 repositories.
includeWellKnownRepositories = true
# A list of repositories to exclude from the includeWellKnownRepositories setting. Should be a space separated
# list of strings, with the acceptable keys being(case does not matter):
# cursemaven
# modrinth
excludeWellKnownRepositories =
# Change these to your Maven coordinates if you want to publish to a custom Maven repository instead of the default GTNH Maven.
# Authenticate with the MAVEN_USER and MAVEN_PASSWORD environment variables.
# If you need a more complex setup disable maven publishing here and add a publishing repository to addon.gradle.
Binary file not shown.
+1 -1
View File
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Vendored
+4 -1
View File
@@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
##############################################################################
#
@@ -84,7 +86,8 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Vendored
+2
View File
@@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
+1 -1
View File
@@ -17,7 +17,7 @@ pluginManagement {
}
plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.23'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.27'
}
@@ -42,6 +42,7 @@ public class GuiDualInterface extends GuiUpgradeable {
private GuiTabButton priority;
private GuiTabButton switcher;
private GuiImgButton BlockMode;
private GuiImgButton SmartBlockMode;
private GuiToggleButton interfaceMode;
private GuiImgButton insertionMode;
private GuiImgButton sidelessMode;
@@ -82,6 +83,9 @@ public class GuiDualInterface extends GuiUpgradeable {
this.BlockMode = new GuiImgButton(this.guiLeft - 18, this.guiTop + offset, Settings.BLOCK, YesNo.NO);
this.buttonList.add(this.BlockMode);
this.SmartBlockMode = new GuiImgButton(this.guiLeft - 36, this.guiTop + offset, Settings.SMART_BLOCK, YesNo.NO);
this.buttonList.add(this.SmartBlockMode);
offset += 18;
this.interfaceMode = new GuiToggleButton(
@@ -156,7 +160,9 @@ public class GuiDualInterface extends GuiUpgradeable {
if (this.BlockMode != null) {
this.BlockMode.set(((ContainerInterface) this.cvb).getBlockingMode());
}
if (this.SmartBlockMode != null) {
this.SmartBlockMode.set(((ContainerInterface) this.cvb).getSmartBlockingMode());
}
if (this.interfaceMode != null) {
this.interfaceMode.setState(((ContainerInterface) this.cvb).getInterfaceTerminalMode() == YesNo.YES);
}
@@ -213,6 +219,8 @@ public class GuiDualInterface extends GuiUpgradeable {
NetworkHandler.instance.sendToServer(new PacketConfigButton(Settings.INTERFACE_TERMINAL, backwards));
} else if (btn == this.BlockMode) {
NetworkHandler.instance.sendToServer(new PacketConfigButton(this.BlockMode.getSetting(), backwards));
} else if (btn == this.SmartBlockMode) {
NetworkHandler.instance.sendToServer(new PacketConfigButton(this.SmartBlockMode.getSetting(), backwards));
} else if (btn == this.insertionMode) {
NetworkHandler.instance.sendToServer(new PacketConfigButton(this.insertionMode.getSetting(), backwards));
} else if (btn == this.doublePatterns) {
@@ -3,6 +3,8 @@ package com.glodblock.github.client.gui;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.entity.player.InventoryPlayer;
import org.lwjgl.input.Mouse;
import com.glodblock.github.FluidCraft;
import com.glodblock.github.client.gui.base.FCGuiAmount;
import com.glodblock.github.common.item.ItemWirelessUltraTerminal;
@@ -17,12 +19,18 @@ import com.glodblock.github.inventory.item.WirelessPatternTerminalInventory;
import com.glodblock.github.loader.ItemAndBlockHolder;
import com.glodblock.github.network.CPacketCraftRequest;
import appeng.api.config.CraftingMode;
import appeng.api.config.Settings;
import appeng.api.storage.ITerminalHost;
import appeng.client.gui.widgets.GuiImgButton;
import appeng.container.implementations.ContainerCraftAmount;
import appeng.core.localization.GuiText;
import appeng.util.Platform;
public class GuiFluidCraftAmount extends FCGuiAmount {
private GuiImgButton craftingMode;
public GuiFluidCraftAmount(final InventoryPlayer inventoryPlayer, final ITerminalHost te) {
super(new ContainerCraftAmount(inventoryPlayer, te));
}
@@ -30,6 +38,14 @@ public class GuiFluidCraftAmount extends FCGuiAmount {
@Override
public void initGui() {
super.initGui();
this.buttonList.add(
this.craftingMode = new GuiImgButton(
this.guiLeft + 10,
this.guiTop + 53,
Settings.CRAFTING_MODE,
CraftingMode.STANDARD));
this.amountBox.setText("1");
this.amountBox.setSelectionPos(0);
}
@@ -55,8 +71,20 @@ public class GuiFluidCraftAmount extends FCGuiAmount {
protected void actionPerformed(final GuiButton btn) {
super.actionPerformed(btn);
try {
if (btn == this.submit && this.submit.enabled) {
FluidCraft.proxy.netHandler.sendToServer(new CPacketCraftRequest(getAmount(), isShiftKeyDown()));
if (btn == this.craftingMode) {
GuiImgButton iBtn = ((GuiImgButton) btn);
final Enum cv = iBtn.getCurrentValue();
final boolean backwards = Mouse.isButtonDown(1);
final Enum next = Platform.rotateEnum(cv, backwards, iBtn.getSetting().getPossibleValues());
iBtn.set(next);
} else if (btn == this.submit && this.submit.enabled) {
FluidCraft.proxy.netHandler.sendToServer(
new CPacketCraftRequest(
getAmount(),
isShiftKeyDown(),
((CraftingMode) this.craftingMode.getCurrentValue())));
}
} catch (final NumberFormatException e) {
this.amountBox.setText("1");
@@ -23,6 +23,7 @@ import appeng.api.storage.data.IItemList;
import appeng.container.guisync.GuiSync;
import appeng.container.slot.SlotRestrictedInput;
import appeng.tile.inventory.AppEngInternalAEInventory;
import appeng.util.IterationCounter;
import appeng.util.Platform;
import appeng.util.iterators.NullIterator;
@@ -156,7 +157,7 @@ public class ContainerFluidStorageBus extends FCContainerFluidConfigurable {
Iterator<IAEFluidStack> i = new NullIterator<>();
if (cellInv != null) {
final IItemList<IAEFluidStack> list = cellInv
.getAvailableItems(AEApi.instance().storage().createFluidList());
.getAvailableItems(AEApi.instance().storage().createFluidList(), IterationCounter.fetchNewId());
i = list.iterator();
}
@@ -37,6 +37,7 @@ import appeng.items.AEBaseItem;
import appeng.items.contents.CellConfig;
import appeng.items.contents.CellUpgrades;
import appeng.util.InventoryAdaptor;
import appeng.util.IterationCounter;
import appeng.util.Platform;
import appeng.util.ReadableNumberConverter;
@@ -224,7 +225,8 @@ public abstract class FCBaseItemCell extends AEBaseItem implements IStorageFluid
.getCellInventory(stack, null, StorageChannel.FLUIDS);
if (inv != null && playerInventory.getCurrentItem() == stack) {
final InventoryAdaptor ia = InventoryAdaptor.getAdaptor(player, ForgeDirection.UNKNOWN);
final IItemList<IAEFluidStack> list = inv.getAvailableItems(StorageChannel.FLUIDS.createList());
final IItemList<IAEFluidStack> list = inv
.getAvailableItems(StorageChannel.FLUIDS.createList(), IterationCounter.fetchNewId());
if (list.isEmpty() && ia != null) {
playerInventory.setInventorySlotContents(playerInventory.currentItem, null);
@@ -1,8 +1,12 @@
package com.glodblock.github.common.parts;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.function.Predicate;
import javax.annotation.Nullable;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.entity.player.EntityPlayer;
@@ -11,16 +15,13 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Vec3;
import net.minecraftforge.fluids.IFluidHandler;
import com.glodblock.github.client.textures.FCPartsTexture;
import com.glodblock.github.common.item.ItemFluidPacket;
import com.glodblock.github.common.tile.TileFluidInterface;
import com.glodblock.github.inventory.InventoryHandler;
import com.glodblock.github.inventory.MEMonitorIFluidHandler;
import com.glodblock.github.inventory.gui.GuiType;
import com.glodblock.github.util.BlockPos;
import com.glodblock.github.util.ModAndClassUtil;
import appeng.api.AEApi;
import appeng.api.config.AccessRestriction;
@@ -43,7 +44,6 @@ import appeng.api.networking.ticking.IGridTickable;
import appeng.api.networking.ticking.ITickManager;
import appeng.api.networking.ticking.TickRateModulation;
import appeng.api.networking.ticking.TickingRequest;
import appeng.api.parts.IPart;
import appeng.api.parts.IPartCollisionHelper;
import appeng.api.parts.IPartRenderHelper;
import appeng.api.storage.ICellContainer;
@@ -66,13 +66,12 @@ import appeng.me.storage.MEInventoryHandler;
import appeng.parts.automation.PartUpgradeable;
import appeng.tile.inventory.AppEngInternalAEInventory;
import appeng.tile.inventory.InvOperation;
import appeng.tile.networking.TileCableBus;
import appeng.util.IterationCounter;
import appeng.util.Platform;
import appeng.util.item.AEFluidStack;
import appeng.util.prioitylist.PrecisePriorityList;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import extracells.tileentity.TileEntityFluidInterface;
public class PartFluidStorageBus extends PartUpgradeable
implements IGridTickable, ICellContainer, IMEMonitorHandlerReceiver<IAEFluidStack>, IPriorityHost {
@@ -86,8 +85,10 @@ public class PartFluidStorageBus extends PartUpgradeable
private int handlerHash = 0;
private boolean wasActive = false;
private byte resetCacheLogic = 0;
private boolean accessChanged;
private boolean readOncePass;
/**
* used to read changes once when the list of extractable items was changed
*/
private boolean readOncePass = false;
public PartFluidStorageBus(ItemStack is) {
super(is);
@@ -130,9 +131,6 @@ public class PartFluidStorageBus extends PartUpgradeable
@Override
public void updateSetting(final IConfigManager manager, final Enum settingName, final Enum newValue) {
if (settingName.name().equals("ACCESS")) {
this.accessChanged = true;
}
this.resetCache(true);
this.getHost().markForSave();
}
@@ -148,7 +146,6 @@ public class PartFluidStorageBus extends PartUpgradeable
super.readFromNBT(data);
this.config.readFromNBT(data, "config");
this.priority = data.getInteger("priority");
this.accessChanged = false;
}
@Override
@@ -201,18 +198,7 @@ public class PartFluidStorageBus extends PartUpgradeable
final MEInventoryHandler<IAEFluidStack> in = this.getInternalHandler();
IItemList<IAEFluidStack> before = AEApi.instance().storage().createFluidList();
if (in != null) {
if (accessChanged) {
AccessRestriction currentAccess = (AccessRestriction) this.getConfigManager()
.getSetting(Settings.ACCESS);
if (!currentAccess.hasPermission(AccessRestriction.READ)) {
readOncePass = true;
}
before = in.getAvailableItems(before);
in.setBaseAccess(currentAccess);
accessChanged = false;
} else {
before = in.getAvailableItems(before);
}
before = in.getAvailableItems(before, IterationCounter.fetchNewId());
}
this.cached = false;
@@ -221,11 +207,15 @@ public class PartFluidStorageBus extends PartUpgradeable
}
final MEInventoryHandler<IAEFluidStack> out = this.getInternalHandler();
if (this.monitor != null) {
this.monitor.onTick();
}
IItemList<IAEFluidStack> after = AEApi.instance().storage().createFluidList();
if (in != out) {
if (out != null) {
after = out.getAvailableItems(after);
after = out.getAvailableItems(after, IterationCounter.fetchNewId());
}
Platform.postListChanges(before, after, this, this.source);
}
@@ -239,23 +229,46 @@ public class PartFluidStorageBus extends PartUpgradeable
@Override
public void postChange(final IBaseMonitor<IAEFluidStack> monitor, final Iterable<IAEFluidStack> change,
final BaseActionSource source) {
if (this.getProxy().isActive()) {
AccessRestriction currentAccess = (AccessRestriction) this.getConfigManager().getSetting(Settings.ACCESS);
if (readOncePass) {
readOncePass = false;
try {
this.getProxy().getStorage()
.postAlterationOfStoredItems(StorageChannel.FLUIDS, change, this.source);
} catch (final GridAccessException ignore) {}
return;
try {
if (this.getProxy().isActive()) {
if (!this.readOncePass) {
AccessRestriction currentAccess = (AccessRestriction) this.getConfigManager()
.getSetting(Settings.ACCESS);
if (!currentAccess.hasPermission(AccessRestriction.READ)) {
return;
}
}
Iterable<IAEFluidStack> filteredChanges = this.filterChanges(change, this.readOncePass);
this.readOncePass = false;
if (filteredChanges == null) return;
this.getProxy().getStorage()
.postAlterationOfStoredItems(StorageChannel.FLUIDS, filteredChanges, this.source);
}
if (!currentAccess.hasPermission(AccessRestriction.READ)) {
return;
}
try {
this.getProxy().getStorage().postAlterationOfStoredItems(StorageChannel.FLUIDS, change, source);
} catch (final GridAccessException ignore) {}
} catch (final GridAccessException ignore) {}
}
/**
* Filters the changes to only include fluids that pass the handlers extract filter. Will return null if none of the
* changes match the filter.
*/
@Nullable
private Iterable<IAEFluidStack> filterChanges(final Iterable<IAEFluidStack> change, final boolean readOncePass) {
if (readOncePass) {
return change;
}
if (this.handler != null && this.handler.isExtractFilterActive()
&& !this.handler.getExtractPartitionList().isEmpty()) {
List<IAEFluidStack> filteredChanges = new ArrayList<>();
Predicate<IAEFluidStack> extractFilterCondition = this.handler.getExtractFilterCondition();
for (final IAEFluidStack changedFluid : change) {
if (extractFilterCondition.test(changedFluid)) {
filteredChanges.add(changedFluid);
}
}
return filteredChanges.isEmpty() ? null : Collections.unmodifiableList(filteredChanges);
}
return change;
}
@Override
@@ -272,38 +285,7 @@ public class PartFluidStorageBus extends PartUpgradeable
@Override
public void onNeighborChanged() {
TileEntity tile = this.getTile();
if (tile == null || this.getProxy() == null || !this.getProxy().isActive()) return;
BlockPos neighbor = new BlockPos(tile).getOffSet(this.getSide());
final TileEntity te = neighbor.getTileEntity();
// In case the TE was destroyed, we have to do a full reset immediately.
if (te instanceof TileCableBus) {
IPart iPart = ((TileCableBus) te).getPart(this.getSide().getOpposite());
if (iPart == null || iPart instanceof PartFluidInterface) {
this.resetCache(true);
this.resetCache();
}
if (ModAndClassUtil.EC2) {
if (iPart == null || iPart instanceof extracells.part.PartFluidInterface) {
this.resetCache(true);
this.resetCache();
}
}
} else if (te == null || te instanceof TileFluidInterface) {
this.resetCache(true);
this.resetCache();
} else if (ModAndClassUtil.EC2) {
if (te instanceof TileEntityFluidInterface) {
this.resetCache(true);
this.resetCache();
}
} else if (te instanceof IFluidHandler) {
this.resetCache(true);
this.resetCache();
} else {
this.resetCache(false);
}
this.resetCache(false);
}
@Override
@@ -356,6 +338,7 @@ public class PartFluidStorageBus extends PartUpgradeable
this.handlerHash = newHandlerHash;
this.handler = null;
this.monitor = null;
this.readOncePass = true;
if (target != null) {
final IExternalStorageHandler esh = AEApi.instance().registries().externalStorage()
.getHandler(target, this.getSide().getOpposite(), StorageChannel.FLUIDS, this.source);
@@ -365,16 +348,21 @@ public class PartFluidStorageBus extends PartUpgradeable
if (inv instanceof final MEMonitorIFluidHandler h) {
h.setMode((StorageFilter) this.getConfigManager().getSetting(Settings.STORAGE_FILTER));
h.setActionSource(new MachineSource(this));
this.monitor = (MEMonitorIFluidHandler) inv;
this.monitor = h;
}
if (inv != null) {
this.handler = new MEInventoryHandler(inv, StorageChannel.FLUIDS);
this.handler.setBaseAccess((AccessRestriction) this.getConfigManager().getSetting(Settings.ACCESS));
AccessRestriction currentAccess = (AccessRestriction) this.getConfigManager().getSetting(Settings.ACCESS);
this.handler.setBaseAccess(currentAccess);
this.handler.setWhitelist(
this.getInstalledUpgrades(Upgrades.INVERTER) > 0 ? IncludeExclude.BLACKLIST
: IncludeExclude.WHITELIST);
this.handler.setSticky(this.getInstalledUpgrades(Upgrades.STICKY) > 0);
this.handler.setPriority(this.priority);
// only READ since READ_WRITE would break compat of existing storage buses
// could use a new setting that is applied via button or a card too
this.handler.setIsExtractFilterActive(currentAccess == AccessRestriction.READ);
if (inv instanceof IMEMonitor) {
((IBaseMonitor) inv).addListener(this, this.handler);
}
@@ -385,7 +373,9 @@ public class PartFluidStorageBus extends PartUpgradeable
final IAEItemStack is = this.config.getAEStackInSlot(x);
if (is != null) priorityList.add(AEFluidStack.create(ItemFluidPacket.getFluidStack(is)));
}
this.handler.setPartitionList(new PrecisePriorityList(priorityList));
PrecisePriorityList partitionList = new PrecisePriorityList(priorityList);
this.handler.setPartitionList(partitionList);
this.handler.setExtractPartitionList(partitionList);
}
}
}
@@ -188,13 +188,16 @@ public class FluidCellInventory implements IFluidCellInventory {
@Override
public int getStatusForCell() {
if (this.canHoldNewFluid()) {
if (this.getUsedBytes() == 0) {
return 1;
}
if (this.getRemainingFluidCount() > 0) {
if (this.canHoldNewFluid()) {
return 2;
}
return 3;
if (this.getRemainingFluidCount() > 0) {
return 3;
}
return 4;
}
protected void loadCellFluids() {
@@ -380,7 +383,7 @@ public class FluidCellInventory implements IFluidCellInventory {
}
@Override
public IItemList<IAEFluidStack> getAvailableItems(IItemList<IAEFluidStack> out) {
public IItemList<IAEFluidStack> getAvailableItems(IItemList<IAEFluidStack> out, int iteration) {
for (final IAEFluidStack i : this.getCellFluids()) {
out.add(i);
}
@@ -388,7 +391,7 @@ public class FluidCellInventory implements IFluidCellInventory {
}
@Override
public IAEFluidStack getAvailableItem(@Nonnull IAEFluidStack request) {
public IAEFluidStack getAvailableItem(@Nonnull IAEFluidStack request, int iteration) {
return this.getCellFluids().findPrecise(request);
}
@@ -92,8 +92,8 @@ public class FluidCellInventoryHandler extends MEInventoryHandler<IAEFluidStack>
public int getStatusForCell() {
int val = this.getCellInv().getStatusForCell();
if (val == 1 && this.isPreformatted()) {
val = 2;
if ((val == 1 || val == 2) && this.isPreformatted()) {
val = 3;
}
return val;
@@ -189,7 +189,7 @@ public class TileFluidDiscretizer extends AENetworkTile implements IPriorityHost
}
@Override
public IItemList<IAEItemStack> getAvailableItems(IItemList<IAEItemStack> out) {
public IItemList<IAEItemStack> getAvailableItems(IItemList<IAEItemStack> out, int iteration) {
if (itemCache == null) {
itemCache = AEApi.instance().storage().createItemList();
IMEMonitor<IAEFluidStack> fluidGrid = getFluidGrid();
@@ -210,7 +210,7 @@ public class TileFluidDiscretizer extends AENetworkTile implements IPriorityHost
}
@Override
public IAEItemStack getAvailableItem(@Nonnull IAEItemStack request) {
public IAEItemStack getAvailableItem(@Nonnull IAEItemStack request, int iteration) {
IMEMonitor<IAEFluidStack> fluidGrid = getFluidGrid();
if (fluidGrid == null) {
return null;
@@ -219,7 +219,7 @@ public class TileFluidDiscretizer extends AENetworkTile implements IPriorityHost
if (fluidRequest == null) {
return null;
}
IAEFluidStack availableFluid = fluidGrid.getAvailableItem(fluidRequest);
IAEFluidStack availableFluid = fluidGrid.getAvailableItem(fluidRequest, iteration);
if (availableFluid == null || availableFluid.getFluid() == null
|| FluidCraftAPI.instance().isBlacklistedInDisplay(availableFluid.getFluid().getClass())) {
return null;
@@ -264,9 +264,42 @@ public class TileFluidDiscretizer extends AENetworkTile implements IPriorityHost
}
}
private class FluidCraftingInventoryHandler extends MEInventoryHandler<IAEFluidStack> {
public FluidCraftingInventoryHandler(IMEInventory<IAEFluidStack> i, StorageChannel channel) {
super(i, channel);
}
@Override
public boolean isPrioritized(IAEFluidStack input) {
return true;
}
@Override
public boolean canAccept(IAEFluidStack input) {
ICraftingGrid craftingGrid;
try {
craftingGrid = getProxy().getGrid().getCache(ICraftingGrid.class);
} catch (GridAccessException e) {
return false;
}
if (craftingGrid instanceof CraftingGridCache craftingGridCache) {
return craftingGridCache.canAccept(ItemFluidDrop.newAeStack(input));
}
return false;
}
@Override
public boolean isAutoCraftingInventory() {
return true;
}
}
private class FluidCraftingInventory implements IMEInventory<IAEFluidStack> {
private final MEInventoryHandler<IAEFluidStack> invHandler = new MEInventoryHandler<>(this, getChannel());
private final MEInventoryHandler<IAEFluidStack> invHandler = new FluidCraftingInventoryHandler(
this,
getChannel());
FluidCraftingInventory() {
invHandler.setPriority(Integer.MAX_VALUE);
@@ -297,12 +330,12 @@ public class TileFluidDiscretizer extends AENetworkTile implements IPriorityHost
}
@Override
public IItemList<IAEFluidStack> getAvailableItems(IItemList<IAEFluidStack> out) {
public IItemList<IAEFluidStack> getAvailableItems(IItemList<IAEFluidStack> out, int iteration) {
return out;
}
@Override
public IAEFluidStack getAvailableItem(@Nonnull IAEFluidStack request) {
public IAEFluidStack getAvailableItem(@Nonnull IAEFluidStack request, int iteration) {
return null;
}
@@ -7,6 +7,7 @@ import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.ClassWriter;
import com.glodblock.github.coremod.transform.CraftingCpuTransformer;
import com.glodblock.github.coremod.transform.CraftingGridCacheTransformer;
import com.glodblock.github.coremod.transform.CraftingTreeNodeTransformer;
import com.glodblock.github.coremod.transform.DualityInterfaceTransformer;
import com.glodblock.github.coremod.transform.ExternalStorageRegistryTransformer;
@@ -20,6 +21,7 @@ public class FCClassTransformer implements IClassTransformer {
Transform tform;
switch (transformedName) {
case "appeng.crafting.CraftingTreeNode" -> tform = CraftingTreeNodeTransformer.INSTANCE;
case "appeng.me.cache.CraftingGridCache" -> tform = CraftingGridCacheTransformer.INSTANCE;
case "appeng.me.cluster.implementations.CraftingCPUCluster" -> tform = CraftingCpuTransformer.INSTANCE;
case "appeng.helpers.DualityInterface" -> tform = DualityInterfaceTransformer.INSTANCE;
case "appeng.client.gui.implementations.GuiCraftingCPU", "appeng.client.gui.implementations.GuiCraftConfirm", "net.p455w0rd.wirelesscraftingterminal.client.gui.GuiCraftConfirm", "appeng.client.gui.widgets.GuiCraftingTree" -> tform = GuiCraftingTransformer.INSTANCE;
@@ -1,7 +1,7 @@
package com.glodblock.github.coremod.hooker;
import java.util.HashSet;
import java.util.Set;
import java.util.Arrays;
import java.util.List;
import javax.annotation.Nullable;
@@ -15,30 +15,24 @@ import net.minecraftforge.fluids.FluidStack;
import com.glodblock.github.client.gui.GuiFluidCraftConfirm;
import com.glodblock.github.common.item.ItemFluidDrop;
import com.glodblock.github.common.item.ItemFluidPacket;
import com.glodblock.github.common.parts.PartFluidInterface;
import com.glodblock.github.common.tile.TileFluidInterface;
import com.glodblock.github.inventory.CraftingGridCacheFluidInventoryProxyCell;
import com.glodblock.github.inventory.FluidConvertingInventoryAdaptor;
import com.glodblock.github.inventory.FluidConvertingInventoryCrafting;
import com.glodblock.github.loader.ItemAndBlockHolder;
import com.glodblock.github.util.Ae2Reflect;
import com.glodblock.github.util.SetBackedMachineSet;
import com.google.common.collect.Sets;
import appeng.api.config.Actionable;
import appeng.api.networking.IGrid;
import appeng.api.networking.IGridHost;
import appeng.api.networking.IGridNode;
import appeng.api.networking.IMachineSet;
import appeng.api.networking.storage.IStorageGrid;
import appeng.api.storage.IMEInventory;
import appeng.api.storage.IMEInventoryHandler;
import appeng.api.storage.StorageChannel;
import appeng.api.storage.data.IAEFluidStack;
import appeng.api.storage.data.IAEItemStack;
import appeng.client.gui.IGuiTooltipHandler;
import appeng.crafting.MECraftingInventory;
import appeng.me.MachineSet;
import appeng.me.cache.CraftingGridCache;
import appeng.me.cluster.implementations.CraftingCPUCluster;
import appeng.parts.misc.PartInterface;
import appeng.tile.misc.TileInterface;
import appeng.util.InventoryAdaptor;
public class CoreModHooks {
@@ -87,40 +81,6 @@ public class CoreModHooks {
return originByte + totalBytes;
}
public static IAEItemStack[] flattenFluidPackets(IAEItemStack[] stacks) {
for (int i = 0; i < stacks.length; i++) {
if (stacks[i].getItem() instanceof ItemFluidPacket) {
stacks[i] = ItemFluidDrop.newAeStack(ItemFluidPacket.getFluidStack(stacks[i]));
}
}
return stacks;
}
public static IMachineSet getMachines(IGrid grid, Class<? extends IGridHost> c) {
if (c == TileInterface.class) {
return unionMachineSets(grid.getMachines(c), grid.getMachines(TileFluidInterface.class));
} else if (c == PartInterface.class) {
return unionMachineSets(grid.getMachines(c), grid.getMachines(PartFluidInterface.class));
} else {
return grid.getMachines(c);
}
}
private static IMachineSet unionMachineSets(IMachineSet a, IMachineSet b) {
if (a.isEmpty()) {
return b;
} else if (b.isEmpty()) {
return a;
} else if (a instanceof MachineSet && b instanceof MachineSet) {
return new SetBackedMachineSet(TileInterface.class, Sets.union((MachineSet) a, (MachineSet) b));
} else {
Set<IGridNode> union = new HashSet<>();
a.forEach(union::add);
b.forEach(union::add);
return new SetBackedMachineSet(TileInterface.class, union);
}
}
public static ItemStack displayFluid(IAEItemStack aeStack) {
if (aeStack.getItemStack() != null && aeStack.getItemStack().getItem() instanceof ItemFluidDrop) {
FluidStack fluid = ItemFluidDrop.getFluidStack(aeStack.getItemStack());
@@ -134,6 +94,13 @@ public class CoreModHooks {
} else return aeStack.getStackSize();
}
public static List<IMEInventoryHandler> craftingGridCacheGetCellArray(final CraftingGridCache instance,
final StorageChannel channel) {
// Equivalent to original function, but using the proxy for fluid channel
return channel == StorageChannel.ITEMS ? Arrays.asList(instance)
: Arrays.asList(new CraftingGridCacheFluidInventoryProxyCell(instance));
}
public static void storeFluidItem(CraftingCPUCluster instance) {
final IGrid g = Ae2Reflect.getGrid(instance);
@@ -0,0 +1,67 @@
package com.glodblock.github.coremod.transform;
import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
import com.glodblock.github.coremod.FCClassTransformer;
public class CraftingGridCacheTransformer extends FCClassTransformer.ClassMapper {
public static final CraftingGridCacheTransformer INSTANCE = new CraftingGridCacheTransformer();
private CraftingGridCacheTransformer() {
// NO-OP
}
@Override
protected ClassVisitor getClassMapper(ClassVisitor downstream) {
return new CraftingGridCacheTransformer.TransformCraftingGridCache(Opcodes.ASM5, downstream);
}
private static class TransformCraftingGridCache extends ClassVisitor {
TransformCraftingGridCache(int api, ClassVisitor cv) {
super(api, cv);
}
@Override
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
if (name.equals("getCellArray")) {
return new CraftingGridCacheTransformer.ReplaceGetCellArray(
api,
super.visitMethod(access, name, desc, signature, exceptions));
}
return super.visitMethod(access, name, desc, signature, exceptions);
}
}
private static class ReplaceGetCellArray extends MethodVisitor {
private final MethodVisitor target;
ReplaceGetCellArray(int api, MethodVisitor mv) {
// Original method is replaced
super(api, null);
target = mv;
}
@Override
public void visitCode() {
target.visitCode();
// Equivalent to
// return CoreModHooks::craftingGridCacheGetCellArray(this, channel);
target.visitVarInsn(Opcodes.ALOAD, 0);
target.visitVarInsn(Opcodes.ALOAD, 1);
target.visitMethodInsn(
Opcodes.INVOKESTATIC,
"com/glodblock/github/coremod/hooker/CoreModHooks",
"craftingGridCacheGetCellArray",
"(Lappeng/me/cache/CraftingGridCache;Lappeng/api/storage/StorageChannel;)Ljava/util/List;",
false);
target.visitInsn(Opcodes.ARETURN);
target.visitMaxs(2, 3);
target.visitEnd();
}
}
}
@@ -0,0 +1,85 @@
package com.glodblock.github.inventory;
import org.jetbrains.annotations.NotNull;
import com.glodblock.github.common.item.ItemFluidDrop;
import appeng.api.config.AccessRestriction;
import appeng.api.config.Actionable;
import appeng.api.networking.security.BaseActionSource;
import appeng.api.storage.IMEInventoryHandler;
import appeng.api.storage.StorageChannel;
import appeng.api.storage.data.IAEFluidStack;
import appeng.api.storage.data.IAEItemStack;
import appeng.api.storage.data.IItemList;
import appeng.me.cache.CraftingGridCache;
public class CraftingGridCacheFluidInventoryProxyCell implements IMEInventoryHandler<IAEFluidStack> {
private final CraftingGridCache inner;
public CraftingGridCacheFluidInventoryProxyCell(final CraftingGridCache craftingGridCache) {
inner = craftingGridCache;
}
@Override
public IAEFluidStack injectItems(IAEFluidStack input, Actionable type, BaseActionSource src) {
return ItemFluidDrop
.getAeFluidStack((IAEItemStack) inner.injectItems(ItemFluidDrop.newAeStack(input), type, src));
}
@Override
public IAEFluidStack extractItems(IAEFluidStack request, Actionable mode, BaseActionSource src) {
return null;
}
@Override
public IItemList<IAEFluidStack> getAvailableItems(IItemList<IAEFluidStack> out, int iteration) {
return out;
}
@Override
public IAEFluidStack getAvailableItem(@NotNull IAEFluidStack request, int iteration) {
return null;
}
@Override
public StorageChannel getChannel() {
return StorageChannel.FLUIDS;
}
@Override
public AccessRestriction getAccess() {
return inner.getAccess();
}
@Override
public boolean isPrioritized(IAEFluidStack input) {
return inner.isPrioritized(input);
}
@Override
public boolean canAccept(IAEFluidStack input) {
return inner.canAccept(ItemFluidDrop.newAeStack(input));
}
@Override
public int getPriority() {
return inner.getPriority();
}
@Override
public int getSlot() {
return inner.getSlot();
}
@Override
public boolean validForPass(int i) {
return inner.validForPass(i);
}
@Override
public boolean isAutoCraftingInventory() {
return inner.isAutoCraftingInventory();
}
}
@@ -31,7 +31,9 @@ import com.glodblock.github.util.Util;
import appeng.api.config.FuzzyMode;
import appeng.api.config.InsertionMode;
import appeng.api.config.Settings;
import appeng.api.config.Upgrades;
import appeng.api.config.YesNo;
import appeng.api.parts.IPart;
import appeng.helpers.DualityInterface;
import appeng.helpers.IInterfaceHost;
@@ -99,11 +101,18 @@ public class FluidConvertingInventoryAdaptor extends InventoryAdaptor {
|| Util.getPart(inter, face.getOpposite()) instanceof PartFluidExportBus
|| Util.getPart(inter, face.getOpposite()) instanceof PartFluidP2PInterface))
return InventoryAdaptor.getAdaptor(capProvider, face);
if (InventoryAdaptor.getAdaptor(capProvider, face) == null) {
if (capProvider instanceof IFluidHandler tank) {
if (!(tank.getTankInfo(face).length > 0)) return null;
} else {
return null;
}
}
InventoryAdaptor item = InventoryAdaptor.getAdaptor(capProvider, face);
IFluidHandler fluid = capProvider instanceof IFluidHandler ? (IFluidHandler) capProvider : null;
boolean onmi = false;
if (inter instanceof TileInterface) {
onmi = ((TileInterface) inter).getTargets().size() > 1;
if (inter instanceof TileInterface in) {
if (in.getConfigManager().getSetting(Settings.BLOCK) == YesNo.NO) onmi = in.getTargets().size() > 1;
}
return new FluidConvertingInventoryAdaptor(capProvider, item, fluid, face, new BlockPos(inter), onmi);
}
@@ -184,7 +184,7 @@ public class MEMonitorIFluidHandler implements IMEMonitor<IAEFluidStack> {
return true;
}
public IItemList<IAEFluidStack> getAvailableItems(IItemList out) {
public IItemList<IAEFluidStack> getAvailableItems(IItemList out, int iteration) {
for (IAEFluidStack fs : this.cache) {
out.addStorage(fs);
@@ -194,7 +194,7 @@ public class MEMonitorIFluidHandler implements IMEMonitor<IAEFluidStack> {
}
@Override
public IAEFluidStack getAvailableItem(@Nonnull IAEFluidStack request) {
public IAEFluidStack getAvailableItem(@Nonnull IAEFluidStack request, int iteration) {
return this.cache.findPrecise(request);
}
@@ -134,6 +134,12 @@ public class ItemAndBlockHolder {
8,
1,
5).register();
public static ItemFluidExtremeStorageCell ARTIFICIAL_UNIVERSE_CELL = new ItemFluidExtremeStorageCell(
NameConst.ITEM_ARTIFICIAL_UNIVERSE_STORAGE,
Long.MAX_VALUE / 2048,
16384,
5,
600000D).register();
public static ItemCreativeFluidStorageCell CREATIVE_CELL = new ItemCreativeFluidStorageCell().register();
public static ItemInfinityWaterStorageCell INFINITY_WATER_CELL = new ItemInfinityWaterStorageCell().register();
public static ItemBasicFluidStoragePart CELL_PART = new ItemBasicFluidStoragePart().register();
@@ -33,7 +33,7 @@ public class DefaultExtractorLoader implements Runnable {
if (ModAndClassUtil.GT5) {
try {
Class<?> recipeMapClazz = Class.forName("gregtech.api.util.GT_Recipe$GT_Recipe_Map");
Class<?> recipeMapClazz = Class.forName("gregtech.api.util.GTRecipe$GT_Recipe_Map");
Collection<?> sMappings = (Collection<?>) recipeMapClazz.getDeclaredField("sMappings").get(null);
for (Object tMap : sMappings) {
String mNEIName = (String) recipeMapClazz.getDeclaredField("mNEIName").get(tMap);
@@ -12,7 +12,7 @@ import com.glodblock.github.nei.object.OrderStack;
import codechicken.nei.PositionedStack;
import gregtech.api.enums.ItemList;
import gregtech.common.items.GT_FluidDisplayItem;
import gregtech.common.items.ItemFluidDisplay;
public class GregTech5RecipeExtractor implements IRecipeExtractor {
@@ -47,7 +47,7 @@ public class GregTech5RecipeExtractor implements IRecipeExtractor {
public static Object getFluidFromDisplay(PositionedStack stack) {
if (stack != null) {
ItemStack item = stack.items[0].copy();
if (item.getItem() instanceof GT_FluidDisplayItem) {
if (item.getItem() instanceof ItemFluidDisplay) {
if (item.getTagCompound() != null) {
Fluid fluid = FluidRegistry.getFluid(item.getItemDamage());
int amt = (int) item.getTagCompound().getLong("mFluidDisplayAmount");
@@ -14,6 +14,7 @@ import com.glodblock.github.inventory.gui.GuiType;
import com.glodblock.github.inventory.item.IWirelessTerminal;
import com.glodblock.github.util.BlockPos;
import appeng.api.config.CraftingMode;
import appeng.api.networking.IGrid;
import appeng.api.networking.IGridHost;
import appeng.api.networking.IGridNode;
@@ -23,6 +24,7 @@ import appeng.container.ContainerOpenContext;
import appeng.container.implementations.ContainerCraftAmount;
import appeng.container.implementations.ContainerCraftConfirm;
import appeng.core.AELog;
import appeng.me.cache.CraftingGridCache;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
@@ -33,23 +35,32 @@ public class CPacketCraftRequest implements IMessage {
private long amount;
private boolean heldShift;
private CraftingMode craftingMode;
public CPacketCraftRequest() {}
public CPacketCraftRequest(final int craftAmt, final boolean shift) {
this(craftAmt, shift, CraftingMode.STANDARD);
}
public CPacketCraftRequest(final int craftAmt, final boolean shift, final CraftingMode craftingMode) {
amount = craftAmt;
heldShift = shift;
this.craftingMode = craftingMode;
}
@Override
public void toBytes(ByteBuf buf) {
buf.writeLong(amount);
buf.writeBoolean(heldShift);
buf.writeBoolean(this.craftingMode == CraftingMode.STANDARD);
}
@Override
public void fromBytes(ByteBuf buf) {
amount = buf.readLong();
heldShift = buf.readBoolean();
craftingMode = buf.readBoolean() ? CraftingMode.STANDARD : CraftingMode.IGNORE_MISSING;
}
public static class Handler implements IMessageHandler<CPacketCraftRequest, IMessage> {
@@ -77,12 +88,22 @@ public class CPacketCraftRequest implements IMessage {
Future<ICraftingJob> futureJob = null;
try {
final ICraftingGrid cg = g.getCache(ICraftingGrid.class);
futureJob = cg.beginCraftingJob(
cca.getWorld(),
cca.getGrid(),
cca.getActionSrc(),
cca.getItemToCraft(),
null);
if(cg instanceof CraftingGridCache cgc) {
futureJob = cgc.beginCraftingJob(
cca.getWorld(),
cca.getGrid(),
cca.getActionSrc(),
cca.getItemToCraft(),
message.craftingMode,
null);
}else {
futureJob = cg.beginCraftingJob(
cca.getWorld(),
cca.getGrid(),
cca.getActionSrc(),
cca.getItemToCraft(),
null);
}
final ContainerOpenContext context = cca.getOpenContext();
if (context != null) {
@@ -104,6 +125,7 @@ public class CPacketCraftRequest implements IMessage {
}
if (player.openContainer instanceof final ContainerCraftConfirm ccc) {
ccc.setItemToCraft(cca.getItemToCraft());
ccc.setAutoStart(message.heldShift);
ccc.setJob(futureJob);
cca.detectAndSendChanges();
@@ -40,6 +40,7 @@ public class NameConst {
public static final String ITEM_MULTI_FLUID_STORAGE = "multi_fluid_storage";
public static final String ITEM_QUANTUM_FLUID_STORAGE = ITEM_FLUID_STORAGE + ".quantum";
public static final String ITEM_SINGULARITY_FLUID_STORAGE = ITEM_FLUID_STORAGE + ".singularity";
public static final String ITEM_ARTIFICIAL_UNIVERSE_STORAGE = ITEM_FLUID_STORAGE + ".Universe";
public static final String ITEM_INFINITY_FLUID_STORAGE = ITEM_FLUID_STORAGE + ".infinity";
public static final String ITEM_INFINITY_WATER_FLUID_STORAGE = ITEM_INFINITY_FLUID_STORAGE + ".water";
public static final String ITEM_CREATIVE_FLUID_STORAGE = "creative_" + ITEM_FLUID_STORAGE;
@@ -46,6 +46,7 @@ item.multi_fluid_storage.4096.name=%s4096k%s ME Multi-Fluid Storage Cell
item.multi_fluid_storage.16384.name=%s16384k%s ME Multi-Fluid Storage Cell
item.fluid_storage.quantum.name=ME Fluid Quantum Storage Cell
item.fluid_storage.singularity.name=ME Fluid Digital Singularity Storage Cell
item.fluid_storage.Universe.name=ME Fluid Artificial Universe Storage Cell
item.fluid_storage.infinity.water.name=ME Fluid Infinity Water Storage Cell
item.fluid_part.0.name=%s1k%s ME Fluid Storage Component
item.fluid_part.1.name=%s4k%s ME Fluid Storage Component
@@ -41,6 +41,7 @@ item.multi_fluid_storage.4096.name=%s4096k%s-ME多重流体存储元件
item.multi_fluid_storage.16384.name=%s16384k%s-ME多重流体存储元件
item.fluid_storage.quantum.name=ME流体量子存储元件
item.fluid_storage.singularity.name=ME流体数字奇点元件
item.fluid_storage.Universe.name=ME流体寰宇存储元件
item.fluid_part.0.name=%s1k%s-ME流体存储组件
item.fluid_part.1.name=%s4k%s-ME流体存储组件
item.fluid_part.2.name=%s16k%s-ME流体存储组件
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

@@ -0,0 +1 @@
{"animation": {"frametime": 1}}