mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-23 05:19:49 +00:00
Compare commits
25
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1706b5a8da | ||
|
|
d89808dc0b | ||
|
|
e7effee580 | ||
|
|
869613ae31 | ||
|
|
6bec3e7e3a | ||
|
|
c251372e95 | ||
|
|
5315b79c70 | ||
|
|
23d2142084 | ||
|
|
049156e63e | ||
|
|
3d445d7988 | ||
|
|
79648a17b5 | ||
|
|
965d3d9db6 | ||
|
|
8d7bde168d | ||
|
|
2352510223 | ||
|
|
5f9c1b236e | ||
|
|
3f5903aad4 | ||
|
|
10cd1d50ab | ||
|
|
7014b7eaca | ||
|
|
e50d549085 | ||
|
|
f381726ef2 | ||
|
|
c1de99049c | ||
|
|
31533e96df | ||
|
|
7124e812d1 | ||
|
|
edac0cdec6 | ||
|
|
3b67b77572 |
No files matched your search
+10
-10
@@ -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.100-GTNH:dev')
|
||||
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-971-GTNH:dev')
|
||||
api('com.github.GTNewHorizons:waila:1.19.29:dev')
|
||||
api("com.github.GTNewHorizons:GTNHLib:0.11.4:dev")
|
||||
api('com.github.GTNewHorizons:NotEnoughItems:2.8.121-GTNH:dev')
|
||||
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-1040-GTNH:dev')
|
||||
api('com.github.GTNewHorizons:waila:1.19.31:dev')
|
||||
api("com.github.GTNewHorizons:GTNHLib:0.11.37:dev")
|
||||
|
||||
compileOnly('com.github.GTNewHorizons:Baubles-Expanded:2.2.21-GTNH:dev')
|
||||
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.60:dev') {transitive = false}
|
||||
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:ExtraCells2:2.5.35:dev') { transitive = false }
|
||||
compileOnly('com.github.GTNewHorizons:ForestryMC:4.11.26:dev')
|
||||
compileOnly('com.github.GTNewHorizons:EnderIO:2.10.29:dev')
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.12.44-GTNH: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("org.jetbrains:annotations:26.1.0")
|
||||
|
||||
runtimeOnlyNonPublishable("com.github.GTNewHorizons:DuraDisplay:1.4.2:dev")
|
||||
runtimeOnlyNonPublishable("com.github.GTNewHorizons:DuraDisplay:1.4.4:dev")
|
||||
runtimeOnlyNonPublishable("com.github.GTNewHorizons:WirelessCraftingTerminal:1.12.16:dev") {
|
||||
exclude group: 'com.github.GTNewHorizons', module: 'Applied-Energistics-2-Unofficial'
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#This file is generated by updateDaemonJvm
|
||||
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/cf726b4a1c84b50457225f9bba6d7650/redirect
|
||||
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/fa1e318c287360478e3c83a9a3ef1007/redirect
|
||||
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/cf726b4a1c84b50457225f9bba6d7650/redirect
|
||||
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/fa1e318c287360478e3c83a9a3ef1007/redirect
|
||||
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c2dd35c9d0aaf0ba6ad0791320f99dfc/redirect
|
||||
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/e5810bd7fd1f8a586644409d395a7e55/redirect
|
||||
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/cf726b4a1c84b50457225f9bba6d7650/redirect
|
||||
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/fa1e318c287360478e3c83a9a3ef1007/redirect
|
||||
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/7b3c4877c0749019e6805bb61e421497/redirect
|
||||
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/d76df094a9cbbabd3b08251f9e61444a/redirect
|
||||
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
|
||||
toolchainVersion=25
|
||||
+1
-1
@@ -17,7 +17,7 @@ pluginManagement {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.24'
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.29'
|
||||
}
|
||||
|
||||
|
||||
@@ -10,8 +10,10 @@ import com.glodblock.github.loader.ChannelLoader;
|
||||
import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.loader.RecipeLoader;
|
||||
import com.glodblock.github.proxy.CommonProxy;
|
||||
import com.glodblock.github.util.FluidCellHandler;
|
||||
import com.glodblock.github.util.ModAndClassUtil;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
@@ -60,7 +62,7 @@ public class FluidCraft {
|
||||
@Mod.EventHandler
|
||||
public static void postInit(FMLPostInitializationEvent event) {
|
||||
NetworkRegistry.INSTANCE.registerGuiHandler(FluidCraft.INSTANCE, new InventoryHandler());
|
||||
|
||||
AEApi.instance().registries().cell().addCellHandler(new FluidCellHandler());
|
||||
ItemAndBlockHolder.loadSetting();
|
||||
|
||||
if (!Config.removeRecipe) {
|
||||
|
||||
@@ -215,7 +215,7 @@ public class UltraTerminalButtons implements ICustomButtonDataObject {
|
||||
public void readData(NBTTagCompound tag) {
|
||||
this.reStock = tag.getBoolean(restockItems);
|
||||
this.magnetMode = WirelessMagnet.Mode.values()[tag.getInteger(modeKey)];
|
||||
this.terminalMode = UltraTerminalModes.values()[tag.getInteger(MODE)];
|
||||
this.terminalMode = UltraTerminalModes.VALUES[tag.getInteger(MODE)];
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -229,7 +229,8 @@ public class UltraTerminalButtons implements ICustomButtonDataObject {
|
||||
public void readByte(ByteBuf buf) {
|
||||
this.reStock = buf.readBoolean();
|
||||
this.magnetMode = WirelessMagnet.Mode.values()[buf.readInt()];
|
||||
this.terminalMode = UltraTerminalModes.values()[buf.readInt()];
|
||||
this.terminalMode = UltraTerminalModes.VALUES[buf.readInt()];
|
||||
ItemWirelessUltraTerminal.setMode(this.terminal, this.terminalMode);
|
||||
|
||||
toggleMagnetButtonsVisibility();
|
||||
toggleRestockVisibility();
|
||||
|
||||
@@ -67,6 +67,8 @@ public class GuiFCImgButton extends GuiButton implements ITooltip {
|
||||
this.registerApp(22, "SWITCH", "DISABLE", "disable");
|
||||
this.registerApp(23, "OPEN_GUI", "YES", "open_gui");
|
||||
this.registerApp(24, "HIGHLIGHT", "YES", "block_highlight");
|
||||
this.registerApp(26, "stock mode button", "normalMode", "Normal.mode");
|
||||
this.registerApp(27, "stock mode button", "fullstockMode", "Full-stock.mode");
|
||||
this.registerApp(30, "MAGNET_CARD", "INV", "magnet_card.inv");
|
||||
this.registerApp(30, "MAGNET_CARD", "ME", "magnet_card.me");
|
||||
this.registerApp(30, "MAGNET_CARD", "FILTER", "magnet_card.filter");
|
||||
|
||||
@@ -29,6 +29,8 @@ import appeng.api.storage.data.IAEStackType;
|
||||
import appeng.client.gui.GuiSub;
|
||||
import appeng.client.gui.slots.VirtualMEPhantomSlot;
|
||||
import appeng.client.gui.widgets.GuiTabButton;
|
||||
import appeng.client.gui.widgets.GuiToggleButton;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.util.calculators.ArithHelper;
|
||||
import appeng.util.calculators.Calculator;
|
||||
|
||||
@@ -40,6 +42,7 @@ public class GuiLevelMaintainer extends GuiSub {
|
||||
private final MouseRegionManager mouseRegions = new MouseRegionManager(this);
|
||||
private Widget focusedWidget;
|
||||
private final FontRenderer render;
|
||||
private GuiToggleButton liteMode;
|
||||
|
||||
public GuiLevelMaintainer(InventoryPlayer ipl, TileLevelMaintainer tile) {
|
||||
super(new ContainerLevelMaintainer(ipl, tile));
|
||||
@@ -88,6 +91,15 @@ public class GuiLevelMaintainer extends GuiSub {
|
||||
this.buttonList,
|
||||
this.cont);
|
||||
}
|
||||
this.buttonList.add(
|
||||
this.liteMode = new GuiToggleButton(
|
||||
guiLeft - 18,
|
||||
guiTop + 2,
|
||||
178,
|
||||
194,
|
||||
GuiText.CraftingModeLite.getLocal(),
|
||||
NameConst.TT_LEVEL_MAINTAINER_LITE_CRAFT_DESC));
|
||||
this.liteMode.setState(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -131,19 +143,15 @@ public class GuiLevelMaintainer extends GuiSub {
|
||||
@Override
|
||||
protected void mouseClicked(final int xCoord, final int yCoord, final int btn) {
|
||||
if (btn == 0) {
|
||||
if (focusedWidget != null) {
|
||||
focusedWidget.textField.setFocused(false);
|
||||
}
|
||||
for (Component com : this.component) {
|
||||
Widget textField = com.isMouseIn(xCoord, yCoord);
|
||||
if (textField != null) {
|
||||
textField.textField.setFocused(true);
|
||||
this.focusedWidget = textField;
|
||||
this.focusWidget(textField);
|
||||
super.mouseClicked(xCoord, yCoord, btn);
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.focusedWidget = null;
|
||||
this.focusWidget(null);
|
||||
}
|
||||
super.mouseClicked(xCoord, yCoord, btn);
|
||||
}
|
||||
@@ -164,12 +172,48 @@ public class GuiLevelMaintainer extends GuiSub {
|
||||
|
||||
if (key == Keyboard.KEY_RETURN || key == Keyboard.KEY_NUMPADENTER) {
|
||||
this.component[this.focusedWidget.componentIndex].submit();
|
||||
this.focusedWidget.textField.setFocused(false);
|
||||
this.focusedWidget = null;
|
||||
this.focusWidget(null);
|
||||
}
|
||||
|
||||
if (key == Keyboard.KEY_TAB) {
|
||||
this.focusAdjacentWidget(isShiftKeyDown());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void focusWidget(@Nullable Widget widget) {
|
||||
if (this.focusedWidget != null) {
|
||||
this.focusedWidget.textField.setFocused(false);
|
||||
}
|
||||
this.focusedWidget = widget;
|
||||
if (this.focusedWidget != null) {
|
||||
this.focusedWidget.textField.setFocused(true);
|
||||
}
|
||||
}
|
||||
|
||||
private void focusAdjacentWidget(boolean backwards) {
|
||||
this.focusedWidget.validate();
|
||||
this.focusWidget(this.getAdjacentWidget(backwards));
|
||||
}
|
||||
|
||||
private Widget getAdjacentWidget(boolean backwards) {
|
||||
int index = this.focusedWidget.componentIndex;
|
||||
boolean isBatch = this.focusedWidget.action == Action.Batch;
|
||||
|
||||
if (backwards) {
|
||||
if (isBatch) {
|
||||
return this.component[index].getQty();
|
||||
}
|
||||
return this.component[(index + TileLevelMaintainer.REQ_COUNT - 1) % TileLevelMaintainer.REQ_COUNT]
|
||||
.getBatch();
|
||||
}
|
||||
|
||||
if (isBatch) {
|
||||
return this.component[(index + 1) % TileLevelMaintainer.REQ_COUNT].getQty();
|
||||
}
|
||||
return this.component[index].getBatch();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(final GuiButton btn) {
|
||||
for (Component com : this.component) {
|
||||
@@ -177,6 +221,14 @@ public class GuiLevelMaintainer extends GuiSub {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (btn == this.liteMode) {
|
||||
if (isShiftKeyDown()) {
|
||||
FluidCraft.proxy.netHandler.sendToServer(new CPacketLevelMaintainer(Action.ClearLiteMode));
|
||||
} else {
|
||||
FluidCraft.proxy.netHandler.sendToServer(new CPacketLevelMaintainer(Action.ToggleLiteMode));
|
||||
}
|
||||
return;
|
||||
}
|
||||
super.actionPerformed(btn);
|
||||
}
|
||||
|
||||
@@ -195,6 +247,10 @@ public class GuiLevelMaintainer extends GuiSub {
|
||||
component[index].setState(state);
|
||||
}
|
||||
|
||||
public void updateComponent(boolean isLiteMode) {
|
||||
this.liteMode.setState(isLiteMode);
|
||||
}
|
||||
|
||||
private static boolean acceptType(VirtualMEPhantomSlot slot, IAEStackType<?> type, int mouseButton) {
|
||||
return true;
|
||||
}
|
||||
@@ -307,43 +363,43 @@ public class GuiLevelMaintainer extends GuiSub {
|
||||
message.add(NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_TITLE) + "\n");
|
||||
switch (this.state) {
|
||||
case Idle -> {
|
||||
this.line.setColor(FCGuiColors.StateIdle.getColor());
|
||||
this.line.setColor(FCGuiColors.stateIdle.getColor());
|
||||
message.add(
|
||||
NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_CURRENT) + " "
|
||||
+ NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_IDLE));
|
||||
}
|
||||
case Craft -> {
|
||||
this.line.setColor(FCGuiColors.StateCraft.getColor());
|
||||
this.line.setColor(FCGuiColors.stateCraft.getColor());
|
||||
message.add(
|
||||
NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_CURRENT) + " "
|
||||
+ NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_LINK));
|
||||
}
|
||||
case Export -> {
|
||||
this.line.setColor(FCGuiColors.StateExport.getColor());
|
||||
this.line.setColor(FCGuiColors.stateExport.getColor());
|
||||
message.add(
|
||||
NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_CURRENT) + " "
|
||||
+ NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_EXPORT));
|
||||
}
|
||||
case Error -> {
|
||||
this.line.setColor(FCGuiColors.StateError.getColor());
|
||||
this.line.setColor(FCGuiColors.stateError.getColor());
|
||||
message.add(
|
||||
NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_CURRENT) + " "
|
||||
+ NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_ERROR));
|
||||
}
|
||||
case NotFound -> {
|
||||
this.line.setColor(FCGuiColors.StateError.getColor());
|
||||
this.line.setColor(FCGuiColors.stateError.getColor());
|
||||
message.add(
|
||||
NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_CURRENT) + " "
|
||||
+ NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_NOT_FOUND));
|
||||
}
|
||||
case CantCraft -> {
|
||||
this.line.setColor(FCGuiColors.StateError.getColor());
|
||||
this.line.setColor(FCGuiColors.stateError.getColor());
|
||||
message.add(
|
||||
NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_CURRENT) + " "
|
||||
+ NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_CANT_CRAFT));
|
||||
}
|
||||
default -> {
|
||||
this.line.setColor(FCGuiColors.StateNone.getColor());
|
||||
this.line.setColor(FCGuiColors.stateNone.getColor());
|
||||
message.add(
|
||||
NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_CURRENT) + " "
|
||||
+ NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_NONE));
|
||||
|
||||
@@ -62,7 +62,6 @@ import appeng.container.AEBaseContainer;
|
||||
import appeng.container.slot.AppEngSlot;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.localization.ButtonToolTips;
|
||||
import appeng.core.localization.GuiColors;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.localization.PlayerMessages;
|
||||
import appeng.core.sync.GuiBridge;
|
||||
@@ -131,7 +130,6 @@ public class GuiLevelTerminal extends FCBaseMEGui implements IDropToFillTextFiel
|
||||
masterList.markDirty();
|
||||
}
|
||||
};
|
||||
searchFieldNames.setFocused(true);
|
||||
extraOptionsText.add(ButtonToolTips.HighlightInterface.getLocal());
|
||||
online = true;
|
||||
}
|
||||
@@ -176,6 +174,7 @@ public class GuiLevelTerminal extends FCBaseMEGui implements IDropToFillTextFiel
|
||||
|
||||
searchFieldNames.x = guiLeft + Math.max(32, offsetX) + 99;
|
||||
searchFieldNames.y = guiTop + 38;
|
||||
searchFieldNames.setFocused(true);
|
||||
|
||||
terminalStyleBox.xPosition = guiLeft - 18;
|
||||
terminalStyleBox.yPosition = guiTop + 8;
|
||||
@@ -241,12 +240,12 @@ public class GuiLevelTerminal extends FCBaseMEGui implements IDropToFillTextFiel
|
||||
StatCollector.translateToLocal(NameConst.GUI_LEVEL_TERMINAL),
|
||||
8,
|
||||
6,
|
||||
GuiColors.GuiTextColorGray.getColor());
|
||||
FCGuiColors.guiTextColorGray.getColor());
|
||||
fontRendererObj.drawString(
|
||||
GuiText.inventory.getLocal(),
|
||||
GuiLevelTerminal.offsetX + 2,
|
||||
ySize - 96 + 3,
|
||||
GuiColors.GuiTextColorGray.getColor());
|
||||
FCGuiColors.guiTextColorGray.getColor());
|
||||
|
||||
if (!ModAndClassUtil.NEI && tooltipStack != null) {
|
||||
renderToolTip(tooltipStack, mouseX, mouseY);
|
||||
@@ -395,7 +394,7 @@ public class GuiLevelTerminal extends FCBaseMEGui implements IDropToFillTextFiel
|
||||
int title;
|
||||
int renderY = 0;
|
||||
final int sectionBottom = viewY + section.getHeight() - 1;
|
||||
final int fontColor = GuiColors.GuiTextColorGray.getColor();
|
||||
final int fontColor = FCGuiColors.guiTextColorGray.getColor();
|
||||
/*
|
||||
* Render title
|
||||
*/
|
||||
@@ -563,11 +562,11 @@ public class GuiLevelTerminal extends FCBaseMEGui implements IDropToFillTextFiel
|
||||
aes.drawOverlayInGui(mc, 0, 0, false, false, false, false);
|
||||
GL11.glTranslatef(0.0f, 0.0f, ITEM_STACK_OVERLAY_Z - ITEM_STACK_Z);
|
||||
int color = switch (state) {
|
||||
case Idle -> FCGuiColors.StateIdle.getColor();
|
||||
case Craft -> FCGuiColors.StateCraft.getColor();
|
||||
case Export -> FCGuiColors.StateExport.getColor();
|
||||
case Error, NotFound, CantCraft -> FCGuiColors.StateError.getColor();
|
||||
case None -> FCGuiColors.StateNone.getColor();
|
||||
case Idle -> FCGuiColors.stateIdle.getColor();
|
||||
case Craft -> FCGuiColors.stateCraft.getColor();
|
||||
case Export -> FCGuiColors.stateExport.getColor();
|
||||
case Error, NotFound, CantCraft -> FCGuiColors.stateError.getColor();
|
||||
case None -> FCGuiColors.stateNone.getColor();
|
||||
};
|
||||
int offset = 0;
|
||||
int size = 4;
|
||||
@@ -585,16 +584,16 @@ public class GuiLevelTerminal extends FCBaseMEGui implements IDropToFillTextFiel
|
||||
if (!tooltip) {
|
||||
if (entry.filteredRecipes[slotIdx]) {
|
||||
GL11.glTranslatef(0.0f, 0.0f, ITEM_STACK_OVERLAY_Z);
|
||||
drawRect(0, 0, 16, 16, GuiColors.ItemSlotOverlayUnpowered.getColor());
|
||||
drawRect(0, 0, 16, 16, FCGuiColors.itemSlotOverlayUnpowered.getColor());
|
||||
}
|
||||
} else {
|
||||
tooltipStack = Platform.stackConvert(aes).getItemStack();
|
||||
tooltipStack = aes.getItemStackForNEI();
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
} else if (entry.filteredRecipes[slotIdx]) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(colLeft, viewY + rowYTop + 1, ITEM_STACK_OVERLAY_Z);
|
||||
drawRect(0, 0, 16, 16, GuiColors.ItemSlotOverlayUnpowered.getColor());
|
||||
drawRect(0, 0, 16, 16, FCGuiColors.itemSlotOverlayUnpowered.getColor());
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
if (tooltip) {
|
||||
@@ -860,18 +859,13 @@ public class GuiLevelTerminal extends FCBaseMEGui implements IDropToFillTextFiel
|
||||
}
|
||||
}
|
||||
|
||||
private boolean itemStackMatchesSearchTerm(final ItemStack itemStack, final String searchTerm) {
|
||||
if (itemStack == null) {
|
||||
private boolean stackMatchesSearchTerm(final IAEStack<?> stack, final String searchTerm) {
|
||||
if (stack == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final String displayName = Platform.getItemDisplayName(itemStack).toLowerCase();
|
||||
|
||||
if (displayName.contains(searchTerm)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
final String displayName = stack.getDisplayName();
|
||||
return displayName != null && displayName.toLowerCase().contains(searchTerm);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1109,9 +1103,7 @@ public class GuiLevelTerminal extends FCBaseMEGui implements IDropToFillTextFiel
|
||||
continue;
|
||||
}
|
||||
|
||||
if (itemStackMatchesSearchTerm(
|
||||
Platform.stackConvert(entry.infoList[i].stack).getItemStack(),
|
||||
output)) {
|
||||
if (stackMatchesSearchTerm(entry.infoList[i].stack, output)) {
|
||||
shouldAdd = true;
|
||||
entry.filteredRecipes[i] = false;
|
||||
} else {
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.text.DecimalFormat;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
@@ -29,14 +30,18 @@ public class GuiSuperStockReplenisher extends AEBaseGui {
|
||||
private final DecimalFormat df = new DecimalFormat("#.#");
|
||||
private Map<Integer, IAEStack<?>> list = new HashMap<>();
|
||||
private final ContainerSuperStockReplenisher containerSuperStockReplenisher;
|
||||
private final TileSuperStockReplenisher tileSuperStockReplenisher;
|
||||
|
||||
private final VirtualMEPhantomSlotPrecise[] configFluidsSlots = new VirtualMEPhantomSlotPrecise[9];
|
||||
private final VirtualMEPhantomSlotPrecise[] configItemsSlots = new VirtualMEPhantomSlotPrecise[63];
|
||||
|
||||
private GuiFCImgButton StockModeButton;
|
||||
|
||||
public GuiSuperStockReplenisher(InventoryPlayer ipl, TileSuperStockReplenisher tile) {
|
||||
super(new ContainerSuperStockReplenisher(ipl, tile));
|
||||
|
||||
this.containerSuperStockReplenisher = (ContainerSuperStockReplenisher) inventorySlots;
|
||||
this.tileSuperStockReplenisher = tile;
|
||||
|
||||
this.ySize = 251;
|
||||
this.xSize = 216;
|
||||
@@ -45,6 +50,15 @@ public class GuiSuperStockReplenisher extends AEBaseGui {
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
|
||||
this.StockModeButton = new GuiFCImgButton(
|
||||
guiLeft - 18,
|
||||
guiTop + 8,
|
||||
"stock mode button",
|
||||
this.containerSuperStockReplenisher.isFullStockMode() ? "fullstockMode" : "normalMode",
|
||||
true);
|
||||
this.containerSuperStockReplenisher.setModeButton(this.StockModeButton);
|
||||
buttonList.add(this.StockModeButton);
|
||||
this.initSlots();
|
||||
}
|
||||
|
||||
@@ -125,6 +139,19 @@ public class GuiSuperStockReplenisher extends AEBaseGui {
|
||||
this.drawTexturedModalRect(offsetX, offsetY, 0, 0, xSize, ySize);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(final GuiButton btn) {
|
||||
if (actionPerformedCustomButtons(btn)) return;
|
||||
if (btn == StockModeButton) {
|
||||
boolean newMode = !containerSuperStockReplenisher.isFullStockMode();
|
||||
this.containerSuperStockReplenisher.setFullStockMode(newMode);
|
||||
StockModeButton.set(newMode ? "fullstockMode" : "normalMode");
|
||||
|
||||
this.flushPendingSync();
|
||||
}
|
||||
super.actionPerformed(btn);
|
||||
}
|
||||
|
||||
public void update(Map<Integer, IAEStack<?>> map) {
|
||||
this.list = map;
|
||||
}
|
||||
|
||||
+2
-2
@@ -110,7 +110,7 @@ public class ContainerLevelMaintainer extends ContainerSubGui implements IVirtua
|
||||
(EntityPlayerMP) this.getInventoryPlayer().player);
|
||||
}
|
||||
FluidCraft.proxy.netHandler.sendTo(
|
||||
new SPacketLevelMaintainerGuiUpdate(this.tile.requests, !this.isFirstUpdate),
|
||||
new SPacketLevelMaintainerGuiUpdate(this.tile.requests, !this.isFirstUpdate, this.tile.isLiteMode()),
|
||||
(EntityPlayerMP) this.getInventoryPlayer().player);
|
||||
this.isFirstUpdate = false;
|
||||
this.updateCount = 0;
|
||||
@@ -126,7 +126,7 @@ public class ContainerLevelMaintainer extends ContainerSubGui implements IVirtua
|
||||
NetworkHandler.instance
|
||||
.sendTo(new PacketVirtualSlot(StorageName.NONE, slotStacks), (EntityPlayerMP) player);
|
||||
FluidCraft.proxy.netHandler.sendTo(
|
||||
new SPacketLevelMaintainerGuiUpdate(this.tile.requests, false),
|
||||
new SPacketLevelMaintainerGuiUpdate(this.tile.requests, false, this.tile.isLiteMode()),
|
||||
(EntityPlayerMP) player);
|
||||
}
|
||||
}
|
||||
|
||||
+41
-12
@@ -11,13 +11,14 @@ import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.common.item.FCBaseItemCell;
|
||||
import com.glodblock.github.client.gui.GuiFCImgButton;
|
||||
import com.glodblock.github.common.tile.TileSuperStockReplenisher;
|
||||
import com.glodblock.github.inventory.gui.GuiType;
|
||||
import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.network.SPacketSuperStockReplenisherUpdate;
|
||||
import com.glodblock.github.util.FluidPrimaryGui;
|
||||
|
||||
import appeng.api.implementations.items.IStorageCell;
|
||||
import appeng.api.storage.StorageName;
|
||||
import appeng.api.storage.data.IAEStack;
|
||||
import appeng.container.AEBaseContainer;
|
||||
@@ -27,10 +28,12 @@ import appeng.container.interfaces.IVirtualSlotSource;
|
||||
import appeng.container.slot.SlotRestrictedInput;
|
||||
import appeng.container.sync.SyncManager;
|
||||
import appeng.container.sync.handlers.AEStackInventorySyncHandler;
|
||||
import appeng.items.storage.ItemBasicStorageCell;
|
||||
import appeng.container.sync.handlers.BooleanSyncHandler;
|
||||
import appeng.tile.inventory.IAEStackInventory;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.item.AEItemStack;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ContainerSuperStockReplenisher extends AEBaseContainer implements IVirtualSlotSource {
|
||||
|
||||
@@ -44,6 +47,11 @@ public class ContainerSuperStockReplenisher extends AEBaseContainer implements I
|
||||
private final IAEStackInventory configItems;
|
||||
public final AEStackInventorySyncHandler configItemsSlots;
|
||||
|
||||
public final BooleanSyncHandler fullStockModeSync;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private GuiFCImgButton modeButton;
|
||||
|
||||
public ContainerSuperStockReplenisher(InventoryPlayer ipl, TileSuperStockReplenisher tile) {
|
||||
super(ipl, tile);
|
||||
this.tile = tile;
|
||||
@@ -54,6 +62,11 @@ public class ContainerSuperStockReplenisher extends AEBaseContainer implements I
|
||||
final SyncManager sm = this.getSyncManager();
|
||||
this.configFluidsSlots = sm.root().aeStackInventory("fluidConfig", this.configFluids);
|
||||
this.configItemsSlots = sm.root().aeStackInventory("itemConfig", this.configItems);
|
||||
this.fullStockModeSync = sm.root().booleanSync("fullstockMode").onClientChange((oldValue, newValue) -> {
|
||||
if (this.modeButton != null) {
|
||||
this.modeButton.set(newValue ? "fullstockMode" : "normalMode");
|
||||
}
|
||||
}).onServerChange((oldValue, newValue) -> this.tile.setFullStockMode(newValue));
|
||||
|
||||
this.addSlotToContainer(
|
||||
new SlotRestrictedInput(
|
||||
@@ -67,6 +80,11 @@ public class ContainerSuperStockReplenisher extends AEBaseContainer implements I
|
||||
bindPlayerInventory(ipl, 0, 251 - 82);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void setModeButton(GuiFCImgButton button) {
|
||||
this.modeButton = button;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack slotClick(int slotId, int clickedButton, int mode, EntityPlayer player) {
|
||||
if (slotId == 0 && player.inventory.getItemStack() == null && isConfigurated()) return null;
|
||||
@@ -95,6 +113,9 @@ public class ContainerSuperStockReplenisher extends AEBaseContainer implements I
|
||||
FluidCraft.proxy.netHandler.sendTo(new SPacketSuperStockReplenisherUpdate(tmp), (EntityPlayerMP) g);
|
||||
}
|
||||
}
|
||||
|
||||
if (Platform.isServer()) this.setFullStockMode(this.tile.isFullStockMode());
|
||||
|
||||
}
|
||||
|
||||
this.lastUpdated++;
|
||||
@@ -115,17 +136,9 @@ public class ContainerSuperStockReplenisher extends AEBaseContainer implements I
|
||||
long currentBytes = 0;
|
||||
long newBytes = -1;
|
||||
|
||||
if (s.getStack().getItem() instanceof ItemBasicStorageCell ibsc) {
|
||||
currentBytes = ibsc.getBytesLong(is);
|
||||
} else if (s.getStack().getItem() instanceof FCBaseItemCell fcbic) {
|
||||
currentBytes = fcbic.getBytes(is);
|
||||
}
|
||||
if (s.getStack().getItem() instanceof IStorageCell isc) currentBytes = isc.getBytesLong(is);
|
||||
|
||||
if (is.getItem() instanceof ItemBasicStorageCell ibsc) {
|
||||
newBytes = ibsc.getBytesLong(is);
|
||||
} else if (is.getItem() instanceof FCBaseItemCell fcbic) {
|
||||
newBytes = fcbic.getBytes(is);
|
||||
}
|
||||
if (is.getItem() instanceof IStorageCell isc) newBytes = isc.getBytesLong(is);
|
||||
|
||||
if (currentBytes > newBytes) {
|
||||
return false;
|
||||
@@ -158,4 +171,20 @@ public class ContainerSuperStockReplenisher extends AEBaseContainer implements I
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public TileSuperStockReplenisher getTile() {
|
||||
return this.tile;
|
||||
}
|
||||
|
||||
public boolean isFullStockMode() {
|
||||
return this.fullStockModeSync.get();
|
||||
}
|
||||
|
||||
public void setFullStockMode(final boolean fullStockMode) {
|
||||
this.fullStockModeSync.set(fullStockMode);
|
||||
}
|
||||
|
||||
public void markDirty() {
|
||||
this.fullStockModeSync.markDirty();
|
||||
}
|
||||
}
|
||||
@@ -42,6 +42,12 @@ public class ItemPacketRender implements IItemRenderer {
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
final boolean entity = type.equals(ItemRenderType.ENTITY);
|
||||
if (entity) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotated(90.0D, 0.0D, 1.0D, 0.0D);
|
||||
GL11.glTranslated(-0.5D, -0.6D, 0.0D);
|
||||
}
|
||||
|
||||
FluidStack fluid = ItemFluidPacket.getFluidStack(item);
|
||||
int RGB = fluid == null ? 0xFFFFFF : fluid.getFluid().getColor(fluid);
|
||||
@@ -65,6 +71,9 @@ public class ItemPacketRender implements IItemRenderer {
|
||||
0.0625F);
|
||||
}
|
||||
|
||||
if (entity) {
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,10 @@ public enum FCPartsTexture {
|
||||
PartFluidFormationPlane("fluid_formation_plane"),
|
||||
PartFluidAnnihilationPlane("fluid_annihilation_plane"),
|
||||
PartFluidFormationPlaneOn("fluid_formation_plane_on"),
|
||||
PartFluidAnnihilationPlaneOn("fluid_annihilation_plane_on");
|
||||
PartFluidAnnihilationPlaneOn("fluid_annihilation_plane_on"),
|
||||
BlockMEChestFluid_Bright("fluid_terminal_light"),
|
||||
BlockMEChestFluid_Dark("fluid_terminal_dark"),
|
||||
BlockMEChestFluid_Medium("fluid_terminal_medium");
|
||||
|
||||
private final String name;
|
||||
public net.minecraft.util.IIcon IIcon;
|
||||
|
||||
@@ -103,7 +103,7 @@ public class ItemBaseWirelessTerminal extends ToolWirelessTerminal implements II
|
||||
Item item = is.getItem();
|
||||
if (item instanceof ItemWirelessUltraTerminal) {
|
||||
if (!is.hasTagCompound()) is.setTagCompound(new NBTTagCompound());
|
||||
return UltraTerminalModes.values()[is.getTagCompound().getInteger(MODE)];
|
||||
return UltraTerminalModes.VALUES[is.getTagCompound().getInteger(MODE)];
|
||||
} else if (item instanceof ItemWirelessPatternTerminal) {
|
||||
return UltraTerminalModes.PATTERN;
|
||||
} else if (item instanceof ItemWirelessInterfaceTerminal) {
|
||||
|
||||
@@ -194,7 +194,7 @@ public class ItemWirelessUltraTerminal extends ItemBaseWirelessTerminal
|
||||
public IGuiItemObject getGuiObject(ItemStack is, World world, EntityPlayer p, int x, int y, int z) {
|
||||
final IWirelessTermHandler wh = AEApi.instance().registries().wireless().getWirelessTerminalHandler(is);
|
||||
if (wh == null) return null;
|
||||
return switch (y != Integer.MIN_VALUE ? UltraTerminalModes.values()[y] : getMode(is)) {
|
||||
return switch (y != Integer.MIN_VALUE ? UltraTerminalModes.VALUES[y] : getMode(is)) {
|
||||
case CRAFTING -> new WirelessCraftingTerminalGuiObject(wh, is, p, world, x, y, z);
|
||||
case PATTERN, PATTERN_EX -> new WirelessPatternTerminalGuiObject(wh, is, p, world, x, y, z);
|
||||
case INTERFACE -> new WirelessInterfaceTerminalGuiObject(wh, is, x);
|
||||
|
||||
@@ -61,14 +61,14 @@ public class PartFluidAnnihilationPlane extends PartBaseAnnihilationPlane {
|
||||
Platform.poweredInsert(power, monitor, toInject, src, Actionable.MODULATE);
|
||||
block.drain(world, self.x + side.offsetX, self.y + side.offsetY, self.z + side.offsetZ, true);
|
||||
} else if (meta == 0) {
|
||||
if (fluidBlock == Blocks.flowing_water) {
|
||||
if (fluidBlock == Blocks.flowing_water || fluidBlock == Blocks.water) {
|
||||
final IAEFluidStack toInject = Util.FluidUtil.createAEFluidStack(FluidRegistry.WATER);
|
||||
final IAEFluidStack notInjected = Platform
|
||||
.poweredInsert(power, monitor, toInject, src, Actionable.SIMULATE);
|
||||
if (notInjected != null) return;
|
||||
Platform.poweredInsert(power, monitor, toInject, src, Actionable.MODULATE);
|
||||
world.setBlockToAir(self.x + side.offsetX, self.y + side.offsetY, self.z + side.offsetZ);
|
||||
} else if (fluidBlock == Blocks.flowing_lava) {
|
||||
} else if (fluidBlock == Blocks.flowing_lava || fluidBlock == Blocks.lava) {
|
||||
final IAEFluidStack toInject = Util.FluidUtil.createAEFluidStack(FluidRegistry.LAVA);
|
||||
final IAEFluidStack notInjected = Platform
|
||||
.poweredInsert(power, monitor, toInject, src, Actionable.SIMULATE);
|
||||
|
||||
@@ -27,9 +27,12 @@ import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.util.DualHostSettings;
|
||||
import com.glodblock.github.util.DualityFluidInterface;
|
||||
import com.glodblock.github.util.Util;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.Upgrades;
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.networking.crafting.ICraftingLink;
|
||||
import appeng.api.networking.events.MENetworkChannelsChanged;
|
||||
import appeng.api.networking.events.MENetworkEventSubscribe;
|
||||
import appeng.api.networking.events.MENetworkPowerStatusChange;
|
||||
@@ -37,6 +40,7 @@ import appeng.api.networking.ticking.TickRateModulation;
|
||||
import appeng.api.networking.ticking.TickingRequest;
|
||||
import appeng.api.storage.IMEMonitor;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IAEStack;
|
||||
import appeng.api.storage.data.IAEStackType;
|
||||
import appeng.helpers.ICustomButtonDataObject;
|
||||
import appeng.helpers.ICustomButtonProvider;
|
||||
@@ -149,6 +153,7 @@ public class PartFluidInterface extends PartInterface implements IDualHost, ICus
|
||||
config.readFromNBT(data, "ConfigInv");
|
||||
fluidDuality.loadConfigFromPacket(this.config);
|
||||
getInternalFluid().readFromNBT(data, "FluidInv");
|
||||
fluidDuality.readCraftingTrackerFromNBT(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -156,6 +161,7 @@ public class PartFluidInterface extends PartInterface implements IDualHost, ICus
|
||||
super.writeToNBT(data);
|
||||
config.writeToNBT(data, "ConfigInv");
|
||||
getInternalFluid().writeToNBT(data, "FluidInv");
|
||||
fluidDuality.writeCraftingTrackerToNBT(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -177,6 +183,26 @@ public class PartFluidInterface extends PartInterface implements IDualHost, ICus
|
||||
return getInterfaceDuality().getInstalledUpgrades(u);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ImmutableSet<ICraftingLink> getRequestedJobs() {
|
||||
return ImmutableSet.<ICraftingLink>builder().addAll(super.getRequestedJobs())
|
||||
.addAll(fluidDuality.getRequestedJobs()).build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAEStack<?> injectCraftedItems(final ICraftingLink link, final IAEStack<?> items, final Actionable mode) {
|
||||
if (items instanceof IAEFluidStack) {
|
||||
return fluidDuality.injectCraftedItems(link, items, mode);
|
||||
}
|
||||
return super.injectCraftedItems(link, items, mode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void jobStateChange(final ICraftingLink link) {
|
||||
super.jobStateChange(link);
|
||||
fluidDuality.jobStateChange(link);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int fill(ForgeDirection from, FluidStack resource, boolean doFill) {
|
||||
return fluidDuality.fill(from, resource, doFill);
|
||||
|
||||
@@ -28,13 +28,17 @@ import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.util.DualHostSettings;
|
||||
import com.glodblock.github.util.DualityFluidInterface;
|
||||
import com.glodblock.github.util.Util;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.implementations.items.IMemoryCard;
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.networking.crafting.ICraftingLink;
|
||||
import appeng.api.networking.ticking.TickRateModulation;
|
||||
import appeng.api.networking.ticking.TickingRequest;
|
||||
import appeng.api.storage.IMEMonitor;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IAEStack;
|
||||
import appeng.api.storage.data.IAEStackType;
|
||||
import appeng.api.util.IConfigManager;
|
||||
import appeng.helpers.DualityInterface;
|
||||
@@ -118,6 +122,23 @@ public class PartFluidP2PInterface extends PartP2PInterface implements IDualHost
|
||||
return output;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(final NBTTagCompound data) {
|
||||
super.readFromNBT(data);
|
||||
config.readFromNBT(data, "ConfigInv");
|
||||
dualityFluid.loadConfigFromPacket(this.config);
|
||||
dualityFluid.getInternalFluid().readFromNBT(data, "FluidInv");
|
||||
dualityFluid.readCraftingTrackerFromNBT(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(final NBTTagCompound data) {
|
||||
super.writeToNBT(data);
|
||||
config.writeToNBT(data, "ConfigInv");
|
||||
dualityFluid.getInternalFluid().writeToNBT(data, "FluidInv");
|
||||
dualityFluid.writeCraftingTrackerToNBT(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TickingRequest getTickingRequest(IGridNode node) {
|
||||
TickingRequest item = duality.getTickingRequest(node);
|
||||
@@ -140,6 +161,26 @@ public class PartFluidP2PInterface extends PartP2PInterface implements IDualHost
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ImmutableSet<ICraftingLink> getRequestedJobs() {
|
||||
return ImmutableSet.<ICraftingLink>builder().addAll(super.getRequestedJobs())
|
||||
.addAll(dualityFluid.getRequestedJobs()).build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAEStack<?> injectCraftedItems(final ICraftingLink link, final IAEStack<?> items, final Actionable mode) {
|
||||
if (items instanceof IAEFluidStack) {
|
||||
return dualityFluid.injectCraftedItems(link, items, mode);
|
||||
}
|
||||
return super.injectCraftedItems(link, items, mode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void jobStateChange(final ICraftingLink link) {
|
||||
super.jobStateChange(link);
|
||||
dualityFluid.jobStateChange(link);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int fill(ForgeDirection from, FluidStack resource, boolean doFill) {
|
||||
return dualityFluid.fill(from, resource, doFill);
|
||||
|
||||
@@ -19,6 +19,8 @@ public enum CellType {
|
||||
Cell4096kPart(6, AEFeature.StorageCells),
|
||||
Cell16384kPart(7, AEFeature.StorageCells);
|
||||
|
||||
public static final CellType[] VALUES = values();
|
||||
|
||||
private final EnumSet<AEFeature> features;
|
||||
private int damageValue;
|
||||
private Item itemInstance;
|
||||
@@ -53,7 +55,7 @@ public enum CellType {
|
||||
}
|
||||
|
||||
public static EnumChatFormatting getTypeColor(int type) {
|
||||
return getTypeColor(CellType.values()[type % CellType.values().length]);
|
||||
return getTypeColor(CellType.VALUES[type % CellType.VALUES.length]);
|
||||
}
|
||||
|
||||
public static EnumChatFormatting getTypeColor(CellType type) {
|
||||
|
||||
@@ -77,15 +77,27 @@ public class TileFluidAutoFiller extends AENetworkInvTile
|
||||
public TileFluidAutoFiller() {
|
||||
getProxy().setIdlePowerUsage(1D);
|
||||
getProxy().setFlags(GridFlags.REQUIRE_CHANNEL);
|
||||
inventory.setInventorySlotContents(0, BUCKET);
|
||||
inventory.setInventorySlotContents(0, BUCKET.copy());
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public ItemStack getContainerItem() {
|
||||
normalizeContainerItem();
|
||||
return getInventory().getStackInSlot(0);
|
||||
}
|
||||
|
||||
public void setContainerItem(ItemStack is) {
|
||||
getInventory().setInventorySlotContents(0, is);
|
||||
normalizeContainerItem();
|
||||
}
|
||||
|
||||
private void normalizeContainerItem() {
|
||||
ItemStack is = getInventory().getStackInSlot(0);
|
||||
if (is == null) {
|
||||
is = BUCKET.copy();
|
||||
getInventory().setInventorySlotContents(0, is);
|
||||
}
|
||||
is.stackSize = 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -102,18 +114,15 @@ public class TileFluidAutoFiller extends AENetworkInvTile
|
||||
}
|
||||
|
||||
public void updatePattern() {
|
||||
ItemStack is = inventory.getStackInSlot(0);
|
||||
if (is == null) return;
|
||||
this.setContainerItem(is);
|
||||
normalizeContainerItem();
|
||||
postEvent();
|
||||
}
|
||||
|
||||
@TileEvent(TileEventType.WORLD_NBT_READ)
|
||||
public void readFromNBTEvent(NBTTagCompound data) {
|
||||
inventory.readFromNBT(data, "Inv");
|
||||
if (inventory.getStackInSlot(0) == null) {
|
||||
inventory.setInventorySlotContents(0, BUCKET);
|
||||
}
|
||||
ItemStack container = inventory.getStackInSlot(0);
|
||||
this.setContainerItem(container);
|
||||
}
|
||||
|
||||
@TileEvent(TileEventType.WORLD_NBT_WRITE)
|
||||
@@ -150,21 +159,21 @@ public class TileFluidAutoFiller extends AENetworkInvTile
|
||||
public void provideCrafting(ICraftingProviderHelper craftingTracker) {
|
||||
IStorageGrid storage = getStorageGrid();
|
||||
if (storage == null) return;
|
||||
ItemStack containerItem = this.getContainerItem();
|
||||
|
||||
if (this.fluids.isEmpty()) {
|
||||
this.fluids = storage.getFluidInventory().getStorageList();
|
||||
}
|
||||
for (IAEFluidStack fluidStack : this.fluids) {
|
||||
Fluid fluid = fluidStack.getFluid();
|
||||
if (fluid == null) continue;
|
||||
int maxCapacity = Util.FluidUtil.getCapacity(this.getContainerItem(), fluid);
|
||||
int maxCapacity = Util.FluidUtil.getCapacity(containerItem, fluid);
|
||||
if (maxCapacity == 0) continue;
|
||||
MutablePair<Integer, ItemStack> filled = Util.FluidUtil
|
||||
.fillStack(this.getContainerItem().copy(), new FluidStack(fluid, maxCapacity));
|
||||
.fillStack(containerItem.copy(), new FluidStack(fluid, maxCapacity));
|
||||
if (filled == null) continue;
|
||||
if (filled.right == null) continue;
|
||||
ItemStack pattern = getPattern(
|
||||
this.getContainerItem(),
|
||||
filled.right,
|
||||
fluidStack.copy().setStackSize(maxCapacity));
|
||||
ItemStack pattern = getPattern(containerItem, filled.right, fluidStack.copy().setStackSize(maxCapacity));
|
||||
ICraftingPatternItem patter = (ICraftingPatternItem) pattern.getItem();
|
||||
craftingTracker.addCraftingOption(this, patter.getPatternForItem(pattern, getWorldObj()));
|
||||
}
|
||||
|
||||
@@ -28,11 +28,14 @@ import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.util.DualHostSettings;
|
||||
import com.glodblock.github.util.DualityFluidInterface;
|
||||
import com.glodblock.github.util.Util;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.SidelessMode;
|
||||
import appeng.api.config.Upgrades;
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.networking.crafting.ICraftingLink;
|
||||
import appeng.api.networking.events.MENetworkChannelsChanged;
|
||||
import appeng.api.networking.events.MENetworkEventSubscribe;
|
||||
import appeng.api.networking.events.MENetworkPowerStatusChange;
|
||||
@@ -40,6 +43,7 @@ import appeng.api.networking.ticking.TickRateModulation;
|
||||
import appeng.api.networking.ticking.TickingRequest;
|
||||
import appeng.api.storage.IMEMonitor;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IAEStack;
|
||||
import appeng.api.storage.data.IAEStackType;
|
||||
import appeng.api.util.IConfigManager;
|
||||
import appeng.helpers.ICustomButtonDataObject;
|
||||
@@ -180,12 +184,14 @@ public class TileFluidInterface extends TileInterface implements IDualHost, ICus
|
||||
config.readFromNBT(data, "ConfigInv");
|
||||
fluidDuality.loadConfigFromPacket(this.config);
|
||||
getInternalFluid().readFromNBT(data, "FluidInv");
|
||||
fluidDuality.readCraftingTrackerFromNBT(data);
|
||||
}
|
||||
|
||||
@TileEvent(TileEventType.WORLD_NBT_WRITE)
|
||||
public NBTTagCompound writeToNBTEvent(NBTTagCompound data) {
|
||||
config.writeToNBT(data, "ConfigInv");
|
||||
getInternalFluid().writeToNBT(data, "FluidInv");
|
||||
fluidDuality.writeCraftingTrackerToNBT(data);
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -216,6 +222,26 @@ public class TileFluidInterface extends TileInterface implements IDualHost, ICus
|
||||
return getInterfaceDuality().getInstalledUpgrades(u);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ImmutableSet<ICraftingLink> getRequestedJobs() {
|
||||
return ImmutableSet.<ICraftingLink>builder().addAll(super.getRequestedJobs())
|
||||
.addAll(fluidDuality.getRequestedJobs()).build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAEStack<?> injectCraftedItems(final ICraftingLink link, final IAEStack<?> items, final Actionable mode) {
|
||||
if (items instanceof IAEFluidStack) {
|
||||
return fluidDuality.injectCraftedItems(link, items, mode);
|
||||
}
|
||||
return super.injectCraftedItems(link, items, mode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void jobStateChange(final ICraftingLink link) {
|
||||
super.jobStateChange(link);
|
||||
fluidDuality.jobStateChange(link);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int fill(ForgeDirection from, FluidStack resource, boolean doFill) {
|
||||
return fluidDuality.fill(from, resource, doFill);
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.CraftingMode;
|
||||
import appeng.api.config.PowerMultiplier;
|
||||
import appeng.api.features.ILevelViewable;
|
||||
import appeng.api.features.LevelItemInfo;
|
||||
@@ -50,12 +51,14 @@ import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IAEStack;
|
||||
import appeng.core.AELog;
|
||||
import appeng.me.GridAccessException;
|
||||
import appeng.me.cache.CraftingGridCache;
|
||||
import appeng.tile.TileEvent;
|
||||
import appeng.tile.events.TileEventType;
|
||||
import appeng.tile.grid.AENetworkTile;
|
||||
import appeng.tile.inventory.IAEAppEngInventory;
|
||||
import appeng.tile.inventory.IAEStackInventory;
|
||||
import appeng.tile.inventory.InvOperation;
|
||||
import appeng.util.IterationCounter;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.SettingsFrom;
|
||||
import appeng.util.item.AEItemStack;
|
||||
@@ -72,12 +75,15 @@ public class TileLevelMaintainer extends AENetworkTile
|
||||
public static final String NBT_ENABLE = "enable";
|
||||
public static final String NBT_STATE = "state";
|
||||
public static final String NBT_LINK = "link";
|
||||
public static final String NBT_LITE_MODE = "lite_mode";
|
||||
|
||||
public final RequestInfo[] requests = new RequestInfo[REQ_COUNT];
|
||||
private final LevelMaintainerInventory inventory = new LevelMaintainerInventory(requests);
|
||||
private int firstRequest = 0;
|
||||
private final BaseActionSource source;
|
||||
private boolean isPowered = false;
|
||||
private boolean isLiteModeOverridden = false;
|
||||
private boolean isLiteMode = false;
|
||||
|
||||
public TileLevelMaintainer() {
|
||||
getProxy().setIdlePowerUsage(1D);
|
||||
@@ -164,6 +170,7 @@ public class TileLevelMaintainer extends AENetworkTile
|
||||
}
|
||||
try {
|
||||
final ICraftingGrid craftingGrid = getProxy().getCrafting();
|
||||
final CraftingGridCache craftingGridCache = (CraftingGridCache) craftingGrid;
|
||||
final IGrid grid = getProxy().getGrid();
|
||||
|
||||
// Check there are available crafting CPUs before doing any work.
|
||||
@@ -202,7 +209,7 @@ public class TileLevelMaintainer extends AENetworkTile
|
||||
IMEMonitor monitor = getProxy().getStorage().getMEMonitor(craftItem.getStackType());
|
||||
if (monitor == null) continue;
|
||||
|
||||
IAEStack<?> stackInStorage = monitor.getStorageList().findPrecise(craftItem);
|
||||
IAEStack<?> stackInStorage = monitor.getAvailableItem(craftItem, IterationCounter.fetchNewId());
|
||||
|
||||
long stackSize = stackInStorage == null ? 0 : stackInStorage.getStackSize();
|
||||
|
||||
@@ -273,9 +280,14 @@ public class TileLevelMaintainer extends AENetworkTile
|
||||
}
|
||||
} else if (itemToBegin != null) {
|
||||
// No jobs to submit, start calculating some item.
|
||||
|
||||
requests[itemToBeginIdx].job = craftingGrid
|
||||
.beginCraftingJob(this.worldObj, grid, source, itemToBegin, null);
|
||||
requests[itemToBeginIdx].job = craftingGridCache.beginCraftingJob(
|
||||
this.worldObj,
|
||||
grid,
|
||||
source,
|
||||
itemToBegin,
|
||||
CraftingMode.STANDARD,
|
||||
isLiteMode(),
|
||||
null);
|
||||
this.updateState(itemToBeginIdx, LevelState.Craft);
|
||||
|
||||
// Try the next item next time.
|
||||
@@ -369,6 +381,35 @@ public class TileLevelMaintainer extends AENetworkTile
|
||||
this.saveChanges();
|
||||
}
|
||||
|
||||
private boolean getLiteModeDefault() {
|
||||
try {
|
||||
final ICraftingGrid craftingGrid = getProxy().getCrafting();
|
||||
if (craftingGrid instanceof CraftingGridCache cache) {
|
||||
return cache.getLiteCraftingDefault();
|
||||
}
|
||||
} catch (GridAccessException ignored) {}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isLiteMode() {
|
||||
return this.isLiteModeOverridden ? this.isLiteMode : getLiteModeDefault();
|
||||
}
|
||||
|
||||
public void setLiteMode(boolean liteMode) {
|
||||
this.isLiteModeOverridden = true;
|
||||
this.isLiteMode = liteMode;
|
||||
this.saveChanges();
|
||||
}
|
||||
|
||||
public void toggleLiteMode() {
|
||||
this.setLiteMode(!this.isLiteMode());
|
||||
}
|
||||
|
||||
public void clearLiteMode() {
|
||||
this.isLiteModeOverridden = false;
|
||||
this.saveChanges();
|
||||
}
|
||||
|
||||
private void updateLink(int idx, @Nullable ICraftingLink link) {
|
||||
if (requests[idx] == null) return;
|
||||
requests[idx].link = link;
|
||||
@@ -416,6 +457,9 @@ public class TileLevelMaintainer extends AENetworkTile
|
||||
}
|
||||
}
|
||||
data.setTag(NBT_REQUESTS, tagList);
|
||||
if (this.isLiteModeOverridden) {
|
||||
data.setBoolean(NBT_LITE_MODE, this.isLiteMode);
|
||||
}
|
||||
}
|
||||
|
||||
@TileEvent(TileEventType.WORLD_NBT_READ)
|
||||
@@ -499,6 +543,10 @@ public class TileLevelMaintainer extends AENetworkTile
|
||||
this.requests[i].quantity = quantyties[i];
|
||||
}
|
||||
}
|
||||
if (data.hasKey(NBT_LITE_MODE)) {
|
||||
this.isLiteModeOverridden = true;
|
||||
this.isLiteMode = data.getBoolean(NBT_LITE_MODE);
|
||||
}
|
||||
}
|
||||
|
||||
// Remove old format NBT data from ItemStack
|
||||
@@ -541,6 +589,12 @@ public class TileLevelMaintainer extends AENetworkTile
|
||||
}
|
||||
}
|
||||
}
|
||||
if (compound.hasKey(NBT_LITE_MODE)) {
|
||||
this.isLiteModeOverridden = true;
|
||||
this.isLiteMode = compound.getBoolean(NBT_LITE_MODE);
|
||||
} else {
|
||||
this.isLiteModeOverridden = false;
|
||||
}
|
||||
this.saveChanges();
|
||||
}
|
||||
|
||||
@@ -557,6 +611,9 @@ public class TileLevelMaintainer extends AENetworkTile
|
||||
}
|
||||
}
|
||||
compound.setTag(NBT_REQUESTS, tagList);
|
||||
if (isLiteModeOverridden) {
|
||||
compound.setBoolean(NBT_LITE_MODE, isLiteMode);
|
||||
}
|
||||
return compound;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@ import net.minecraftforge.fluids.IFluidHandler;
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import com.glodblock.github.common.item.FCBaseItemCell;
|
||||
import com.glodblock.github.common.item.ItemFluidPacket;
|
||||
import com.glodblock.github.inventory.AEFluidInventory;
|
||||
import com.glodblock.github.inventory.IAEFluidInventory;
|
||||
@@ -28,6 +27,7 @@ import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.PowerMultiplier;
|
||||
import appeng.api.implementations.IPowerChannelState;
|
||||
import appeng.api.implementations.items.IStorageCell;
|
||||
import appeng.api.networking.GridFlags;
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.networking.events.MENetworkBootingStatusChange;
|
||||
@@ -48,7 +48,6 @@ import appeng.api.util.AECableType;
|
||||
import appeng.api.util.DimensionalCoord;
|
||||
import appeng.api.util.IConfigManager;
|
||||
import appeng.core.AELog;
|
||||
import appeng.items.storage.ItemBasicStorageCell;
|
||||
import appeng.me.GridAccessException;
|
||||
import appeng.tile.TileEvent;
|
||||
import appeng.tile.events.TileEventType;
|
||||
@@ -69,6 +68,7 @@ public class TileSuperStockReplenisher extends AENetworkInvTile implements IAEFl
|
||||
private final AppEngInternalInventory cell = new AppEngInternalInventory(this, 1);
|
||||
private final BiggerAppEngInventory invItems = new BiggerAppEngInventory(this, 63);
|
||||
private final AEFluidInventory invFluids = new AEFluidInventory(this, 9, Integer.MAX_VALUE);
|
||||
private final IAEStackInventory configItems = new IAEStackInventory(this, 63, StorageName.CONFIG);
|
||||
private final IAEStackInventory configFluids = new IAEStackInventory(this, 9, StorageName.NONE) {
|
||||
|
||||
@Override
|
||||
@@ -85,32 +85,47 @@ public class TileSuperStockReplenisher extends AENetworkInvTile implements IAEFl
|
||||
}
|
||||
}
|
||||
};
|
||||
private final IAEStackInventory configItems = new IAEStackInventory(this, 63, StorageName.CONFIG);
|
||||
private final BaseActionSource source;
|
||||
private boolean isPowered;
|
||||
private long totalBytes;
|
||||
private long storedFluidCount;
|
||||
private long storedItemCount;
|
||||
protected boolean isFullStockMode;
|
||||
protected boolean isSlotsAccessible;
|
||||
protected boolean isNeedsFullyStocked;
|
||||
protected boolean modeChange;
|
||||
|
||||
private boolean needReCountStoredFluids = true;
|
||||
private boolean needReCountStoredItems = true;
|
||||
|
||||
public TileSuperStockReplenisher() {
|
||||
super(false);
|
||||
getProxy().setIdlePowerUsage(4D);
|
||||
getProxy().setFlags(GridFlags.REQUIRE_CHANNEL);
|
||||
this.getProxy().setIdlePowerUsage(4D);
|
||||
this.getProxy().setFlags(GridFlags.REQUIRE_CHANNEL);
|
||||
this.source = new MachineSource(this);
|
||||
invItems.setMaxStackSize(Integer.MAX_VALUE);
|
||||
this.isFullStockMode = false;
|
||||
this.isSlotsAccessible = true;
|
||||
this.isNeedsFullyStocked = false;
|
||||
this.modeChange = false;
|
||||
}
|
||||
|
||||
private TickRateModulation doWork() {
|
||||
final TickRateModulation tickRateModulation;
|
||||
|
||||
if (this.isFullStockMode()) {
|
||||
if (this.isNeedsFullyStocked()) {
|
||||
tickRateModulation = TickRateModulation.FASTER;
|
||||
} else tickRateModulation = TickRateModulation.SLOWER;
|
||||
} else tickRateModulation = TickRateModulation.IDLE;
|
||||
|
||||
this.fletchFluids();
|
||||
this.fletchItems();
|
||||
|
||||
this.needReCountStoredFluids = true;
|
||||
this.needReCountStoredItems = true;
|
||||
|
||||
return TickRateModulation.SAME;
|
||||
return tickRateModulation;
|
||||
}
|
||||
|
||||
private void fletchFluids() {
|
||||
@@ -123,7 +138,8 @@ public class TileSuperStockReplenisher extends AENetworkInvTile implements IAEFl
|
||||
else if (invFluid.equals(ifs)) {
|
||||
long invSize = invFluid.getStackSize();
|
||||
long confSize = ifs.getStackSize();
|
||||
if (invSize < confSize / 2f) {
|
||||
if (!this.isFullStockMode() && (invSize < confSize / 2f)
|
||||
|| (this.isFullStockMode() && (invSize < confSize))) {
|
||||
ifs.setStackSize(confSize - invSize);
|
||||
requestFluid(ifs, i);
|
||||
} else if (invSize > confSize) {
|
||||
@@ -146,9 +162,11 @@ public class TileSuperStockReplenisher extends AENetworkInvTile implements IAEFl
|
||||
IAEItemStack is = ais.copy();
|
||||
if (invItem == null) requestItem(is, i);
|
||||
else if (is.equals(invItem)) {
|
||||
int invSize = invItem.stackSize;
|
||||
int confSize = (int) is.getStackSize();
|
||||
if (invItem.stackSize < confSize / 2f) {
|
||||
is.setStackSize(confSize - invItem.stackSize);
|
||||
if ((!this.isFullStockMode() && (invSize < confSize / 2f))
|
||||
|| ((this.isFullStockMode()) && (invSize < confSize))) {
|
||||
is.setStackSize(confSize - invSize);
|
||||
requestItem(is, i);
|
||||
} else if (invItem.stackSize > confSize) {
|
||||
returnItem(i, invItem.stackSize - confSize);
|
||||
@@ -193,6 +211,7 @@ public class TileSuperStockReplenisher extends AENetworkInvTile implements IAEFl
|
||||
if (notInserted != null) {
|
||||
invFluids.fill(index, notInserted, true);
|
||||
storedFluidCount += notInserted.getStackSize();
|
||||
checkSlotsAccessible();
|
||||
}
|
||||
} catch (final GridAccessException ignored) {}
|
||||
}
|
||||
@@ -207,6 +226,7 @@ public class TileSuperStockReplenisher extends AENetworkInvTile implements IAEFl
|
||||
if (extracted != null) {
|
||||
storedFluidCount += extracted.getStackSize();
|
||||
invFluids.fill(index, extracted, true);
|
||||
checkSlotsAccessible();
|
||||
}
|
||||
} catch (final GridAccessException ignored) {}
|
||||
}
|
||||
@@ -227,13 +247,15 @@ public class TileSuperStockReplenisher extends AENetworkInvTile implements IAEFl
|
||||
IAEItemStack notInserted = this.getProxy().getStorage().getItemInventory()
|
||||
.injectItems(AEItemStack.create(is), Actionable.MODULATE, this.source);
|
||||
if (notInserted != null) {
|
||||
ItemStack tempStack = invItems.getStackInSlot(index);
|
||||
if (tempStack != null) {
|
||||
if (invItems.getStackInSlot(index) != null) {
|
||||
ItemStack tempStack = invItems.getStackInSlot(index).copy();
|
||||
tempStack.stackSize = tempStack.stackSize + (int) notInserted.getStackSize();
|
||||
|
||||
saveChanges();
|
||||
} else invItems.setInventorySlotContents(index, notInserted.getItemStack());
|
||||
|
||||
invItems.setInventorySlotContents(index, tempStack);
|
||||
checkSlotsAccessible();
|
||||
} else {
|
||||
invItems.setInventorySlotContents(index, notInserted.getItemStack());
|
||||
checkSlotsAccessible();
|
||||
}
|
||||
this.storedItemCount += notInserted.getStackSize();
|
||||
}
|
||||
} catch (final GridAccessException ignored) {}
|
||||
@@ -247,21 +269,160 @@ public class TileSuperStockReplenisher extends AENetworkInvTile implements IAEFl
|
||||
IAEItemStack extracted = this.getProxy().getStorage().getItemInventory()
|
||||
.extractItems(is, Actionable.MODULATE, this.source);
|
||||
if (extracted != null) {
|
||||
ItemStack tempStack = invItems.getStackInSlot(index);
|
||||
if (tempStack != null) {
|
||||
if (invItems.getStackInSlot(index) != null) {
|
||||
ItemStack tempStack = invItems.getStackInSlot(index).copy();
|
||||
tempStack.stackSize = tempStack.stackSize + (int) extracted.getStackSize();
|
||||
invItems.setInventorySlotContents(index, tempStack);
|
||||
checkSlotsAccessible();
|
||||
|
||||
saveChanges();
|
||||
} else invItems.setInventorySlotContents(index, extracted.getItemStack());
|
||||
} else {
|
||||
invItems.setInventorySlotContents(index, extracted.getItemStack());
|
||||
checkSlotsAccessible();
|
||||
|
||||
}
|
||||
|
||||
this.storedItemCount += extracted.getStackSize();
|
||||
}
|
||||
} catch (final GridAccessException ignored) {}
|
||||
}
|
||||
|
||||
public boolean isFullStockMode() {
|
||||
return this.isFullStockMode;
|
||||
}
|
||||
|
||||
public void setFullStockMode(boolean fullStockMode) {
|
||||
|
||||
if (this.isFullStockMode == fullStockMode) return;
|
||||
|
||||
if (fullStockMode) this.modeChange = true;
|
||||
|
||||
this.isFullStockMode = fullStockMode;
|
||||
checkSlotsAccessible();
|
||||
this.modeChange = false;
|
||||
}
|
||||
|
||||
public boolean isSlotsAccessible() {
|
||||
return this.isSlotsAccessible;
|
||||
}
|
||||
|
||||
public boolean isNeedsFullyStocked() {
|
||||
return this.isNeedsFullyStocked;
|
||||
}
|
||||
|
||||
public boolean hasModeChangedToTrue() {
|
||||
return this.modeChange;
|
||||
}
|
||||
|
||||
public void setSlotsAccessible() {
|
||||
if (this.isFullStockMode()) {
|
||||
|
||||
if (this.hasModeChangedToTrue()) {
|
||||
|
||||
this.isSlotsAccessible = false;
|
||||
|
||||
}
|
||||
if (this.isSlotsAccessible()) {
|
||||
|
||||
if ((this.needsFullyStocked())) this.isSlotsAccessible = false;
|
||||
|
||||
} else {
|
||||
|
||||
if (this.isFullyStocked()) this.isSlotsAccessible = true;
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
this.isSlotsAccessible = true;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void checkSlotsAccessible() {
|
||||
this.setSlotsAccessible();
|
||||
this.notifyNeighbors();
|
||||
}
|
||||
|
||||
private boolean needsFullyStocked() {
|
||||
int configSlots = 0;
|
||||
int emptySlots = 0;
|
||||
|
||||
for (int i = 0; i < 9; i++) {
|
||||
IAEStack<?> config = configFluids.getAEStackInSlot(i);
|
||||
|
||||
if (config instanceof IAEFluidStack cfg) {
|
||||
configSlots++;
|
||||
IAEFluidStack inv = invFluids.getFluidInSlot(i);
|
||||
|
||||
if (inv == null) {
|
||||
emptySlots++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 63; i++) {
|
||||
IAEStack<?> config = configItems.getAEStackInSlot(i);
|
||||
|
||||
if (config instanceof IAEItemStack cfg) {
|
||||
configSlots++;
|
||||
ItemStack inv = invItems.getStackInSlot(i);
|
||||
|
||||
if (inv == null) {
|
||||
emptySlots++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.isNeedsFullyStocked = (emptySlots == configSlots) && (configSlots > 0);
|
||||
|
||||
return isNeedsFullyStocked;
|
||||
}
|
||||
|
||||
private boolean isFullyStocked() {
|
||||
|
||||
for (int i = 0; i < 9; i++) {
|
||||
IAEStack<?> config = configFluids.getAEStackInSlot(i);
|
||||
|
||||
if (config instanceof IAEFluidStack cfg) {
|
||||
IAEFluidStack cfgFis = cfg.copy();
|
||||
IAEFluidStack inv = invFluids.getFluidInSlot(i);
|
||||
|
||||
if (inv == null || inv.getStackSize() < cfgFis.getStackSize()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 63; i++) {
|
||||
IAEStack<?> config = configItems.getAEStackInSlot(i);
|
||||
|
||||
if (config instanceof IAEItemStack cfg) {
|
||||
IAEItemStack cfgIs = cfg.copy();
|
||||
ItemStack inv = invItems.getStackInSlot(i);
|
||||
|
||||
if (inv == null || inv.stackSize < (int) cfgIs.getStackSize()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsBySide(ForgeDirection whichSide) {
|
||||
return IntStream.rangeClosed(0, 62).toArray();
|
||||
return ((this.isSlotsAccessible()) ? IntStream.rangeClosed(0, 62).toArray() : new int[0]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slotIndex, ItemStack itemStackIn, int side) {
|
||||
return this.isSlotsAccessible();
|
||||
}
|
||||
|
||||
public void notifyNeighbors() {
|
||||
if (this.getWorldObj() != null) {
|
||||
this.markDirty();
|
||||
this.getWorldObj().notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
|
||||
}
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@@ -326,11 +487,7 @@ public class TileSuperStockReplenisher extends AENetworkInvTile implements IAEFl
|
||||
case setInventorySlotContents -> {
|
||||
if (inv == cell) {
|
||||
if (added != null) {
|
||||
if (added.getItem() instanceof ItemBasicStorageCell ibsc) {
|
||||
totalBytes = ibsc.getBytesLong(added);
|
||||
} else if (added.getItem() instanceof FCBaseItemCell fcbic) {
|
||||
totalBytes = fcbic.getBytes(added);
|
||||
}
|
||||
if (added.getItem() instanceof IStorageCell isc) totalBytes = isc.getBytesLong(added);
|
||||
getProxy().setIdlePowerUsage(Math.sqrt(Math.pow(totalBytes, 0.576D)));
|
||||
} else if (removed != null) {
|
||||
totalBytes = 0;
|
||||
@@ -352,6 +509,8 @@ public class TileSuperStockReplenisher extends AENetworkInvTile implements IAEFl
|
||||
} catch (GridAccessException e) {
|
||||
AELog.error(e, "Couldn't wake up level emitter for delayed updates");
|
||||
}
|
||||
|
||||
checkSlotsAccessible();
|
||||
}
|
||||
|
||||
public void fullRefund() {
|
||||
@@ -404,12 +563,12 @@ public class TileSuperStockReplenisher extends AENetworkInvTile implements IAEFl
|
||||
|
||||
@Override
|
||||
public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) {
|
||||
return invFluids.drain(from, resource, doDrain);
|
||||
return (this.isFullStockMode() && !this.isSlotsAccessible()) ? null : invFluids.drain(from, resource, doDrain);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) {
|
||||
return invFluids.drain(from, maxDrain, doDrain);
|
||||
return (this.isFullStockMode() && !this.isSlotsAccessible()) ? null : invFluids.drain(from, maxDrain, doDrain);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -419,17 +578,19 @@ public class TileSuperStockReplenisher extends AENetworkInvTile implements IAEFl
|
||||
|
||||
@Override
|
||||
public boolean canDrain(ForgeDirection from, Fluid fluid) {
|
||||
return invFluids.canDrain(from, fluid);
|
||||
return (this.isFullStockMode() && !this.isSlotsAccessible()) ? false : invFluids.canDrain(from, fluid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTankInfo[] getTankInfo(ForgeDirection from) {
|
||||
return invFluids.getTankInfo(from);
|
||||
return (this.isFullStockMode() && !this.isSlotsAccessible()) ? new FluidTankInfo[0]
|
||||
: invFluids.getTankInfo(from);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFluidInventoryChanged(IAEFluidTank inv, int slot) {
|
||||
this.markDirty();
|
||||
checkSlotsAccessible();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -456,6 +617,9 @@ public class TileSuperStockReplenisher extends AENetworkInvTile implements IAEFl
|
||||
configItems.readFromNBT(data, "configItems");
|
||||
configFluids.readFromNBT(data, "configFluids");
|
||||
cell.readFromNBT(data, "cellHolder");
|
||||
isFullStockMode = data.getBoolean("isFullStockMode");
|
||||
checkSlotsAccessible();
|
||||
isSlotsAccessible = data.getBoolean("isSlotsAccessible");
|
||||
totalBytes = data.getLong("totalBytes");
|
||||
getProxy().setIdlePowerUsage(data.getDouble("powerDraw"));
|
||||
}
|
||||
@@ -467,6 +631,8 @@ public class TileSuperStockReplenisher extends AENetworkInvTile implements IAEFl
|
||||
configItems.writeToNBT(data, "configItems");
|
||||
configFluids.writeToNBT(data, "configFluids");
|
||||
cell.writeToNBT(data, "cellHolder");
|
||||
data.setBoolean("isFullStockMode", isFullStockMode);
|
||||
data.setBoolean("isSlotsAccessible", isSlotsAccessible);
|
||||
data.setLong("totalBytes", totalBytes);
|
||||
data.setDouble("powerDraw", getProxy().getIdlePowerUsage());
|
||||
return data;
|
||||
@@ -517,7 +683,7 @@ public class TileSuperStockReplenisher extends AENetworkInvTile implements IAEFl
|
||||
|
||||
@Override
|
||||
public TickingRequest getTickingRequest(IGridNode node) {
|
||||
return new TickingRequest(120, 120, false, false);
|
||||
return new TickingRequest(10, 120, false, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+7
-8
@@ -13,7 +13,7 @@ import com.glodblock.github.util.DualityFluidInterface;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import com.glodblock.github.util.Util;
|
||||
|
||||
import appeng.api.parts.IPartHost;
|
||||
import appeng.util.Platform;
|
||||
import li.cil.oc.api.driver.EnvironmentProvider;
|
||||
import li.cil.oc.api.driver.NamedBlock;
|
||||
import li.cil.oc.api.driver.SidedBlock;
|
||||
@@ -104,20 +104,19 @@ public class DriverDualFluidInterface implements SidedBlock {
|
||||
if (te instanceof TileFluidInterface) {
|
||||
return true;
|
||||
}
|
||||
if (te instanceof IPartHost) {
|
||||
return ((IPartHost) te).getPart(face) instanceof PartFluidInterface;
|
||||
}
|
||||
|
||||
return Platform.getPartFromTE(te, face) instanceof PartFluidInterface;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static DualityFluidInterface getInterface(TileEntity te, ForgeDirection face) {
|
||||
if (te != null) {
|
||||
if (te instanceof TileFluidInterface) {
|
||||
return ((TileFluidInterface) te).getDualityFluid();
|
||||
if (te instanceof TileFluidInterface tile) {
|
||||
return tile.getDualityFluid();
|
||||
}
|
||||
if (te instanceof IPartHost && ((IPartHost) te).getPart(face) instanceof PartFluidInterface) {
|
||||
return ((PartFluidInterface) ((IPartHost) te).getPart(face)).getDualityFluid();
|
||||
if (Platform.getPartFromTE(te, face) instanceof PartFluidInterface part) {
|
||||
return part.getDualityFluid();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -4,6 +4,8 @@ import com.glodblock.github.common.tile.TileCertusQuartzTank;
|
||||
import com.glodblock.github.util.ModAndClassUtil;
|
||||
|
||||
import appeng.api.parts.IPartHost;
|
||||
import appeng.integration.IntegrationRegistry;
|
||||
import appeng.integration.IntegrationType;
|
||||
import appeng.tile.AEBaseTile;
|
||||
import appeng.util.Platform;
|
||||
import codechicken.nei.guihook.GuiContainerManager;
|
||||
@@ -19,8 +21,12 @@ public class WailaInit {
|
||||
|
||||
public static void register(final IWailaRegistrar registrar) {
|
||||
final IWailaDataProvider part = new PartWailaDataProvider();
|
||||
registrar.registerBodyProvider(part, IPartHost.class);
|
||||
registrar.registerNBTProvider(part, IPartHost.class);
|
||||
registerPartProvider(registrar, part, IPartHost.class);
|
||||
if (IntegrationRegistry.INSTANCE.isEnabled(IntegrationType.FMP)) {
|
||||
try {
|
||||
registerPartProvider(registrar, part, Class.forName("codechicken.multipart.TileMultipart"));
|
||||
} catch (final ClassNotFoundException ignored) {}
|
||||
}
|
||||
if (Platform.isClient()) GuiContainerManager.addTooltipHandler(new FCTooltipHandlerWaila());
|
||||
|
||||
final IWailaDataProvider tile = new TileWailaDataProvider();
|
||||
@@ -32,4 +38,10 @@ public class WailaInit {
|
||||
registrar.registerBodyProvider(certusQuartzTank, TileCertusQuartzTank.class);
|
||||
}
|
||||
}
|
||||
|
||||
private static void registerPartProvider(final IWailaRegistrar registrar, final IWailaDataProvider provider,
|
||||
final Class<?> tileClass) {
|
||||
registrar.registerBodyProvider(provider, tileClass);
|
||||
registrar.registerNBTProvider(provider, tileClass);
|
||||
}
|
||||
}
|
||||
+4
-5
@@ -3,13 +3,12 @@ package com.glodblock.github.inventory.external;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.glodblock.github.util.Util;
|
||||
|
||||
import appeng.api.implementations.tiles.ITileStorageMonitorable;
|
||||
import appeng.api.networking.security.BaseActionSource;
|
||||
import appeng.api.storage.IExternalStorageHandler;
|
||||
import appeng.api.storage.IMEInventory;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class AEFluidInterfaceHandler implements IExternalStorageHandler {
|
||||
|
||||
@@ -18,7 +17,7 @@ public class AEFluidInterfaceHandler implements IExternalStorageHandler {
|
||||
if (channel == StorageChannel.FLUIDS) {
|
||||
if (te instanceof ITileStorageMonitorable) {
|
||||
return true;
|
||||
} else return Util.getPart(te, d.getOpposite()) instanceof ITileStorageMonitorable;
|
||||
} else return Platform.getPartFromTE(te, d.getOpposite()) instanceof ITileStorageMonitorable;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -30,8 +29,8 @@ public class AEFluidInterfaceHandler implements IExternalStorageHandler {
|
||||
if (te instanceof ITileStorageMonitorable
|
||||
&& ((ITileStorageMonitorable) te).getMonitorable(d, src) != null) {
|
||||
return ((ITileStorageMonitorable) te).getMonitorable(d, src).getFluidInventory();
|
||||
} else if (Util.getPart(te, d.getOpposite()) instanceof ITileStorageMonitorable part
|
||||
&& ((ITileStorageMonitorable) Util.getPart(te, d.getOpposite())).getMonitorable(d, src) != null) {
|
||||
} else if (Platform.getPartFromTE(te, d.getOpposite()) instanceof ITileStorageMonitorable part
|
||||
&& part.getMonitorable(d, src) != null) {
|
||||
return part.getMonitorable(d, src).getFluidInventory();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.api.parts.IPart;
|
||||
import appeng.api.parts.IPartHost;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public abstract class PartGuiFactory<T> extends TileGuiFactory<T> {
|
||||
|
||||
@@ -17,12 +17,11 @@ public abstract class PartGuiFactory<T> extends TileGuiFactory<T> {
|
||||
@Nullable
|
||||
@Override
|
||||
protected T getInventory(TileEntity tile, ForgeDirection face) {
|
||||
if (tile instanceof IPartHost) {
|
||||
IPart part = ((IPartHost) tile).getPart(face);
|
||||
if (invClass.isInstance(part)) {
|
||||
return invClass.cast(part);
|
||||
}
|
||||
IPart part = Platform.getPartFromTE(tile, face);
|
||||
if (invClass.isInstance(part)) {
|
||||
return invClass.cast(part);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.api.parts.IPart;
|
||||
import appeng.api.parts.IPartHost;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public abstract class TileOrPartGuiFactory<T> extends TileGuiFactory<T> {
|
||||
|
||||
@@ -17,12 +17,11 @@ public abstract class TileOrPartGuiFactory<T> extends TileGuiFactory<T> {
|
||||
@Nullable
|
||||
@Override
|
||||
protected T getInventory(TileEntity tile, ForgeDirection face) {
|
||||
if (tile instanceof IPartHost) {
|
||||
IPart part = ((IPartHost) tile).getPart(face);
|
||||
if (invClass.isInstance(part)) {
|
||||
return invClass.cast(part);
|
||||
}
|
||||
IPart part = Platform.getPartFromTE(tile, face);
|
||||
if (invClass.isInstance(part)) {
|
||||
return invClass.cast(part);
|
||||
}
|
||||
|
||||
return super.getInventory(tile, face);
|
||||
}
|
||||
}
|
||||
@@ -29,7 +29,9 @@ public class WirelessMagnet {
|
||||
|
||||
Off,
|
||||
Inv,
|
||||
ME
|
||||
ME;
|
||||
|
||||
public static final Mode[] VALUES = values();
|
||||
}
|
||||
|
||||
public enum ListMode {
|
||||
@@ -138,7 +140,7 @@ public class WirelessMagnet {
|
||||
if (is != null && is.getItem() instanceof ItemWirelessUltraTerminal) {
|
||||
NBTTagCompound data = Platform.openNbtData(is);
|
||||
if (data.hasKey(modeKey)) {
|
||||
return Mode.values()[data.getInteger(modeKey)];
|
||||
return Mode.VALUES[data.getInteger(modeKey)];
|
||||
}
|
||||
setMode(is, Mode.Off);
|
||||
}
|
||||
|
||||
@@ -269,6 +269,7 @@ public class RecipeLoader implements Runnable {
|
||||
'W',
|
||||
AE2_WORK_BENCH));
|
||||
GameRegistry.addShapelessRecipe(FLUID_STORAGE_BUS.stack(), FLUID_INTERFACE, STICKY_PISTON, PISTON);
|
||||
GameRegistry.addShapelessRecipe(FLUID_STORAGE_BUS.stack(), FLUID_STORAGE_BUS);
|
||||
GameRegistry.addShapelessRecipe(FLUID_STORAGE_BUS.stack(), INTERFACE, STICKY_PISTON, PISTON);
|
||||
GameRegistry.addRecipe(
|
||||
new ShapedOreRecipe(
|
||||
|
||||
@@ -119,7 +119,12 @@ public class NEICellViewHandler implements IUsageHandler {
|
||||
final String usedBytes = Platform.formatByteDouble(cellHandler.getUsedBytes());
|
||||
final String totalBytes = Platform.formatByteDouble(cellHandler.getTotalBytes());
|
||||
fontRenderer.drawString(
|
||||
usedBytes + " " + GuiText.Of.getLocal() + ' ' + totalBytes + ' ' + GuiText.BytesUsed.getLocal(),
|
||||
usedBytes + " "
|
||||
+ GuiText.Of.getLocal()
|
||||
+ ' '
|
||||
+ totalBytes
|
||||
+ ' '
|
||||
+ GuiText.FromStoragePercent.getLocal(),
|
||||
OFFSET_X,
|
||||
INFO_OFFSET_Y,
|
||||
0);
|
||||
|
||||
@@ -16,6 +16,8 @@ public class CPacketLevelMaintainer implements IMessage {
|
||||
Batch,
|
||||
Enable,
|
||||
Disable,
|
||||
ToggleLiteMode,
|
||||
ClearLiteMode,
|
||||
}
|
||||
|
||||
private Action action;
|
||||
@@ -25,6 +27,12 @@ public class CPacketLevelMaintainer implements IMessage {
|
||||
@SuppressWarnings("unused")
|
||||
public CPacketLevelMaintainer() {}
|
||||
|
||||
public CPacketLevelMaintainer(Action action) {
|
||||
this.action = action;
|
||||
this.slotIndex = -1;
|
||||
this.size = 0;
|
||||
}
|
||||
|
||||
public CPacketLevelMaintainer(Action action, int slotIndex) {
|
||||
this.action = action;
|
||||
this.slotIndex = slotIndex;
|
||||
@@ -62,6 +70,8 @@ public class CPacketLevelMaintainer implements IMessage {
|
||||
case Batch -> clm.getTile().updateBatchSize(message.slotIndex, message.size);
|
||||
case Enable -> clm.getTile().updateStatus(message.slotIndex, false);
|
||||
case Disable -> clm.getTile().updateStatus(message.slotIndex, true);
|
||||
case ToggleLiteMode -> clm.getTile().toggleLiteMode();
|
||||
case ClearLiteMode -> clm.getTile().clearLiteMode();
|
||||
}
|
||||
clm.updateGui();
|
||||
}
|
||||
|
||||
@@ -12,8 +12,6 @@ import com.glodblock.github.inventory.gui.GuiType;
|
||||
import com.glodblock.github.util.BlockPos;
|
||||
|
||||
import appeng.api.parts.ILevelEmitter;
|
||||
import appeng.api.parts.IPart;
|
||||
import appeng.api.parts.IPartHost;
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.PrimaryGui;
|
||||
import appeng.container.interfaces.IContainerSubGui;
|
||||
@@ -125,16 +123,13 @@ public class CPacketLevelTerminalCommands implements IMessage {
|
||||
TileEntity tile = DimensionManager.getWorld(message.dim)
|
||||
.getTileEntity(message.x, message.y, message.z);
|
||||
|
||||
if (tile instanceof IPartHost host) {
|
||||
IPart part = host.getPart(message.side);
|
||||
if (part instanceof ILevelEmitter) {
|
||||
InventoryHandler.openGui(
|
||||
player,
|
||||
tile.getWorldObj(),
|
||||
new BlockPos(tile),
|
||||
message.side,
|
||||
GuiType.LEVEL_EMITTER_PROXY);
|
||||
}
|
||||
if (Platform.getPartFromTE(tile, message.side) instanceof ILevelEmitter) {
|
||||
InventoryHandler.openGui(
|
||||
player,
|
||||
tile.getWorldObj(),
|
||||
new BlockPos(tile),
|
||||
message.side,
|
||||
GuiType.LEVEL_EMITTER_PROXY);
|
||||
} else {
|
||||
InventoryHandler.openGui(
|
||||
player,
|
||||
|
||||
@@ -28,6 +28,7 @@ import appeng.container.ContainerOpenContext;
|
||||
import appeng.container.PrimaryGui;
|
||||
import appeng.container.interfaces.IContainerSubGui;
|
||||
import appeng.helpers.ICustomButtonProvider;
|
||||
import appeng.util.Platform;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
@@ -54,7 +55,7 @@ public class CPacketSwitchGuis implements IMessage {
|
||||
@Override
|
||||
public void fromBytes(ByteBuf byteBuf) {
|
||||
final int ord = byteBuf.readInt();
|
||||
mode = ord != -1 ? UltraTerminalModes.values()[ord] : null;
|
||||
mode = ord != -1 ? UltraTerminalModes.VALUES[ord] : null;
|
||||
switchTerminal = byteBuf.readBoolean();
|
||||
}
|
||||
|
||||
@@ -75,7 +76,7 @@ public class CPacketSwitchGuis implements IMessage {
|
||||
// switch terminal
|
||||
|
||||
if (message.switchTerminal) {
|
||||
ImmutablePair<Integer, ItemStack> temp = Util.getUltraWirelessTerm(player);
|
||||
ImmutablePair<Integer, ItemStack> temp = getTerminalToSwitch(player, cont);
|
||||
if (temp != null && temp.getRight().getItem() instanceof ItemWirelessUltraTerminal iwut) {
|
||||
if (message.mode != null && cont instanceof AEBaseContainer abc) {
|
||||
abc.setSwitchAbleGuiNext(message.mode.ordinal());
|
||||
@@ -118,6 +119,21 @@ public class CPacketSwitchGuis implements IMessage {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static ImmutablePair<Integer, ItemStack> getTerminalToSwitch(EntityPlayerMP player, Container cont) {
|
||||
if (cont instanceof AEBaseContainer aeBaseContainer) {
|
||||
final int slot = aeBaseContainer.getTargetSlotIndex();
|
||||
if (slot == Integer.MIN_VALUE) return null;
|
||||
|
||||
final ItemStack terminal = Platform.getItemFromPlayerInventoryBySlotIndex(player, slot);
|
||||
return terminal != null && terminal.getItem() instanceof ItemWirelessUltraTerminal
|
||||
? new ImmutablePair<>(slot, terminal)
|
||||
: null;
|
||||
}
|
||||
|
||||
// Global terminal hotkeys have no open item GUI from which to obtain an exact slot.
|
||||
return Util.getUltraWirelessTerm(player);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -18,13 +18,15 @@ public class SPacketLevelMaintainerGuiUpdate implements IMessage {
|
||||
|
||||
private Info[] infoList;
|
||||
private boolean onlyState;
|
||||
private boolean isLiteMode;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public SPacketLevelMaintainerGuiUpdate() {}
|
||||
|
||||
public SPacketLevelMaintainerGuiUpdate(RequestInfo[] requests, boolean onlyState) {
|
||||
public SPacketLevelMaintainerGuiUpdate(RequestInfo[] requests, boolean onlyState, boolean isLiteMode) {
|
||||
this.infoList = new Info[REQ_COUNT];
|
||||
this.onlyState = onlyState;
|
||||
this.isLiteMode = isLiteMode;
|
||||
|
||||
for (int i = 0; i < REQ_COUNT; i++) {
|
||||
if (requests[i] == null) {
|
||||
@@ -43,6 +45,7 @@ public class SPacketLevelMaintainerGuiUpdate implements IMessage {
|
||||
public void fromBytes(ByteBuf buf) {
|
||||
this.infoList = new Info[REQ_COUNT];
|
||||
this.onlyState = buf.readBoolean();
|
||||
this.isLiteMode = buf.readBoolean();
|
||||
|
||||
for (int i = 0; i < REQ_COUNT; i++) {
|
||||
if (buf.readBoolean()) {
|
||||
@@ -64,6 +67,7 @@ public class SPacketLevelMaintainerGuiUpdate implements IMessage {
|
||||
@Override
|
||||
public void toBytes(ByteBuf buf) {
|
||||
buf.writeBoolean(this.onlyState);
|
||||
buf.writeBoolean(this.isLiteMode);
|
||||
for (Info info : this.infoList) {
|
||||
buf.writeBoolean(info != null);
|
||||
if (info == null) continue;
|
||||
@@ -114,6 +118,8 @@ public class SPacketLevelMaintainerGuiUpdate implements IMessage {
|
||||
gui.updateComponent(i, info.quantity, info.batchSize, info.enable, info.state);
|
||||
}
|
||||
}
|
||||
|
||||
gui.updateComponent(message.isLiteMode);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -6,7 +6,6 @@ import static appeng.util.item.AEItemStackType.ITEM_STACK_TYPE;
|
||||
import java.util.IdentityHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -26,12 +25,14 @@ import com.glodblock.github.common.item.ItemFluidPacket;
|
||||
import com.glodblock.github.inventory.AEFluidInventory;
|
||||
import com.glodblock.github.inventory.IAEFluidInventory;
|
||||
import com.glodblock.github.inventory.IAEFluidTank;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.Upgrades;
|
||||
import appeng.api.implementations.IUpgradeableHost;
|
||||
import appeng.api.networking.GridFlags;
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.networking.crafting.ICraftingLink;
|
||||
import appeng.api.networking.events.MENetworkChannelsChanged;
|
||||
import appeng.api.networking.events.MENetworkPowerStatusChange;
|
||||
import appeng.api.networking.security.BaseActionSource;
|
||||
@@ -46,10 +47,12 @@ import appeng.api.storage.IStorageMonitorable;
|
||||
import appeng.api.storage.data.AEStackTypeRegistry;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IAEStack;
|
||||
import appeng.api.storage.data.IAEStackType;
|
||||
import appeng.api.util.IConfigManager;
|
||||
import appeng.core.settings.TickRates;
|
||||
import appeng.helpers.IInterfaceHost;
|
||||
import appeng.helpers.MultiCraftingTracker;
|
||||
import appeng.me.GridAccessException;
|
||||
import appeng.me.helpers.AENetworkProxy;
|
||||
import appeng.me.storage.MEMonitorIFluidHandler;
|
||||
@@ -75,6 +78,7 @@ public class DualityFluidInterface implements IGridTickable, IStorageMonitorable
|
||||
private final IAEFluidStack[] requireWork;
|
||||
private int isWorking = -1;
|
||||
private final Map<IAEStackType<?>, MEMonitorPassThrough<?>> monitorMap;
|
||||
private final MultiCraftingTracker craftingTracker;
|
||||
|
||||
public DualityFluidInterface(final AENetworkProxy networkProxy, final IInterfaceHost ih) {
|
||||
this.gridProxy = networkProxy;
|
||||
@@ -94,6 +98,8 @@ public class DualityFluidInterface implements IGridTickable, IStorageMonitorable
|
||||
for (int i = 0; i < 6; ++i) {
|
||||
this.requireWork[i] = null;
|
||||
}
|
||||
|
||||
this.craftingTracker = new MultiCraftingTracker(this.iHost, NUMBER_OF_TANKS);
|
||||
}
|
||||
|
||||
public IAEFluidStack getStandardFluid(IAEFluidStack fluid) {
|
||||
@@ -147,6 +153,18 @@ public class DualityFluidInterface implements IGridTickable, IStorageMonitorable
|
||||
this.readConfig();
|
||||
}
|
||||
|
||||
public void writeCraftingTrackerToNBT(NBTTagCompound data) {
|
||||
final NBTTagCompound tracker = new NBTTagCompound();
|
||||
this.craftingTracker.writeToNBT(tracker);
|
||||
data.setTag("fluidCraftingLinks", tracker);
|
||||
}
|
||||
|
||||
public void readCraftingTrackerFromNBT(NBTTagCompound data) {
|
||||
if (data.hasKey("fluidCraftingLinks")) {
|
||||
this.craftingTracker.readFromNBT(data.getCompoundTag("fluidCraftingLinks"));
|
||||
}
|
||||
}
|
||||
|
||||
public void writeConfigToNBT(NBTTagCompound data, String name) {
|
||||
this.config.writeToNBT(data, name);
|
||||
}
|
||||
@@ -173,6 +191,8 @@ public class DualityFluidInterface implements IGridTickable, IStorageMonitorable
|
||||
}
|
||||
|
||||
private IMEMonitor<IAEFluidStack> getFluidGrid() {
|
||||
if (!this.gridProxy.isActive()) return null;
|
||||
|
||||
try {
|
||||
return gridProxy.getGrid().<IStorageGrid>getCache(IStorageGrid.class).getFluidInventory();
|
||||
} catch (GridAccessException e) {
|
||||
@@ -182,7 +202,7 @@ public class DualityFluidInterface implements IGridTickable, IStorageMonitorable
|
||||
|
||||
@Override
|
||||
public int getInstalledUpgrades(Upgrades u) {
|
||||
return 0;
|
||||
return this.iHost.getInstalledUpgrades(u);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -326,9 +346,11 @@ public class DualityFluidInterface implements IGridTickable, IStorageMonitorable
|
||||
}
|
||||
IAEFluidStack toStore;
|
||||
if (work.getStackSize() > 0L) {
|
||||
if ((long) this.tanks.fill(slot, work.getFluidStack(), false) != work.getStackSize()) {
|
||||
if (this.craftingTracker.isBusy(slot)) {
|
||||
changed = this.handleCrafting(slot, work);
|
||||
} else if ((long) this.tanks.fill(slot, work.getFluidStack(), false) != work.getStackSize()) {
|
||||
changed = true;
|
||||
} else if (Objects.requireNonNull(getFluidGrid()).getStorageList().findPrecise(work) != null) {
|
||||
} else {
|
||||
toStore = dest.extractItems(work, Actionable.MODULATE, this.mySource);
|
||||
if (toStore != null) {
|
||||
changed = true;
|
||||
@@ -336,6 +358,8 @@ public class DualityFluidInterface implements IGridTickable, IStorageMonitorable
|
||||
if ((long) filled != toStore.getStackSize()) {
|
||||
throw new IllegalStateException("bad attempt at managing tanks. ( fill )");
|
||||
}
|
||||
} else {
|
||||
changed = this.handleCrafting(slot, work);
|
||||
}
|
||||
}
|
||||
} else if (work.getStackSize() < 0L) {
|
||||
@@ -365,6 +389,57 @@ public class DualityFluidInterface implements IGridTickable, IStorageMonitorable
|
||||
return changed;
|
||||
}
|
||||
|
||||
private boolean handleCrafting(final int slot, final IAEFluidStack fluidStack) {
|
||||
try {
|
||||
if (this.getInstalledUpgrades(Upgrades.CRAFTING) > 0 && fluidStack != null) {
|
||||
return this.craftingTracker.handleCrafting(
|
||||
slot,
|
||||
fluidStack.getStackSize(),
|
||||
(IAEStack<?>) fluidStack,
|
||||
this.iHost.getTileEntity().getWorldObj(),
|
||||
this.gridProxy.getGrid(),
|
||||
this.gridProxy.getCrafting(),
|
||||
this.mySource);
|
||||
}
|
||||
} catch (final GridAccessException e) {
|
||||
// :P
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public ImmutableSet<ICraftingLink> getRequestedJobs() {
|
||||
return this.craftingTracker.getRequestedJobs();
|
||||
}
|
||||
|
||||
public IAEStack<?> injectCraftedItems(final ICraftingLink link, final IAEStack<?> acquired, final Actionable mode) {
|
||||
final int slot = this.craftingTracker.getSlot(link);
|
||||
|
||||
if (acquired instanceof IAEFluidStack afs && slot >= 0 && slot < NUMBER_OF_TANKS) {
|
||||
if (mode == Actionable.SIMULATE) {
|
||||
final int filled = this.tanks.fill(slot, afs.getFluidStack(), false);
|
||||
return filled >= afs.getFluidStack().amount ? null
|
||||
: AEFluidStack.create(drainRemainder(afs.getFluidStack(), filled));
|
||||
} else {
|
||||
final int filled = this.tanks.fill(slot, afs.getFluidStack(), true);
|
||||
this.updatePlan(slot);
|
||||
return filled >= afs.getFluidStack().amount ? null
|
||||
: AEFluidStack.create(drainRemainder(afs.getFluidStack(), filled));
|
||||
}
|
||||
}
|
||||
|
||||
return acquired;
|
||||
}
|
||||
|
||||
private static FluidStack drainRemainder(final FluidStack original, final int accepted) {
|
||||
final FluidStack remainder = original.copy();
|
||||
remainder.amount -= accepted;
|
||||
return remainder;
|
||||
}
|
||||
|
||||
public void jobStateChange(final ICraftingLink link) {
|
||||
this.craftingTracker.jobStateChange(link);
|
||||
}
|
||||
|
||||
private void updatePlan(int slot) {
|
||||
IAEFluidStack req = this.config.getFluidInSlot(slot);
|
||||
IAEFluidStack stored = this.tanks.getFluidInSlot(slot);
|
||||
|
||||
@@ -1,46 +1,20 @@
|
||||
package com.glodblock.github.util;
|
||||
|
||||
import net.minecraft.util.StatCollector;
|
||||
import com.gtnewhorizon.gtnhlib.color.ColorResource;
|
||||
|
||||
import appeng.core.AELog;
|
||||
public class FCGuiColors {
|
||||
|
||||
public enum FCGuiColors {
|
||||
private static final ColorResource.Factory color = new ColorResource.Factory("ae2fc");
|
||||
|
||||
// ARGB Colors: Name and default value
|
||||
StateNone(0x00000000),
|
||||
StateIdle(0xFF55FF55),
|
||||
StateCraft(0xFFFFFF55),
|
||||
StateExport(0xFFAA00AA),
|
||||
StateError(0xFFFF5555);
|
||||
public static final ColorResource
|
||||
// spotless:off
|
||||
guiTextColorGray = color.rgb("guiTextColorGray", "0x404040"),
|
||||
|
||||
private final String root;
|
||||
private final int color;
|
||||
|
||||
FCGuiColors() {
|
||||
this.root = "ae2fc.gui.color";
|
||||
this.color = 0x000000;
|
||||
}
|
||||
|
||||
FCGuiColors(final int hex) {
|
||||
this.root = "ae2fc.gui.color";
|
||||
this.color = hex;
|
||||
}
|
||||
|
||||
public int getColor() {
|
||||
String hex = StatCollector.translateToLocal(this.getUnlocalized());
|
||||
int color = this.color;
|
||||
|
||||
if (hex.length() <= 8) {
|
||||
try {
|
||||
color = Integer.parseUnsignedInt(hex, 16);
|
||||
} catch (final NumberFormatException e) {
|
||||
AELog.warn("Couldn't format color correctly for: " + this.root + " -> " + hex);
|
||||
}
|
||||
}
|
||||
return color;
|
||||
}
|
||||
|
||||
public String getUnlocalized() {
|
||||
return this.root + '.' + this.toString();
|
||||
}
|
||||
stateNone = color.argb("stateNone", "0x00000000"),
|
||||
stateIdle = color.argb("stateIdle", "0xFF55FF55"),
|
||||
stateCraft = color.argb("stateCraft", "0xFFFFFF55"),
|
||||
stateExport = color.argb("stateExport", "0xFFAA00AA"),
|
||||
stateError = color.argb("stateError", "0xFFFF5555"),
|
||||
itemSlotOverlayUnpowered = color.argb("itemSlotOverlayUnpowered", "0x66111111");
|
||||
// spotless:on
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.glodblock.github.util;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import com.glodblock.github.client.textures.FCPartsTexture;
|
||||
import com.glodblock.github.common.item.FCBaseItemCell;
|
||||
|
||||
import appeng.api.implementations.items.IStorageCell;
|
||||
import appeng.api.implementations.tiles.IChestOrDrive;
|
||||
import appeng.api.storage.ICellHandler;
|
||||
import appeng.api.storage.ICellInventoryHandler;
|
||||
import appeng.api.storage.IMEInventory;
|
||||
import appeng.api.storage.IMEInventoryHandler;
|
||||
import appeng.api.storage.ISaveProvider;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.api.storage.data.IAEStackType;
|
||||
import appeng.core.sync.GuiBridge;
|
||||
import appeng.me.storage.CellInventory;
|
||||
import appeng.me.storage.FluidCellInventoryHandler;
|
||||
import appeng.util.Platform;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class FluidCellHandler implements ICellHandler {
|
||||
|
||||
@Override
|
||||
public boolean isCell(final ItemStack is) {
|
||||
/*
|
||||
* FCBaseItemCell covers Basic, Multi, and Extreme fluid storage
|
||||
*/
|
||||
return is != null && is.getItem() instanceof FCBaseItemCell;
|
||||
}
|
||||
|
||||
/**
|
||||
* ME Chest icon
|
||||
*/
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getTopTexture_Dark() {
|
||||
return FCPartsTexture.BlockMEChestFluid_Dark.getIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getTopTexture_Light() {
|
||||
return FCPartsTexture.BlockMEChestFluid_Bright.getIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getTopTexture_Medium() {
|
||||
return FCPartsTexture.BlockMEChestFluid_Medium.getIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openChestGui(final EntityPlayer player, final IChestOrDrive chest, final ICellHandler cellHandler,
|
||||
@SuppressWarnings("rawtypes") final IMEInventoryHandler inv, final ItemStack itemStack,
|
||||
final StorageChannel channel) {
|
||||
Platform.openGUI(player, (TileEntity) chest, chest.getUp(), GuiBridge.GUI_ME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getStatusForCell(ItemStack is, IMEInventory handler) {
|
||||
if (handler instanceof FluidCellInventoryHandler ci) {
|
||||
return ci.getStatusForCell();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double cellIdleDrain(final ItemStack is, @SuppressWarnings("rawtypes") final IMEInventory handler) {
|
||||
return ((ICellInventoryHandler) handler).getCellInv().getIdleDrain();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMEInventoryHandler getCellInventory(ItemStack fluidCell, ISaveProvider saveProvider, IAEStackType<?> type) {
|
||||
if (fluidCell != null && fluidCell.getItem() instanceof IStorageCell cell && cell.getStackType() == type) {
|
||||
return CellInventory.getCell(fluidCell, saveProvider, type);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -87,6 +87,7 @@ public class NameConst {
|
||||
public static final String TT_LEVEL_MAINTAINER_NOT_FOUND_DESC = TT_LEVEL_MAINTAINER + "not_found_desc";
|
||||
public static final String TT_LEVEL_MAINTAINER_CANT_CRAFT = TT_LEVEL_MAINTAINER + "cant_craft";
|
||||
public static final String TT_LEVEL_MAINTAINER_CANT_CRAFT_DESC = TT_LEVEL_MAINTAINER + "cant_craft_desc";
|
||||
public static final String TT_LEVEL_MAINTAINER_LITE_CRAFT_DESC = TT_LEVEL_MAINTAINER + "lite_craft_desc";
|
||||
public static final String TT_CELL_PORTABLE = TT_KEY + "cell_portable";
|
||||
public static final String TT_WIRELESS = TT_KEY + "wireless.";
|
||||
public static final String TT_WIRELESS_INSTALLED = TT_WIRELESS + "installed";
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.glodblock.github.util;
|
||||
|
||||
public enum UltraTerminalModes {
|
||||
|
||||
CRAFTING,
|
||||
PATTERN,
|
||||
PATTERN_EX,
|
||||
INTERFACE,
|
||||
LEVEL
|
||||
LEVEL;
|
||||
|
||||
public static final UltraTerminalModes[] VALUES = values();
|
||||
}
|
||||
@@ -52,7 +52,6 @@ import appeng.api.util.DimensionalCoord;
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.items.tools.powered.ToolWirelessTerminal;
|
||||
import appeng.me.storage.NullInventory;
|
||||
import appeng.tile.networking.TileCableBus;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.item.AEFluidStack;
|
||||
import appeng.util.item.AEItemStack;
|
||||
@@ -161,11 +160,12 @@ public final class Util {
|
||||
}
|
||||
|
||||
public static ImmutablePair<Integer, ItemStack> getUltraWirelessTerm(EntityPlayer player) {
|
||||
int invSize = player.inventory.getSizeInventory();
|
||||
final ImmutablePair<Integer, ItemStack> baublesTerminal = getBaublesUltraWirelessTerm(player);
|
||||
return baublesTerminal != null ? baublesTerminal : getInventoryUltraWirelessTerm(player);
|
||||
}
|
||||
|
||||
if (invSize <= 0) {
|
||||
return null;
|
||||
}
|
||||
private static ImmutablePair<Integer, ItemStack> getInventoryUltraWirelessTerm(EntityPlayer player) {
|
||||
final int invSize = player.inventory.getSizeInventory();
|
||||
for (int i = 0; i < invSize; ++i) {
|
||||
ItemStack is = player.inventory.getStackInSlot(i);
|
||||
if (is != null && is.getItem() instanceof ItemWirelessUltraTerminal) {
|
||||
@@ -173,10 +173,14 @@ public final class Util {
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static ImmutablePair<Integer, ItemStack> getBaublesUltraWirelessTerm(EntityPlayer player) {
|
||||
if (ModAndClassUtil.BAUBLES) {
|
||||
IInventory handler = BaublesApi.getBaubles(player);
|
||||
final IInventory handler = BaublesApi.getBaubles(player);
|
||||
if (handler != null) {
|
||||
invSize = handler.getSizeInventory();
|
||||
final int invSize = handler.getSizeInventory();
|
||||
for (int i = 0; i < invSize; ++i) {
|
||||
ItemStack is = handler.getStackInSlot(i);
|
||||
if (is != null && is.getItem() instanceof ItemWirelessUltraTerminal) {
|
||||
@@ -345,13 +349,6 @@ public final class Util {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static IPart getPart(Object te, ForgeDirection face) {
|
||||
if (te instanceof TileCableBus) {
|
||||
return ((TileCableBus) te).getPart(face);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void writeFluidMapToBuf(Map<Integer, IAEFluidStack> list, ByteBuf buf) throws IOException {
|
||||
buf.writeInt(list.size());
|
||||
for (Map.Entry<Integer, IAEFluidStack> fs : list.entrySet()) {
|
||||
|
||||
@@ -190,12 +190,6 @@ ae2fc.gui.magnet.ore=Ore Dictionary benutzen
|
||||
ae2fc.gui.magnet.whitelist=Whitelist
|
||||
ae2fc.gui.magnet.blacklist=Blacklist
|
||||
|
||||
ae2fc.gui.color.StateNone=00000000
|
||||
ae2fc.gui.color.StateIdle=FF55FF55
|
||||
ae2fc.gui.color.StateCraft=FFFFFF55
|
||||
ae2fc.gui.color.StateExport=FFAA00AA
|
||||
ae2fc.gui.color.StateError=FFFF5555
|
||||
|
||||
error.unknown=Unbekannt
|
||||
|
||||
ae2fc.key.OpenTerminal=Handkonsole öffnen
|
||||
|
||||
@@ -99,6 +99,7 @@ ae2fc.tooltip.level_maintainer.not_found=§4Not Found§r
|
||||
ae2fc.tooltip.level_maintainer.not_found_desc=The Requester is trying to schedule a crafting job but can't find a crafting pattern.
|
||||
ae2fc.tooltip.level_maintainer.cant_craft=§4Can't Craft§r
|
||||
ae2fc.tooltip.level_maintainer.cant_craft_desc=The Requester is trying to schedule a crafting job but the crafting manager cannot process the job. (not enough ingredients, CPU doesn't have enough memory, recursion).
|
||||
ae2fc.tooltip.level_maintainer.lite_craft_desc=Toggle lite crafting mode. Shift-click to clear override and restore network defaults.
|
||||
ae2fc.tooltip.level_maintainer.batch_size=§6Crafting Batch Size§r
|
||||
ae2fc.tooltip.level_maintainer.batch_size.hint=When craft requests are emitted, the Requester will use the batch size for the request. Using larger batches will increase the speed of stocking up items but will require more crafting storage.
|
||||
ae2fc.tooltip.level_maintainer.request_size=§6Amount to Maintain§r
|
||||
@@ -124,7 +125,7 @@ ae2fc.tooltip.cell_portable=Right click to open its GUI. It works like a backpac
|
||||
ae2fc.tooltip.fluid_terminal=uh So we don't need EC2 anymore?
|
||||
ae2fc.tooltip.level_terminal=uh...
|
||||
ae2fc.tooltip.invalid_fluid=Invalid fluid!
|
||||
ae2fc.tooltip.item_fluid_packet=§cIf you unexpect this, then you using §6Interface§c instead of §6Dual Interface
|
||||
ae2fc.tooltip.item_fluid_packet=§cIf you didn't expect this, then you are using an §6Interface§c instead of a §6Dual Interface
|
||||
ae2fc.tooltip.encode_pattern=Encode Pattern
|
||||
ae2fc.tooltip.fluid_packet=Use a Fluid Packet/Drops Decoder to\nconvert this back into fluid.
|
||||
ae2fc.tooltip.empty=Empty
|
||||
@@ -174,6 +175,10 @@ ae2fc.tooltip.restock.on=Toggle Restock
|
||||
ae2fc.tooltip.restock.on.hint=Enable
|
||||
ae2fc.tooltip.restock.off=Toggle Restock
|
||||
ae2fc.tooltip.restock.off.hint=Disable
|
||||
ae2fc.tooltip.Full-stock.mode=Full-stock Mode
|
||||
ae2fc.tooltip.Full-stock.mode.hint=Stocked items and fluids always visible to storage busses and only after all are fully stocked following the replenisher being fully emptied, and always fully restocked
|
||||
ae2fc.tooltip.Normal.mode=Normal Mode
|
||||
ae2fc.tooltip.Normal.mode.hint=Stocked items and fluids always visible to storage busses, and only restocked when below 50%
|
||||
|
||||
ae2fc.gui.part_level_terminal=Level Terminal
|
||||
ae2fc.gui.fluid_pattern_encoder=Fluid Pattern Encoder
|
||||
@@ -199,12 +204,6 @@ ae2fc.gui.magnet.ore=Use Ore Dictionary
|
||||
ae2fc.gui.magnet.whitelist=Whitelisting
|
||||
ae2fc.gui.magnet.blacklist=Blacklisting
|
||||
|
||||
ae2fc.gui.color.StateNone=00000000
|
||||
ae2fc.gui.color.StateIdle=FF55FF55
|
||||
ae2fc.gui.color.StateCraft=FFFFFF55
|
||||
ae2fc.gui.color.StateExport=FFAA00AA
|
||||
ae2fc.gui.color.StateError=FFFF5555
|
||||
|
||||
error.unknown=Unknown
|
||||
|
||||
ae2fc.key.OpenTerminal=Open Wireless Universal Terminal
|
||||
|
||||
@@ -190,12 +190,6 @@ ae2fc.gui.magnet.ore=Использовать словарь руд
|
||||
ae2fc.gui.magnet.whitelist=Белый список
|
||||
ae2fc.gui.magnet.blacklist=Чёрный список
|
||||
|
||||
ae2fc.gui.color.StateNone=00000000
|
||||
ae2fc.gui.color.StateIdle=FF55FF55
|
||||
ae2fc.gui.color.StateCraft=FFFFFF55
|
||||
ae2fc.gui.color.StateExport=FFAA00AA
|
||||
ae2fc.gui.color.StateError=FFFF5555
|
||||
|
||||
error.unknown=Неизвестно
|
||||
|
||||
ae2fc.key.OpenTerminal=Открыть беспроводной универсальный терминал
|
||||
|
||||
@@ -159,6 +159,8 @@ ae2fc.tooltip.restock.on=Toggle Restock
|
||||
ae2fc.tooltip.restock.on.hint=Enable
|
||||
ae2fc.tooltip.restock.off=Toggle Restock
|
||||
ae2fc.tooltip.restock.off.hint=Disable
|
||||
ae2fc.tooltip.Full-stock.mode=Full-stock Mode
|
||||
ae2fc.tooltip.Normal.mode=Normal Mode
|
||||
|
||||
ae2fc.gui.part_level_terminal=Level Terminal
|
||||
ae2fc.gui.fluid_pattern_encoder=流体适配型样板编码台
|
||||
@@ -184,12 +186,6 @@ ae2fc.gui.magnet.ore=Use Ore Dictionary
|
||||
ae2fc.gui.magnet.whitelist=Whitelisting
|
||||
ae2fc.gui.magnet.blacklist=Blacklisting
|
||||
|
||||
ae2fc.gui.color.StateNone=00000000
|
||||
ae2fc.gui.color.StateIdle=FF55FF55
|
||||
ae2fc.gui.color.StateCraft=FFFFFF55
|
||||
ae2fc.gui.color.StateExport=FFAA00AA
|
||||
ae2fc.gui.color.StateError=FFFF5555
|
||||
|
||||
error.unknown=未知流体
|
||||
|
||||
ae2fc.key.OpenTerminal=Open Wireless Universal Terminal
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 95 B |
Binary file not shown.
|
After Width: | Height: | Size: 119 B |
Binary file not shown.
|
After Width: | Height: | Size: 115 B |
Binary file not shown.
|
Before Width: | Height: | Size: 502 B After Width: | Height: | Size: 1.0 KiB |
Reference in new issue
Block a user