Compare commits

..
Author SHA1 Message Date
Martin Robertz cb697002d5 update to pre version 2025-12-09 13:12:23 +01:00
Martin Robertz c7b7baa80b sa+update 2025-12-09 13:11:54 +01:00
Martin Robertz cddadf308b Merge remote-tracking branch 'michaeldoylecs/creative-like-pick-block' into dev 2025-12-09 13:04:56 +01:00
Martin Robertz 9b529607c5 Merge remote-tracking branch 'danyadev/certus-quartz-tank-drain-from-above' into dev 2025-12-09 13:03:41 +01:00
Martin Robertz 8450096b04 Merge remote-tracking branch 'lc-1337/gui-reaper' into dev 2025-12-09 13:03:23 +01:00
Kogepan229 3e24f7ba47 Wireless Terminal infinite check 2025-12-08 11:24:45 +09:00
Michael Doyle 75c62058d4 Remove client-side terminal checks 2025-12-04 20:42:26 -05:00
Michael Doyle f8e40f842b Create dedicated Player Inventory Util class and support WirelessCraftingTerminal 2025-12-04 20:42:26 -05:00
Michael Doyle a106dd7c02 Add JavaDocs 2025-12-04 20:42:21 -05:00
Michael Doyle aea1ce8dd0 Create and use Util function to get any wireless terminal 2025-12-04 20:41:52 -05:00
Michael Doyle 4cf57ee42f Add Keybind to pull looked-at item into inventory from AE2 System 2025-12-04 20:41:38 -05:00
lc-1337 22ac5eee31 Merge remote-tracking branch 'origin/gui-reaper' into gui-reaper 2025-11-24 20:31:15 +02:00
lc-1337 87c8b1ec2a fix client crash on fresh ultra terminal 2025-11-24 20:31:07 +02:00
lc_1337 1d0a1bde9c fix bind 2025-11-24 12:17:20 +02:00
lc-1337 f77014fafc fix inf loop 2025-11-21 21:56:22 +02:00
Martin Robertz 33dba5ae02 Merge branch 'master' into gui-reaper 2025-11-15 21:16:02 +01:00
Martin Robertz c64fe075ad Merge branch 'master' into certus-quartz-tank-drain-from-above 2025-11-15 21:15:53 +01:00
Martin Robertz 6eeebd3644 Merge branch 'master' into gui-reaper 2025-11-15 10:44:16 +01:00
Martin Robertz 3098b870f1 Merge branch 'master' into certus-quartz-tank-drain-from-above 2025-11-15 10:43:44 +01:00
Kogepan229 24e5effffa Merge branch 'master' into gui-reaper 2025-11-15 17:18:04 +09:00
danyadev d8242779a5 allow draining tank tower from an empty tank above 2025-11-15 01:30:49 +03:00
Kogepan229 e00aea2d07 Merge branch 'master' into gui-reaper 2025-11-15 00:38:21 +09:00
Kogepan229 20a10250df Fix fluid export bus not working 2025-11-10 22:33:42 +09:00
Kogepan229 c358e041cd fix 2025-11-10 22:16:16 +09:00
Kogepan229 81c637c37a Merge branch 'master' into gui-reaper 2025-11-10 22:10:06 +09:00
Kogepan229 56cdadce75 Revert "Merge branch 'master' into gui-reaper"
This reverts commit f29844f2f8, reversing
changes made to f35d6856d5.
2025-11-10 21:58:28 +09:00
Martin Robertz f29844f2f8 Merge branch 'master' into gui-reaper 2025-11-07 21:50:16 +01:00
lc-1337 f35d6856d5 refactor fix for terminal keybind 2025-11-07 21:10:46 +02:00
lc-1337 44c33b998c Merge branch 'master' into gui-reaper 2025-11-07 19:56:43 +02:00
lc_1337 9456dd5ecd fix terminal open keybind (sketch) 2025-11-07 15:56:19 +02:00
lc_1337 c1ccceb123 fix fluid bus legacy config 2025-11-07 11:23:40 +02:00
lc-1337 a900afc9fe fix extreme cell was stackable 2025-11-06 22:09:04 +02:00
Kogepan229 f876fe9ede Fix dual interface crash 2025-11-06 15:43:02 +09:00
Kogepan229 f942e3a9ab Move level things to AE2 2025-11-04 20:37:54 +09:00
Martin Robertz 15ed08077a Merge branch 'master' into gui-reaper 2025-11-04 12:08:07 +01:00
lc-1337 13e57daf1a update interfaces path 2025-11-01 09:42:19 +02:00
Kogepan229 a90e7c6e09 Fix Level Maintainer Gui 2025-10-31 23:52:24 +09:00
Kogepan229 f6242f8862 fix 2025-10-31 23:52:07 +09:00
Kogepan229 4f61e09ffd Cleanup 2025-10-31 19:03:31 +09:00
Kogepan229 9176dec955 Use AE2 sub gui system for Level Maintainer 2025-10-31 18:54:26 +09:00
Kogepan229 7a00f6e44a Remove unused 2025-10-31 18:36:41 +09:00
Kogepan229 5adddd2df5 Display stack size on level maintainer gui 2025-10-31 17:57:51 +09:00
lc-1337 b4265992c3 io bus fixes 2025-10-30 20:41:53 +02:00
Kogepan229 e1afdf1c53 Universal Level Maintainer Gui 2025-10-31 00:31:24 +09:00
Kogepan229 3107ecf1c0 Remove terminal type filter 2025-10-30 22:09:12 +09:00
Kogepan229 cdc86aaca9 Fix import 2025-10-30 22:08:33 +09:00
lc_1337 53d22de11a interface 2025-10-30 13:41:43 +02:00
lc-1337 20e69fa2c3 io bus fixes 2025-10-29 20:40:33 +02:00
lc_1337 e2947e41c9 io bus 2025-10-29 16:17:35 +02:00
Kogepan229 7a841a1eca Fix ultra terminal 2025-10-28 13:52:32 +09:00
Kogepan229 0039183e37 remove useless parametrization 2025-10-28 13:19:47 +09:00
Kogepan229 5b2429236c Fix Level Terminal 2025-10-27 21:12:40 +09:00
Kogepan229 024222d305 Fix funny 2025-10-27 20:38:04 +09:00
Kogepan229 dc50383f00 Fix infinite cells 2025-10-27 17:28:19 +09:00
Kogepan229 9bc66bbad6 Don't use AEBaseMEGui 2025-10-27 00:15:37 +09:00
Kogepan229 9f54e93ade Restore public api compatibility around cell 2025-10-26 23:07:56 +09:00
lc-1337 4afacb98f0 cells, remove ExtraCells integration 2025-10-26 12:07:36 +02:00
lc-1337 ebd42852ff cells 2025-10-25 23:31:24 +03:00
lc_1337 24d30ef078 storage bus 2025-10-24 12:47:09 +03:00
lc-1337 edb027424d Merge branch 'master' into gui-reaper 2025-10-23 20:51:16 +03:00
lc_1337 b9860934ee level terminal 2025-10-23 15:08:43 +03:00
lc-1337 461d574a54 Merge remote-tracking branch 'origin/gui-reaper' into gui-reaper
# Conflicts:
#	src/main/java/com/glodblock/github/client/gui/GuiFluidLevelEmitter.java
#	src/main/java/com/glodblock/github/inventory/gui/GuiType.java
2025-10-22 21:09:00 +03:00
lc-1337 644a8a4b42 level emitter 2025-10-22 21:07:28 +03:00
lc-1337 c0b8e58aae Merge branch 'master' into gui-reaper 2025-10-19 13:56:27 +03:00
lc-1337 3567b68acb ultra terminal 2025-10-19 13:53:41 +03:00
lc_1337 30624682e4 save 2025-10-17 15:20:14 +03:00
lc-1337 7a8ed661cd save 2025-10-16 22:16:02 +03:00
lc-1337 6680f3e91a save 2025-10-16 20:31:06 +03:00
lc_1337 7c567e0c38 save 2025-10-14 15:37:37 +03:00
lc_1337 be7b8d684e save 2025-10-13 16:28:19 +03:00
lc-1337 fce98077ff save 2025-10-12 19:37:16 +03:00
lc_1337 078073e5ce save 2025-10-09 16:12:43 +03:00
lc_1337 34dc6c423b save 2025-10-08 16:45:27 +03:00
41 changed files with 593 additions and 199 deletions

No files matched your search

+10 -10
View File
@@ -34,29 +34,29 @@
* 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.48-GTNH:dev')
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-775-GTNH:dev')
api('com.github.GTNewHorizons:NotEnoughItems:2.8.40-GTNH:dev')
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-753-GTNH-pre:dev')
api('curse.maven:cofh-core-69162:2388751')
api('com.github.GTNewHorizons:waila:1.9.15:dev')
api("com.github.GTNewHorizons:GTNHLib:0.8.41:dev")
api("com.github.GTNewHorizons:GTNHLib:0.8.25:dev")
implementation("com.github.GTNewHorizons:WirelessCraftingTerminal:1.12.12:dev") {
implementation("com.github.GTNewHorizons:WirelessCraftingTerminal:1.12.7:dev") {
exclude group: 'com.github.GTNewHorizons', module: 'Applied-Energistics-2-Unofficial'
}
compileOnly('com.github.GTNewHorizons:Baubles-Expanded:2.2.6-GTNH:dev')
compileOnly('com.github.GTNewHorizons:Baubles-Expanded:2.2.2-GTNH:dev')
compileOnly('com.github.GTNewHorizons:ExtraCells2:2.5.35:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:ForestryMC:4.11.4:dev')
compileOnly('com.github.GTNewHorizons:EnderIO:2.10.12:dev')
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.52.179:dev') {
compileOnly('com.github.GTNewHorizons:ForestryMC:4.11.2:dev')
compileOnly('com.github.GTNewHorizons:EnderIO:2.10.6:dev')
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.52.134: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.12.9-GTNH:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.7.18-GTNH:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:OpenComputers:1.12.6-GTNH:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.7.16-GTNH:dev') { transitive = false }
runtimeOnlyNonPublishable("com.github.GTNewHorizons:DuraDisplay:1.4.0:dev")
}
-7
View File
@@ -43,10 +43,6 @@ developmentEnvironmentUserName = Developer
# See https://github.com/bsideup/jabel for details on how this works.
enableModernJavaSyntax = true
# If set, ignores the above setting and compiles with the given toolchain. This may cause unexpected issues,
# and should *not* be used in most situations. -1 disables this.
# forceToolchainVersion = -1
# Enables injecting missing generics into the decompiled source code for a better coding experience.
# Turns most publicly visible List, Map, etc. into proper List<E>, Map<K, V> types.
enableGenericInjection = true
@@ -213,6 +209,3 @@ curseForgeRelations =
# This is meant to be set in $HOME/.gradle/gradle.properties.
# ideaCheckSpotlessOnBuild = true
# Non-GTNH properties
org.gradle.configuration-cache = true
org.gradle.parallel = true
-12
View File
@@ -1,12 +0,0 @@
#This file is generated by updateDaemonJvm
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/df211d3c3eefdc408b462041881bc575/redirect
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/b41931cf1e70bc8e08d7dd19c343ef00/redirect
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/df211d3c3eefdc408b462041881bc575/redirect
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/b41931cf1e70bc8e08d7dd19c343ef00/redirect
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/46949723aaa20c7b64d7ecfed7207034/redirect
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/d6690dfd71c4c91e08577437b5b2beb0/redirect
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/df211d3c3eefdc408b462041881bc575/redirect
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/b41931cf1e70bc8e08d7dd19c343ef00/redirect
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/3cd7045fca9a72cd9bc7d14a385e594c/redirect
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/552c7bffe0370c66410a51c55985b511/redirect
toolchainVersion=25
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-9.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Vendored
+4 -1
View File
@@ -1,7 +1,7 @@
#!/bin/sh
#
# Copyright © 2015 the original authors.
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -114,6 +114,7 @@ case "$( uname )" in #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH="\\\"\\\""
# Determine the Java command to use to start the JVM.
@@ -171,6 +172,7 @@ fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
@@ -210,6 +212,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
"$@"
Vendored
+2 -1
View File
@@ -70,10 +70,11 @@ goto fail
:execute
@rem Setup the command line
set CLASSPATH=
@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" %*
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
:end
@rem End local scope for the variables with windows NT shell
+1 -1
View File
@@ -17,7 +17,7 @@ pluginManagement {
}
plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.7'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.48'
}
@@ -7,12 +7,10 @@ import static com.glodblock.github.inventory.item.WirelessMagnet.modeKey;
import java.util.List;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import com.glodblock.github.FluidCraft;
import com.glodblock.github.client.gui.GuiFCImgButton;
import com.glodblock.github.common.item.ItemWirelessUltraTerminal;
import com.glodblock.github.inventory.item.WirelessMagnet;
import com.glodblock.github.network.CPacketFluidPatternTermBtns;
import com.glodblock.github.network.CPacketSwitchGuis;
@@ -26,8 +24,6 @@ public class UltraTerminalButtons implements ICustomButtonDataObject {
public static String restockItems = "restock";
private ItemStack terminal;
private GuiFCImgButton CraftingTerminal;
private GuiFCImgButton PatternTerminal;
private GuiFCImgButton InterfaceTerminal;
@@ -49,10 +45,6 @@ public class UltraTerminalButtons implements ICustomButtonDataObject {
private int offset;
public UltraTerminalButtons(ItemStack terminal) {
this.terminal = terminal;
}
public void initCustomButtons(int guiLeft, int guiTop, int xSize, int ySize, int xOffset, int yOffset,
List<GuiButton> buttonList) {
this.offset = yOffset;
@@ -101,21 +93,16 @@ public class UltraTerminalButtons implements ICustomButtonDataObject {
@Override
public boolean actionPerformedCustomButtons(final GuiButton btn) {
if (btn instanceof GuiFCImgButton) {
UltraTerminalModes mode = null;
if (btn == this.CraftingTerminal) {
mode = UltraTerminalModes.CRAFTING;
FluidCraft.proxy.netHandler.sendToServer(new CPacketSwitchGuis(UltraTerminalModes.CRAFTING, true));
} else if (btn == this.PatternTerminal) {
mode = UltraTerminalModes.PATTERN;
FluidCraft.proxy.netHandler.sendToServer(new CPacketSwitchGuis(UltraTerminalModes.PATTERN, true));
} else if (btn == this.InterfaceTerminal) {
mode = UltraTerminalModes.INTERFACE;
FluidCraft.proxy.netHandler.sendToServer(new CPacketSwitchGuis(UltraTerminalModes.INTERFACE, true));
} else if (btn == this.LevelTerminal) {
mode = UltraTerminalModes.LEVEL;
FluidCraft.proxy.netHandler.sendToServer(new CPacketSwitchGuis(UltraTerminalModes.LEVEL, true));
} else if (btn == this.PatternTerminalEx) {
mode = UltraTerminalModes.PATTERN_EX;
}
if (mode != null) {
ItemWirelessUltraTerminal.setMode(this.terminal, mode);
FluidCraft.proxy.netHandler.sendToServer(new CPacketSwitchGuis(mode, true));
FluidCraft.proxy.netHandler.sendToServer(new CPacketSwitchGuis(UltraTerminalModes.PATTERN_EX, true));
}
if (btn == this.magnetOff || btn == this.magnetME || btn == this.magnetInv) {
@@ -1,8 +1,10 @@
package com.glodblock.github.client.gui;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Slot;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.util.ForgeDirection;
@@ -49,6 +51,13 @@ public class GuiFluidInterface extends GuiSub {
}
}
@Override
public void func_146977_a(final Slot s) {
try {
GuiContainer.class.getDeclaredMethod("func_146977_a_original", Slot.class).invoke(this, s);
} catch (final Exception ignore) {}
}
@Override
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) {
fontRendererObj.drawString(getGuiDisplayName(I18n.format(NameConst.GUI_FLUID_INTERFACE)), 8, 6, 0x404040);
@@ -244,7 +244,8 @@ public class ContainerLevelTerminal extends FCBaseContainer {
}
@Override
public PrimaryGui createPrimaryGui() {
public PrimaryGui getPrimaryGui() {
ContainerOpenContext context = getOpenContext();
return new FluidPrimaryGui(
GuiType.LEVEL_TERMINAL,
@@ -22,7 +22,8 @@ public class ContainerLevelWireless extends ContainerLevelTerminal {
}
@Override
public PrimaryGui createPrimaryGui() {
public PrimaryGui getPrimaryGui() {
ContainerOpenContext context = getOpenContext();
return new FluidPrimaryGui(
GuiType.WIRELESS_LEVEL_TERMINAL,
@@ -172,7 +172,8 @@ public class ContainerSuperStockReplenisher extends AEBaseContainer
}
@Override
public PrimaryGui createPrimaryGui() {
public PrimaryGui getPrimaryGui() {
ContainerOpenContext context = getOpenContext();
return new FluidPrimaryGui(
GuiType.GUI_SUPER_STOCK_REPLENISHER,
@@ -0,0 +1,49 @@
package com.glodblock.github.common.block;
import static net.minecraft.client.gui.GuiScreen.isShiftKeyDown;
import java.util.List;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import com.glodblock.github.common.item.FCBaseItemBlock;
import com.glodblock.github.common.tabs.FluidCraftingTabs;
import com.glodblock.github.common.tile.TileFluidDiscretizer;
import com.glodblock.github.util.NameConst;
import com.glodblock.github.util.RenderUtil;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockFluidDiscretizer extends FCBaseBlock {
public BlockFluidDiscretizer() {
super(Material.iron, NameConst.BLOCK_FLUID_DISCRETIZER);
setFullBlock(true);
setOpaque(true);
setTileEntity(TileFluidDiscretizer.class);
}
@Override
public BlockFluidDiscretizer register() {
GameRegistry.registerBlock(this, FCBaseItemBlock.class, NameConst.BLOCK_FLUID_DISCRETIZER);
GameRegistry.registerTileEntity(TileFluidDiscretizer.class, NameConst.BLOCK_FLUID_DISCRETIZER);
setCreativeTab(FluidCraftingTabs.INSTANCE);
return this;
}
@Override
@SideOnly(Side.CLIENT)
public void addInformation(final ItemStack itemStack, final EntityPlayer player, final List<String> toolTip,
final boolean advancedToolTips) {
if (isShiftKeyDown()) {
toolTip.addAll(RenderUtil.listFormattedStringToWidth(NameConst.i18n(NameConst.TT_FLUID_DISCRETIZER_DESC)));
} else {
toolTip.add(NameConst.i18n(NameConst.TT_SHIFT_FOR_MORE));
}
}
}
@@ -8,7 +8,6 @@ import com.google.common.base.Optional;
import appeng.api.storage.StorageChannel;
import appeng.items.AEBaseCell;
import appeng.util.Platform;
public abstract class FCBaseItemCell extends AEBaseCell {
@@ -47,20 +46,4 @@ public abstract class FCBaseItemCell extends AEBaseCell {
public ItemStack stack() {
return new ItemStack(this, 1);
}
@Override
public String getCellData(ItemStack is) {
return totalBytes + ","
+ this.getTotalTypes(null)
+ ","
+ perType
+ ","
+ 8 * 256
+ ","
+ Platform.openNbtData(is).getByte("cellRestrictionTypes")
+ ","
+ Platform.openNbtData(is).getLong("cellRestrictionAmount")
+ ","
+ "fluid";
}
}
@@ -63,7 +63,7 @@ public class ItemFluidLevelEmitter extends FCBaseItem implements IPartItem {
@Override
public void addInformation(final ItemStack stack, final EntityPlayer player, final List<String> lines,
final boolean displayMoreInfo) {
lines.add("§4Deprecated, use regular level emitter, hold CTRL for get fluid of container.");
lines.add("Deprecated, use regular level emitter, hold CTRL for get fluid of container.");
super.addInformation(stack, player, lines, displayMoreInfo);
}
}
@@ -59,6 +59,6 @@ public class ItemPartFluidPatternTerminal extends FCBaseItem implements IPartIte
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List<String> toolTip, boolean flag) {
toolTip.add("§4DEPRECATED!");
toolTip.add("DEPRECATED!");
}
}
@@ -59,6 +59,6 @@ public class ItemPartFluidPatternTerminalEx extends FCBaseItem implements IPartI
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List<String> toolTip, boolean flag) {
toolTip.add("§4DEPRECATED!");
toolTip.add("DEPRECATED!");
}
}
@@ -45,7 +45,7 @@ public class ItemPartFluidTerminal extends FCBaseItem implements IPartItem {
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List<String> toolTip, boolean flag) {
toolTip.add("§4DEPRECATED!");
toolTip.add("DEPRECATED!");
if (isShiftKeyDown()) {
toolTip.add(NameConst.i18n(NameConst.TT_FLUID_TERMINAL));
} else {
@@ -1,7 +1,6 @@
package com.glodblock.github.common.item;
import java.util.EnumSet;
import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
@@ -39,10 +38,4 @@ public class ItemWirelessFluidTerminal extends ItemBaseWirelessTerminal
return null;
}
@Override
public void addCheckedInformation(ItemStack stack, EntityPlayer player, List<String> lines,
boolean displayMoreInfo) {
lines.add("§4DEPRECATED!");
super.addCheckedInformation(stack, player, lines, displayMoreInfo);
}
}
@@ -226,6 +226,6 @@ public class ItemWirelessUltraTerminal extends ItemBaseWirelessTerminal
@Override
public ICustomButtonDataObject getCustomDataObject(ICustomButtonProvider provider) {
return new UltraTerminalButtons(((IGuiItemObject) provider).getItemStack());
return new UltraTerminalButtons();
}
}
@@ -33,7 +33,7 @@ public class PartFluidExportBus extends PartBaseExportBus<IAEFluidStack> {
@Override
protected int getAdaptorFlags() {
return InventoryAdaptor.ALLOW_FLUIDS | InventoryAdaptor.FOR_INSERTS;
return InventoryAdaptor.DEFAULT & ~InventoryAdaptor.ALLOW_ITEMS;
}
@Override
@@ -26,7 +26,6 @@ import appeng.api.storage.data.IAEStack;
import appeng.me.GridAccessException;
import appeng.parts.automation.PartBaseImportBus;
import appeng.tile.inventory.IAEStackInventory;
import appeng.util.InventoryAdaptor;
import appeng.util.item.AEFluidStack;
public class PartFluidImportBus extends PartBaseImportBus<IAEFluidStack> {
@@ -98,12 +97,13 @@ public class PartFluidImportBus extends PartBaseImportBus<IAEFluidStack> {
FluidTankInfo[] tanksInfo = fh.getTankInfo(this.getSide().getOpposite());
if (tanksInfo == null) return true;
int maxDrain = this.calculateAmountToSend();
boolean doBreak = true;
for (FluidTankInfo tankInfo : tanksInfo) {
if (tankInfo.fluid == null) continue;
FluidStack fluidStack = new FluidStack(
tankInfo.fluid,
Math.min(tankInfo.fluid.amount, this.itemToSend));
FluidStack fluidStack = new FluidStack(tankInfo.fluid, Math.min(tankInfo.fluid.amount, maxDrain));
fluidStack = fh.drain(this.getSide().getOpposite(), fluidStack, false);
if (this.filterEnabled() && !this.isInFilter(fluidStack)) continue;
@@ -112,16 +112,18 @@ public class PartFluidImportBus extends PartBaseImportBus<IAEFluidStack> {
final IAEFluidStack notInserted = inv.injectItems(aeFluidStack, Actionable.MODULATE, this.mySrc);
if (notInserted != null && notInserted.getStackSize() > 0) {
if (notInserted.getFluidStack().amount == aeFluidStack.getFluidStack().amount) continue;
aeFluidStack.decStackSize(notInserted.getStackSize());
}
fh.drain(this.getSide().getOpposite(), aeFluidStack.getFluidStack(), true);
this.itemToSend -= aeFluidStack.getFluidStack().amount;
this.worked = true;
maxDrain -= aeFluidStack.getFluidStack().amount;
doBreak = false;
}
}
return doBreak;
}
return true;
}
@@ -171,9 +173,4 @@ public class PartFluidImportBus extends PartBaseImportBus<IAEFluidStack> {
}
}
}
@Override
protected int getAdaptorFlags() {
return InventoryAdaptor.ALLOW_FLUIDS | InventoryAdaptor.FOR_EXTRACTS;
}
}
@@ -1,12 +1,7 @@
package com.glodblock.github.common.parts;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import com.glodblock.github.common.item.ItemFluidPacket;
import appeng.api.storage.data.IAEItemStack;
import appeng.api.storage.data.IAEStack;
import appeng.helpers.Reflected;
import appeng.parts.automation.PartLevelEmitter;
@@ -16,14 +11,4 @@ public class PartFluidLevelEmitter extends PartLevelEmitter {
public PartFluidLevelEmitter(final ItemStack is) {
super(is);
}
@Override
public void readFromNBT(NBTTagCompound data) {
super.readFromNBT(data);
final IAEStack<?> aes = this.getAEInventoryByName(null).getAEStackInSlot(0);
if (aes instanceof IAEItemStack ais && ais.getItem() instanceof ItemFluidPacket) {
this.getAEInventoryByName(null).putAEStackInSlot(0, ItemFluidPacket.getFluidAEStack(ais));
}
}
}
@@ -16,6 +16,6 @@ public class FluidCraftingTabs extends CreativeTabs {
@Override
public Item getTabIconItem() {
return ItemAndBlockHolder.WALRUS.stack().getItem();
return ItemAndBlockHolder.DISCRETIZER.stack().getItem();
}
}
@@ -73,7 +73,7 @@ public class TileCertusQuartzTank extends TileEntity implements IFluidHandler {
FluidStack drainedFluid = this.tank.drain(amount, doDrain);
int drained = drainedFluid != null ? drainedFluid.amount : 0;
if (doDrain && drained > 0) {
if (drained > 0) {
update();
}
@@ -100,7 +100,7 @@ public class TileCertusQuartzTank extends TileEntity implements IFluidHandler {
@Override
public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) {
return drain(null, maxDrain, doDrain, true);
return drain(null, maxDrain, true, true);
}
public int fill(FluidStack fluid, boolean doFill, boolean findMainTank) {
@@ -131,7 +131,7 @@ public class TileCertusQuartzTank extends TileEntity implements IFluidHandler {
int filled = this.tank.fill(fluid, doFill);
if (doFill && filled > 0) {
if (filled > 0) {
update();
}
@@ -0,0 +1,10 @@
package com.glodblock.github.common.tile;
import appeng.tile.grid.AENetworkTile;
public class TileFluidDiscretizer extends AENetworkTile {
public TileFluidDiscretizer() {
super();
}
}
@@ -6,6 +6,7 @@ import com.glodblock.github.network.CPacketDumpTank;
import com.glodblock.github.network.CPacketFluidPatternTermBtns;
import com.glodblock.github.network.CPacketLevelMaintainer;
import com.glodblock.github.network.CPacketLevelTerminalCommands;
import com.glodblock.github.network.CPacketPickBlockWithdraw;
import com.glodblock.github.network.CPacketSwitchGuis;
import com.glodblock.github.network.CPacketValueConfig;
import com.glodblock.github.network.SPacketCustomButtonUpdate;
@@ -57,6 +58,11 @@ public class ChannelLoader implements Runnable {
SPacketLevelMaintainerGuiUpdate.class,
id++,
Side.CLIENT);
netHandler.registerMessage(
new CPacketPickBlockWithdraw.Handler(),
CPacketPickBlockWithdraw.class,
id++,
Side.SERVER);
netHandler.registerMessage(
new SPacketCustomButtonUpdate.Handler(),
SPacketCustomButtonUpdate.class,
@@ -4,6 +4,7 @@ import com.glodblock.github.common.Config;
import com.glodblock.github.common.block.BlockCertusQuartzTank;
import com.glodblock.github.common.block.BlockFluidAutoFiller;
import com.glodblock.github.common.block.BlockFluidBuffer;
import com.glodblock.github.common.block.BlockFluidDiscretizer;
import com.glodblock.github.common.block.BlockFluidInterface;
import com.glodblock.github.common.block.BlockFluidPacketDecoder;
import com.glodblock.github.common.block.BlockFluidPatternEncoder;
@@ -53,6 +54,7 @@ public class ItemAndBlockHolder {
public static BlockCertusQuartzTank CERTUS_QUARTZ_TANK = new BlockCertusQuartzTank().register();
public static BlockFluidAutoFiller FLUID_AUTO_FILLER = new BlockFluidAutoFiller().register();
public static BlockFluidDiscretizer DISCRETIZER = new BlockFluidDiscretizer().register();
public static BlockLevelMaintainer LEVEL_MAINTAINER = new BlockLevelMaintainer().register();
public static BlockFluidPatternEncoder ENCODER = new BlockFluidPatternEncoder().register();
public static BlockFluidPacketDecoder DECODER = new BlockFluidPacketDecoder().register();
@@ -4,15 +4,15 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityClientPlayerMP;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.lwjgl.input.Keyboard;
import com.glodblock.github.FluidCraft;
import com.glodblock.github.common.item.ItemWirelessUltraTerminal;
import com.glodblock.github.network.CPacketPickBlockWithdraw;
import com.glodblock.github.network.CPacketSwitchGuis;
import com.glodblock.github.network.CPacketValueConfig;
import com.glodblock.github.util.UltraTerminalModes;
import com.glodblock.github.util.Util;
import cpw.mods.fml.client.registry.ClientRegistry;
@@ -26,84 +26,50 @@ import cpw.mods.fml.relauncher.SideOnly;
public class KeybindLoader implements Runnable {
public static KeyBinding openTerminal;
public static KeyBinding openCraftingTerminal;
public static KeyBinding openLevelTerminal;
public static KeyBinding openInterfaceTerminal;
public static KeyBinding openPatternTerminal;
public static KeyBinding openPatternExTerminal;
public static KeyBinding restock;
public static KeyBinding pickBlock;
@Override
public void run() {
openTerminal = new KeyBinding(FluidCraft.MODID + ".key.OpenTerminal", Keyboard.CHAR_NONE, "itemGroup.ae2fc");
openCraftingTerminal = new KeyBinding(
FluidCraft.MODID + ".key.OpenCraftingTerminal",
Keyboard.CHAR_NONE,
"itemGroup.ae2fc");
openLevelTerminal = new KeyBinding(
FluidCraft.MODID + ".key.OpenLevelTerminal",
Keyboard.CHAR_NONE,
"itemGroup.ae2fc");
openInterfaceTerminal = new KeyBinding(
FluidCraft.MODID + ".key.OpenInterfaceTerminal",
Keyboard.CHAR_NONE,
"itemGroup.ae2fc");
openPatternTerminal = new KeyBinding(
FluidCraft.MODID + ".key.OpenPatternTerminal",
Keyboard.CHAR_NONE,
"itemGroup.ae2fc");
openPatternExTerminal = new KeyBinding(
FluidCraft.MODID + ".key.OpenPatternExTerminal",
Keyboard.CHAR_NONE,
"itemGroup.ae2fc");
restock = new KeyBinding(FluidCraft.MODID + ".key.Restock", Keyboard.CHAR_NONE, "itemGroup.ae2fc");
pickBlock = new KeyBinding(FluidCraft.MODID + ".key.PickBlock", Keyboard.CHAR_NONE, "itemGroup.ae2fc");
ClientRegistry.registerKeyBinding(openTerminal);
ClientRegistry.registerKeyBinding(openCraftingTerminal);
ClientRegistry.registerKeyBinding(openLevelTerminal);
ClientRegistry.registerKeyBinding(openInterfaceTerminal);
ClientRegistry.registerKeyBinding(openPatternTerminal);
ClientRegistry.registerKeyBinding(openPatternExTerminal);
ClientRegistry.registerKeyBinding(restock);
ClientRegistry.registerKeyBinding(pickBlock);
FMLCommonHandler.instance().bus().register(this);
}
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onKeyInput(InputEvent.KeyInputEvent event) {
handleKeybindings();
if (openTerminal.isPressed()) {
handleOpenTerminalKey();
} else if (restock.isPressed()) {
handleRestockKey();
} else if (pickBlock.isPressed()) {
handlePickBlockKey();
}
}
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onMouseInput(InputEvent.MouseInputEvent event) {
handleKeybindings();
}
private void handleKeybindings() {
if (openTerminal.isPressed()) {
handleOpenTerminalKey(null);
} else if (openCraftingTerminal.isPressed()) {
handleOpenTerminalKey(UltraTerminalModes.CRAFTING);
} else if (openLevelTerminal.isPressed()) {
handleOpenTerminalKey(UltraTerminalModes.LEVEL);
} else if (openInterfaceTerminal.isPressed()) {
handleOpenTerminalKey(UltraTerminalModes.INTERFACE);
} else if (openPatternTerminal.isPressed()) {
handleOpenTerminalKey(UltraTerminalModes.PATTERN);
} else if (openPatternExTerminal.isPressed()) {
handleOpenTerminalKey(UltraTerminalModes.PATTERN_EX);
handleOpenTerminalKey();
} else if (restock.isPressed()) {
handleRestockKey();
} else if (pickBlock.isPressed()) {
handlePickBlockKey();
}
}
private void handleOpenTerminalKey(UltraTerminalModes mode) {
private void handleOpenTerminalKey() {
if (Minecraft.getMinecraft().currentScreen != null) return;
EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
ImmutablePair<Integer, ItemStack> temp = Util.getUltraWirelessTerm(player);
if (temp == null) return;
if (mode != null) ItemWirelessUltraTerminal.setMode(temp.getRight(), mode);
FluidCraft.proxy.netHandler.sendToServer(new CPacketSwitchGuis(mode, true));
FluidCraft.proxy.netHandler.sendToServer(new CPacketSwitchGuis(null, true));
}
private void handleRestockKey() {
@@ -118,4 +84,22 @@ public class KeybindLoader implements Runnable {
FluidCraft.proxy.netHandler.sendToServer(new CPacketValueConfig(0, 1));
}
}
private void handlePickBlockKey() {
Minecraft minecraft = Minecraft.getMinecraft();
if (minecraft.currentScreen != null) return; // Don't act if a GUI is open
EntityClientPlayerMP player = minecraft.thePlayer;
if (player == null) return;
// Get the block the player is currently looking at
MovingObjectPosition movingObject = minecraft.objectMouseOver;
if (movingObject == null || movingObject.typeOfHit != MovingObjectPosition.MovingObjectType.BLOCK) {
return;
}
// Send packet to server with block coordinates
FluidCraft.proxy.netHandler.sendToServer(
new CPacketPickBlockWithdraw(movingObject.blockX, movingObject.blockY, movingObject.blockZ));
}
}
@@ -22,6 +22,7 @@ import static com.glodblock.github.loader.ItemAndBlockHolder.CELL64KM;
import static com.glodblock.github.loader.ItemAndBlockHolder.CELL_HOUSING;
import static com.glodblock.github.loader.ItemAndBlockHolder.CERTUS_QUARTZ_TANK;
import static com.glodblock.github.loader.ItemAndBlockHolder.DECODER;
import static com.glodblock.github.loader.ItemAndBlockHolder.DISCRETIZER;
import static com.glodblock.github.loader.ItemAndBlockHolder.ENCODER;
import static com.glodblock.github.loader.ItemAndBlockHolder.ENERGY_CARD;
import static com.glodblock.github.loader.ItemAndBlockHolder.FLUID_AUTO_FILLER;
@@ -50,11 +51,11 @@ import static com.glodblock.github.loader.ItemAndBlockHolder.QUANTUM_BRIDGE_CARD
import static com.glodblock.github.loader.ItemAndBlockHolder.QUANTUM_CELL;
import static com.glodblock.github.loader.ItemAndBlockHolder.SINGULARITY_CELL;
import static com.glodblock.github.loader.ItemAndBlockHolder.WALRUS;
import static com.glodblock.github.loader.ItemAndBlockHolder.WIRELESS_FLUID_TERM;
import static com.glodblock.github.loader.ItemAndBlockHolder.WIRELESS_INTERFACE_TERM;
import static com.glodblock.github.loader.ItemAndBlockHolder.WIRELESS_LEVEL_TERM;
import static com.glodblock.github.loader.ItemAndBlockHolder.WIRELESS_PATTERN_TERM;
import static com.glodblock.github.loader.ItemAndBlockHolder.WIRELESS_ULTRA_TERM;
import static net.minecraft.init.Blocks.redstone_torch;
import static net.minecraft.init.Items.fish;
import java.util.Arrays;
@@ -110,10 +111,6 @@ public class RecipeLoader implements Runnable {
GameRegistry.findItem("appliedenergistics2", "item.ItemMultiPart"),
1,
340);
public static final ItemStack AE2_PATTERN_TERM_EX = new ItemStack(
GameRegistry.findItem("appliedenergistics2", "item.ItemMultiPart"),
1,
500);
public static final ItemStack AE2_PROCESS_LOG = new ItemStack(
GameRegistry.findItem("appliedenergistics2", "item.ItemMultiMaterial"),
1,
@@ -192,12 +189,6 @@ public class RecipeLoader implements Runnable {
GameRegistry.findItem("appliedenergistics2", "item.ItemMultiMaterial"),
1,
28);
public static final ItemStack AE2_LEVEL_EMITTER = new ItemStack(
GameRegistry.findItem("appliedenergistics2", "item.ItemMultiPart"),
1,
280);
public static final ItemStack AE2_WIRELESS_RECEIVER = new ItemStack(
GameRegistry.findItem("appliedenergistics2", "item.ItemMultiMaterial"),
1,
@@ -243,12 +234,26 @@ public class RecipeLoader implements Runnable {
GameRegistry.addShapelessRecipe(FLUID_INTERFACE_P2P.stack(), AE2_P2P_ME, FLUID_INTERFACE.stack());
}
GameRegistry.addShapelessRecipe(INTERFACE.stack(), FLUID_INTERFACE.stack());
GameRegistry.addShapelessRecipe(WIRELESS_PATTERN_TERM.stack(), AE2_WIRELESS_TERMINAL, AE2_PATTERN_TERM);
GameRegistry.addShapelessRecipe(WIRELESS_PATTERN_TERM.stack(), FLUID_TERMINAL);
GameRegistry.addShapelessRecipe(WIRELESS_INTERFACE_TERM.stack(), AE2_WIRELESS_TERMINAL, AE2_INTERFACE_TERMINAL);
GameRegistry.addShapelessRecipe(WIRELESS_LEVEL_TERM.stack(), AE2_WIRELESS_TERMINAL, LEVEL_MAINTAINER);
GameRegistry
.addRecipe(new ShapedOreRecipe(CERTUS_QUARTZ_TANK.stack(), "GGG", "G G", "GGG", 'G', AE2_QUARTZ_GLASS));
GameRegistry.addShapelessRecipe(FLUID_AUTO_FILLER.stack(), AE2_PATTERN_TERM, ENCODER);
GameRegistry.addShapelessRecipe(FLUID_AUTO_FILLER.stack(), FLUID_TERMINAL, ENCODER);
GameRegistry.addRecipe(
new ShapedOreRecipe(
DISCRETIZER.stack(),
"IPI",
"TMT",
"IPI",
'I',
"ingotIron",
'P',
AE2_PROCESS_ENG,
'T',
AE2_STORAGE_BUS,
'M',
AE2_CONDENSER));
GameRegistry.addRecipe(
new ShapedOreRecipe(
DECODER.stack(),
@@ -289,7 +294,7 @@ public class RecipeLoader implements Runnable {
'I',
"itemIlluminatedPanel",
'E',
AE2_LEVEL_EMITTER,
FLUID_LEVEL_EMITTER,
'P',
"dyeBlue"));
GameRegistry.addRecipe(
@@ -302,6 +307,13 @@ public class RecipeLoader implements Runnable {
FLUID_STORAGE_MONITOR,
'F',
AE2_CORE_FOM));
GameRegistry.addShapelessRecipe(FLUID_TERMINAL.stack(), AE2_PATTERN_TERM, ENCODER);
GameRegistry.addShapelessRecipe(
FLUID_TERMINAL_EX.stack(),
FLUID_TERMINAL.stack(),
AE2_PROCESS_CAL,
AE2_PROCESS_ENG,
AE2_PROCESS_LOG);
GameRegistry.addRecipe(
new ShapedOreRecipe(
BUFFER.stack(),
@@ -321,6 +333,16 @@ public class RecipeLoader implements Runnable {
'B',
BUCKET));
GameRegistry.addRecipe(new ShapedOreRecipe(WALRUS, "FFF", "F F", "FFF", 'F', fish));
GameRegistry.addRecipe(
new ShapedOreRecipe(
FLUID_LEVEL_EMITTER.stack(),
"RPD",
'R',
redstone_torch,
'P',
AE2_PROCESS_CAL,
'D',
"dyeBlue"));
GameRegistry.addRecipe(
new ShapedOreRecipe(
LARGE_BUFFER.stack(),
@@ -334,6 +356,7 @@ public class RecipeLoader implements Runnable {
'E',
AE2_PROCESS_ENG));
GameRegistry.addShapelessRecipe(AE2_BLANK_PATTERN, PATTERN.stack());
GameRegistry.addShapelessRecipe(FLUID_TERM.stack(), AE2_TERMINAL, BUFFER);
GameRegistry.addShapelessRecipe(LEVEL_TERMINAL.stack(), AE2_TERMINAL, LEVEL_MAINTAINER);
GameRegistry.addShapelessRecipe(
FLUID_BUFFER.stack(),
@@ -342,14 +365,6 @@ public class RecipeLoader implements Runnable {
: ModAndClassUtil.EC2 ? ItemEnum.STORAGECOMPONENT.getDamagedStack(4) : null);
GameRegistry
.addShapelessRecipe(LEVEL_MAINTAINER.stack(), AE2_CRAFTING_CP_UNIT, ENCODER, AE2_PATTERN_CAPACITY_CARD);
// Deprecated
GameRegistry.addShapelessRecipe(AE2_TERMINAL, FLUID_TERM.stack());
GameRegistry.addShapelessRecipe(AE2_WIRELESS_TERMINAL, WIRELESS_FLUID_TERM.stack());
GameRegistry.addShapelessRecipe(AE2_LEVEL_EMITTER, FLUID_LEVEL_EMITTER.stack());
GameRegistry.addShapelessRecipe(AE2_PATTERN_TERM, FLUID_TERMINAL.stack());
GameRegistry.addShapelessRecipe(AE2_PATTERN_TERM_EX, FLUID_TERMINAL_EX.stack());
if (Config.fluidCells) {
OreDictionary.registerOre("anyCertusCrystal", AE2_PURE_CERTUS);
for (ItemStack it : OreDictionary.getOres("crystalCertusQuartz"))
@@ -115,7 +115,7 @@ public class CPacketFluidPatternTermBtns implements IMessage {
}
}
case MAGNET_OPEN_FILTER -> {
final PrimaryGui pGui = abc.createPrimaryGui();
final PrimaryGui pGui = abc.getPrimaryGui();
final int nextGui = abc.getSwitchAbleGuiNext();
InventoryHandler.openGui(
@@ -120,7 +120,7 @@ public class CPacketLevelTerminalCommands implements IMessage {
if (Objects.requireNonNull(message.action) == Action.EDIT) {
if (player.openContainer instanceof AEBaseContainer abc) {
final PrimaryGui pGui = abc.createPrimaryGui();
final PrimaryGui pGui = abc.getPrimaryGui();
TileEntity tile = DimensionManager.getWorld(message.dim)
.getTileEntity(message.x, message.y, message.z);
@@ -150,7 +150,7 @@ public class CPacketLevelTerminalCommands implements IMessage {
}
} else if (Objects.requireNonNull(message.action) == Action.RENAME) {
if (player.openContainer instanceof AEBaseContainer abc) {
final PrimaryGui pGui = abc.createPrimaryGui();
final PrimaryGui pGui = abc.getPrimaryGui();
TileEntity tile = DimensionManager.getWorld(message.dim)
.getTileEntity(message.x, message.y, message.z);
@@ -0,0 +1,247 @@
package com.glodblock.github.network;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ChatComponentText;
import net.minecraft.world.World;
import net.p455w0rd.wirelesscraftingterminal.common.container.ContainerWirelessCraftingTerminal;
import net.p455w0rd.wirelesscraftingterminal.common.utils.RandomUtils;
import org.apache.commons.lang3.tuple.ImmutablePair;
import com.glodblock.github.util.PlayerInventoryUtil;
import com.glodblock.github.util.Util;
import appeng.api.AEApi;
import appeng.api.config.Actionable;
import appeng.api.networking.security.PlayerSource;
import appeng.api.storage.IMEInventoryHandler;
import appeng.api.storage.StorageChannel;
import appeng.api.storage.data.IAEItemStack;
import appeng.api.storage.data.IAEStack;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
import io.netty.buffer.ByteBuf;
/**
* Network packet sent from client to server when a player looks at a block and requests to withdraw that block type
* from their wireless terminal's ME network.
*
* <p>
* This packet handles the entire withdrawal flow including:
* <ul>
* <li>Scanning the player's inventory for existing stacks of the target block</li>
* <li>Consolidating partial stacks to maximize inventory efficiency</li>
* <li>Extracting the appropriate amount from the ME network to fill or create a full stack</li>
* <li>Setting the target stack as the player's active hotbar slot for immediate use</li>
* </ul>
*
* <p>
* The packet carries the coordinates of the block the player is looking at, which determines what item type to withdraw
* from the ME network.
*/
public class CPacketPickBlockWithdraw implements IMessage {
private int blockX;
private int blockY;
private int blockZ;
public CPacketPickBlockWithdraw() {
// Required for FML
}
public CPacketPickBlockWithdraw(int x, int y, int z) {
this.blockX = x;
this.blockY = y;
this.blockZ = z;
}
@Override
public void fromBytes(ByteBuf buf) {
this.blockX = buf.readInt();
this.blockY = buf.readInt();
this.blockZ = buf.readInt();
}
@Override
public void toBytes(ByteBuf buf) {
buf.writeInt(this.blockX);
buf.writeInt(this.blockY);
buf.writeInt(this.blockZ);
}
public static class Handler implements IMessageHandler<CPacketPickBlockWithdraw, IMessage> {
@Override
public IMessage onMessage(CPacketPickBlockWithdraw message, MessageContext ctx) {
EntityPlayerMP player = ctx.getServerHandler().playerEntity;
if (player == null || player.inventory == null) {
return null;
}
World world = player.worldObj;
// Ensure the player has a wireless terminal
IMEInventoryHandler<IAEItemStack> terminalInventory = getWirelessInventory(player);
if (terminalInventory == null) {
player.addChatMessage(new ChatComponentText("Could not access AE2 network."));
return null;
}
// Get the target block
Block targetBlock = world.getBlock(message.blockX, message.blockY, message.blockZ);
if (targetBlock == Blocks.air) {
return null; // Don't try to withdraw air
}
Item targetItem = Item.getItemFromBlock(targetBlock);
if (targetItem == null) {
return null; // Should not happen for non-air blocks
}
// Check player inventory for existing stacks to determine how much to withdraw.
ItemStack itemToFind = new ItemStack(
targetItem,
1,
world.getBlockMetadata(message.blockX, message.blockY, message.blockZ));
// 1. Scan through the player's main inventory to categorize existing stacks of the target block:
// - If a full stack (stackSize >= maxStackSize) is found, record its slot and stop searching.
// This indicates the player already has the maximum possible stack, so no withdrawal is needed.
// - Otherwise, collect all partial stack slots (stacks that match the item but aren't full).
// Partial stacks will be consolidated in a later step.
int fullStackSlot = -1;
List<Integer> partialStackSlotsList = new ArrayList<>();
for (int i = 0; i < player.inventory.mainInventory.length; i++) {
ItemStack stackInSlot = player.inventory.mainInventory[i];
if (stackInSlot != null && stackInSlot.isItemEqual(itemToFind)
&& ItemStack.areItemStackTagsEqual(stackInSlot, itemToFind)) {
if (stackInSlot.stackSize >= stackInSlot.getMaxStackSize()) {
fullStackSlot = i;
break; // Found a full stack, no need to do anything.
}
partialStackSlotsList.add(i);
}
}
// 2. If a full stack already exists, put in active slot and return.
if (fullStackSlot >= 0) {
PlayerInventoryUtil.setSlotAsActiveSlot(player, fullStackSlot);
return null;
}
// 3. If there are no partial stacks and the player's inventory is full,
// then return since we cannot add a retrieved stack to a full inventory
int nextEmptySlot = PlayerInventoryUtil.getFirstEmptyStackReverse(player.inventory);
if (partialStackSlotsList.isEmpty() && nextEmptySlot == -1) {
return null;
}
// 4. Consolidate all partial stacks of target block into 1 ItemStack.
// If a full stack is obtained, set it as the active slot and return.
ItemStack consolidatedStack = null;
int consolidatedStackSlot = -1;
for (Integer partialStackSlot : partialStackSlotsList) {
if (consolidatedStack == null) {
consolidatedStack = player.inventory.getStackInSlot(partialStackSlot);
consolidatedStackSlot = partialStackSlot;
} else {
PlayerInventoryUtil
.consolidateItemStacks(player.inventory, partialStackSlot, consolidatedStackSlot);
}
// Check if we created a full stack of items
if (consolidatedStack.stackSize == consolidatedStack.getMaxStackSize()) {
PlayerInventoryUtil.setSlotAsActiveSlot(player, consolidatedStackSlot);
return null;
}
}
// 5. Calculate withdrawal amount
int amountToWithdraw = consolidatedStack == null ? itemToFind.getMaxStackSize()
: itemToFind.getMaxStackSize() - consolidatedStack.stackSize;
if (amountToWithdraw <= 0) {
return null;
}
// Create an IAEItemStack for the target block with the calculated amount
ItemStack targetItemStack = itemToFind.copy();
targetItemStack.stackSize = amountToWithdraw;
IAEItemStack targetAeItemStack = AEApi.instance().storage().createItemStack(targetItemStack);
if (targetAeItemStack == null) {
return null;
}
// 6. Extract items from the network
PlayerSource source = new PlayerSource(player, null);
IAEStack<?> extractedStack = terminalInventory.extractItems(targetAeItemStack, Actionable.MODULATE, source);
if (extractedStack instanceof IAEItemStack extractedAeItemStack && extractedStack.getStackSize() > 0) {
ItemStack itemsToGive = extractedAeItemStack.getItemStack();
// Update the player's inventory with the withdrawn items
if (itemsToGive != null && itemsToGive.stackSize > 0) {
if (consolidatedStack == null) {
player.inventory.setInventorySlotContents(nextEmptySlot, itemsToGive);
} else {
consolidatedStack.stackSize += itemsToGive.stackSize;
}
player.inventory.markDirty();
}
}
// If the target stack is already in the player's hotbar, set that as the active slot.
// Otherwise, move the target stack to the active slot.
// The slot to swap will have either been a consolidated stack of partial ItemStacks,
// or it will have been a newly created ItemStack in the next empty slot.
int slotToSwap = consolidatedStack == null ? nextEmptySlot : consolidatedStackSlot;
PlayerInventoryUtil.setSlotAsActiveSlot(player, slotToSwap);
return null; // No reply packet needed
}
@SuppressWarnings("unchecked")
private IMEInventoryHandler<IAEItemStack> getWirelessInventory(EntityPlayerMP player) {
ImmutablePair<Integer, ItemStack> terminalAndInventorySlot = Util.getWirelessTerminal(player);
ItemStack wctTerminal = null;
if (terminalAndInventorySlot == null) {
// Secondary check, does the player have a WirelessCraftingTerminal terminal
// Why is this mod still in GTNH ;-;
wctTerminal = RandomUtils.getWirelessTerm(player.inventory);
if (wctTerminal == null) {
return null;
}
}
IMEInventoryHandler<IAEItemStack> inventoryHandler;
if (wctTerminal != null) {
inventoryHandler = ContainerWirelessCraftingTerminal.getGuiObject(
wctTerminal,
player,
player.worldObj,
(int) player.posX,
(int) player.posY,
(int) player.posZ).getItemInventory();
} else {
ItemStack terminalItemStack = terminalAndInventorySlot.getRight();
if (terminalItemStack == null) {
return null;
}
// Obtain the inventory handler for the AE2 wireless terminal.
//
// We can safely suppress this warning, as we are the one providing the storage type in
// the function call.
inventoryHandler = (IMEInventoryHandler<IAEItemStack>) Util
.getWirelessInv(terminalItemStack, player, StorageChannel.ITEMS);
}
return inventoryHandler;
}
}
}
@@ -91,7 +91,7 @@ public class CPacketSwitchGuis implements IMessage {
}
} else {
if (cont instanceof AEBaseContainer aeBaseContainer) {
final PrimaryGui pGui = aeBaseContainer.createPrimaryGui();
final PrimaryGui pGui = aeBaseContainer.getPrimaryGui();
ContainerOpenContext context = aeBaseContainer.getOpenContext();
if (context == null) return null;
TileEntity te = context.getTile();
@@ -412,9 +412,12 @@ public class DualityFluidInterface implements IGridTickable, IStorageMonitorable
IAEFluidStack remove;
if (doFill) {
remove = fluidGrid.injectItems(AEFluidStack.create(resource), Actionable.MODULATE, this.mySource);
if (remove == null) {} else {
if (remove == null) {
onStackReturnedToNetwork(resource);
} else {
FluidStack copy = resource.copy();
copy.amount -= (int) remove.getStackSize();
onStackReturnedToNetwork(copy);
}
} else {
remove = fluidGrid.injectItems(AEFluidStack.create(resource), Actionable.SIMULATE, this.mySource);
@@ -447,6 +450,10 @@ public class DualityFluidInterface implements IGridTickable, IStorageMonitorable
return this.tanks.getTankInfo(from);
}
private void onStackReturnedToNetwork(FluidStack fluidStack) {
this.iHost.getInterfaceDuality().onStackReturnedToNetwork(ItemFluidDrop.newAeStack(fluidStack));
}
private static class InterfaceInventory extends MEMonitorIFluidHandler {
InterfaceInventory(DualityFluidInterface tileInterface) {
@@ -10,6 +10,7 @@ import com.glodblock.github.FluidCraft;
public class NameConst {
public static final String BLOCK_CERTUS_QUARTZ_TANK = "certus_quartz_tank";
public static final String BLOCK_FLUID_DISCRETIZER = "fluid_discretizer";
public static final String BLOCK_FLUID_PATTERN_ENCODER = "fluid_pattern_encoder";
public static final String BLOCK_FLUID_PACKET_DECODER = "fluid_packet_decoder";
public static final String BLOCK_FLUID_INTERFACE = "fluid_interface";
@@ -74,6 +75,8 @@ public class NameConst {
public static final String TT_FLUID_PACKET_DECODER = TT_KEY + "fluid_packet_decoder.";
public static final String TT_FLUID_PACKET_DECODER_DESC = TT_FLUID_PACKET_DECODER + "desc";
public static final String TT_FLUID_BUFFER_DESC = TT_FLUID_BUFFER + "desc";
public static final String TT_FLUID_DISCRETIZER = TT_KEY + "discretizer.";
public static final String TT_FLUID_DISCRETIZER_DESC = TT_FLUID_DISCRETIZER + "desc";
public static final String TT_LEVEL_MAINTAINER = TT_KEY + "level_maintainer.";
public static final String TT_LEVEL_MAINTAINER_DESC = TT_LEVEL_MAINTAINER + "desc";
public static final String TT_LEVEL_MAINTAINER_WHO_AM_I = TT_LEVEL_MAINTAINER + "Who_Am_I";
@@ -0,0 +1,105 @@
package com.glodblock.github.util;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.network.play.server.S09PacketHeldItemChange;
public class PlayerInventoryUtil {
/**
* Finds the first empty slot in the player's inventory, searching in reverse order (from the last slot to the
* first). This prioritizes filling the inventory from the end, which helps keep commonly accessed hotbar slots
* free.
*
* @param inventory The player's inventory to search.
* @return The index of the first empty slot found (searching backwards), or -1 if the inventory is full.
*/
public static int getFirstEmptyStackReverse(InventoryPlayer inventory) {
for (int i = inventory.mainInventory.length - 1; i >= 0; --i) {
if (inventory.mainInventory[i] == null) {
return i;
}
}
return -1;
}
/**
* Sets the specified inventory slot as the player's active (held) slot. If the target slot is in the hotbar (slots
* 0-8), it directly selects that hotbar slot. If the target slot is outside the hotbar, it swaps the contents of
* that slot with the current active slot.
*
* @param player The player whose active slot should be changed.
* @param slot The inventory slot index to make active (0-8 for hotbar, 9+ for main inventory).
*/
public static void setSlotAsActiveSlot(EntityPlayerMP player, int slot) {
if (slot >= 0 && slot <= 8) {
player.inventory.currentItem = slot;
player.playerNetServerHandler.sendPacket(new S09PacketHeldItemChange(slot));
} else {
swapInventorySlots(player.inventory, player.inventory.currentItem, slot);
}
player.inventory.markDirty();
}
/**
* Moves an ItemStack from a source slot to a destination slot in the player's inventory. If the destination slot is
* occupied, the items are swapped.
*
* @param inventory The player's inventory.
* @param slot1 The index of the first ItemStack to move.
* @param slot2 The index of the second ItemStack to move.
*/
public static void swapInventorySlots(InventoryPlayer inventory, int slot1, int slot2) {
if (slot1 == slot2) {
return;
}
// Get the stacks from both slots
ItemStack sourceStack = inventory.getStackInSlot(slot1);
ItemStack destinationStack = inventory.getStackInSlot(slot2);
// Set the destination slot with the source stack (even if it's null)
inventory.setInventorySlotContents(slot2, sourceStack);
// Set the source slot with the original destination stack
inventory.setInventorySlotContents(slot1, destinationStack);
// Mark the inventory as dirty to ensure changes are saved and synced
inventory.markDirty();
}
/**
* Consolidate ItemStacks from a source slot to a destination slot in the player's inventory.
*
* @param inventory The player's inventory.
* @param sourceSlot The index of the slot to move the item from.
* @param destinationSlot The index of the slot to move the item to.
*/
public static void consolidateItemStacks(InventoryPlayer inventory, int sourceSlot, int destinationSlot) {
ItemStack sourceStack = inventory.getStackInSlot(sourceSlot);
ItemStack destinationStack = inventory.getStackInSlot(destinationSlot);
if (!sourceStack.isItemEqual(destinationStack)
|| !ItemStack.areItemStackTagsEqual(sourceStack, destinationStack)) {
return;
}
int missingQuantity = destinationStack.getMaxStackSize() - destinationStack.stackSize;
if (missingQuantity >= sourceStack.stackSize) {
destinationStack.stackSize = destinationStack.stackSize + sourceStack.stackSize;
sourceStack = null;
} else {
sourceStack.stackSize -= missingQuantity;
destinationStack.stackSize += missingQuantity;
}
// Update the inventory stacks
inventory.setInventorySlotContents(destinationSlot, destinationStack);
inventory.setInventorySlotContents(sourceSlot, sourceStack);
// Mark the inventory as dirty to ensure changes are saved and synced
inventory.markDirty();
}
}
@@ -202,6 +202,32 @@ public final class Util {
}
}
public static ImmutablePair<Integer, ItemStack> getWirelessTerminal(EntityPlayer player) {
// Check player inventory for the wireless terminal.
int inventorySize = player.inventory.getSizeInventory();
for (int i = 0; i < inventorySize; ++i) {
ItemStack is = player.inventory.getStackInSlot(i);
if (is != null && is.getItem() instanceof ToolWirelessTerminal) {
return new ImmutablePair<>(GuiHelper.encodeType(i, GuiHelper.InvType.PLAYER_BAUBLES), is);
}
}
if (isBaublesLoaded) {
IInventory handler = BaublesApi.getBaubles(player);
if (handler != null) {
int baubleSlotCount = handler.getSizeInventory();
for (int i = 0; i < baubleSlotCount; ++i) {
ItemStack is = handler.getStackInSlot(i);
if (is != null && is.getItem() instanceof ToolWirelessTerminal) {
return new ImmutablePair<>(GuiHelper.encodeType(i, GuiHelper.InvType.PLAYER_BAUBLES), is);
}
}
}
}
return null;
}
public static ImmutablePair<Integer, ItemStack> getUltraWirelessTerm(EntityPlayer player) {
int invSize = player.inventory.getSizeInventory();
@@ -15,7 +15,7 @@ item.part_level_terminal.name=ME Level Terminal
item.portable_fluid_cell.name=Portable Fluid Cell
item.wireless_fluid_terminal.name=Wireless Fluid Terminal
item.wireless_level_terminal.name=Wireless Level Terminal
item.wireless_fluid_pattern_terminal.name=Wireless Pattern Terminal
item.wireless_fluid_pattern_terminal.name=Wireless Fluid Pattern Terminal
item.wireless_interface_terminal.name=Wireless Interface Terminal
item.wireless_ultra_terminal.name=Universal Wireless Terminal
item.wireless_ultra_terminal.CRAFTING.name=Universal Wireless Terminal - Crafting
@@ -63,6 +63,7 @@ item.fluid_storage_housing.1.name=ME Advanced Fluid Storage Housing
item.fluid_storage_housing.2.name=ME Multi-Fluid Storage Housing
item.fluid_storage_housing.3.name=ME Advanced Multi-Fluid Storage Housing
tile.fluid_discretizer.name=Fluid Discretizer
tile.fluid_pattern_encoder.name=Fluid Pattern Encoder
tile.fluid_packet_decoder.name=ME Fluid Packet Decoder
tile.fluid_interface.name=ME Dual Interface
@@ -84,6 +85,7 @@ ae2fc.waila.disable=Disable
ae2fc.tooltip.shift_for_more=§r> Hold §3Shift§r for more information
ae2fc.tooltip.ctrl_for_more=§r> Hold §3Ctrl§r for more information
ae2fc.tooltip.fluid_packet_decoder.desc=The Fluid Decoder can decode Fluid packets. It has to be connected to a ME System and a place to store the liquid in otherwise it won't work.
ae2fc.tooltip.discretizer.desc=When the ME Fluid Discretizer is attached to your ME System, it will represent the Fluids that are stored in your ME Fluid Storage Cells (Or Storage bus) as drops. They will be the item equivalent of fluids. Its just another way to show fluids, it won't actually convert your fluids to items.
ae2fc.tooltip.fluid_buffer.desc=This is a high speed fluid IO
ae2fc.tooltip.walrus.desc=GTNH is like a job
ae2fc.tooltip.fluid_auto_filler=Creates fluid canning pattern with given container automatically.
@@ -219,12 +221,8 @@ ae2fc.gui.color.StateError=FFFF5555
error.unknown=Unknown
ae2fc.key.OpenTerminal=Open Wireless Universal Terminal
ae2fc.key.OpenCraftingTerminal=Open Wireless Universal Crafting Terminal
ae2fc.key.OpenLevelTerminal=Open Wireless Universal Level Terminal
ae2fc.key.OpenInterfaceTerminal=Open Wireless Universal Interface Terminal
ae2fc.key.OpenPatternTerminal=Open Wireless Universal Pattern Terminal
ae2fc.key.OpenPatternExTerminal=Open Wireless Universal Processing Pattern Terminal
ae2fc.key.Restock=Toggle Restock
ae2fc.key.PickBlock=AE2 Pick Block
itemGroup.ae2fc=Fluid Craft For AE2
Binary file not shown.

Before

Width:  |  Height:  |  Size: 609 B

After

Width:  |  Height:  |  Size: 581 B