Compare commits

..
83 changed files with 191 additions and 206 deletions

No files matched your search

+1
View File
@@ -28,6 +28,7 @@ whitelist.json
*.iws
src/main/resources/mixins.*([!.]).json
*.bat
*.sh
*.DS_Store
!gradlew.bat
.factorypath
+9 -9
View File
@@ -34,21 +34,21 @@
* 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.8.121-GTNH:dev')
api('com.github.GTNewHorizons:NotEnoughItems:2.8.160-GTNH:dev')
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-1078-GTNH:dev')
api('com.github.GTNewHorizons:waila:1.19.31:dev')
api("com.github.GTNewHorizons:GTNHLib:0.11.37:dev")
api('com.github.GTNewHorizons:waila:1.19.34:dev')
api("com.github.GTNewHorizons:GTNHLib:0.11.52:dev")
compileOnly('com.github.GTNewHorizons:Baubles-Expanded:2.2.22-GTNH:dev')
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.63:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:Baubles-Expanded:2.2.25-GTNH:dev')
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.64:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:ExtraCells2:2.5.35:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:ForestryMC:4.11.34:dev')
compileOnly('com.github.GTNewHorizons:EnderIO:2.10.37:dev')
compileOnly('com.github.GTNewHorizons:OpenComputers:1.12.55-GTNH:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:ForestryMC:4.11.39:dev')
compileOnly('com.github.GTNewHorizons:EnderIO:2.10.49:dev')
compileOnly('com.github.GTNewHorizons:OpenComputers:1.12.64-GTNH:dev') { transitive = false }
compileOnly("org.jetbrains:annotations:26.1.0")
runtimeOnlyNonPublishable("com.github.GTNewHorizons:DuraDisplay:1.4.4:dev")
runtimeOnlyNonPublishable("com.github.GTNewHorizons:DuraDisplay:1.4.6:dev")
runtimeOnlyNonPublishable("com.github.GTNewHorizons:WirelessCraftingTerminal:1.12.16:dev") {
exclude group: 'com.github.GTNewHorizons', module: 'Applied-Energistics-2-Unofficial'
}
+5
View File
@@ -186,6 +186,11 @@ modrinthRelations =
# Leave this empty if you don't want to publish on CurseForge.
curseForgeProjectId =
# Comma-separated supported CurseForge environments: client, server (case-insensitive).
# Use client or server for mods that only support one environment. Defaults to client,server.
# These tags describe where the mod can run, not whether installation is required on both sides.
curseForgeEnvironments = client,server
# The project's relations on CurseForge. You can use this to refer to other projects on CurseForge.
# Syntax: type1:name1;type2:name2;...
# Where type can be one of [requiredDependency, embeddedLibrary, optionalDependency, tool, incompatible],
+10 -10
View File
@@ -1,12 +1,12 @@
#This file is generated by updateDaemonJvm
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/97d46b5ff4df0bf61e95652a190a5567/redirect
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/9ef54a08e06b0754cee9fc95ed3a3134/redirect
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/97d46b5ff4df0bf61e95652a190a5567/redirect
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/9ef54a08e06b0754cee9fc95ed3a3134/redirect
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1df82b76031285ef2e6a4f59ffe9299d/redirect
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/c7d5be6a02945ac2e045048ee54a7d32/redirect
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/97d46b5ff4df0bf61e95652a190a5567/redirect
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/9ef54a08e06b0754cee9fc95ed3a3134/redirect
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/643f404f769811f5f265fd66f7af5d89/redirect
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/38256085a73e137cb4937ea9c4807fec/redirect
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/539ea72837c6244075f8ee037babc29e/redirect
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/876dbbf00bf4ef6190f7da074cee903a/redirect
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/539ea72837c6244075f8ee037babc29e/redirect
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/876dbbf00bf4ef6190f7da074cee903a/redirect
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/9064f22734b42ac03e85df04b632e167/redirect
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/4d0277c49991306ac78048580fe34bcf/redirect
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/539ea72837c6244075f8ee037babc29e/redirect
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/876dbbf00bf4ef6190f7da074cee903a/redirect
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/a9fa3b809e484a1e1ac4308a5dda661a/redirect
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/aa99913fa6d767d899ffc96082da01ca/redirect
toolchainVersion=25
Binary file not shown.
+3 -1
View File
@@ -1,7 +1,9 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.1-bin.zip
networkTimeout=10000
retries=0
retryBackOffMs=500
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Vendored
+3 -3
View File
@@ -20,7 +20,7 @@
##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
# gradlew start up script for POSIX generated by Gradle.
#
# Important for running:
#
@@ -29,7 +29,7 @@
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
# ksh gradlew
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
@@ -57,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/b631911858264c0b6e4d6603d677ff5218766cee/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Vendored
+12 -23
View File
@@ -19,12 +19,12 @@
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem gradlew startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Set local scope for the variables, and ensure extensions are enabled
setlocal EnableExtensions
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@@ -51,7 +51,7 @@ echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
"%COMSPEC%" /c exit 1
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
@@ -65,29 +65,18 @@ echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
"%COMSPEC%" /c exit 1
:execute
@rem Setup the command line
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
@rem Execute gradlew
@rem endlocal doesn't take effect until after the line is parsed and variables are expanded
@rem which allows us to clear the local environment before executing the java command
endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel
:end
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
:exitWithErrorLevel
@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts
"%COMSPEC%" /c exit %ERRORLEVEL%
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

+1 -1
View File
@@ -17,7 +17,7 @@ pluginManagement {
}
plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.29'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.34'
}
@@ -10,7 +10,6 @@ import org.lwjgl.opengl.GL11;
import com.glodblock.github.FluidCraft;
import com.glodblock.github.client.gui.container.ContainerFluidInterface;
import com.glodblock.github.common.parts.PartFluidInterface;
import com.glodblock.github.inventory.IAEFluidTank;
import com.glodblock.github.inventory.IDualHost;
import com.glodblock.github.inventory.gui.MouseRegionManager;
@@ -19,6 +18,7 @@ import com.glodblock.github.util.FCGuiColors;
import com.glodblock.github.util.NameConst;
import com.glodblock.github.util.RenderUtil;
import appeng.api.parts.IPart;
import appeng.api.storage.data.IAEFluidStack;
import appeng.client.gui.GuiSub;
import appeng.core.localization.GuiText;
@@ -103,6 +103,6 @@ public class GuiFluidInterface extends GuiSub {
}
private boolean isPart() {
return this.cont.getTile() instanceof PartFluidInterface;
return this.cont.getTile() instanceof IPart;
}
}
@@ -1,7 +1,10 @@
package com.glodblock.github.common.block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
@@ -12,11 +15,17 @@ import com.glodblock.github.inventory.gui.GuiType;
import com.glodblock.github.util.BlockPos;
import com.glodblock.github.util.NameConst;
import appeng.api.util.AEColor;
import appeng.block.AEBaseItemBlock;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockSuperStockReplenisher extends FCBaseBlock {
@SideOnly(Side.CLIENT)
private IIcon[] coloredTextures;
public BlockSuperStockReplenisher() {
super(Material.web, NameConst.BLOCK_SUPER_STOCK_REPLENISHER);
setTileEntity(TileSuperStockReplenisher.class);
@@ -25,6 +34,28 @@ public class BlockSuperStockReplenisher extends FCBaseBlock {
this.lightOpacity = 4;
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(final IIconRegister iconRegistry) {
super.registerBlockIcons(iconRegistry);
this.coloredTextures = new IIcon[AEColor.VALUES.length];
for (final AEColor color : AEColor.VALID_COLORS) {
this.coloredTextures[color.ordinal()] = iconRegistry
.registerIcon(this.getTextureName().replace(":", ":replenisher/") + "_" + color.name());
}
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(final IBlockAccess world, final int x, final int y, final int z, final int side) {
final TileSuperStockReplenisher tile = this.getTileEntity(world, x, y, z);
if (tile != null && tile.getColor() != AEColor.Transparent) {
return this.coloredTextures[tile.getColor().ordinal()];
}
return super.getIcon(world, x, y, z, side);
}
@Override
public boolean onActivated(World world, int x, int y, int z, EntityPlayer player, int facing, float hitX,
float hitY, float hitZ) {
@@ -14,6 +14,7 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import com.glodblock.github.FluidCraft;
import com.glodblock.github.common.item.BaseItemBlockContainer;
import com.glodblock.github.common.tabs.FluidCraftingTabs;
import com.glodblock.github.common.tile.TileWalrus;
@@ -30,6 +31,8 @@ public class BlockWalrus extends BaseBlockContainer {
setHardness(2.0F);
setResistance(10.0F);
setBlockName(NameConst.BLOCK_WALRUS);
// only used for hit/break particles, the block itself is rendered by RenderBlockWalrus
setBlockTextureName(FluidCraft.MODID + ":" + NameConst.BLOCK_WALRUS + "_particle");
}
@Override
@@ -192,7 +192,7 @@ public class TileLevelMaintainer extends AENetworkTile
IAEStack<?> itemToBegin = null;
int itemToBeginIdx = -1;
for (int j = 0; j < REQ_COUNT; ++j) {
req: for (int j = 0; j < REQ_COUNT; ++j) {
int i = (firstRequest + j) % REQ_COUNT;
if (requests[i] == null) continue;
@@ -248,8 +248,11 @@ public class TileLevelMaintainer extends AENetworkTile
// Walking every CPU to see whether the item is already being
// made is comparatively expensive
if (craftingGrid.isRequesting(craftItem)) {
continue;
for (ICraftingCPU cpu : craftingGrid.getCpus()) {
IAEStack<?> output = cpu.getFinalMultiOutput();
if (output != null && output.isSameType(craftItem)) {
continue req;
}
}
// do crafting
@@ -11,7 +11,7 @@ import appeng.tile.inventory.InvOperation;
public class TileOCPatternEditor extends AEBaseInvTile {
private final AppEngInternalInventory invItems = new AppEngInternalInventory(this, 16);
private final AppEngInternalInventory invItems = new AppEngInternalInventory(this, 16, 1);
@Override
public IInventory getInternalInventory() {
@@ -5,10 +5,12 @@ import java.util.stream.IntStream;
import javax.annotation.Nonnull;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import net.minecraftforge.common.util.Constants;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
@@ -28,6 +30,7 @@ import appeng.api.config.Actionable;
import appeng.api.config.PowerMultiplier;
import appeng.api.implementations.IPowerChannelState;
import appeng.api.implementations.items.IStorageCell;
import appeng.api.implementations.tiles.IColorableTile;
import appeng.api.networking.GridFlags;
import appeng.api.networking.IGridNode;
import appeng.api.networking.events.MENetworkBootingStatusChange;
@@ -45,6 +48,7 @@ import appeng.api.storage.data.IAEFluidStack;
import appeng.api.storage.data.IAEItemStack;
import appeng.api.storage.data.IAEStack;
import appeng.api.util.AECableType;
import appeng.api.util.AEColor;
import appeng.api.util.DimensionalCoord;
import appeng.api.util.IConfigManager;
import appeng.core.AELog;
@@ -63,7 +67,7 @@ import appeng.util.item.AEItemStack;
import io.netty.buffer.ByteBuf;
public class TileSuperStockReplenisher extends AENetworkInvTile implements IAEFluidInventory, IFluidHandler,
IPowerChannelState, IGridTickable, ITerminalHost, IIAEStackInventory {
IPowerChannelState, IGridTickable, ITerminalHost, IIAEStackInventory, IColorableTile {
private final AppEngInternalInventory cell = new AppEngInternalInventory(this, 1);
private final BiggerAppEngInventory invItems = new BiggerAppEngInventory(this, 63);
@@ -87,6 +91,7 @@ public class TileSuperStockReplenisher extends AENetworkInvTile implements IAEFl
};
private final BaseActionSource source;
private boolean isPowered;
private AEColor paintedColor = AEColor.Transparent;
private long totalBytes;
private long storedFluidCount;
private long storedItemCount;
@@ -601,17 +606,26 @@ public class TileSuperStockReplenisher extends AENetworkInvTile implements IAEFl
@TileEvent(TileEventType.NETWORK_READ)
public boolean readFromStream_TileSuperStockReplenisher(final ByteBuf data) {
final boolean oldPower = isPowered;
final AEColor oldPaintedColor = this.paintedColor;
isPowered = data.readBoolean();
return isPowered != oldPower;
this.paintedColor = AEColor.fromOrdinal(data.readByte());
this.getProxy().setColor(this.paintedColor);
return isPowered != oldPower || this.paintedColor != oldPaintedColor;
}
@TileEvent(TileEventType.NETWORK_WRITE)
public void writeToStream_TileSuperStockReplenisher(final ByteBuf data) {
data.writeBoolean(isActive());
data.writeByte(this.paintedColor.ordinal());
}
@TileEvent(TileEventType.WORLD_NBT_READ)
public void readFromNBTEvent(NBTTagCompound data) {
final int color = data.hasKey("paintedColor", Constants.NBT.TAG_BYTE) ? data.getByte("paintedColor")
: AEColor.Transparent.ordinal();
this.paintedColor = color >= 0 && color < AEColor.VALUES.length ? AEColor.fromOrdinal(color)
: AEColor.Transparent;
this.getProxy().setColor(this.paintedColor);
invItems.readFromNBT(data, "ItemInv");
invFluids.readFromNBT(data, "FluidInv");
configItems.readFromNBT(data, "configItems");
@@ -626,6 +640,7 @@ public class TileSuperStockReplenisher extends AENetworkInvTile implements IAEFl
@TileEvent(TileEventType.WORLD_NBT_WRITE)
public NBTTagCompound writeToNBTEvent(NBTTagCompound data) {
data.setByte("paintedColor", (byte) this.paintedColor.ordinal());
invItems.writeToNBT(data, "ItemInv");
invFluids.writeToNBT(data, "FluidInv");
configItems.writeToNBT(data, "configItems");
@@ -638,6 +653,27 @@ public class TileSuperStockReplenisher extends AENetworkInvTile implements IAEFl
return data;
}
@Override
public AEColor getColor() {
return this.paintedColor;
}
@Override
public boolean recolourBlock(final ForgeDirection side, final AEColor newPaintedColor, final EntityPlayer who) {
if (this.paintedColor == newPaintedColor) {
return false;
}
this.paintedColor = newPaintedColor;
this.getProxy().setColor(this.paintedColor);
final IGridNode node = this.getGridNode(side);
if (node != null) {
node.updateState();
}
this.markDirty();
this.markForUpdate();
return true;
}
@MENetworkEventSubscribe
public void stateChange(final MENetworkPowerStatusChange p) {
this.updatePowerState();
@@ -3,31 +3,24 @@ package com.glodblock.github.crossmod.opencomputers;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
import com.glodblock.github.common.item.ItemFluidDrop;
import com.glodblock.github.common.item.ItemFluidEncodedPattern;
import com.glodblock.github.common.tile.TileOCPatternEditor;
import com.glodblock.github.loader.ItemAndBlockHolder;
import com.glodblock.github.util.NameConst;
import com.glodblock.github.util.Util;
import appeng.items.misc.ItemEncodedPattern;
import appeng.util.item.AEItemStack;
import appeng.api.AEApi;
import li.cil.oc.api.driver.EnvironmentProvider;
import li.cil.oc.api.driver.NamedBlock;
import li.cil.oc.api.internal.Database;
import li.cil.oc.api.machine.Arguments;
import li.cil.oc.api.machine.Callback;
import li.cil.oc.api.machine.Context;
import li.cil.oc.api.network.Component;
import li.cil.oc.api.network.ManagedEnvironment;
import li.cil.oc.api.network.Node;
import li.cil.oc.api.prefab.DriverSidedTileEntity;
import li.cil.oc.integration.ManagedTileEntityEnvironment;
import li.cil.oc.integration.appeng.internal.PatternEnvironment;
import li.cil.oc.integration.appeng.internal.PatternEnvironment$class;
public class DriverOCPatternEditor extends DriverSidedTileEntity {
@@ -43,12 +36,33 @@ public class DriverOCPatternEditor extends DriverSidedTileEntity {
return new DriverOCPatternEditor.Environment((TileOCPatternEditor) world.getTileEntity(x, y, z));
}
public static class Environment extends ManagedTileEntityEnvironment<TileOCPatternEditor> implements NamedBlock {
public static class Environment extends ManagedTileEntityEnvironment<TileOCPatternEditor>
implements NamedBlock, PatternEnvironment {
public Environment(TileOCPatternEditor tileEntity) {
super(tileEntity, NameConst.BLOCK_OC_PATTERN_EDITOR);
}
@Override
public IInventory getPatternInventory(Context context, Arguments args) {
return tileEntity.getInternalInventory();
}
@Override
public int offset() {
return PatternEnvironment$class.offset(this);
}
@Override
public Object[] setPatternSlot(Context context, Arguments args, String tag) {
return PatternEnvironment$class.setPatternSlot(this, context, args, tag);
}
@Override
public Object[] storeInterfacePattern(Context context, Arguments args, String tag) {
return PatternEnvironment$class.storeInterfacePattern(this, context, args, tag);
}
private int optSlot(Arguments args, IInventory inv, int index, int def) {
if (index >= 0 && index < args.count()) {
int slot = args.checkInteger(index) - 1;
@@ -62,132 +76,23 @@ public class DriverOCPatternEditor extends DriverSidedTileEntity {
}
private int checkSlot(Arguments args, IInventory inv, int index) {
if (index >= 0 && index < args.count()) {
int slot = args.checkInteger(index) - 1;
if (slot < 0 || slot >= inv.getSizeInventory()) {
throw new IllegalArgumentException("invalid slot");
}
return slot;
} else {
int slot = args.checkInteger(index) - 1;
if (slot < 0 || slot >= inv.getSizeInventory()) {
throw new IllegalArgumentException("invalid slot");
}
return slot;
}
private boolean validPattern(ItemStack pattern) {
if (pattern == null) {
throw new IllegalArgumentException("No pattern here!");
}
if (pattern.getItem() instanceof ItemEncodedPattern iep
&& !(pattern.getItem() instanceof ItemFluidEncodedPattern)) {
return iep.getOutput(pattern) == null;
}
return true;
}
private ItemStack getStack(Arguments args) {
if (args.count() > 1) {
String address;
int entry;
int size;
if (args.isString(0)) {
address = args.checkString(0);
entry = args.checkInteger(1);
size = args.optInteger(2, 1);
} else {
address = args.checkString(1);
entry = args.checkInteger(2);
size = args.optInteger(3, 1);
}
Node node = node().network().node(address);
if (node instanceof Component) {
if (node.host() instanceof Database) {
ItemStack dbStack = ((Database) node.host()).getStackInSlot(entry - 1);
if (dbStack == null || size < 1) {
return null;
} else {
dbStack.stackSize = Math.min(size, dbStack.getMaxStackSize());
return dbStack;
}
} else {
throw new IllegalArgumentException("not a database");
}
} else {
throw new IllegalArgumentException("no such component");
}
} else {
return null;
}
}
private Object[] clearInterfacePattern(Context context, Arguments args, String tag) {
private void replaceBlankPattern(Arguments args) {
IInventory inv = tileEntity.getInternalInventory();
ItemStack pattern = inv.getStackInSlot(checkSlot(args, inv, 0));
if (validPattern(pattern)) {
NBTTagCompound encodedValue = pattern.getTagCompound();
int slot = checkSlot(args, inv, 0);
if (encodedValue == null) throw new IllegalArgumentException("No pattern here!");
NBTTagList nbt = encodedValue.getTagList(tag, 10);
int index = args.checkInteger(1) - 1;
if (index < 0) throw new IllegalArgumentException("Invalid index!");
nbt.removeTag(index);
encodedValue.setTag(tag, nbt);
pattern.setTagCompound(encodedValue);
inv.setInventorySlotContents(slot, null);
int slot = checkSlot(args, inv, 0);
if (AEApi.instance().definitions().materials().blankPattern().isSameAs(inv.getStackInSlot(slot))) {
ItemStack pattern = AEApi.instance().definitions().items().encodedUltimatePattern().maybeStack(1).get();
pattern.setTagCompound(new NBTTagCompound());
inv.setInventorySlotContents(slot, pattern);
context.pause(0.1);
return new Object[] { true };
} else {
throw new IllegalArgumentException("Not Fluid Encoded pattern!");
}
}
private Object[] setPatternSlot(Context context, Arguments args, String tag, boolean fluid) {
IInventory inv = tileEntity.getInternalInventory();
int slot = args.isString(0) ? 0 : optSlot(args, inv, 0, 0);
ItemStack stack = getStack(args);
if (fluid) {
FluidStack fluids = Util.getFluidFromItem(stack);
stack = ItemFluidDrop.newStack(fluids);
}
int index = args.checkInteger(4) - 1;
if (index < 0 || index > 511) throw new IllegalArgumentException("Invalid index!");
ItemStack pattern = inv.getStackInSlot(slot);
if (validPattern(pattern)) {
NBTTagCompound encodedValue = pattern.getTagCompound();
if (encodedValue == null) throw new IllegalArgumentException("No pattern here!");
NBTTagList inTag = encodedValue.getTagList(tag, 10);
while (inTag.tagCount() <= index) inTag.appendTag(new NBTTagCompound());
if (stack != null) {
NBTTagCompound nbt = new NBTTagCompound();
AEItemStack aeStack = AEItemStack.create(stack);
aeStack.writeToNBT(nbt);
inTag.func_150304_a(index, nbt);
} else {
inTag.removeTag(index);
}
encodedValue.setTag(tag, inTag);
pattern.setTagCompound(encodedValue);
inv.setInventorySlotContents(slot, null);
inv.setInventorySlotContents(slot, pattern);
context.pause(0.1);
return new Object[] { true };
} else {
throw new IllegalArgumentException("Not Fluid Encoded pattern!");
}
}
@Callback(doc = "function([slot:number]):table -- Get the configuration of the interface.")
public Object[] getInterfaceConfiguration(Context context, Arguments args) {
IInventory config = tileEntity.getInternalInventory();
int slot = optSlot(args, config, 0, 0);
ItemStack stack = config.getStackInSlot(slot);
if (!validPattern(stack)) {
throw new IllegalArgumentException("Not Fluid Encoded pattern!");
}
return new Object[] { stack };
}
@Callback(doc = "function([slot:number]):table -- Get the given pattern in the interface.")
public Object[] getInterfacePattern(Context context, Arguments args) {
IInventory inv = tileEntity.getInternalInventory();
@@ -197,37 +102,39 @@ public class DriverOCPatternEditor extends DriverSidedTileEntity {
}
@Callback(
doc = "function(slot:number, database:address, entry:number, size:number, index:number):boolean -- Set the pattern item input at the given index.")
public Object[] setInterfacePatternItemInput(Context context, Arguments args) {
return setPatternSlot(context, args, "in", false);
doc = "function(slot:number, index:number[, database:address, entry:number, size:number]):boolean OR function(slot:number, index:number[, detail:table, type:string]):boolean -- Set the pattern input at the given index. A blank pattern becomes an ultimate pattern.")
public Object[] setInterfacePatternInput(Context context, Arguments args) {
replaceBlankPattern(args);
return setPatternSlot(context, args, "in");
}
@Callback(
doc = "function(slot:number, database:address, entry:number, size:number, index:number):boolean -- Set the pattern item output at the given index.")
public Object[] setInterfacePatternItemOutput(Context context, Arguments args) {
return setPatternSlot(context, args, "out", false);
doc = "function(slot:number, index:number[, database:address, entry:number, size:number]):boolean OR function(slot:number, index:number[, detail:table, type:string]):boolean -- Set the pattern output at the given index. A blank pattern becomes an ultimate pattern.")
public Object[] setInterfacePatternOutput(Context context, Arguments args) {
replaceBlankPattern(args);
return setPatternSlot(context, args, "out");
}
@Callback(
doc = "function(slot:number, database:address, entry:number, size:number, index:number):boolean -- Set the pattern fluid input at the given index.")
public Object[] setInterfacePatternFluidInput(Context context, Arguments args) {
return setPatternSlot(context, args, "in", true);
doc = "function(slot:number, index:number, database:address, entry:number):boolean -- Store pattern input at the given index to the database entry.")
public Object[] storeInterfacePatternInput(Context context, Arguments args) {
return storeInterfacePattern(context, args, "in");
}
@Callback(
doc = "function(slot:number, database:address, entry:number, size:number, index:number):boolean -- Set the pattern fluid output at the given index.")
public Object[] setInterfacePatternFluidOutput(Context context, Arguments args) {
return setPatternSlot(context, args, "out", true);
doc = "function(slot:number, index:number, database:address, entry:number):boolean -- Store pattern output at the given index to the database entry.")
public Object[] storeInterfacePatternOutput(Context context, Arguments args) {
return storeInterfacePattern(context, args, "out");
}
@Callback(doc = "function(slot:number, index:number):boolean -- Clear pattern input at the given index.")
public Object[] clearInterfacePatternInput(Context context, Arguments args) {
return clearInterfacePattern(context, args, "in");
return setPatternSlot(context, args, "in");
}
@Callback(doc = "function(slot:number, index:number):boolean -- Clear pattern output at the given index.")
public Object[] clearInterfacePatternOutput(Context context, Arguments args) {
return clearInterfacePattern(context, args, "out");
return setPatternSlot(context, args, "out");
}
@Override
@@ -5,8 +5,11 @@ import net.minecraftforge.common.util.ForgeDirection;
import appeng.api.implementations.tiles.ITileStorageMonitorable;
import appeng.api.networking.security.BaseActionSource;
import appeng.api.parts.IPart;
import appeng.api.parts.IPartHost;
import appeng.api.storage.IExternalStorageHandler;
import appeng.api.storage.IMEInventory;
import appeng.api.storage.IStorageMonitorable;
import appeng.api.storage.StorageChannel;
import appeng.util.Platform;
@@ -16,8 +19,8 @@ public class AEFluidInterfaceHandler implements IExternalStorageHandler {
public boolean canHandle(TileEntity te, ForgeDirection d, StorageChannel channel, BaseActionSource mySrc) {
if (channel == StorageChannel.FLUIDS) {
if (te instanceof ITileStorageMonitorable) {
return true;
} else return Platform.getPartFromTE(te, d.getOpposite()) instanceof ITileStorageMonitorable;
return !(te instanceof IPartHost);
} else return getMonitorablePart(te, d, mySrc) != null;
}
return false;
}
@@ -26,14 +29,19 @@ public class AEFluidInterfaceHandler implements IExternalStorageHandler {
@SuppressWarnings("rawtypes")
public IMEInventory getInventory(TileEntity te, ForgeDirection d, StorageChannel channel, BaseActionSource src) {
if (channel == StorageChannel.FLUIDS) {
if (te instanceof ITileStorageMonitorable
&& ((ITileStorageMonitorable) te).getMonitorable(d, src) != null) {
return ((ITileStorageMonitorable) te).getMonitorable(d, src).getFluidInventory();
} else if (Platform.getPartFromTE(te, d.getOpposite()) instanceof ITileStorageMonitorable part
&& part.getMonitorable(d, src) != null) {
return part.getMonitorable(d, src).getFluidInventory();
}
if (te instanceof ITileStorageMonitorable tsm) {
final IStorageMonitorable monitorable = tsm.getMonitorable(d, src);
return monitorable != null ? monitorable.getFluidInventory() : null;
} else {
final IStorageMonitorable monitorable = getMonitorablePart(te, d, src);
return monitorable != null ? monitorable.getFluidInventory() : null;
}
}
return null;
}
private static IStorageMonitorable getMonitorablePart(TileEntity te, ForgeDirection d, BaseActionSource src) {
final IPart part = Platform.getPartFromTE(te, d);
return part instanceof ITileStorageMonitorable monitorablePart ? monitorablePart.getMonitorable(d, src) : null;
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 182 B

After

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 182 B

After

Width:  |  Height:  |  Size: 122 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 B

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 B

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 B

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 B

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 B

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 B

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 B

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 B

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 B

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 B

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 204 B

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 197 B

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 133 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 133 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 193 B

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 350 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB