Compare commits

..
Author SHA1 Message Date
lc-1337 f3c3a81681 Use bigger inventory (#395) 2026-01-17 09:35:58 +01:00
lc-1337 1ea9b2e410 Fix replenisher void (#394) 2026-01-16 18:34:26 +01:00
Kogepan229 cf189f00a3 Revert part of "remove transformers (#389)" (#393) 2026-01-16 17:13:56 +01:00
UltraProdigy a121342a4b Change Artificial Universe Fluid Cell to 63 Types (#392) 2026-01-16 13:41:36 +01:00
lc-1337 e62215f02b remove transformers (#389) 2026-01-15 08:06:47 +01:00
danyadevandgithub-actions[bot] f4c6d8a3f0 fix NPE when trying to drain a tank in a tank tower (#390)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-01-13 11:54:36 -05:00
Ranzu 72a068b6d6 Fixed Level Maintainer FCGuiLineField and texture (#387) 2026-01-08 12:12:49 +00:00
Maya 58cdd446a7 Allow using inverter card on fluid cells (#388) 2026-01-08 13:08:46 +01:00
Martin Robertz af032179f6 fix for new ae2 dep 2026-01-01 19:41:53 +01:00
Martin Robertz 9732625ced update bs+deps+gradle 2026-01-01 19:31:26 +01:00
Ranzu f23d792b91 Updated Super Stock Replenisher block texture (#386) 2026-01-01 16:57:36 +01:00
hiroscho f6c3227cd9 Fix import/export bus issues (#384) 2025-12-22 15:35:07 +00:00
lc-1337 20f03a8e9f fix certus tank update spam 2.8 2.9 (#385) 2025-12-22 15:21:29 +00:00
Kogepan229andgithub-actions[bot] 341f1d9236 Adapt to AE2 slot rendering refactor (#380)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-12-22 13:15:50 +01:00
danyadev 0f68feb0be fix draining simulation actually perform drain (#383) 2025-12-21 23:45:54 +01:00
Kogepan229andMartin Robertz 300bb445e2 Fix primary gui (#382)
Co-authored-by: Martin Robertz <[email protected]>
2025-12-20 10:12:10 +00:00
iR3turnZandiR3turnZ 4cf54e7658 Add keybinds for every universal terminal (#379)
Co-authored-by: iR3turnZ <[email protected]>
2025-12-17 07:12:37 +00:00
95dad4d305 allow draining tank tower from an empty tank above (#359)
Co-authored-by: Martin Robertz <[email protected]>
Co-authored-by: boubou19 <[email protected]>
2025-12-16 19:08:46 +00:00
30 changed files with 196 additions and 128 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.40-GTNH:dev')
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-754-GTNH:dev')
api('com.github.GTNewHorizons:NotEnoughItems:2.8.48-GTNH:dev')
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-775-GTNH:dev')
api('curse.maven:cofh-core-69162:2388751')
api('com.github.GTNewHorizons:waila:1.9.15:dev')
api("com.github.GTNewHorizons:GTNHLib:0.8.29:dev")
api("com.github.GTNewHorizons:GTNHLib:0.8.41:dev")
implementation("com.github.GTNewHorizons:WirelessCraftingTerminal:1.12.10:dev") {
implementation("com.github.GTNewHorizons:WirelessCraftingTerminal:1.12.12:dev") {
exclude group: 'com.github.GTNewHorizons', module: 'Applied-Energistics-2-Unofficial'
}
compileOnly('com.github.GTNewHorizons:Baubles-Expanded:2.2.4-GTNH:dev')
compileOnly('com.github.GTNewHorizons:Baubles-Expanded:2.2.6-GTNH:dev')
compileOnly('com.github.GTNewHorizons:ExtraCells2:2.5.35:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:ForestryMC:4.11.2:dev')
compileOnly('com.github.GTNewHorizons:EnderIO:2.10.8:dev')
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.52.138:dev') {
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') {
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.6-GTNH:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.7.16-GTNH: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 }
runtimeOnlyNonPublishable("com.github.GTNewHorizons:DuraDisplay:1.4.0:dev")
}
+7
View File
@@ -43,6 +43,10 @@ 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
@@ -209,3 +213,6 @@ 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
@@ -0,0 +1,12 @@
#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-8.14.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Vendored
+1 -4
View File
@@ -1,7 +1,7 @@
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
# Copyright © 2015 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,7 +114,6 @@ case "$( uname )" in #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH="\\\"\\\""
# Determine the Java command to use to start the JVM.
@@ -172,7 +171,6 @@ 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" )
@@ -212,7 +210,6 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
"$@"
Vendored
+1 -2
View File
@@ -70,11 +70,10 @@ 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%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -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 '1.0.48'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.7'
}
@@ -1,10 +1,8 @@
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;
@@ -51,13 +49,6 @@ 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);
@@ -82,7 +82,7 @@ public class GuiLevelMaintainer extends GuiSub {
new GuiFCImgButton(guiLeft + 105 + 47, guiTop + 17 + 19 * i, "SUBMIT", "SUBMIT", false),
new GuiFCImgButton(guiLeft + 9, guiTop + 20 + 19 * i, "ENABLE", "ENABLE", false),
new GuiFCImgButton(guiLeft + 9, guiTop + 20 + 19 * i, "DISABLE", "DISABLE", false),
new FCGuiLineField(fontRendererObj, guiLeft + 47, guiTop + 33 + 19 * i, 125),
new FCGuiLineField(fontRendererObj, guiLeft + 47, guiTop + 33 + 19 * i, 120),
this.buttonList,
this.cont);
}
@@ -244,8 +244,7 @@ public class ContainerLevelTerminal extends FCBaseContainer {
}
@Override
public PrimaryGui getPrimaryGui() {
public PrimaryGui createPrimaryGui() {
ContainerOpenContext context = getOpenContext();
return new FluidPrimaryGui(
GuiType.LEVEL_TERMINAL,
@@ -22,8 +22,7 @@ public class ContainerLevelWireless extends ContainerLevelTerminal {
}
@Override
public PrimaryGui getPrimaryGui() {
public PrimaryGui createPrimaryGui() {
ContainerOpenContext context = getOpenContext();
return new FluidPrimaryGui(
GuiType.WIRELESS_LEVEL_TERMINAL,
@@ -172,8 +172,7 @@ public class ContainerSuperStockReplenisher extends AEBaseContainer
}
@Override
public PrimaryGui getPrimaryGui() {
public PrimaryGui createPrimaryGui() {
ContainerOpenContext context = getOpenContext();
return new FluidPrimaryGui(
GuiType.GUI_SUPER_STOCK_REPLENISHER,
@@ -33,7 +33,7 @@ public class PartFluidExportBus extends PartBaseExportBus<IAEFluidStack> {
@Override
protected int getAdaptorFlags() {
return InventoryAdaptor.DEFAULT & ~InventoryAdaptor.ALLOW_ITEMS;
return InventoryAdaptor.ALLOW_FLUIDS | InventoryAdaptor.FOR_INSERTS;
}
@Override
@@ -26,6 +26,7 @@ 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> {
@@ -97,13 +98,12 @@ 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, maxDrain));
FluidStack fluidStack = new FluidStack(
tankInfo.fluid,
Math.min(tankInfo.fluid.amount, this.itemToSend));
fluidStack = fh.drain(this.getSide().getOpposite(), fluidStack, false);
if (this.filterEnabled() && !this.isInFilter(fluidStack)) continue;
@@ -112,18 +112,16 @@ 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);
maxDrain -= aeFluidStack.getFluidStack().amount;
doBreak = false;
this.itemToSend -= aeFluidStack.getFluidStack().amount;
this.worked = true;
}
}
return doBreak;
}
return true;
}
@@ -173,4 +171,9 @@ public class PartFluidImportBus extends PartBaseImportBus<IAEFluidStack> {
}
}
}
@Override
protected int getAdaptorFlags() {
return InventoryAdaptor.ALLOW_FLUIDS | InventoryAdaptor.FOR_EXTRACTS;
}
}
@@ -33,42 +33,61 @@ public class TileCertusQuartzTank extends TileEntity implements IFluidHandler {
return tankFluid == null || tankFluid.amount == 0 ? 0 : tankFluid.getFluid().getLuminosity(tankFluid);
}
public FluidStack drain(FluidStack fluid, boolean doDrain, boolean findMainTank) {
if (fluid == null || this.getFluid() == null || this.getFluid() != fluid.getFluid()) {
public FluidStack drain(Fluid fluid, int amount, boolean doDrain, boolean findMainTank) {
if (fluid != null && this.getFluid() != fluid) {
return null;
}
if (findMainTank) {
// Main tank is the highest tank in the column with desired fluid
TileCertusQuartzTank mainTank = this;
TileCertusQuartzTank tankAbove;
while ((tankAbove = mainTank.getTankAbove()) != null) {
// We can't drain tank with different or null fluid
if (fluid.getFluid() != tankAbove.getFluid()) {
break;
if (this.tank.getFluid() != null) {
// Current tank has a fluid, searching for the highest tank with this fluid
TileCertusQuartzTank tankAbove;
while ((tankAbove = mainTank.getTankAbove()) != null) {
// We can't drain tank with different or null fluid
if (tankAbove.getFluid() == null || mainTank.getFluid() != tankAbove.getFluid()) {
break;
}
mainTank = tankAbove;
}
} else {
// Current tank doesn't have a fluid, searching for the first non-empty tank below
TileCertusQuartzTank tankBelow;
while ((tankBelow = mainTank.getTankBelow()) != null) {
// We can't drain tank with different fluid
if (fluid != null && tankBelow.getFluid() != fluid) {
break;
}
mainTank = tankBelow;
if (tankBelow.getFluid() != null) {
break;
}
}
mainTank = tankAbove;
}
return mainTank.drain(fluid, doDrain, false);
return mainTank.drain(fluid, amount, doDrain, false);
}
FluidStack drainedFluid = this.tank.drain(fluid.amount, doDrain);
if (this.getFluid() == null) {
return null;
}
FluidStack drainedFluid = this.tank.drain(amount, doDrain);
int drained = drainedFluid != null ? drainedFluid.amount : 0;
if (drained > 0) {
if (doDrain && drained > 0) {
update();
}
if (drained < fluid.amount) {
if (drained < amount) {
TileCertusQuartzTank tankBelow = this.getTankBelow();
if (tankBelow != null) {
FluidStack fluidToDrain = new FluidStack(fluid.getFluid(), fluid.amount - drained);
FluidStack externallyDrained = tankBelow.drain(fluidToDrain, doDrain, false);
FluidStack externallyDrained = tankBelow.drain(this.getFluid(), amount - drained, doDrain, false);
if (externallyDrained != null) {
return new FluidStack(fluid.getFluid(), drained + externallyDrained.amount);
return new FluidStack(this.getFluid(), drained + externallyDrained.amount);
}
}
}
@@ -78,14 +97,14 @@ public class TileCertusQuartzTank extends TileEntity implements IFluidHandler {
@Override
public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) {
return drain(resource, doDrain, true);
if (resource == null) return null;
return drain(resource.getFluid(), resource.amount, doDrain, true);
}
@Override
public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) {
if (this.tank.getFluid() == null) return null;
return drain(from, new FluidStack(this.tank.getFluid(), maxDrain), doDrain);
return drain(null, maxDrain, doDrain, true);
}
public int fill(FluidStack fluid, boolean doFill, boolean findMainTank) {
@@ -116,7 +135,7 @@ public class TileCertusQuartzTank extends TileEntity implements IFluidHandler {
int filled = this.tank.fill(fluid, doFill);
if (filled > 0) {
if (doFill && filled > 0) {
update();
}
@@ -174,14 +193,14 @@ public class TileCertusQuartzTank extends TileEntity implements IFluidHandler {
}
final FluidStack tankFluidStack = this.tank.getFluid();
final Fluid mainFluid = tankFluidStack != null ? tankFluidStack.getFluid() : null;
Fluid mainFluid = tankFluidStack != null ? tankFluidStack.getFluid() : null;
int amount = tankFluidStack == null ? 0 : tankFluidStack.amount;
int capacity = this.tank.getCapacity();
TileCertusQuartzTank tankAbove = this;
while ((tankAbove = tankAbove.getTankAbove()) != null) {
if (tankAbove.getFluid() == null || mainFluid != tankAbove.getFluid()) {
if (tankAbove.getFluid() != null && mainFluid != tankAbove.getFluid()) {
break;
}
@@ -192,7 +211,10 @@ public class TileCertusQuartzTank extends TileEntity implements IFluidHandler {
TileCertusQuartzTank tankBelow = this;
while ((tankBelow = tankBelow.getTankBelow()) != null) {
if (mainFluid == null || mainFluid != tankBelow.getFluid()) {
if (mainFluid == null && tankBelow.getFluid() != null) {
mainFluid = tankBelow.getFluid();
}
if (mainFluid != tankBelow.getFluid()) {
break;
}
@@ -49,6 +49,7 @@ import appeng.tile.events.TileEventType;
import appeng.tile.grid.AENetworkInvTile;
import appeng.tile.inventory.AppEngInternalAEInventory;
import appeng.tile.inventory.AppEngInternalInventory;
import appeng.tile.inventory.BiggerAppEngInventory;
import appeng.tile.inventory.InvOperation;
import appeng.util.item.AEFluidStack;
import appeng.util.item.AEItemStack;
@@ -58,7 +59,7 @@ public class TileSuperStockReplenisher extends AENetworkInvTile
implements IAEFluidInventory, IFluidHandler, IPowerChannelState, IGridTickable, ITerminalHost {
private final AppEngInternalInventory cell = new AppEngInternalInventory(this, 1);
private final AppEngInternalInventory invItems = new AppEngInternalInventory(this, 63);
private final BiggerAppEngInventory invItems = new BiggerAppEngInventory(this, 63);
private final AEFluidInventory invFluids = new AEFluidInventory(this, 9, Integer.MAX_VALUE);
private final AppEngInternalAEInventory configFluids = new AppEngInternalAEInventory(this, 9);
private final AppEngInternalAEInventory configItems = new AppEngInternalAEInventory(this, 63);
@@ -171,6 +172,8 @@ public class TileSuperStockReplenisher extends AENetworkInvTile
if (tempStack != null) {
tempStack.stackSize = tempStack.stackSize + (int) notInserted.getStackSize();
storedItemCount += notInserted.getStackSize();
saveChanges();
} else invItems.setInventorySlotContents(index, notInserted.getItemStack());
}
} catch (final GridAccessException ignored) {}
@@ -188,6 +191,8 @@ public class TileSuperStockReplenisher extends AENetworkInvTile
if (tempStack != null) {
tempStack.stackSize = tempStack.stackSize + (int) extracted.getStackSize();
storedItemCount += extracted.getStackSize();
saveChanges();
} else invItems.setInventorySlotContents(index, extracted.getItemStack());
}
} catch (final GridAccessException ignored) {}
@@ -295,8 +300,6 @@ public class TileSuperStockReplenisher extends AENetworkInvTile
} catch (GridAccessException e) {
AELog.error(e, "Couldn't wake up level emitter for delayed updates");
}
markForUpdate();
}
public void fullRefund() {
@@ -365,7 +368,6 @@ public class TileSuperStockReplenisher extends AENetworkInvTile
@Override
public void onFluidInventoryChanged(IAEFluidTank inv, int slot) {
saveChanges();
markForUpdate();
}
@Override
@@ -31,9 +31,6 @@ public class NEITransformer extends FCClassTransformer.ClassMapper {
case "getStackUnderMouse" -> new TransformStackUnderMouse(
api,
super.visitMethod(access, name, desc, signature, exceptions));
case "shouldShowTooltip" -> new TransformShowTooltip(
api,
super.visitMethod(access, name, desc, signature, exceptions));
default -> super.visitMethod(access, name, desc, signature, exceptions);
};
}
@@ -62,32 +59,4 @@ public class NEITransformer extends FCClassTransformer.ClassMapper {
super.visitInsn(opcode);
}
}
private static class TransformShowTooltip extends MethodVisitor {
int const_1 = 0;
TransformShowTooltip(int api, MethodVisitor mv) {
super(api, mv);
}
@Override
public void visitInsn(int opcode) {
if (opcode == Opcodes.ICONST_1 && const_1 == 2) {
super.visitVarInsn(Opcodes.ALOAD, 1);
super.visitMethodInsn(
Opcodes.INVOKESTATIC,
"com/glodblock/github/coremod/hooker/CoreModHooks",
"shouldShowTooltip",
"(Lnet/minecraft/client/gui/inventory/GuiContainer;)Z",
false);
const_1++;
return;
}
if (opcode == Opcodes.ICONST_1) {
const_1++;
}
super.visitInsn(opcode);
}
}
}
@@ -20,9 +20,11 @@ public class CertusQuartzTankWailaDataProvider extends BaseWailaDataProvider {
TileEntity tileEntity = accessor.getTileEntity();
if (tileEntity instanceof TileCertusQuartzTank quartzTank) {
FluidTankInfo info = quartzTank.getTankInfo(true)[0];
if (info.fluid != null) {
currentToolTip
.add(Tooltip.fluidFormat(info.fluid.getLocalizedName(), info.fluid.amount, info.capacity));
if (info.fluid == null) {
currentToolTip.add(Tooltip.tankEmptyFormat(info.capacity));
} else {
currentToolTip.add(
Tooltip.tankWithFluidFormat(info.fluid.getLocalizedName(), info.fluid.amount, info.capacity));
}
}
return currentToolTip;
@@ -15,14 +15,18 @@ public class Tooltip {
return String.format("%s: %s mB", name, NumberFormat.getInstance().format(amount));
}
public static String fluidFormat(String name, long amount, long capacity) {
public static String tankWithFluidFormat(String fluidName, long amount, long capacity) {
return String.format(
"%s: %s mB / %s mB",
name,
fluidName,
NumberFormat.getInstance().format(amount),
NumberFormat.getInstance().format(capacity));
}
public static String tankEmptyFormat(long capacity) {
return String.format("0 mB / %s mB", NumberFormat.getInstance().format(capacity));
}
public static String partFluidBusFormat(int amount) {
return String
.format("%s: %s mB/t", I18n.format(NameConst.WAILA_SPEED), NumberFormat.getInstance().format(amount));
@@ -137,7 +137,7 @@ public class ItemAndBlockHolder {
NameConst.ITEM_ARTIFICIAL_UNIVERSE_STORAGE,
Long.MAX_VALUE / 2048,
16384,
5,
63,
600000D).register();
public static ItemFluidVoidStorageCell FLUID_VOID_CELL = new ItemFluidVoidStorageCell().register();
public static ItemCreativeFluidStorageCell CREATIVE_CELL = new ItemCreativeFluidStorageCell().register();
@@ -9,8 +9,10 @@ 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.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;
@@ -24,13 +26,43 @@ 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;
@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");
ClientRegistry.registerKeyBinding(openTerminal);
ClientRegistry.registerKeyBinding(openCraftingTerminal);
ClientRegistry.registerKeyBinding(openLevelTerminal);
ClientRegistry.registerKeyBinding(openInterfaceTerminal);
ClientRegistry.registerKeyBinding(openPatternTerminal);
ClientRegistry.registerKeyBinding(openPatternExTerminal);
ClientRegistry.registerKeyBinding(restock);
FMLCommonHandler.instance().bus().register(this);
}
@@ -38,29 +70,40 @@ public class KeybindLoader implements Runnable {
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onKeyInput(InputEvent.KeyInputEvent event) {
if (openTerminal.isPressed()) {
handleOpenTerminalKey();
} else if (restock.isPressed()) {
handleRestockKey();
}
handleKeybindings();
}
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onMouseInput(InputEvent.MouseInputEvent event) {
handleKeybindings();
}
private void handleKeybindings() {
if (openTerminal.isPressed()) {
handleOpenTerminalKey();
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);
} else if (restock.isPressed()) {
handleRestockKey();
}
}
private void handleOpenTerminalKey() {
private void handleOpenTerminalKey(UltraTerminalModes mode) {
if (Minecraft.getMinecraft().currentScreen != null) return;
EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
ImmutablePair<Integer, ItemStack> temp = Util.getUltraWirelessTerm(player);
if (temp == null) return;
FluidCraft.proxy.netHandler.sendToServer(new CPacketSwitchGuis(null, true));
if (mode != null) ItemWirelessUltraTerminal.setMode(temp.getRight(), mode);
FluidCraft.proxy.netHandler.sendToServer(new CPacketSwitchGuis(mode, true));
}
private void handleRestockKey() {
@@ -115,7 +115,7 @@ public class CPacketFluidPatternTermBtns implements IMessage {
}
}
case MAGNET_OPEN_FILTER -> {
final PrimaryGui pGui = abc.getPrimaryGui();
final PrimaryGui pGui = abc.createPrimaryGui();
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.getPrimaryGui();
final PrimaryGui pGui = abc.createPrimaryGui();
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.getPrimaryGui();
final PrimaryGui pGui = abc.createPrimaryGui();
TileEntity tile = DimensionManager.getWorld(message.dim)
.getTileEntity(message.x, message.y, message.z);
@@ -91,7 +91,7 @@ public class CPacketSwitchGuis implements IMessage {
}
} else {
if (cont instanceof AEBaseContainer aeBaseContainer) {
final PrimaryGui pGui = aeBaseContainer.getPrimaryGui();
final PrimaryGui pGui = aeBaseContainer.createPrimaryGui();
ContainerOpenContext context = aeBaseContainer.getOpenContext();
if (context == null) return null;
TileEntity te = context.getTile();
@@ -168,6 +168,28 @@ public class CommonProxy {
Upgrades.DISTRIBUTION.registerItem(new ItemStack(ItemAndBlockHolder.CELL4096KM), 1);
Upgrades.DISTRIBUTION.registerItem(new ItemStack(ItemAndBlockHolder.CELL16384KM), 1);
Upgrades.INVERTER.registerItem(new ItemStack(ItemAndBlockHolder.FLUID_VOID_CELL), 1);
Upgrades.INVERTER.registerItem(new ItemStack(ItemAndBlockHolder.CELL1K), 1);
Upgrades.INVERTER.registerItem(new ItemStack(ItemAndBlockHolder.CELL4K), 1);
Upgrades.INVERTER.registerItem(new ItemStack(ItemAndBlockHolder.CELL16K), 1);
Upgrades.INVERTER.registerItem(new ItemStack(ItemAndBlockHolder.CELL64K), 1);
Upgrades.INVERTER.registerItem(new ItemStack(ItemAndBlockHolder.CELL256K), 1);
Upgrades.INVERTER.registerItem(new ItemStack(ItemAndBlockHolder.CELL1024K), 1);
Upgrades.INVERTER.registerItem(new ItemStack(ItemAndBlockHolder.CELL4096K), 1);
Upgrades.INVERTER.registerItem(new ItemStack(ItemAndBlockHolder.CELL16384K), 1);
Upgrades.INVERTER.registerItem(new ItemStack(ItemAndBlockHolder.QUANTUM_CELL), 1);
Upgrades.INVERTER.registerItem(new ItemStack(ItemAndBlockHolder.SINGULARITY_CELL), 1);
Upgrades.INVERTER.registerItem(new ItemStack(ItemAndBlockHolder.CELL1KM), 1);
Upgrades.INVERTER.registerItem(new ItemStack(ItemAndBlockHolder.CELL4KM), 1);
Upgrades.INVERTER.registerItem(new ItemStack(ItemAndBlockHolder.CELL16KM), 1);
Upgrades.INVERTER.registerItem(new ItemStack(ItemAndBlockHolder.CELL64KM), 1);
Upgrades.INVERTER.registerItem(new ItemStack(ItemAndBlockHolder.CELL256KM), 1);
Upgrades.INVERTER.registerItem(new ItemStack(ItemAndBlockHolder.CELL1024KM), 1);
Upgrades.INVERTER.registerItem(new ItemStack(ItemAndBlockHolder.CELL4096KM), 1);
Upgrades.INVERTER.registerItem(new ItemStack(ItemAndBlockHolder.CELL16384KM), 1);
Upgrades.INVERTER.registerItem(new ItemStack(ItemAndBlockHolder.ARTIFICIAL_UNIVERSE_CELL), 1);
Upgrades.FAKE_CRAFTING.registerItem(new ItemStack(ItemAndBlockHolder.FLUID_INTERFACE), 1);
Upgrades.FAKE_CRAFTING.registerItem(new ItemStack(ItemAndBlockHolder.INTERFACE), 1);
Upgrades.FAKE_CRAFTING.registerItem(new ItemStack(ItemAndBlockHolder.FLUID_INTERFACE_P2P), 1);
@@ -412,12 +412,9 @@ public class DualityFluidInterface implements IGridTickable, IStorageMonitorable
IAEFluidStack remove;
if (doFill) {
remove = fluidGrid.injectItems(AEFluidStack.create(resource), Actionable.MODULATE, this.mySource);
if (remove == null) {
onStackReturnedToNetwork(resource);
} else {
if (remove == null) {} else {
FluidStack copy = resource.copy();
copy.amount -= (int) remove.getStackSize();
onStackReturnedToNetwork(copy);
}
} else {
remove = fluidGrid.injectItems(AEFluidStack.create(resource), Actionable.SIMULATE, this.mySource);
@@ -450,10 +447,6 @@ 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) {
@@ -219,6 +219,11 @@ 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
itemGroup.ae2fc=Fluid Craft For AE2
Binary file not shown.

Before

Width:  |  Height:  |  Size: 581 B

After

Width:  |  Height:  |  Size: 609 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB