mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-10-27 06:43:49 +00:00
Compare commits
17
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a110560099 | ||
|
|
6c3106c001 | ||
|
|
77d694d097 | ||
|
|
85c56a0552 | ||
|
|
dc542e9a90 | ||
|
|
e37a24a861 | ||
|
|
bde2c04322 | ||
|
|
ba822d614d | ||
|
|
4b66de3ddb | ||
|
|
5d2b7cd305 | ||
|
|
750d0d90e8 | ||
|
|
d5885cb599 | ||
|
|
676d44c112 | ||
|
|
0f7a126417 | ||
|
|
766b289246 | ||
|
|
efd579bfae | ||
|
|
b0583a32cb |
No files matched your search
+5
-5
@@ -34,11 +34,11 @@
|
||||
* 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.7.31-GTNH:dev')
|
||||
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-554-GTNH:dev')
|
||||
api('com.github.GTNewHorizons:NotEnoughItems:2.7.34-GTNH:dev')
|
||||
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-563-GTNH:dev')
|
||||
api('curse.maven:cofh-core-69162:2388751')
|
||||
api('com.github.GTNewHorizons:waila:1.8.4:dev')
|
||||
api("com.github.GTNewHorizons:GTNHLib:0.6.16:dev")
|
||||
api("com.github.GTNewHorizons:GTNHLib:0.6.17:dev")
|
||||
|
||||
implementation("com.github.GTNewHorizons:WirelessCraftingTerminal:1.12.0:dev") {
|
||||
exclude group: 'com.github.GTNewHorizons', module: 'Applied-Energistics-2-Unofficial'
|
||||
@@ -47,8 +47,8 @@ dependencies {
|
||||
compileOnly('com.github.GTNewHorizons:Baubles-Expanded:2.1.6-GTNH:dev')
|
||||
compileOnly('com.github.GTNewHorizons:ExtraCells2:2.5.35:dev') { transitive = false }
|
||||
compileOnly('com.github.GTNewHorizons:ForestryMC:4.10.5:dev')
|
||||
compileOnly('com.github.GTNewHorizons:EnderIO:2.9.5:dev')
|
||||
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.51.189:dev') {
|
||||
compileOnly('com.github.GTNewHorizons:EnderIO:2.9.6:dev')
|
||||
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.51.200:dev') {
|
||||
exclude group: 'com.github.GTNewHorizons', module: 'AE2FluidCraft-Rework'
|
||||
exclude group: 'com.github.GTNewHorizons', module: 'Applied-Energistics-2-Unofficial'
|
||||
}
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
package com.glodblock.github.client.gui.widget;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class FCGuiBaseButton extends GuiButton {
|
||||
|
||||
// copy from wct button
|
||||
protected static final ResourceLocation buttonTextures = new ResourceLocation(
|
||||
"minecraft",
|
||||
"textures/gui/widgets.png");
|
||||
|
||||
public FCGuiBaseButton(int id, int xPosition, int yPosition, int width, int height, String displayString) {
|
||||
super(id, xPosition, yPosition, width, height, displayString);
|
||||
this.enabled = true;
|
||||
this.visible = true;
|
||||
this.id = id;
|
||||
this.xPosition = xPosition;
|
||||
this.yPosition = yPosition;
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
this.displayString = displayString;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
|
||||
if (this.visible) {
|
||||
FontRenderer fontrenderer = mc.fontRenderer;
|
||||
mc.getTextureManager().bindTexture(buttonTextures);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.field_146123_n = mouseX >= this.xPosition && mouseY >= this.yPosition
|
||||
&& mouseX < this.xPosition + this.width
|
||||
&& mouseY < this.yPosition + this.height;
|
||||
int k = this.getHoverState(this.field_146123_n);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
this.drawTexturedModalRect(this.xPosition, this.yPosition, 0, 46 + k * 20, this.width / 2, this.height);
|
||||
this.drawTexturedModalRect(
|
||||
this.xPosition + this.width / 2,
|
||||
this.yPosition,
|
||||
200 - this.width / 2,
|
||||
46 + k * 20,
|
||||
this.width / 2,
|
||||
this.height - 2);
|
||||
this.drawTexturedModalRect(
|
||||
this.xPosition + 2,
|
||||
this.yPosition + (this.height - 2),
|
||||
200 - (this.width - 2),
|
||||
64 + k * 20,
|
||||
this.width - 2,
|
||||
2);
|
||||
this.drawTexturedModalRect(
|
||||
this.xPosition,
|
||||
this.yPosition + (this.height - 1),
|
||||
200 - this.width,
|
||||
65 + k * 20,
|
||||
this.width,
|
||||
1);
|
||||
this.mouseDragged(mc, mouseX, mouseY);
|
||||
|
||||
int l = 14737632;
|
||||
|
||||
if (packedFGColour != 0) {
|
||||
l = packedFGColour;
|
||||
} else if (!this.enabled) {
|
||||
l = 10526880;
|
||||
} else if (this.field_146123_n) {
|
||||
l = 16777120;
|
||||
}
|
||||
|
||||
this.drawCenteredString(
|
||||
fontrenderer,
|
||||
this.displayString,
|
||||
this.xPosition + this.width / 2,
|
||||
this.yPosition + (this.height - 8) / 2,
|
||||
l);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -66,6 +66,16 @@ public class GuiFCImgButton extends GuiButton implements ITooltip {
|
||||
this.registerApp(22, "SWITCH", "DISABLE", "disable");
|
||||
this.registerApp(23, "CONFIG", "YES", "open_configuration");
|
||||
this.registerApp(24, "HIGHLIGHT", "YES", "block_highlight");
|
||||
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");
|
||||
this.registerApp(31, "MAGNET_CARD", "OFF", "magnet_card.off");
|
||||
this.registerApp(32, "DATA_SYNC", "ENABLE", "data_sync.enable");
|
||||
this.registerApp(33, "ENABLE_12x", "ENABLE", "enable");
|
||||
this.registerApp(34, "DISABLE_12x", "DISABLE", "disable");
|
||||
this.registerApp(35, "DATA_SYNC", "DISABLE", "data_sync.disable");
|
||||
this.registerApp(36, "RESTOCK", "ENABLE", "restock.on");
|
||||
this.registerApp(37, "RESTOCK", "DISABLE", "restock.off");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ public class GuiFluidMonitor extends FCGuiMonitor<IAEFluidStack> {
|
||||
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||
this.fontRendererObj.drawString(this.getGuiDisplayName(GuiText.Terminal.getLocal()), 8, 6, 4210752);
|
||||
this.fontRendererObj.drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
|
||||
super.drawFG(offsetX, offsetY, mouseX, mouseY);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -27,4 +27,9 @@ public class GuiFluidPortableCell extends GuiFluidTerminal {
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isPortableCell() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -37,6 +37,7 @@ public class GuiItemMonitor extends FCGuiMonitor<IAEItemStack> {
|
||||
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||
this.fontRendererObj.drawString(this.getGuiDisplayName(GuiText.Terminal.getLocal()), 8, 6, 4210752);
|
||||
this.fontRendererObj.drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
|
||||
super.drawFG(offsetX, offsetY, mouseX, mouseY);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,177 @@
|
||||
/* Author: asdflj */
|
||||
package com.glodblock.github.client.gui;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.client.gui.container.ContainerMagnetFilter;
|
||||
import com.glodblock.github.client.gui.widget.FCGuiBaseButton;
|
||||
import com.glodblock.github.common.item.ItemWirelessUltraTerminal;
|
||||
import com.glodblock.github.inventory.InventoryHandler;
|
||||
import com.glodblock.github.inventory.item.WirelessMagnet;
|
||||
import com.glodblock.github.network.CPacketFluidPatternTermBtns;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
|
||||
import appeng.api.config.ActionItems;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.client.gui.AEBaseMEGui;
|
||||
import appeng.client.gui.widgets.GuiImgButton;
|
||||
import appeng.client.gui.widgets.GuiTabButton;
|
||||
|
||||
public class GuiMagnetFilter extends AEBaseMEGui {
|
||||
|
||||
protected FCGuiBaseButton listModeBtn;
|
||||
protected ContainerMagnetFilter cont;
|
||||
private static final ResourceLocation TEX_BG = FluidCraft.resource("textures/gui/magnet_filter.png");
|
||||
|
||||
protected Component components[] = new Component[3];
|
||||
protected GuiTabButton originalGuiBtn;
|
||||
protected GuiImgButton clearBtn;
|
||||
|
||||
public GuiMagnetFilter(InventoryPlayer ip, ITerminalHost container) {
|
||||
super(new ContainerMagnetFilter(ip, container));
|
||||
this.xSize = 195;
|
||||
this.ySize = 214;
|
||||
this.cont = (ContainerMagnetFilter) this.inventorySlots;
|
||||
}
|
||||
|
||||
private class Component {
|
||||
|
||||
private GuiFCImgButton enable;
|
||||
private GuiFCImgButton disable;
|
||||
private String action;
|
||||
private boolean var;
|
||||
|
||||
public Component(int x, int y, boolean var, String action) {
|
||||
this.enable = new GuiFCImgButton(x, y, "ENABLE_12x", "ENABLE", false);
|
||||
this.disable = new GuiFCImgButton(x, y, "DISABLE_12x", "DISABLE", false);
|
||||
this.var = var;
|
||||
this.action = action;
|
||||
buttonList.add(this.enable);
|
||||
buttonList.add(this.disable);
|
||||
}
|
||||
|
||||
public boolean sameBtn(GuiButton btn) {
|
||||
return btn == this.enable || btn == this.disable;
|
||||
}
|
||||
|
||||
public boolean getVar() {
|
||||
return this.var;
|
||||
}
|
||||
|
||||
public void setVar(boolean var) {
|
||||
this.var = var;
|
||||
}
|
||||
|
||||
public void send() {
|
||||
FluidCraft.proxy.netHandler.sendToServer(new CPacketFluidPatternTermBtns(this.action, !this.getVar()));
|
||||
}
|
||||
|
||||
public void draw() {
|
||||
if (var) {
|
||||
this.enable.visible = true;
|
||||
this.disable.visible = false;
|
||||
} else {
|
||||
this.enable.visible = false;
|
||||
this.disable.visible = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
this.buttonList.clear();
|
||||
|
||||
this.buttonList.add(
|
||||
this.listModeBtn = new FCGuiBaseButton(
|
||||
0,
|
||||
this.guiLeft + 86,
|
||||
this.guiTop + 4,
|
||||
64,
|
||||
14,
|
||||
NameConst.i18n(
|
||||
this.cont.listMode == WirelessMagnet.ListMode.WhiteList
|
||||
? NameConst.GUI_MAGNET_CARD_WhiteList
|
||||
: NameConst.GUI_MAGNET_CARD_BlackList)));
|
||||
this.components[0] = new Component(
|
||||
this.guiLeft + 156,
|
||||
this.guiTop + 18,
|
||||
this.cont.nbt,
|
||||
"WirelessTerminal.magnet.NBT");
|
||||
this.components[1] = new Component(
|
||||
this.guiLeft + 156,
|
||||
this.guiTop + 31,
|
||||
this.cont.meta,
|
||||
"WirelessTerminal.magnet.Meta");
|
||||
this.components[2] = new Component(
|
||||
this.guiLeft + 156,
|
||||
this.guiTop + 44,
|
||||
this.cont.ore,
|
||||
"WirelessTerminal.magnet.Ore");
|
||||
|
||||
this.buttonList.add(
|
||||
this.originalGuiBtn = new GuiTabButton(
|
||||
this.guiLeft + this.xSize - 44,
|
||||
this.guiTop - 4,
|
||||
this.cont.getPortableCell().getItemStack(),
|
||||
this.cont.getPortableCell().getItemStack().getDisplayName(),
|
||||
itemRender));
|
||||
this.originalGuiBtn.setHideEdge(13); // GuiTabButton implementation //
|
||||
|
||||
this.clearBtn = new GuiImgButton(this.guiLeft + 8, this.guiTop + 48, Settings.ACTIONS, ActionItems.CLOSE);
|
||||
this.clearBtn.setHalfSize(true);
|
||||
this.buttonList.add(this.clearBtn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) {
|
||||
this.fontRendererObj.drawString(getGuiDisplayName(NameConst.i18n(NameConst.GUI_MAGNET_CARD)), 8, 6, 0x404040);
|
||||
this.fontRendererObj
|
||||
.drawString(getGuiDisplayName(NameConst.i18n(NameConst.GUI_MAGNET_CARD_NBT)), 61, 22, 0x404040);
|
||||
this.fontRendererObj
|
||||
.drawString(getGuiDisplayName(NameConst.i18n(NameConst.GUI_MAGNET_CARD_META)), 61, 34, 0x404040);
|
||||
this.fontRendererObj
|
||||
.drawString(getGuiDisplayName(NameConst.i18n(NameConst.GUI_MAGNET_CARD_ORE)), 61, 46, 0x404040);
|
||||
this.components[0].setVar(this.cont.nbt);
|
||||
this.components[1].setVar(this.cont.meta);
|
||||
this.components[2].setVar(this.cont.ore);
|
||||
for (Component c : components) {
|
||||
c.draw();
|
||||
}
|
||||
this.listModeBtn.displayString = NameConst.i18n(
|
||||
this.cont.listMode == WirelessMagnet.ListMode.WhiteList ? NameConst.GUI_MAGNET_CARD_WhiteList
|
||||
: NameConst.GUI_MAGNET_CARD_BlackList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) {
|
||||
mc.getTextureManager().bindTexture(TEX_BG);
|
||||
drawTexturedModalRect(offsetX, offsetY, 0, 0, 176, ySize);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton btn) {
|
||||
for (Component c : components) {
|
||||
if (c.sameBtn(btn)) {
|
||||
c.send();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (btn == this.listModeBtn) {
|
||||
FluidCraft.proxy.netHandler.sendToServer(
|
||||
new CPacketFluidPatternTermBtns(
|
||||
"WirelessTerminal.magnet.FilterMode",
|
||||
this.cont.listMode != WirelessMagnet.ListMode.WhiteList));
|
||||
} else if (btn == this.originalGuiBtn) {
|
||||
InventoryHandler.switchGui(ItemWirelessUltraTerminal.readMode(this.cont.getPortableCell().getItemStack()));
|
||||
} else if (btn == this.clearBtn) {
|
||||
FluidCraft.proxy.netHandler
|
||||
.sendToServer(new CPacketFluidPatternTermBtns("WirelessTerminal.magnet.clear", 1));
|
||||
}
|
||||
super.actionPerformed(btn);
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.client.gui.GuiEssentiaTerminal;
|
||||
import com.glodblock.github.client.gui.GuiFCImgButton;
|
||||
import com.glodblock.github.client.gui.GuiFluidCraftingWireless;
|
||||
@@ -19,8 +20,11 @@ import com.glodblock.github.client.gui.container.base.FCBaseContainer;
|
||||
import com.glodblock.github.common.item.ItemWirelessUltraTerminal;
|
||||
import com.glodblock.github.inventory.gui.GuiType;
|
||||
import com.glodblock.github.inventory.item.IWirelessTerminal;
|
||||
import com.glodblock.github.inventory.item.WirelessMagnet;
|
||||
import com.glodblock.github.network.CPacketFluidPatternTermBtns;
|
||||
import com.glodblock.github.util.ModAndClassUtil;
|
||||
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.client.gui.AEBaseMEGui;
|
||||
|
||||
public abstract class FCBaseMEGui extends AEBaseMEGui {
|
||||
@@ -32,8 +36,15 @@ public abstract class FCBaseMEGui extends AEBaseMEGui {
|
||||
protected GuiFCImgButton InterfaceTerminal;
|
||||
protected GuiFCImgButton LevelTerminal;
|
||||
protected GuiFCImgButton PatternTerminalEx;
|
||||
protected GuiFCImgButton magnetOff;
|
||||
protected GuiFCImgButton magnetInv;
|
||||
protected GuiFCImgButton magnetME;
|
||||
protected GuiFCImgButton magnetFilter;
|
||||
protected GuiFCImgButton restockEnableBtn;
|
||||
protected GuiFCImgButton restockDisableBtn;
|
||||
protected List<GuiFCImgButton> termBtns = new ArrayList<>();
|
||||
protected boolean drawSwitchGuiBtn;
|
||||
private StorageChannel channel = null;
|
||||
|
||||
public FCBaseMEGui(final InventoryPlayer inventoryPlayer, Container container) {
|
||||
super(container);
|
||||
@@ -42,10 +53,19 @@ public abstract class FCBaseMEGui extends AEBaseMEGui {
|
||||
if (target instanceof IWirelessTerminal
|
||||
&& ((IWirelessTerminal) target).getItemStack().getItem() instanceof ItemWirelessUltraTerminal) {
|
||||
this.drawSwitchGuiBtn = true;
|
||||
channel = ((IWirelessTerminal) target).getChannel();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected WirelessMagnet.Mode getMagnetMode() {
|
||||
return ((FCBaseContainer) this.inventorySlots).mode;
|
||||
}
|
||||
|
||||
protected boolean isRestock() {
|
||||
return ((FCBaseContainer) this.inventorySlots).restock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGuiClosed() {
|
||||
super.onGuiClosed();
|
||||
@@ -66,6 +86,46 @@ public abstract class FCBaseMEGui extends AEBaseMEGui {
|
||||
if (!termBtns.isEmpty()) {
|
||||
this.termBtns.clear();
|
||||
}
|
||||
if (this.getMagnetMode() != null && this.channel == StorageChannel.ITEMS) {
|
||||
this.buttonList.add(
|
||||
this.magnetOff = new GuiFCImgButton(
|
||||
this.guiLeft + this.xSize - 18,
|
||||
this.guiTop + this.ySize - 124,
|
||||
"MAGNET_CARD",
|
||||
"OFF"));
|
||||
this.buttonList.add(
|
||||
this.magnetInv = new GuiFCImgButton(
|
||||
this.guiLeft + this.xSize - 18,
|
||||
this.guiTop + this.ySize - 124,
|
||||
"MAGNET_CARD",
|
||||
"INV"));
|
||||
this.buttonList.add(
|
||||
this.magnetME = new GuiFCImgButton(
|
||||
this.guiLeft + this.xSize - 18,
|
||||
this.guiTop + this.ySize - 124,
|
||||
"MAGNET_CARD",
|
||||
"ME"));
|
||||
this.buttonList.add(
|
||||
this.magnetFilter = new GuiFCImgButton(
|
||||
this.guiLeft + this.xSize - 18,
|
||||
this.guiTop + this.ySize - 104,
|
||||
"MAGNET_CARD",
|
||||
"FILTER"));
|
||||
}
|
||||
if (this.channel == StorageChannel.ITEMS) {
|
||||
this.buttonList.add(
|
||||
this.restockEnableBtn = new GuiFCImgButton(
|
||||
this.guiLeft + this.xSize - 18,
|
||||
this.guiTop + this.ySize - 84,
|
||||
"RESTOCK",
|
||||
"ENABLE"));
|
||||
this.buttonList.add(
|
||||
this.restockDisableBtn = new GuiFCImgButton(
|
||||
this.guiLeft + this.xSize - 18,
|
||||
this.guiTop + this.ySize - 84,
|
||||
"RESTOCK",
|
||||
"DISABLE"));
|
||||
}
|
||||
if (!(this instanceof GuiFluidCraftingWireless)) {
|
||||
this.buttonList.add(
|
||||
this.CraftingTerminal = new GuiFCImgButton(
|
||||
@@ -157,6 +217,21 @@ public abstract class FCBaseMEGui extends AEBaseMEGui {
|
||||
scheduleGuiResize = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) {
|
||||
if (isPortableCell()) return;
|
||||
if (getMagnetMode() != null && this.channel == StorageChannel.ITEMS) {
|
||||
GuiFCImgButton[] magnetButtons = { this.magnetOff, this.magnetInv, this.magnetME };
|
||||
for (int i = 0; i < magnetButtons.length; i++) {
|
||||
magnetButtons[i].visible = getMagnetMode().ordinal() == i;
|
||||
}
|
||||
}
|
||||
if (this.drawSwitchGuiBtn && this.channel == StorageChannel.ITEMS) { // Only ultra terminal
|
||||
this.restockDisableBtn.visible = !this.isRestock();
|
||||
this.restockEnableBtn.visible = this.isRestock();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(final GuiButton btn) {
|
||||
if (btn instanceof GuiFCImgButton) {
|
||||
@@ -174,8 +249,20 @@ public abstract class FCBaseMEGui extends AEBaseMEGui {
|
||||
ItemWirelessUltraTerminal.switchTerminal(this.mc.thePlayer, GuiType.WIRELESS_LEVEL_TERMINAL);
|
||||
} else if (btn == this.PatternTerminalEx) {
|
||||
ItemWirelessUltraTerminal.switchTerminal(this.mc.thePlayer, GuiType.WIRELESS_FLUID_PATTERN_TERMINAL_EX);
|
||||
} else if (btn == this.magnetOff || btn == this.magnetME || btn == this.magnetInv) {
|
||||
FluidCraft.proxy.netHandler.sendToServer(
|
||||
new CPacketFluidPatternTermBtns("WirelessTerminal.MagnetMode", this.getMagnetMode().ordinal()));
|
||||
} else if (btn == this.magnetFilter) {
|
||||
FluidCraft.proxy.netHandler
|
||||
.sendToServer(new CPacketFluidPatternTermBtns("WirelessTerminal.OpenMagnet", 0));
|
||||
} else if (btn == this.restockDisableBtn || btn == this.restockEnableBtn) {
|
||||
FluidCraft.proxy.netHandler.sendToServer(new CPacketFluidPatternTermBtns("WirelessTerminal.Stock", 1));
|
||||
}
|
||||
}
|
||||
super.actionPerformed(btn);
|
||||
}
|
||||
|
||||
protected boolean isPortableCell() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
/* Author: asdflj */
|
||||
package com.glodblock.github.client.gui.container;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import com.glodblock.github.client.gui.container.base.FCBaseContainer;
|
||||
import com.glodblock.github.inventory.item.IItemTerminal;
|
||||
import com.glodblock.github.inventory.item.IWirelessMagnetFilter;
|
||||
import com.glodblock.github.inventory.item.WirelessMagnet;
|
||||
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.container.guisync.GuiSync;
|
||||
import appeng.container.slot.AppEngSlot;
|
||||
import appeng.container.slot.IOptionalSlotHost;
|
||||
import appeng.container.slot.SlotFake;
|
||||
import appeng.container.slot.SlotPatternOutputs;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class ContainerMagnetFilter extends FCBaseContainer implements IOptionalSlotHost {
|
||||
|
||||
@GuiSync(101)
|
||||
public WirelessMagnet.ListMode listMode;
|
||||
|
||||
@GuiSync(102)
|
||||
public boolean nbt;
|
||||
|
||||
@GuiSync(103)
|
||||
public boolean meta;
|
||||
|
||||
@GuiSync(104)
|
||||
public boolean ore;
|
||||
protected SlotFake[] filterSlots;
|
||||
protected final IInventory filter;
|
||||
|
||||
public ContainerMagnetFilter(InventoryPlayer ip, ITerminalHost monitorable) {
|
||||
super(ip, monitorable);
|
||||
this.filter = ((IItemTerminal) monitorable).getInventoryByName("config");
|
||||
this.filterSlots = new SlotFake[27];
|
||||
for (int y = 0; y < 3; y++) {
|
||||
for (int x = 0; x < 9; x++) {
|
||||
this.addSlotToContainer(
|
||||
this.filterSlots[x + y * 9] = new SlotPatternOutputs(
|
||||
this.filter,
|
||||
this,
|
||||
x + y * 9,
|
||||
8 + x * 18,
|
||||
58 + y * 18,
|
||||
0,
|
||||
0,
|
||||
1));
|
||||
}
|
||||
}
|
||||
bindPlayerInventory(ip, 0, 126);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isWirelessTerminal() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer p, int idx) {
|
||||
AppEngSlot clickSlot = (AppEngSlot) this.inventorySlots.get(idx);
|
||||
if (clickSlot == null || !clickSlot.getHasStack()) return null;
|
||||
ItemStack tis = clickSlot.getStack();
|
||||
for (SlotFake slot : this.filterSlots) {
|
||||
if (!slot.getHasStack()) {
|
||||
slot.putStack(tis);
|
||||
detectAndSendChanges();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return super.transferStackInSlot(p, idx);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void detectAndSendChanges() {
|
||||
if (Platform.isServer() && this.getPortableCell() instanceof IWirelessMagnetFilter) {
|
||||
IWirelessMagnetFilter host = (IWirelessMagnetFilter) this.getHost();
|
||||
this.listMode = host.getListMode();
|
||||
this.meta = host.getMetaMode();
|
||||
this.nbt = host.getNBTMode();
|
||||
this.ore = host.getOreMode();
|
||||
}
|
||||
super.detectAndSendChanges();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSlotEnabled(int idx) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -3,32 +3,42 @@ package com.glodblock.github.client.gui.container.base;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import com.glodblock.github.inventory.item.IFluidPortableCell;
|
||||
import com.glodblock.github.inventory.item.IWirelessExtendCard;
|
||||
import com.glodblock.github.inventory.item.WirelessMagnet;
|
||||
import com.glodblock.github.util.Util;
|
||||
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.guisync.GuiSync;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public abstract class FCBaseContainer extends AEBaseContainer {
|
||||
|
||||
private int ticks;
|
||||
private final double powerMultiplier = 0.5;
|
||||
private IFluidPortableCell host;
|
||||
private ITerminalHost host;
|
||||
private int slot = -1;
|
||||
private final InventoryPlayer ip;
|
||||
|
||||
@GuiSync(105)
|
||||
public boolean restock = false;
|
||||
|
||||
@GuiSync(106)
|
||||
public WirelessMagnet.Mode mode = WirelessMagnet.Mode.Off;
|
||||
|
||||
public FCBaseContainer(InventoryPlayer ip, ITerminalHost monitorable) {
|
||||
super(ip, monitorable);
|
||||
this.ip = ip;
|
||||
this.host = monitorable;
|
||||
if (isWirelessTerminal()) {
|
||||
host = (IFluidPortableCell) monitorable;
|
||||
this.slot = lockSlot();
|
||||
}
|
||||
}
|
||||
|
||||
private int lockSlot() {
|
||||
if (isWirelessTerminal()) {
|
||||
if (this.host != null) {
|
||||
final int slotIndex = this.host.getInventorySlot();
|
||||
if (this.host instanceof IFluidPortableCell) {
|
||||
final int slotIndex = ((IFluidPortableCell) this.host).getInventorySlot();
|
||||
if (Util.GuiHelper.decodeInvType(slotIndex).getLeft() == Util.GuiHelper.InvType.PLAYER_INV) {
|
||||
this.lockPlayerInventorySlot(slotIndex);
|
||||
}
|
||||
@@ -50,7 +60,14 @@ public abstract class FCBaseContainer extends AEBaseContainer {
|
||||
this.slot,
|
||||
this.ticks,
|
||||
this.getPowerMultiplier(),
|
||||
this.host);
|
||||
((IFluidPortableCell) this.host));
|
||||
}
|
||||
|
||||
if (Platform.isServer()) {
|
||||
if (this.host instanceof IWirelessExtendCard wec) {
|
||||
this.mode = wec.getMagnetCardMode();
|
||||
this.restock = wec.isRestock();
|
||||
}
|
||||
}
|
||||
super.detectAndSendChanges();
|
||||
}
|
||||
@@ -59,4 +76,14 @@ public abstract class FCBaseContainer extends AEBaseContainer {
|
||||
return this.powerMultiplier;
|
||||
}
|
||||
|
||||
public ITerminalHost getHost() {
|
||||
return this.host;
|
||||
}
|
||||
|
||||
public IFluidPortableCell getPortableCell() {
|
||||
if (this.host instanceof IFluidPortableCell fpc) {
|
||||
return fpc;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -230,8 +230,4 @@ public abstract class FCContainerMonitor<T extends IAEStack<T>> extends FCBaseCo
|
||||
this.getGui().updateSetting(manager, settingName, newValue);
|
||||
}
|
||||
}
|
||||
|
||||
public ITerminalHost getHost() {
|
||||
return this.host;
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,8 @@ public class Config {
|
||||
public static boolean replaceEC2;
|
||||
public static int levelMaintainerMinTicks;
|
||||
public static int levelMaintainerMaxTicks;
|
||||
public static int reStockTime;
|
||||
public static int magnetRange;
|
||||
|
||||
public static void run() {
|
||||
loadCategory();
|
||||
@@ -74,6 +76,9 @@ public class Config {
|
||||
levelMaintainerMaxTicks = Config.get("LevelMaintainer", "maxTick", 120, "Number on ticks for maximal request")
|
||||
.getInt();
|
||||
|
||||
reStockTime = Config.get("UltraWireless", "reStockTime", 1000, "Time between restocks").getInt();
|
||||
magnetRange = Config.get("UltraWireless", "magnetRange", 16, "Magnet pick up radius").getInt();
|
||||
|
||||
if (Config.hasChanged()) Config.save();
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import java.util.List;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
@@ -36,6 +37,8 @@ public class ItemBaseWirelessTerminal extends ToolWirelessTerminal implements II
|
||||
protected GuiType type;
|
||||
public static String infinityBoosterCard = "infinityBoosterCard";
|
||||
public static String infinityEnergyCard = "InfinityEnergyCard";
|
||||
public static String restockItems = "restock";
|
||||
private static boolean effect = false;
|
||||
|
||||
public ItemBaseWirelessTerminal(GuiType t) {
|
||||
super();
|
||||
@@ -48,6 +51,7 @@ public class ItemBaseWirelessTerminal extends ToolWirelessTerminal implements II
|
||||
// terminal
|
||||
if (ForgeEventFactory.onItemUseStart(player, item, 1) > 0) {
|
||||
if (Platform.isClient()) {
|
||||
setEffect(false);
|
||||
return item;
|
||||
}
|
||||
IWirelessTermRegistry term = AEApi.instance().registries().wireless();
|
||||
@@ -105,6 +109,9 @@ public class ItemBaseWirelessTerminal extends ToolWirelessTerminal implements II
|
||||
if (hasEnergyCard(stack)) {
|
||||
lines.add(" " + EnumChatFormatting.GOLD + getEnergyCard().getDisplayName());
|
||||
}
|
||||
if (hasEnergyCard(stack)) {
|
||||
lines.add(" " + EnumChatFormatting.GOLD + getEnergyCard().getDisplayName());
|
||||
}
|
||||
} else {
|
||||
lines.add(NameConst.i18n(NameConst.TT_CTRL_FOR_MORE));
|
||||
}
|
||||
@@ -112,6 +119,9 @@ public class ItemBaseWirelessTerminal extends ToolWirelessTerminal implements II
|
||||
|
||||
@Override
|
||||
public boolean canHandle(final ItemStack is) {
|
||||
if (is == null) {
|
||||
return false;
|
||||
}
|
||||
return is.getItem() instanceof ItemBaseWirelessTerminal;
|
||||
}
|
||||
|
||||
@@ -128,4 +138,24 @@ public class ItemBaseWirelessTerminal extends ToolWirelessTerminal implements II
|
||||
return this.type;
|
||||
}
|
||||
|
||||
public static void setEffect(boolean e) {
|
||||
effect = e;
|
||||
}
|
||||
|
||||
public static boolean getEffect() {
|
||||
return effect;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasEffect(ItemStack par1ItemStack, int pass) {
|
||||
if (Platform.isClient()) {
|
||||
return getEffect();
|
||||
}
|
||||
return super.hasEffect(par1ItemStack, pass);
|
||||
}
|
||||
|
||||
public static void toggleRestockItemsMode(ItemStack is, boolean state) {
|
||||
NBTTagCompound data = Platform.openNbtData(is);
|
||||
data.setBoolean(restockItems, state);
|
||||
}
|
||||
}
|
||||
@@ -25,6 +25,7 @@ import com.glodblock.github.inventory.item.WirelessCraftingTerminalInventory;
|
||||
import com.glodblock.github.inventory.item.WirelessFluidTerminalInventory;
|
||||
import com.glodblock.github.inventory.item.WirelessInterfaceTerminalInventory;
|
||||
import com.glodblock.github.inventory.item.WirelessLevelTerminalInventory;
|
||||
import com.glodblock.github.inventory.item.WirelessMagnetCardFilterInventory;
|
||||
import com.glodblock.github.inventory.item.WirelessPatternTerminalExInventory;
|
||||
import com.glodblock.github.inventory.item.WirelessPatternTerminalInventory;
|
||||
import com.glodblock.github.loader.IRegister;
|
||||
@@ -102,7 +103,9 @@ public class ItemWirelessUltraTerminal extends ItemBaseWirelessTerminal
|
||||
try {
|
||||
IGridNode gridNode = Util.getWirelessGrid(stack);
|
||||
final GuiType gui;
|
||||
if (Util.GuiHelper.decodeType(y).getLeft() == Util.GuiHelper.GuiType.ITEM && z > 0) {
|
||||
if (Util.GuiHelper.decodeType(y).getLeft() == Util.GuiHelper.GuiType.ITEM && z == -1) {
|
||||
gui = GuiType.WIRELESS_MAGNET_FILTER;
|
||||
} else if (Util.GuiHelper.decodeType(y).getLeft() == Util.GuiHelper.GuiType.ITEM && z > 0) {
|
||||
gui = getGuis().get(Util.GuiHelper.decodeType(y).getRight());
|
||||
} else {
|
||||
gui = readMode(stack);
|
||||
@@ -121,6 +124,8 @@ public class ItemWirelessUltraTerminal extends ItemBaseWirelessTerminal
|
||||
return new WirelessLevelTerminalInventory(stack, x, gridNode, player);
|
||||
} else if (gui == GuiType.WIRELESS_FLUID_PATTERN_TERMINAL_EX) {
|
||||
return new WirelessPatternTerminalExInventory(stack, x, gridNode, player);
|
||||
} else if (gui == GuiType.WIRELESS_MAGNET_FILTER) {
|
||||
return new WirelessMagnetCardFilterInventory(stack, x, gridNode, player);
|
||||
} else {
|
||||
this.setMode(GuiType.WIRELESS_FLUID_TERMINAL, stack); // set as default mode
|
||||
return new WirelessFluidTerminalInventory(stack, x, gridNode, player);
|
||||
|
||||
@@ -60,7 +60,7 @@ public class CreativeFluidCellInventory extends FluidCellInventory {
|
||||
if (fs == null) continue;
|
||||
IAEFluidStack iaeFluidStack = Util.FluidUtil.createAEFluidStack(fs);
|
||||
if (this.cellFluids.findPrecise(iaeFluidStack) == null) {
|
||||
iaeFluidStack.setStackSize(Integer.MAX_VALUE * 1_000_000L);
|
||||
iaeFluidStack.setStackSize((long) (Math.pow(2, 52) - 1));
|
||||
this.cellFluids.add(iaeFluidStack);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,9 @@ public class FluidCellInventoryHandler extends MEInventoryHandler<IAEFluidStack>
|
||||
final ItemStack is = config.getStackInSlot(x);
|
||||
final FluidStack fluid = Util.getFluidFromItem(is);
|
||||
if (fluid != null) {
|
||||
priorityList.add(AEFluidStack.create(fluid));
|
||||
AEFluidStack stack = AEFluidStack.create(fluid);
|
||||
stack.setStackSize(1);
|
||||
priorityList.add(stack);
|
||||
}
|
||||
}
|
||||
if (!priorityList.isEmpty()) {
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
package com.glodblock.github.crossmod.waila;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.item.ItemPotion;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import com.glodblock.github.common.item.ItemFluidDrop;
|
||||
import com.glodblock.github.util.ModAndClassUtil;
|
||||
import com.glodblock.github.util.Util;
|
||||
|
||||
import mcp.mobius.waila.handlers.nei.TooltipHandlerWaila;
|
||||
@@ -36,6 +39,15 @@ public class FCTooltipHandlerWaila extends TooltipHandlerWaila {
|
||||
}
|
||||
String modName = Util.getFluidModName(fs.getFluid());
|
||||
if (modName != null && !modName.equals("")) currenttip.set(currenttip.size() - 1, "§9§o" + modName);
|
||||
|
||||
if (ModAndClassUtil.GT5NH || ModAndClassUtil.GT5) {
|
||||
ItemStack potion = Util.FluidUtil.getPotion(fs);
|
||||
if (potion != null && potion.getItem() instanceof ItemPotion) {
|
||||
List<String> potionEffects = new ArrayList<>();
|
||||
potion.getItem().addInformation(potion, Minecraft.getMinecraft().thePlayer, potionEffects, false);
|
||||
currenttip.addAll(currenttip.size() - 1, potionEffects);
|
||||
}
|
||||
}
|
||||
}
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,18 @@
|
||||
package com.glodblock.github.inventory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.event.ClickEvent;
|
||||
import net.minecraft.event.HoverEvent;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.ChatStyle;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
@@ -25,10 +29,13 @@ import appeng.api.storage.IMEMonitorHandlerReceiver;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.core.AELog;
|
||||
import appeng.util.item.AEFluidStack;
|
||||
|
||||
public class MEMonitorIFluidHandler implements IMEMonitor<IAEFluidStack> {
|
||||
|
||||
private static boolean WrongFluidRemovedWarnIssued = false;
|
||||
|
||||
private final IFluidHandler handler;
|
||||
private final ForgeDirection side;
|
||||
private IItemList<IAEFluidStack> cache = AEApi.instance().storage().createFluidList();
|
||||
@@ -57,6 +64,10 @@ public class MEMonitorIFluidHandler implements IMEMonitor<IAEFluidStack> {
|
||||
}
|
||||
|
||||
public IAEFluidStack injectItems(IAEFluidStack input, Actionable type, BaseActionSource src) {
|
||||
if (!this.handler.canFill(this.side, input.getFluid())) {
|
||||
return input;
|
||||
}
|
||||
|
||||
int filled = this.handler.fill(this.side, input.getFluidStack(), type == Actionable.MODULATE);
|
||||
|
||||
if (type == Actionable.MODULATE) {
|
||||
@@ -73,8 +84,41 @@ public class MEMonitorIFluidHandler implements IMEMonitor<IAEFluidStack> {
|
||||
}
|
||||
|
||||
public IAEFluidStack extractItems(IAEFluidStack request, Actionable type, BaseActionSource src) {
|
||||
if (!this.handler.canDrain(this.side, request.getFluid())) {
|
||||
return null;
|
||||
}
|
||||
FluidStack removed = this.handler.drain(this.side, request.getFluidStack(), type == Actionable.MODULATE);
|
||||
if (removed != null && removed.amount != 0) {
|
||||
// perform a one time log if the removed fluid isn't what's reported since this will create a dupe exploit
|
||||
if (!WrongFluidRemovedWarnIssued && !removed.isFluidEqual(request.getFluidStack())) {
|
||||
WrongFluidRemovedWarnIssued = true;
|
||||
String issuesUrl = "https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/new";
|
||||
String msg = String.format(
|
||||
"[AE2FC] MEMonitorIFluidHandler.extractItems got the wrong fluids while extracting from %s. expected %s got %s. Please report this message if seen: ",
|
||||
this.handler.getClass().getSimpleName(),
|
||||
request.getFluidStack().getUnlocalizedName(),
|
||||
removed.getUnlocalizedName());
|
||||
// elevate log to error if chat msg is removed to make it easier to find.
|
||||
AELog.warn(msg + issuesUrl);
|
||||
|
||||
ChatComponentText chatTxt = new ChatComponentText(msg);
|
||||
chatTxt.setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED).setBold(true));
|
||||
|
||||
ChatComponentText chatUrl = new ChatComponentText(issuesUrl);
|
||||
chatUrl.setChatStyle(
|
||||
new ChatStyle().setUnderlined(true)
|
||||
.setChatClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, issuesUrl))
|
||||
.setChatHoverEvent(
|
||||
new HoverEvent(
|
||||
HoverEvent.Action.SHOW_TEXT,
|
||||
new ChatComponentText("Click to open link"))));
|
||||
|
||||
ChatComponentText chat = new ChatComponentText("");
|
||||
chat.appendSibling(chatTxt);
|
||||
chat.appendSibling(chatUrl);
|
||||
|
||||
MinecraftServer.getServer().getConfigurationManager().sendChatMsg(chat);
|
||||
}
|
||||
IAEFluidStack o = request.copy();
|
||||
o.setStackSize(removed.amount);
|
||||
if (type == Actionable.MODULATE) {
|
||||
@@ -98,8 +142,6 @@ public class MEMonitorIFluidHandler implements IMEMonitor<IAEFluidStack> {
|
||||
// *Decompiled Stuff*//
|
||||
|
||||
public TickRateModulation onTick() {
|
||||
boolean changed = false;
|
||||
List<IAEFluidStack> changes = new ArrayList<>();
|
||||
FluidTankInfo[] tankProperties = this.handler.getTankInfo(this.side);
|
||||
IItemList<IAEFluidStack> currentlyOnStorage = AEApi.instance().storage().createFluidList();
|
||||
|
||||
@@ -111,37 +153,32 @@ public class MEMonitorIFluidHandler implements IMEMonitor<IAEFluidStack> {
|
||||
}
|
||||
}
|
||||
|
||||
Iterator<?> var9 = this.cache.iterator();
|
||||
|
||||
IAEFluidStack is;
|
||||
while (var9.hasNext()) {
|
||||
is = (IAEFluidStack) var9.next();
|
||||
is.setStackSize(-is.getStackSize());
|
||||
// make diff between cache and new contents
|
||||
IItemList<IAEFluidStack> changes = AEApi.instance().storage().createFluidList();
|
||||
// using non-enhanced for to prevent concurrency errors
|
||||
for (Iterator<IAEFluidStack> iter = this.cache.iterator(); iter.hasNext();) {
|
||||
IAEFluidStack copy = iter.next().copy();
|
||||
copy.setStackSize(-copy.getStackSize());
|
||||
changes.add(copy);
|
||||
}
|
||||
|
||||
var9 = currentlyOnStorage.iterator();
|
||||
|
||||
while (var9.hasNext()) {
|
||||
is = (IAEFluidStack) var9.next();
|
||||
this.cache.add(is);
|
||||
for (IAEFluidStack is : currentlyOnStorage) {
|
||||
changes.add(is);
|
||||
}
|
||||
|
||||
var9 = this.cache.iterator();
|
||||
|
||||
while (var9.hasNext()) {
|
||||
is = (IAEFluidStack) var9.next();
|
||||
if (is.getStackSize() != 0L) {
|
||||
changes.add(is);
|
||||
// update cache as soon as possible
|
||||
this.cache = currentlyOnStorage;
|
||||
// remove unchanged values
|
||||
for (Iterator<IAEFluidStack> iter = changes.iterator(); iter.hasNext();) {
|
||||
if (iter.next().getStackSize() == 0L) {
|
||||
iter.remove();
|
||||
}
|
||||
}
|
||||
|
||||
this.cache = currentlyOnStorage;
|
||||
if (!changes.isEmpty()) {
|
||||
this.postDifference(changes);
|
||||
changed = true;
|
||||
return TickRateModulation.URGENT;
|
||||
}
|
||||
|
||||
return changed ? TickRateModulation.URGENT : TickRateModulation.SLOWER;
|
||||
return TickRateModulation.SLOWER;
|
||||
}
|
||||
|
||||
private void postDifference(Iterable<IAEFluidStack> a) {
|
||||
|
||||
@@ -33,6 +33,7 @@ import com.glodblock.github.client.gui.GuiLargeIngredientBuffer;
|
||||
import com.glodblock.github.client.gui.GuiLevelMaintainer;
|
||||
import com.glodblock.github.client.gui.GuiLevelTerminal;
|
||||
import com.glodblock.github.client.gui.GuiLevelWireless;
|
||||
import com.glodblock.github.client.gui.GuiMagnetFilter;
|
||||
import com.glodblock.github.client.gui.GuiOCPatternEditor;
|
||||
import com.glodblock.github.client.gui.GuiPatternMulti;
|
||||
import com.glodblock.github.client.gui.GuiPatternValueAmount;
|
||||
@@ -61,6 +62,7 @@ import com.glodblock.github.client.gui.container.ContainerLargeIngredientBuffer;
|
||||
import com.glodblock.github.client.gui.container.ContainerLevelMaintainer;
|
||||
import com.glodblock.github.client.gui.container.ContainerLevelTerminal;
|
||||
import com.glodblock.github.client.gui.container.ContainerLevelWireless;
|
||||
import com.glodblock.github.client.gui.container.ContainerMagnetFilter;
|
||||
import com.glodblock.github.client.gui.container.ContainerOCPatternEditor;
|
||||
import com.glodblock.github.client.gui.container.ContainerPatternMulti;
|
||||
import com.glodblock.github.client.gui.container.ContainerPatternValueAmount;
|
||||
@@ -527,6 +529,18 @@ public enum GuiType {
|
||||
protected Object createClientGui(EntityPlayer player, ITerminalHost inv) {
|
||||
return new GuiPatternMulti(player.inventory, inv);
|
||||
}
|
||||
}),
|
||||
WIRELESS_MAGNET_FILTER(new ItemGuiFactory<>(ITerminalHost.class) {
|
||||
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, ITerminalHost inv) {
|
||||
return new ContainerMagnetFilter(player.inventory, inv);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object createClientGui(EntityPlayer player, ITerminalHost inv) {
|
||||
return new GuiMagnetFilter(player.inventory, inv);
|
||||
}
|
||||
});
|
||||
|
||||
public static final List<GuiType> VALUES = ImmutableList.copyOf(values());
|
||||
|
||||
@@ -0,0 +1,174 @@
|
||||
package com.glodblock.github.inventory.item;
|
||||
|
||||
import static com.glodblock.github.common.item.ItemBaseWirelessTerminal.restockItems;
|
||||
import static com.glodblock.github.inventory.item.WirelessMagnet.modeKey;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.glodblock.github.common.item.ItemBaseWirelessTerminal;
|
||||
import com.glodblock.github.util.Util;
|
||||
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.PowerMultiplier;
|
||||
import appeng.api.implementations.items.IAEItemPowerStorage;
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.networking.security.PlayerSource;
|
||||
import appeng.api.networking.storage.IStorageGrid;
|
||||
import appeng.api.storage.MEMonitorHandler;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IAEStack;
|
||||
import appeng.api.util.AECableType;
|
||||
import appeng.items.tools.powered.ToolWirelessTerminal;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public abstract class BaseWirelessInventory extends MEMonitorHandler implements IWirelessTerminal, IWirelessExtendCard {
|
||||
|
||||
protected final ItemStack target;
|
||||
protected final IAEItemPowerStorage ips;
|
||||
protected final int inventorySlot;
|
||||
|
||||
protected final IGridNode grid;
|
||||
|
||||
protected final PlayerSource source;
|
||||
protected final StorageChannel channel;
|
||||
protected WirelessMagnet.Mode magnetMode = WirelessMagnet.Mode.Off;
|
||||
protected EntityPlayer player;
|
||||
protected boolean restock;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public BaseWirelessInventory(final ItemStack is, final int slot, IGridNode gridNode, EntityPlayer player,
|
||||
StorageChannel channel) {
|
||||
super(Objects.requireNonNull(Util.getWirelessInv(is, player, channel)));
|
||||
this.ips = (ToolWirelessTerminal) is.getItem();
|
||||
this.grid = gridNode;
|
||||
this.target = is;
|
||||
this.inventorySlot = slot;
|
||||
this.channel = channel;
|
||||
this.source = new PlayerSource(player, this);
|
||||
this.readFromNBT();
|
||||
}
|
||||
|
||||
private void readFromNBT() {
|
||||
NBTTagCompound data = Platform.openNbtData(this.target);
|
||||
this.setMagnetCardMode(WirelessMagnet.Mode.values()[data.getInteger(modeKey)]);
|
||||
this.setRestock(data.getBoolean(ItemBaseWirelessTerminal.restockItems));
|
||||
}
|
||||
|
||||
public StorageChannel getChannel() {
|
||||
return this.channel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getItemStack() {
|
||||
return this.target;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double extractAEPower(double amt, Actionable mode, PowerMultiplier usePowerMultiplier) {
|
||||
amt = usePowerMultiplier.multiply(amt);
|
||||
if (mode == Actionable.SIMULATE) {
|
||||
return usePowerMultiplier.divide(Math.min(amt, this.ips.getAECurrentPower(this.target)));
|
||||
}
|
||||
return usePowerMultiplier.divide(this.ips.extractAEPower(this.target, amt));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventorySlot() {
|
||||
return this.inventorySlot;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IGridNode getGridNode(ForgeDirection dir) {
|
||||
return this.grid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AECableType getCableConnectionType(ForgeDirection dir) {
|
||||
return AECableType.NONE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void securityBreak() {
|
||||
this.getGridNode(ForgeDirection.UNKNOWN).getMachine().securityBreak();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveChanges() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public IGridNode getActionableNode() {
|
||||
return this.grid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlayerSource getActionSource() {
|
||||
return this.source;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMagnetCardMode(WirelessMagnet.Mode mode) {
|
||||
this.magnetMode = mode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WirelessMagnet.Mode getMagnetCardMode() {
|
||||
return this.magnetMode;
|
||||
}
|
||||
|
||||
public void setMagnetCardNextMode() {
|
||||
setMagnetCardMode(
|
||||
WirelessMagnet.Mode.values()[(getMagnetCardMode().ordinal() + 1)
|
||||
% WirelessMagnet.Mode.values().length]);
|
||||
}
|
||||
|
||||
public void setRestock(boolean val) {
|
||||
this.restock = val;
|
||||
}
|
||||
|
||||
public boolean isRestock() {
|
||||
return this.restock;
|
||||
}
|
||||
|
||||
public IAEStack injectItems(IAEStack aeStack) {
|
||||
try {
|
||||
if (aeStack.isItem()) {
|
||||
return ((IStorageGrid) getActionableNode().getGrid().getCache(IStorageGrid.class)).getItemInventory()
|
||||
.injectItems((IAEItemStack) aeStack, Actionable.MODULATE, getActionSource());
|
||||
} else {
|
||||
return ((IStorageGrid) getActionableNode().getGrid().getCache(IStorageGrid.class)).getFluidInventory()
|
||||
.injectItems((IAEFluidStack) aeStack, Actionable.MODULATE, getActionSource());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return aeStack;
|
||||
}
|
||||
}
|
||||
|
||||
public IAEStack extractItems(IAEStack aeStack) {
|
||||
try {
|
||||
if (aeStack.isItem()) {
|
||||
return ((IStorageGrid) getActionableNode().getGrid().getCache(IStorageGrid.class)).getItemInventory()
|
||||
.extractItems((IAEItemStack) aeStack, Actionable.MODULATE, getActionSource());
|
||||
} else {
|
||||
return ((IStorageGrid) getActionableNode().getGrid().getCache(IStorageGrid.class)).getFluidInventory()
|
||||
.extractItems((IAEFluidStack) aeStack, Actionable.MODULATE, getActionSource());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public void saveSettings() {
|
||||
NBTTagCompound data = Platform.openNbtData(this.target);
|
||||
data.setBoolean(restockItems, this.restock);
|
||||
data.setInteger(modeKey, this.getMagnetCardMode().ordinal());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.glodblock.github.inventory.item;
|
||||
|
||||
import appeng.api.networking.security.PlayerSource;
|
||||
import appeng.api.storage.data.IAEStack;
|
||||
|
||||
public interface IWirelessExtendCard {
|
||||
|
||||
default void setMagnetCardMode(WirelessMagnet.Mode mode) {}
|
||||
|
||||
WirelessMagnet.Mode getMagnetCardMode();
|
||||
|
||||
PlayerSource getActionSource();
|
||||
|
||||
IAEStack injectItems(IAEStack aeStack);
|
||||
|
||||
IAEStack extractItems(IAEStack aeStack);
|
||||
|
||||
default void setMagnetCardNextMode() {};
|
||||
|
||||
void setRestock(boolean val);
|
||||
|
||||
default boolean isRestock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.glodblock.github.inventory.item;
|
||||
|
||||
public interface IWirelessMagnetFilter extends IWirelessTerminal, IItemTerminal {
|
||||
|
||||
WirelessMagnet.ListMode getListMode();
|
||||
|
||||
boolean getNBTMode();
|
||||
|
||||
boolean getMetaMode();
|
||||
|
||||
boolean getOreMode();
|
||||
|
||||
void setListMode(WirelessMagnet.ListMode mode);
|
||||
|
||||
void setNBTMode(boolean ignoreNBT);
|
||||
|
||||
void setMetaMode(boolean ignoreMeta);
|
||||
|
||||
void setOreMode(boolean useOre);
|
||||
|
||||
default void clearConfig() {};
|
||||
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import appeng.api.implementations.guiobjects.IGuiItemObject;
|
||||
import appeng.api.implementations.tiles.IViewCellStorage;
|
||||
import appeng.api.networking.IGridHost;
|
||||
import appeng.api.networking.security.IActionHost;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.tile.inventory.IAEAppEngInventory;
|
||||
|
||||
public interface IWirelessTerminal
|
||||
@@ -21,4 +22,7 @@ public interface IWirelessTerminal
|
||||
return false;
|
||||
}
|
||||
|
||||
default StorageChannel getChannel() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+2
-10
@@ -1,7 +1,5 @@
|
||||
package com.glodblock.github.inventory.item;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -9,7 +7,6 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.glodblock.github.inventory.ItemBiggerAppEngInventory;
|
||||
import com.glodblock.github.util.Util;
|
||||
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.PowerMultiplier;
|
||||
@@ -20,9 +17,7 @@ import appeng.api.config.TypeFilter;
|
||||
import appeng.api.config.ViewItems;
|
||||
import appeng.api.implementations.items.IAEItemPowerStorage;
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.storage.IMEInventoryHandler;
|
||||
import appeng.api.storage.IMEMonitor;
|
||||
import appeng.api.storage.MEMonitorHandler;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
@@ -35,8 +30,7 @@ import appeng.tile.inventory.InvOperation;
|
||||
import appeng.util.ConfigManager;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class WirelessCraftingTerminalInventory extends MEMonitorHandler<IAEItemStack>
|
||||
implements IWirelessCraftTerminal {
|
||||
public class WirelessCraftingTerminalInventory extends BaseWirelessInventory implements IWirelessCraftTerminal {
|
||||
|
||||
private final ItemStack target;
|
||||
private final IAEItemPowerStorage ips;
|
||||
@@ -51,9 +45,7 @@ public class WirelessCraftingTerminalInventory extends MEMonitorHandler<IAEItemS
|
||||
@SuppressWarnings("unchecked")
|
||||
public WirelessCraftingTerminalInventory(final ItemStack is, final int slot, IGridNode gridNode,
|
||||
EntityPlayer player) {
|
||||
super(
|
||||
(IMEInventoryHandler<IAEItemStack>) Objects
|
||||
.requireNonNull(Util.getWirelessInv(is, player, StorageChannel.ITEMS)));
|
||||
super(is, slot, gridNode, player, StorageChannel.ITEMS);
|
||||
this.ips = (ToolWirelessTerminal) is.getItem();
|
||||
this.grid = gridNode;
|
||||
this.target = is;
|
||||
|
||||
+7
-10
@@ -1,15 +1,11 @@
|
||||
package com.glodblock.github.inventory.item;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.glodblock.github.util.Util;
|
||||
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.PowerMultiplier;
|
||||
import appeng.api.config.Settings;
|
||||
@@ -18,9 +14,7 @@ import appeng.api.config.SortOrder;
|
||||
import appeng.api.config.ViewItems;
|
||||
import appeng.api.implementations.items.IAEItemPowerStorage;
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.storage.IMEInventoryHandler;
|
||||
import appeng.api.storage.IMEMonitor;
|
||||
import appeng.api.storage.MEMonitorHandler;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
@@ -33,7 +27,7 @@ import appeng.tile.inventory.InvOperation;
|
||||
import appeng.util.ConfigManager;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class WirelessFluidTerminalInventory extends MEMonitorHandler<IAEFluidStack> implements IWirelessTerminal {
|
||||
public class WirelessFluidTerminalInventory extends BaseWirelessInventory implements IWirelessTerminal, IItemTerminal {
|
||||
|
||||
private final ItemStack target;
|
||||
private final IAEItemPowerStorage ips;
|
||||
@@ -44,9 +38,7 @@ public class WirelessFluidTerminalInventory extends MEMonitorHandler<IAEFluidSta
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public WirelessFluidTerminalInventory(final ItemStack is, final int slot, IGridNode gridNode, EntityPlayer player) {
|
||||
super(
|
||||
(IMEInventoryHandler<IAEFluidStack>) Objects
|
||||
.requireNonNull(Util.getWirelessInv(is, player, StorageChannel.FLUIDS)));
|
||||
super(is, slot, gridNode, player, StorageChannel.FLUIDS);
|
||||
this.ips = (ToolWirelessTerminal) is.getItem();
|
||||
this.grid = gridNode;
|
||||
this.target = is;
|
||||
@@ -135,4 +127,9 @@ public class WirelessFluidTerminalInventory extends MEMonitorHandler<IAEFluidSta
|
||||
@Override
|
||||
public void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removedStack,
|
||||
ItemStack newStack) {}
|
||||
|
||||
@Override
|
||||
public IInventory getInventoryByName(String name) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,169 @@
|
||||
/* Author: asdflj */
|
||||
package com.glodblock.github.inventory.item;
|
||||
|
||||
import static com.glodblock.github.common.Config.magnetRange;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.item.EntityXPOrb;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.glodblock.github.common.item.ItemWirelessUltraTerminal;
|
||||
import com.glodblock.github.inventory.ItemBiggerAppEngInventory;
|
||||
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.tile.inventory.AppEngInternalInventory;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class WirelessMagnet {
|
||||
|
||||
public static String modeKey = "MagnetMode";
|
||||
public static String filterKey = "MagnetFilter";
|
||||
public static String filterConfigKey = "MagnetConfig";
|
||||
|
||||
public enum Mode {
|
||||
Off,
|
||||
Inv,
|
||||
ME
|
||||
}
|
||||
|
||||
public enum ListMode {
|
||||
WhiteList,
|
||||
BlackList
|
||||
}
|
||||
|
||||
public static List<?> getEntitiesInRange(Class<?> entityType, World world, int x, int y, int z, int distance) {
|
||||
return world.getEntitiesWithinAABB(
|
||||
entityType,
|
||||
AxisAlignedBB.getBoundingBox(
|
||||
x - distance,
|
||||
y - distance,
|
||||
z - distance,
|
||||
x + distance,
|
||||
y + distance,
|
||||
z + distance));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static List<ItemStack> getFilteredItems(ItemStack wirelessTerm) {
|
||||
if (wirelessTerm == null) {
|
||||
return null;
|
||||
}
|
||||
if (wirelessTerm.getItem() instanceof ItemWirelessUltraTerminal) {
|
||||
if (wirelessTerm.hasTagCompound()) {
|
||||
NBTTagCompound data = Platform.openNbtData(wirelessTerm);
|
||||
if (!data.hasKey(filterKey)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
AppEngInternalInventory filterList = new ItemBiggerAppEngInventory(wirelessTerm, filterKey, 27);
|
||||
ArrayList<ItemStack> list = new ArrayList<>();
|
||||
filterList.iterator().forEachRemaining(list::add);
|
||||
return list;
|
||||
}
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
public static boolean isConfigured(ItemStack wirelessTerm) {
|
||||
NBTTagCompound data = Platform.openNbtData(wirelessTerm);
|
||||
return data.hasKey(modeKey);
|
||||
}
|
||||
|
||||
public static void doMagnet(ItemStack wirelessTerm, World world, EntityPlayer player,
|
||||
WirelessMagnetCardFilterInventory inv) {
|
||||
if (Platform.isClient() || wirelessTerm == null
|
||||
|| getMode(wirelessTerm) == Mode.Off
|
||||
|| player == null
|
||||
|| player.isSneaking()
|
||||
|| !isConfigured(wirelessTerm))
|
||||
return;
|
||||
|
||||
Iterator<?> iterator = getEntitiesInRange(
|
||||
EntityItem.class,
|
||||
world,
|
||||
(int) player.posX,
|
||||
(int) player.posY,
|
||||
(int) player.posZ,
|
||||
magnetRange).iterator();
|
||||
IItemList<IAEItemStack> filteredList = inv.getAEFilteredItems();
|
||||
while (iterator.hasNext()) {
|
||||
EntityItem itemToGet = (EntityItem) iterator.next();
|
||||
if (itemToGet.func_145800_j() != null && itemToGet.func_145800_j()
|
||||
.equals(player.getCommandSenderName())) { /* don`t pick up items dropped by yourself */
|
||||
continue;
|
||||
}
|
||||
|
||||
EntityPlayer closestPlayer = world.getClosestPlayerToEntity(itemToGet, magnetRange);
|
||||
|
||||
if (closestPlayer != null && closestPlayer != player) {
|
||||
continue;
|
||||
}
|
||||
ItemStack stack = itemToGet.getEntityItem();
|
||||
if ((inv.getListMode() == ListMode.WhiteList && !filteredList.isEmpty()
|
||||
&& inv.isItemFiltered(stack, filteredList))
|
||||
|| (inv.getListMode() == ListMode.BlackList && !inv.isItemFiltered(stack, filteredList))) {
|
||||
if (itemToGet.delayBeforeCanPickup > 0) {
|
||||
itemToGet.delayBeforeCanPickup = 0;
|
||||
}
|
||||
itemToGet.motionX = itemToGet.motionY = itemToGet.motionZ = 0;
|
||||
itemToGet.setPosition(
|
||||
player.posX - 0.2 + (world.rand.nextDouble() * 0.4),
|
||||
player.posY - 0.6,
|
||||
player.posZ - 0.2 + (world.rand.nextDouble() * 0.4));
|
||||
}
|
||||
}
|
||||
|
||||
// xp
|
||||
iterator = getEntitiesInRange(
|
||||
EntityXPOrb.class,
|
||||
world,
|
||||
(int) player.posX,
|
||||
(int) player.posY,
|
||||
(int) player.posZ,
|
||||
magnetRange).iterator();
|
||||
while (iterator.hasNext()) {
|
||||
EntityXPOrb xpToGet = (EntityXPOrb) iterator.next();
|
||||
if (xpToGet.isDead || xpToGet.isInvisible()) {
|
||||
continue;
|
||||
}
|
||||
int xpAmount = xpToGet.xpValue;
|
||||
xpToGet.xpValue = 0;
|
||||
player.xpCooldown = 0;
|
||||
player.addExperience(xpAmount);
|
||||
xpToGet.setDead();
|
||||
xpToGet.setInvisible(true);
|
||||
world.playSoundAtEntity(
|
||||
player,
|
||||
"random.orb",
|
||||
0.08F,
|
||||
0.5F * ((world.rand.nextFloat() - world.rand.nextFloat()) * 0.7F + 1.8F));
|
||||
}
|
||||
}
|
||||
|
||||
public static Mode getMode(ItemStack is) {
|
||||
if (is != null && is.getItem() instanceof ItemWirelessUltraTerminal) {
|
||||
NBTTagCompound data = Platform.openNbtData(is);
|
||||
if (data.hasKey(modeKey)) {
|
||||
return Mode.values()[data.getInteger(modeKey)];
|
||||
}
|
||||
setMode(is, Mode.Off);
|
||||
}
|
||||
return Mode.Off;
|
||||
}
|
||||
|
||||
public static void setMode(ItemStack is, Mode mode) {
|
||||
if (is != null && is.getItem() instanceof ItemWirelessUltraTerminal) {
|
||||
NBTTagCompound data = Platform.openNbtData(is);
|
||||
data.setInteger(modeKey, mode.ordinal());
|
||||
}
|
||||
}
|
||||
}
|
||||
+215
@@ -0,0 +1,215 @@
|
||||
/* Author: asdflj */
|
||||
package com.glodblock.github.inventory.item;
|
||||
|
||||
import static com.glodblock.github.inventory.item.WirelessMagnet.filterConfigKey;
|
||||
import static com.glodblock.github.inventory.item.WirelessMagnet.filterKey;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.glodblock.github.inventory.ItemBiggerAppEngInventory;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.PowerMultiplier;
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.storage.IMEMonitor;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.api.util.IConfigManager;
|
||||
import appeng.tile.inventory.AppEngInternalInventory;
|
||||
import appeng.tile.inventory.InvOperation;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class WirelessMagnetCardFilterInventory extends BaseWirelessInventory implements IWirelessMagnetFilter {
|
||||
|
||||
private boolean nbt;
|
||||
private boolean mata;
|
||||
private boolean ore;
|
||||
private WirelessMagnet.ListMode listMode = WirelessMagnet.ListMode.WhiteList;
|
||||
protected AppEngInternalInventory filterList;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public WirelessMagnetCardFilterInventory(ItemStack is, int slot, IGridNode gridNode, EntityPlayer player) {
|
||||
super(is, slot, gridNode, player, StorageChannel.ITEMS);
|
||||
this.filterList = new ItemBiggerAppEngInventory(is, filterKey, 27);
|
||||
readFromNBT();
|
||||
}
|
||||
|
||||
public void readFromNBT() {
|
||||
NBTTagCompound data = Platform.openNbtData(this.target);
|
||||
if (!data.hasKey(filterConfigKey)) this.writeToNBT();
|
||||
NBTTagCompound tag = (NBTTagCompound) data.getTag(filterConfigKey);
|
||||
this.nbt = tag.getBoolean("nbt");
|
||||
this.mata = tag.getBoolean("meta");
|
||||
this.ore = tag.getBoolean("ore");
|
||||
this.listMode = WirelessMagnet.ListMode.values()[tag.getInteger("list")];
|
||||
}
|
||||
|
||||
public void writeToNBT() {
|
||||
NBTTagCompound data = Platform.openNbtData(this.target);
|
||||
NBTTagCompound tmp = new NBTTagCompound();
|
||||
tmp.setBoolean("nbt", this.nbt);
|
||||
tmp.setBoolean("meta", this.mata);
|
||||
tmp.setBoolean("ore", this.ore);
|
||||
tmp.setInteger("list", this.listMode.ordinal());
|
||||
data.setTag(filterConfigKey, tmp);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WirelessMagnet.ListMode getListMode() {
|
||||
return this.listMode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getNBTMode() {
|
||||
return this.nbt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getMetaMode() {
|
||||
return this.mata;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getOreMode() {
|
||||
return this.ore;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setListMode(WirelessMagnet.ListMode mode) {
|
||||
this.listMode = mode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setNBTMode(boolean ignoreNBT) {
|
||||
this.nbt = ignoreNBT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMetaMode(boolean ignoreMeta) {
|
||||
this.mata = ignoreMeta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOreMode(boolean useOre) {
|
||||
this.ore = useOre;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearConfig() {
|
||||
IInventory inv = this.getInventoryByName("config");
|
||||
for (int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
inv.setInventorySlotContents(i, null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public StorageChannel getChannel() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getViewCellStorage() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double extractAEPower(double amt, Actionable mode, PowerMultiplier usePowerMultiplier) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMEMonitor<IAEItemStack> getItemInventory() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMEMonitor<IAEFluidStack> getFluidInventory() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IConfigManager getConfigManager() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removedStack,
|
||||
ItemStack newStack) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveSettings() {
|
||||
super.saveSettings();
|
||||
writeToNBT();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getInventoryByName(String name) {
|
||||
if (name.equals("config")) {
|
||||
return this.filterList;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean doInject(IAEItemStack is, EntityItem itemToGet, World world) {
|
||||
IAEItemStack ais = (IAEItemStack) injectItems(is);
|
||||
if (ais != null) {
|
||||
player.onItemPickup(itemToGet, ais.getItemStack().stackSize);
|
||||
player.inventory.addItemStackToInventory(ais.getItemStack());
|
||||
world.playSoundAtEntity(
|
||||
player,
|
||||
"random.pop",
|
||||
0.15F,
|
||||
((world.rand.nextFloat() - world.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public List<ItemStack> getFilteredItems() {
|
||||
return WirelessMagnet.getFilteredItems(this.target);
|
||||
}
|
||||
|
||||
public IItemList<IAEItemStack> getAEFilteredItems() {
|
||||
IItemList<IAEItemStack> list = AEApi.instance().storage().createItemList();
|
||||
for (ItemStack is : this.getFilteredItems()) {
|
||||
list.add(AEApi.instance().storage().createItemStack(is));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public boolean isItemFiltered(ItemStack is, IItemList<IAEItemStack> list) {
|
||||
if (is == null && list.isEmpty()) return false;
|
||||
IAEItemStack ais = AEApi.instance().storage().createItemStack(is);
|
||||
for (IAEItemStack i : list) {
|
||||
if (this.ore) {
|
||||
// use oredict
|
||||
return i.sameOre(ais);
|
||||
} else if (!this.mata && !this.nbt) {
|
||||
// ignore meta & nbt
|
||||
return Platform.isSameItem(i.getItemStack(), ais.getItemStack());
|
||||
} else if (!this.mata && this.nbt) {
|
||||
// ignore meta only
|
||||
return Platform.isSameItemPrecise(i.getItemStack(), ais.getItemStack());
|
||||
} else if (this.mata) {
|
||||
// ignore nbt only
|
||||
return i.getItemDamage() == ais.getItemDamage();
|
||||
} else {
|
||||
// ignore nothing/don't use oredict--must be exact match
|
||||
return list.findPrecise(ais) != null;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
+3
-9
@@ -2,7 +2,6 @@ package com.glodblock.github.inventory.item;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
@@ -14,7 +13,6 @@ import com.glodblock.github.common.item.ItemFluidDrop;
|
||||
import com.glodblock.github.common.item.ItemFluidPacket;
|
||||
import com.glodblock.github.inventory.ItemBiggerAppEngInventory;
|
||||
import com.glodblock.github.inventory.WirelessFluidPatternTerminalPatterns;
|
||||
import com.glodblock.github.util.Util;
|
||||
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.PowerMultiplier;
|
||||
@@ -27,9 +25,7 @@ import appeng.api.implementations.ICraftingPatternItem;
|
||||
import appeng.api.implementations.items.IAEItemPowerStorage;
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.networking.crafting.ICraftingPatternDetails;
|
||||
import appeng.api.storage.IMEInventoryHandler;
|
||||
import appeng.api.storage.IMEMonitor;
|
||||
import appeng.api.storage.MEMonitorHandler;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
@@ -42,8 +38,7 @@ import appeng.tile.inventory.InvOperation;
|
||||
import appeng.util.ConfigManager;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class WirelessPatternTerminalExInventory extends MEMonitorHandler<IAEItemStack>
|
||||
implements IWirelessPatternTerminal {
|
||||
public class WirelessPatternTerminalExInventory extends BaseWirelessInventory implements IWirelessPatternTerminal {
|
||||
|
||||
private final ItemStack target;
|
||||
private final IAEItemPowerStorage ips;
|
||||
@@ -68,9 +63,7 @@ public class WirelessPatternTerminalExInventory extends MEMonitorHandler<IAEItem
|
||||
@SuppressWarnings("unchecked")
|
||||
public WirelessPatternTerminalExInventory(final ItemStack is, final int slot, IGridNode gridNode,
|
||||
EntityPlayer player) {
|
||||
super(
|
||||
(IMEInventoryHandler<IAEItemStack>) Objects
|
||||
.requireNonNull(Util.getWirelessInv(is, player, StorageChannel.ITEMS)));
|
||||
super(is, slot, gridNode, player, StorageChannel.ITEMS);
|
||||
this.ips = (ToolWirelessTerminal) is.getItem();
|
||||
this.grid = gridNode;
|
||||
this.target = is;
|
||||
@@ -419,6 +412,7 @@ public class WirelessPatternTerminalExInventory extends MEMonitorHandler<IAEItem
|
||||
|
||||
@Override
|
||||
public void saveSettings() {
|
||||
super.saveSettings();
|
||||
this.writeToNBT();
|
||||
}
|
||||
|
||||
|
||||
+3
-9
@@ -2,7 +2,6 @@ package com.glodblock.github.inventory.item;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
@@ -14,7 +13,6 @@ import com.glodblock.github.common.item.ItemFluidDrop;
|
||||
import com.glodblock.github.common.item.ItemFluidPacket;
|
||||
import com.glodblock.github.inventory.ItemBiggerAppEngInventory;
|
||||
import com.glodblock.github.inventory.WirelessFluidPatternTerminalPatterns;
|
||||
import com.glodblock.github.util.Util;
|
||||
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.PowerMultiplier;
|
||||
@@ -27,9 +25,7 @@ import appeng.api.implementations.ICraftingPatternItem;
|
||||
import appeng.api.implementations.items.IAEItemPowerStorage;
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.networking.crafting.ICraftingPatternDetails;
|
||||
import appeng.api.storage.IMEInventoryHandler;
|
||||
import appeng.api.storage.IMEMonitor;
|
||||
import appeng.api.storage.MEMonitorHandler;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
@@ -42,8 +38,7 @@ import appeng.tile.inventory.InvOperation;
|
||||
import appeng.util.ConfigManager;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class WirelessPatternTerminalInventory extends MEMonitorHandler<IAEItemStack>
|
||||
implements IWirelessPatternTerminal {
|
||||
public class WirelessPatternTerminalInventory extends BaseWirelessInventory implements IWirelessPatternTerminal {
|
||||
|
||||
private final ItemStack target;
|
||||
private final IAEItemPowerStorage ips;
|
||||
@@ -68,9 +63,7 @@ public class WirelessPatternTerminalInventory extends MEMonitorHandler<IAEItemSt
|
||||
@SuppressWarnings("unchecked")
|
||||
public WirelessPatternTerminalInventory(final ItemStack is, final int slot, IGridNode gridNode,
|
||||
EntityPlayer player) {
|
||||
super(
|
||||
(IMEInventoryHandler<IAEItemStack>) Objects
|
||||
.requireNonNull(Util.getWirelessInv(is, player, StorageChannel.ITEMS)));
|
||||
super(is, slot, gridNode, player, StorageChannel.ITEMS);
|
||||
this.ips = (ToolWirelessTerminal) is.getItem();
|
||||
this.grid = gridNode;
|
||||
this.target = is;
|
||||
@@ -391,6 +384,7 @@ public class WirelessPatternTerminalInventory extends MEMonitorHandler<IAEItemSt
|
||||
|
||||
@Override
|
||||
public void saveSettings() {
|
||||
super.saveSettings();
|
||||
this.writeToNBT();
|
||||
}
|
||||
|
||||
|
||||
@@ -4,11 +4,15 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.common.item.ItemWirelessUltraTerminal;
|
||||
import com.glodblock.github.network.CPacketValueConfig;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import com.glodblock.github.util.Util;
|
||||
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
@@ -22,11 +26,14 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
public class KeybindLoader implements Runnable {
|
||||
|
||||
public static KeyBinding openTerminal;
|
||||
public static KeyBinding restock;
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
openTerminal = new KeyBinding("key.OpenTerminal", Keyboard.CHAR_NONE, "itemGroup.ae2fc");
|
||||
openTerminal = new KeyBinding(FluidCraft.MODID + ".key.OpenTerminal", Keyboard.CHAR_NONE, "itemGroup.ae2fc");
|
||||
restock = new KeyBinding(FluidCraft.MODID + ".key.Restock", Keyboard.CHAR_NONE, "itemGroup.ae2fc");
|
||||
ClientRegistry.registerKeyBinding(openTerminal);
|
||||
ClientRegistry.registerKeyBinding(restock);
|
||||
FMLCommonHandler.instance().bus().register(this);
|
||||
}
|
||||
|
||||
@@ -35,6 +42,8 @@ public class KeybindLoader implements Runnable {
|
||||
public void onKeyInput(InputEvent.KeyInputEvent event) {
|
||||
if (openTerminal.isPressed()) {
|
||||
handleOpenTerminalKey();
|
||||
} else if (restock.isPressed()) {
|
||||
handleRestockKey();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,6 +52,8 @@ public class KeybindLoader implements Runnable {
|
||||
public void onMouseInput(InputEvent.MouseInputEvent event) {
|
||||
if (openTerminal.isPressed()) {
|
||||
handleOpenTerminalKey();
|
||||
} else if (restock.isPressed()) {
|
||||
handleRestockKey();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,4 +71,23 @@ public class KeybindLoader implements Runnable {
|
||||
((ItemWirelessUltraTerminal) term.getRight().getItem()).guiGuiType(term.getRight()));
|
||||
}
|
||||
}
|
||||
|
||||
private void handleRestockKey() {
|
||||
if (Minecraft.getMinecraft().currentScreen != null) return;
|
||||
EntityClientPlayerMP p = Minecraft.getMinecraft().thePlayer;
|
||||
if (p.openContainer == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
ImmutablePair<Integer, ItemStack> term = Util.getUltraWirelessTerm(p);
|
||||
if (term != null) {
|
||||
p.addChatMessage(
|
||||
new ChatComponentText(
|
||||
NameConst.i18n(
|
||||
!Util.isRestock(term.getRight()) ? NameConst.TT_ULTRA_TERMINAL_RESTOCK_ON
|
||||
: NameConst.TT_ULTRA_TERMINAL_RESTOCK_OFF)));
|
||||
FluidCraft.proxy.netHandler.sendToServer(new CPacketValueConfig(0, 1));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,20 @@
|
||||
package com.glodblock.github.network;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.glodblock.github.client.gui.container.ContainerFluidStorageBus;
|
||||
import com.glodblock.github.client.gui.container.base.FCBaseContainer;
|
||||
import com.glodblock.github.client.gui.container.base.FCContainerEncodeTerminal;
|
||||
import com.glodblock.github.inventory.InventoryHandler;
|
||||
import com.glodblock.github.inventory.gui.GuiType;
|
||||
import com.glodblock.github.inventory.item.IItemTerminal;
|
||||
import com.glodblock.github.inventory.item.IWirelessExtendCard;
|
||||
import com.glodblock.github.inventory.item.IWirelessMagnetFilter;
|
||||
import com.glodblock.github.inventory.item.WirelessMagnet;
|
||||
import com.glodblock.github.util.BlockPos;
|
||||
import com.glodblock.github.util.Util;
|
||||
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
@@ -25,6 +36,10 @@ public class CPacketFluidPatternTermBtns implements IMessage {
|
||||
Value = value.toString();
|
||||
}
|
||||
|
||||
public CPacketFluidPatternTermBtns(final String name, final boolean value) {
|
||||
this(name, value ? 1 : 0);
|
||||
}
|
||||
|
||||
public CPacketFluidPatternTermBtns() {
|
||||
// NO-OP
|
||||
}
|
||||
@@ -64,7 +79,49 @@ public class CPacketFluidPatternTermBtns implements IMessage {
|
||||
String Name = message.Name;
|
||||
String Value = message.Value;
|
||||
final Container c = ctx.getServerHandler().playerEntity.openContainer;
|
||||
if (Name.startsWith("PatternTerminal.") && (c instanceof final FCContainerEncodeTerminal cpt)) {
|
||||
final EntityPlayer player = ctx.getServerHandler().playerEntity;
|
||||
if (Name.startsWith("WirelessTerminal.") && (c instanceof FCBaseContainer)) {
|
||||
final FCBaseContainer cpt = (FCBaseContainer) c;
|
||||
final IItemTerminal itemTerminal = (IItemTerminal) cpt.getHost();
|
||||
final IWirelessExtendCard iwt = (IWirelessExtendCard) itemTerminal;
|
||||
switch (Name) {
|
||||
case "WirelessTerminal.Stock":
|
||||
iwt.setRestock(!iwt.isRestock());
|
||||
break;
|
||||
case "WirelessTerminal.MagnetMode":
|
||||
iwt.setMagnetCardNextMode();
|
||||
break;
|
||||
case "WirelessTerminal.OpenMagnet":
|
||||
InventoryHandler.openGui(
|
||||
player,
|
||||
player.worldObj,
|
||||
new BlockPos(
|
||||
cpt.getPortableCell().getInventorySlot(),
|
||||
Util.GuiHelper.encodeType(0, Util.GuiHelper.GuiType.ITEM),
|
||||
-1),
|
||||
ForgeDirection.UNKNOWN,
|
||||
GuiType.WIRELESS_MAGNET_FILTER);
|
||||
break;
|
||||
case "WirelessTerminal.magnet.NBT":
|
||||
((IWirelessMagnetFilter) itemTerminal).setNBTMode(Value.equals("1"));
|
||||
break;
|
||||
case "WirelessTerminal.magnet.Meta":
|
||||
((IWirelessMagnetFilter) itemTerminal).setMetaMode(Value.equals("1"));
|
||||
break;
|
||||
case "WirelessTerminal.magnet.Ore":
|
||||
((IWirelessMagnetFilter) itemTerminal).setOreMode(Value.equals("1"));
|
||||
break;
|
||||
case "WirelessTerminal.magnet.FilterMode":
|
||||
((IWirelessMagnetFilter) itemTerminal).setListMode(
|
||||
Value.equals("1") ? WirelessMagnet.ListMode.WhiteList
|
||||
: WirelessMagnet.ListMode.BlackList);
|
||||
break;
|
||||
case "WirelessTerminal.magnet.clear":
|
||||
((IWirelessMagnetFilter) itemTerminal).clearConfig();
|
||||
break;
|
||||
}
|
||||
itemTerminal.saveSettings();
|
||||
} else if (Name.startsWith("PatternTerminal.") && (c instanceof final FCContainerEncodeTerminal cpt)) {
|
||||
switch (Name) {
|
||||
case "PatternTerminal.CraftMode" -> cpt.getPatternTerminal().setCraftingRecipe(Value.equals("1"));
|
||||
case "PatternTerminal.Encode" -> {
|
||||
|
||||
@@ -2,9 +2,20 @@ package com.glodblock.github.network;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.ContainerPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
|
||||
import com.glodblock.github.client.gui.container.ContainerFluidLevelEmitter;
|
||||
import com.glodblock.github.common.item.ItemBaseWirelessTerminal;
|
||||
import com.glodblock.github.inventory.item.WirelessCraftingTerminalInventory;
|
||||
import com.glodblock.github.util.Util;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
@@ -39,13 +50,51 @@ public class CPacketValueConfig implements IMessage {
|
||||
@Override
|
||||
public IMessage onMessage(CPacketValueConfig message, MessageContext ctx) {
|
||||
EntityPlayer player = ctx.getServerHandler().playerEntity;
|
||||
if (player.openContainer != null) {
|
||||
Container container = player.openContainer;
|
||||
Container container = player.openContainer;
|
||||
if (container != null) {
|
||||
if (container instanceof ContainerFluidLevelEmitter) {
|
||||
((ContainerFluidLevelEmitter) container).setLevel(message.amount, player);
|
||||
} else if (container instanceof ContainerPlayer) {
|
||||
ImmutablePair<Integer, ItemStack> result = Util.getUltraWirelessTerm(player);
|
||||
if (result == null) return null;
|
||||
if (message.valueIndex == 1) {
|
||||
ItemBaseWirelessTerminal
|
||||
.toggleRestockItemsMode(result.getRight(), !Util.isRestock(result.getRight()));
|
||||
return null;
|
||||
} else if (Util.isRestock(result.getRight())) {
|
||||
restockItems(result.getRight(), result.getLeft(), player);
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private void restockItems(ItemStack terminal, int slot, EntityPlayer player) {
|
||||
IGridNode iGridNode = Util.getWirelessGrid(terminal);
|
||||
if (iGridNode == null) return;
|
||||
WirelessCraftingTerminalInventory inv = new WirelessCraftingTerminalInventory(
|
||||
terminal,
|
||||
slot,
|
||||
iGridNode,
|
||||
player);
|
||||
|
||||
for (int i = 0; i < 9; i++) {
|
||||
ItemStack is = player.inventory.mainInventory[i];
|
||||
if (is == null) continue;
|
||||
int maxSize = is.getMaxStackSize();
|
||||
if (is.stackSize == maxSize) continue;
|
||||
|
||||
int fillSize = maxSize - is.stackSize;
|
||||
|
||||
IAEItemStack ias = AEApi.instance().storage().createItemStack(is);
|
||||
|
||||
ias.setStackSize(fillSize);
|
||||
IAEItemStack extractedItem = (IAEItemStack) inv
|
||||
.extractItems(ias, Actionable.MODULATE, inv.getActionSource());
|
||||
if (extractedItem == null) continue;
|
||||
player.inventory.addItemStackToInventory(extractedItem.getItemStack());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,33 @@
|
||||
package com.glodblock.github.proxy;
|
||||
|
||||
import static com.glodblock.github.common.Config.reStockTime;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.loader.KeybindLoader;
|
||||
import com.glodblock.github.loader.ListenerLoader;
|
||||
import com.glodblock.github.loader.RenderLoader;
|
||||
import com.glodblock.github.nei.recipes.DefaultExtractorLoader;
|
||||
import com.glodblock.github.network.CPacketValueConfig;
|
||||
import com.glodblock.github.util.ModAndClassUtil;
|
||||
import com.glodblock.github.util.Util;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLLoadCompleteEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
|
||||
public class ClientProxy extends CommonProxy {
|
||||
|
||||
private static final Minecraft mc = Minecraft.getMinecraft();
|
||||
private static long refreshTick = System.currentTimeMillis();
|
||||
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
super.preInit(event);
|
||||
@@ -38,4 +53,16 @@ public class ClientProxy extends CommonProxy {
|
||||
new DefaultExtractorLoader().run();
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void tickEvent(TickEvent.PlayerTickEvent e) {
|
||||
super.tickEvent(e);
|
||||
if (refreshTick + reStockTime < System.currentTimeMillis()) {
|
||||
// try to stock items
|
||||
ImmutablePair<Integer, ItemStack> result = Util.getUltraWirelessTerm(mc.thePlayer);
|
||||
if (result == null || !Util.isRestock(result.getRight()) || mc.currentScreen != null) return;
|
||||
FluidCraft.proxy.netHandler.sendToServer(new CPacketValueConfig(1, 0));
|
||||
refreshTick = System.currentTimeMillis();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,13 @@
|
||||
package com.glodblock.github.proxy;
|
||||
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.EntityItemPickupEvent;
|
||||
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.common.Config;
|
||||
@@ -12,24 +19,104 @@ import com.glodblock.github.crossmod.extracells.EC2Replacer;
|
||||
import com.glodblock.github.crossmod.thaumcraft.AspectUtil;
|
||||
import com.glodblock.github.crossmod.thaumcraft.ThaumicEnergisticsCrafting;
|
||||
import com.glodblock.github.inventory.external.AEFluidInterfaceHandler;
|
||||
import com.glodblock.github.inventory.item.WirelessMagnet;
|
||||
import com.glodblock.github.inventory.item.WirelessMagnetCardFilterInventory;
|
||||
import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.network.SPacketMEUpdateBuffer;
|
||||
import com.glodblock.github.network.wrapper.FCNetworkWrapper;
|
||||
import com.glodblock.github.util.ModAndClassUtil;
|
||||
import com.glodblock.github.util.Util;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.IAppEngApi;
|
||||
import appeng.api.config.Upgrades;
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.util.Platform;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLLoadCompleteEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
|
||||
public class CommonProxy {
|
||||
|
||||
public final FCNetworkWrapper netHandler = new FCNetworkWrapper(FluidCraft.MODID);
|
||||
|
||||
public CommonProxy() {
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
FMLCommonHandler.instance().bus().register(this);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@SubscribeEvent
|
||||
public void pickupEvent(EntityItemPickupEvent e) {
|
||||
try {
|
||||
if (Platform.isClient() || e.entityPlayer == null) return;
|
||||
EntityPlayer player = e.entityPlayer;
|
||||
EntityItem itemEntity = e.item;
|
||||
ItemStack stack = itemEntity.getEntityItem();
|
||||
World world = player.getEntityWorld();
|
||||
|
||||
ImmutablePair<Integer, ItemStack> result = Util.getUltraWirelessTerm(player);
|
||||
if (result == null) return;
|
||||
final ItemStack wirelessTerm = result.getRight();
|
||||
WirelessMagnet.Mode mode = WirelessMagnet.getMode(wirelessTerm);
|
||||
if (mode != WirelessMagnet.Mode.ME) return;
|
||||
IGridNode gridNode = Util.getWirelessGrid(wirelessTerm);
|
||||
if (gridNode == null || !Util.rangeCheck(wirelessTerm, player, gridNode)) return;
|
||||
WirelessMagnetCardFilterInventory inv = new WirelessMagnetCardFilterInventory(
|
||||
wirelessTerm,
|
||||
result.getLeft(),
|
||||
gridNode,
|
||||
player);
|
||||
|
||||
IItemList<IAEItemStack> filteredList = inv.getAEFilteredItems();
|
||||
IAEItemStack ais = AEApi.instance().storage().createItemStack(stack);
|
||||
if (inv.getListMode() == WirelessMagnet.ListMode.WhiteList) { // whitelisting
|
||||
if (!filteredList.isEmpty() && inv.isItemFiltered(stack, filteredList)) {
|
||||
if (inv.doInject(ais, itemEntity, world)) {
|
||||
stack = null;
|
||||
itemEntity.setDead();
|
||||
e.setCanceled(true);
|
||||
}
|
||||
}
|
||||
} else if (inv.getListMode() == WirelessMagnet.ListMode.BlackList) {
|
||||
if (!inv.isItemFiltered(stack, filteredList)) {
|
||||
if (inv.doInject(ais, itemEntity, world)) {
|
||||
stack = null;
|
||||
itemEntity.setDead();
|
||||
e.setCanceled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} catch (NullPointerException ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void tickEvent(TickEvent.PlayerTickEvent e) {
|
||||
EntityPlayer player = e.player;
|
||||
ImmutablePair<Integer, ItemStack> result = Util.getUltraWirelessTerm(player);
|
||||
if (result == null) return;
|
||||
final ItemStack wirelessTerm = result.getRight();
|
||||
if (WirelessMagnet.getMode(wirelessTerm) == WirelessMagnet.Mode.Off) return;
|
||||
IGridNode gridNode = Util.getWirelessGrid(wirelessTerm);
|
||||
if (gridNode == null) return;
|
||||
WirelessMagnetCardFilterInventory inv = new WirelessMagnetCardFilterInventory(
|
||||
wirelessTerm,
|
||||
result.getLeft(),
|
||||
gridNode,
|
||||
player);
|
||||
WirelessMagnet.doMagnet(wirelessTerm, e.player.worldObj, e.player, inv);
|
||||
|
||||
}
|
||||
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
ModAndClassUtil.init();
|
||||
ItemAndBlockHolder.init();
|
||||
|
||||
@@ -57,7 +57,9 @@ public class NameConst {
|
||||
public static final String ITEM_ENERGY_CARD = "energy_card";
|
||||
|
||||
public static final String TT_KEY = FluidCraft.MODID + ".tooltip.";
|
||||
public static final String TT_CRAFTING_COMPLETE = TT_KEY + "crafting_complete";
|
||||
public static final String TT_FLUID_TERMINAL = TT_KEY + "fluid_terminal";
|
||||
public static final String TT_FLUID_TERMINAL_AMOUNT = TT_FLUID_TERMINAL + ".amount";
|
||||
public static final String TT_LEVEL_TERMINAL = TT_KEY + "level_terminal";
|
||||
public static final String TT_INVALID_FLUID = TT_KEY + "invalid_fluid";
|
||||
public static final String TT_FLUID_PACKET = TT_KEY + "fluid_packet";
|
||||
@@ -106,6 +108,10 @@ public class NameConst {
|
||||
public static final String TT_QUANTUM_BRIDGE_CARD_DESC = TT_QUANTUM_BRIDGE_CARD + ".desc";
|
||||
public static final String TT_ITEM_FLUID_VOID_CELL = TT_KEY + ITEM_FLUID_VOID_CELL;
|
||||
|
||||
public static final String TT_ULTRA_TERMINAL_RESTOCK = TT_ULTRA_TERMINAL + ".restock";
|
||||
public static final String TT_ULTRA_TERMINAL_RESTOCK_ON = TT_ULTRA_TERMINAL_RESTOCK + ".on";
|
||||
public static final String TT_ULTRA_TERMINAL_RESTOCK_OFF = TT_ULTRA_TERMINAL_RESTOCK + ".off";
|
||||
|
||||
public static final String WAILA_KEY = FluidCraft.MODID + ".waila.";
|
||||
public static final String WAILA_ENABLE = WAILA_KEY + "enable";
|
||||
public static final String WAILA_DISABLE = WAILA_KEY + "disable";
|
||||
@@ -130,6 +136,13 @@ public class NameConst {
|
||||
public static final String GUI_FLUID_EXPORT = GUI_KEY + ITEM_PART_FLUID_EXPORT;
|
||||
public static final String GUI_FLUID_STORAGE_BUS = GUI_KEY + ITEM_PART_FLUID_STORAGE_BUS;
|
||||
|
||||
public static final String GUI_MAGNET_CARD = GUI_KEY + "magnet";
|
||||
public static final String GUI_MAGNET_CARD_NBT = GUI_MAGNET_CARD + ".nbt";
|
||||
public static final String GUI_MAGNET_CARD_META = GUI_MAGNET_CARD + ".meta";
|
||||
public static final String GUI_MAGNET_CARD_ORE = GUI_MAGNET_CARD + ".ore";
|
||||
public static final String GUI_MAGNET_CARD_WhiteList = GUI_MAGNET_CARD + ".whitelist";
|
||||
public static final String GUI_MAGNET_CARD_BlackList = GUI_MAGNET_CARD + ".blacklist";
|
||||
|
||||
public static String i18n(String t, String delimiter, boolean hint) {
|
||||
if (!hint) {
|
||||
return I18n.format(t);
|
||||
|
||||
@@ -2,7 +2,9 @@ package com.glodblock.github.util;
|
||||
|
||||
import static com.glodblock.github.common.item.ItemBaseWirelessTerminal.infinityBoosterCard;
|
||||
import static com.glodblock.github.common.item.ItemBaseWirelessTerminal.infinityEnergyCard;
|
||||
import static com.glodblock.github.common.item.ItemBaseWirelessTerminal.restockItems;
|
||||
import static com.glodblock.github.util.Util.DimensionalCoordSide.hasEnergyCard;
|
||||
import static net.minecraft.init.Items.glass_bottle;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
@@ -14,6 +16,7 @@ import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemPotion;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
@@ -105,6 +108,40 @@ public final class Util {
|
||||
return ticks;
|
||||
}
|
||||
|
||||
public static boolean rangeCheck(ItemStack is, EntityPlayer player, IGridNode grid) {
|
||||
if (grid.getGrid() == null) return false;
|
||||
return rangeCheck(is, player, grid.getGrid());
|
||||
}
|
||||
|
||||
public static boolean rangeCheck(ItemStack is, EntityPlayer player, IGrid grid) {
|
||||
boolean canConnect = false;
|
||||
if (hasInfinityBoosterCard(is)) {
|
||||
canConnect = true;
|
||||
} else {
|
||||
for (IGridNode node : grid.getMachines(TileWireless.class)) {
|
||||
IWirelessAccessPoint accessPoint = (IWirelessAccessPoint) node.getMachine();
|
||||
if (accessPoint.isActive() && accessPoint.getLocation().getDimension() == player.dimension) {
|
||||
WorldCoord distance = accessPoint.getLocation()
|
||||
.subtract((int) player.posX, (int) player.posY, (int) player.posZ);
|
||||
int squaredDistance = distance.x * distance.x + distance.y * distance.y + distance.z * distance.z;
|
||||
if (squaredDistance <= accessPoint.getRange() * accessPoint.getRange()) {
|
||||
canConnect = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return canConnect;
|
||||
}
|
||||
|
||||
public static boolean isRestock(ItemStack is) {
|
||||
if (is.getItem() instanceof ItemBaseWirelessTerminal) {
|
||||
NBTTagCompound data = Platform.openNbtData(is);
|
||||
return data.hasKey(restockItems) && data.getBoolean(restockItems);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean hasInfinityBoosterCard(ItemStack is) {
|
||||
if (is.getItem() instanceof ItemBaseWirelessTerminal) {
|
||||
NBTTagCompound data = Platform.openNbtData(is);
|
||||
@@ -130,24 +167,7 @@ public final class Util {
|
||||
if (gridNode == null) return null;
|
||||
IGrid grid = gridNode.getGrid();
|
||||
if (grid == null) return null;
|
||||
boolean canConnect = false;
|
||||
if (hasInfinityBoosterCard(is)) {
|
||||
canConnect = true;
|
||||
} else {
|
||||
for (IGridNode node : grid.getMachines(TileWireless.class)) {
|
||||
IWirelessAccessPoint accessPoint = (IWirelessAccessPoint) node.getMachine();
|
||||
if (accessPoint.isActive() && accessPoint.getLocation().getDimension() == player.dimension) {
|
||||
WorldCoord distance = accessPoint.getLocation()
|
||||
.subtract((int) player.posX, (int) player.posY, (int) player.posZ);
|
||||
int squaredDistance = distance.x * distance.x + distance.y * distance.y + distance.z * distance.z;
|
||||
if (squaredDistance <= accessPoint.getRange() * accessPoint.getRange()) {
|
||||
canConnect = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (canConnect) {
|
||||
if (rangeCheck(is, player, grid)) {
|
||||
IStorageGrid gridCache = grid.getCache(IStorageGrid.class);
|
||||
if (gridCache != null) {
|
||||
if (channel == StorageChannel.FLUIDS) {
|
||||
@@ -433,6 +453,18 @@ public final class Util {
|
||||
|
||||
public static class FluidUtil {
|
||||
|
||||
private static final ItemStack glassBottle = new ItemStack(glass_bottle, 1);
|
||||
|
||||
public static ItemStack getPotion(FluidStack fs) {
|
||||
if (fs == null) return null;
|
||||
MutablePair<Integer, ItemStack> fillStack = Util.FluidUtil.fillStack(glassBottle, fs);
|
||||
if (fillStack != null && fillStack.getRight() != null
|
||||
&& fillStack.getRight().getItem() instanceof ItemPotion) {
|
||||
return fillStack.right;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static final ItemStack water_bucket = new ItemStack(Items.water_bucket, 1);
|
||||
|
||||
public static void fluidTankInfoWriteToNBT(FluidTankInfo[] infos, NBTTagCompound data) {
|
||||
|
||||
@@ -163,6 +163,18 @@ ae2fc.tooltip.not_fill_pattern.hint=Disabled
|
||||
ae2fc.tooltip.open_configuration=Open configuration
|
||||
ae2fc.tooltip.block_highlight=Highlight Block
|
||||
|
||||
ae2fc.tooltip.magnet_card.off=Magnet Card
|
||||
ae2fc.tooltip.magnet_card.off.hint=Off
|
||||
ae2fc.tooltip.magnet_card.inv=Magnet Card
|
||||
ae2fc.tooltip.magnet_card.inv.hint=Pickup to Inventory
|
||||
ae2fc.tooltip.magnet_card.me=Magnet Card
|
||||
ae2fc.tooltip.magnet_card.me.hint=Pickup to ME
|
||||
ae2fc.tooltip.magnet_card.filter=Magnet Filter
|
||||
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.gui.part_fluid_pattern_terminal=Fluid Pattern Terminal
|
||||
ae2fc.gui.part_fluid_pattern_terminal_ex=Fluid Processing Pattern Terminal
|
||||
ae2fc.gui.part_level_terminal=Level Terminal
|
||||
@@ -187,6 +199,13 @@ ae2fc.gui.part_fluid_terminal=ME Fluid Terminal
|
||||
ae2fc.gui.part_fluid_storage_bus=ME Fluid Storage Bus
|
||||
ae2fc.gui.fluid_auto_filler=ME Fluid Auto Filler
|
||||
|
||||
ae2fc.gui.magnet=Magnet Filter
|
||||
ae2fc.gui.magnet.nbt=Ignore NBT Data
|
||||
ae2fc.gui.magnet.meta=Ignore Meta Data
|
||||
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
|
||||
@@ -195,7 +214,8 @@ ae2fc.gui.color.StateError=FFFF5555
|
||||
|
||||
error.unknown=Unknown
|
||||
|
||||
key.OpenTerminal=Open Wireless Universal Terminal
|
||||
ae2fc.key.OpenTerminal=Open Wireless Universal Terminal
|
||||
ae2fc.key.Restock=Toggle Restock
|
||||
|
||||
itemGroup.ae2fc=Fluid Craft For AE2
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
Reference in new issue
Block a user