mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-16 10:34:40 +00:00
Merge branch 'master' into levelterminal-improve
This commit is contained in:
15 files changed
+373
-348
No files matched your search
+11
-11
@@ -34,30 +34,30 @@
|
||||
* 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.72-GTNH:dev')
|
||||
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-671-GTNH:dev')
|
||||
api('com.github.GTNewHorizons:NotEnoughItems:2.7.91-GTNH:dev')
|
||||
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-690-GTNH:dev')
|
||||
api('curse.maven:cofh-core-69162:2388751')
|
||||
api('com.github.GTNewHorizons:waila:1.8.12:dev')
|
||||
api("com.github.GTNewHorizons:GTNHLib:0.6.38:dev")
|
||||
api('com.github.GTNewHorizons:waila:1.8.14:dev')
|
||||
api("com.github.GTNewHorizons:GTNHLib:0.6.40:dev")
|
||||
|
||||
implementation("com.github.GTNewHorizons:WirelessCraftingTerminal:1.12.7:dev") {
|
||||
exclude group: 'com.github.GTNewHorizons', module: 'Applied-Energistics-2-Unofficial'
|
||||
}
|
||||
|
||||
compileOnly('com.github.GTNewHorizons:Baubles-Expanded:2.1.9-GTNH:dev')
|
||||
compileOnly('com.github.GTNewHorizons:Baubles-Expanded:2.1.15-GTNH:dev')
|
||||
compileOnly('com.github.GTNewHorizons:ExtraCells2:2.5.35:dev') { transitive = false }
|
||||
compileOnly('com.github.GTNewHorizons:ForestryMC:4.10.16:dev')
|
||||
compileOnly('com.github.GTNewHorizons:EnderIO:2.9.22:dev')
|
||||
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.51.423:dev') {
|
||||
compileOnly('com.github.GTNewHorizons:ForestryMC:4.10.17:dev')
|
||||
compileOnly('com.github.GTNewHorizons:EnderIO:2.9.26:dev')
|
||||
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.51.469:dev') {
|
||||
exclude group: 'com.github.GTNewHorizons', module: 'AE2FluidCraft-Rework'
|
||||
exclude group: 'com.github.GTNewHorizons', module: 'Applied-Energistics-2-Unofficial'
|
||||
}
|
||||
|
||||
compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
|
||||
compileOnly('com.gregoriust.gregtech:gregtech_1.7.10:6.14.23:dev') { transitive = false }
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.11.16-GTNH:dev') { transitive = false }
|
||||
compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.7.11-GTNH:dev') { transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.6.96:dev") { transitive = false }
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.11.19-GTNH:dev') { transitive = false }
|
||||
compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.7.14-GTNH:dev') { transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.6.108:dev") { transitive = false }
|
||||
|
||||
runtimeOnlyNonPublishable("com.github.GTNewHorizons:DuraDisplay:1.3.4:dev")
|
||||
}
|
||||
+1
-1
@@ -17,7 +17,7 @@ pluginManagement {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.41'
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.42'
|
||||
}
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ public class GuiCraftingStatus extends appeng.client.gui.implementations.GuiCraf
|
||||
new CPacketInventoryAction(
|
||||
InventoryAction.AUTO_CRAFT,
|
||||
Ae2ReflectClient.getInventorySlots(this).size(),
|
||||
0,
|
||||
hoveredAEStack.getStackSize(),
|
||||
hoveredAEStack));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -55,6 +55,7 @@ public class GuiFCPriority extends FCGuiAmount {
|
||||
protected void addQty(final int i) {
|
||||
try {
|
||||
this.amountBox.setText(Long.toString(getAmount() + i));
|
||||
this.amountBox.setCursorPositionEnd();
|
||||
} catch (final NumberFormatException ignore) {}
|
||||
try {
|
||||
NetworkHandler.instance
|
||||
|
||||
@@ -45,9 +45,7 @@ public class GuiFluidCraftAmount extends FCGuiAmount {
|
||||
this.guiTop + 53,
|
||||
Settings.CRAFTING_MODE,
|
||||
CraftingMode.STANDARD));
|
||||
|
||||
this.amountBox.setText("1");
|
||||
this.amountBox.setSelectionPos(0);
|
||||
((ContainerCraftAmount) this.inventorySlots).setAmountField(this.amountBox);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -7,12 +7,10 @@ import net.minecraft.item.ItemStack;
|
||||
|
||||
import com.glodblock.github.client.gui.base.FCGuiMonitor;
|
||||
import com.glodblock.github.client.gui.container.ContainerItemMonitor;
|
||||
import com.glodblock.github.util.ModAndClassUtil;
|
||||
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.client.me.ItemRepo;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.localization.GuiText;
|
||||
|
||||
public class GuiItemMonitor extends FCGuiMonitor<IAEItemStack> {
|
||||
@@ -40,13 +38,6 @@ public class GuiItemMonitor extends FCGuiMonitor<IAEItemStack> {
|
||||
super.drawFG(offsetX, offsetY, mouseX, mouseY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(final int mouseX, final int mouseY, final float btn) {
|
||||
super.drawScreen(mouseX, mouseY, btn);
|
||||
if (ModAndClassUtil.isSearchBar && AEConfig.instance.preserveSearchBar && searchField != null)
|
||||
handleTooltip(mouseX, mouseY, searchField.new TooltipProvider());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTextFieldValue(String displayName, int mousex, int mousey, ItemStack stack) {
|
||||
setSearchString(displayName, true);
|
||||
|
||||
@@ -117,8 +117,9 @@ public class GuiPatternMulti extends GuiAmount {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected long addOrderAmount(final int i) {
|
||||
return i + getAmount();
|
||||
protected void addAmount(int i) {
|
||||
this.amountTextField.setText(Long.toString(i + getAmount()));
|
||||
this.amountTextField.setCursorPositionEnd();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.glodblock.github.client.gui.base;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiTextField;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@@ -12,6 +11,7 @@ import com.glodblock.github.inventory.gui.GuiType;
|
||||
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.widgets.GuiTabButton;
|
||||
import appeng.client.gui.widgets.MEGuiTextField;
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.localization.GuiText;
|
||||
@@ -20,7 +20,7 @@ import appeng.util.calculators.Calculator;
|
||||
|
||||
public abstract class FCGuiAmount extends AEBaseGui {
|
||||
|
||||
protected GuiTextField amountBox;
|
||||
protected MEGuiTextField amountBox;
|
||||
protected GuiTabButton originalGuiBtn;
|
||||
protected GuiButton submit;
|
||||
protected GuiButton plus1;
|
||||
@@ -72,16 +72,10 @@ public abstract class FCGuiAmount extends AEBaseGui {
|
||||
this.originalGuiBtn.setHideEdge(13);
|
||||
}
|
||||
|
||||
this.amountBox = new GuiTextField(
|
||||
this.fontRendererObj,
|
||||
this.guiLeft + 62,
|
||||
this.guiTop + 57,
|
||||
59,
|
||||
this.fontRendererObj.FONT_HEIGHT);
|
||||
this.amountBox.setEnableBackgroundDrawing(false);
|
||||
this.amountBox = new MEGuiTextField(61, 12);
|
||||
this.amountBox.x = this.guiLeft + 60;
|
||||
this.amountBox.y = this.guiTop + 55;
|
||||
this.amountBox.setMaxStringLength(16);
|
||||
this.amountBox.setTextColor(0xFFFFFF);
|
||||
this.amountBox.setVisible(true);
|
||||
this.amountBox.setFocused(true);
|
||||
}
|
||||
|
||||
@@ -134,6 +128,7 @@ public abstract class FCGuiAmount extends AEBaseGui {
|
||||
}
|
||||
String out = Long.toString(resultI);
|
||||
this.amountBox.setText(out);
|
||||
this.amountBox.setCursorPositionEnd();
|
||||
} catch (final NumberFormatException ignore) {}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@ import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.client.gui.FCGuiTextField;
|
||||
import com.glodblock.github.client.gui.GuiFluidMonitor;
|
||||
import com.glodblock.github.client.gui.GuiItemMonitor;
|
||||
import com.glodblock.github.client.gui.container.base.FCContainerMonitor;
|
||||
@@ -28,6 +27,7 @@ import com.glodblock.github.util.ModAndClassUtil;
|
||||
|
||||
import appeng.api.config.CraftingStatus;
|
||||
import appeng.api.config.PinsState;
|
||||
import appeng.api.config.SearchBoxFocusPriority;
|
||||
import appeng.api.config.SearchBoxMode;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.TerminalStyle;
|
||||
@@ -45,6 +45,7 @@ import appeng.client.gui.widgets.GuiScrollbar;
|
||||
import appeng.client.gui.widgets.GuiTabButton;
|
||||
import appeng.client.gui.widgets.IDropToFillTextField;
|
||||
import appeng.client.gui.widgets.ISortSource;
|
||||
import appeng.client.gui.widgets.MEGuiTextField;
|
||||
import appeng.client.me.InternalSlotME;
|
||||
import appeng.client.me.ItemRepo;
|
||||
import appeng.client.me.PinSlotME;
|
||||
@@ -93,7 +94,7 @@ public abstract class FCGuiMonitor<T extends IAEStack<T>> extends FCBaseMEGui
|
||||
public GuiTabButton craftingStatusBtn;
|
||||
protected IDisplayRepo repo;
|
||||
protected GuiImgButton craftingStatusImgBtn;
|
||||
protected FCGuiTextField searchField;
|
||||
protected MEGuiTextField searchField;
|
||||
protected int perRow = 9;
|
||||
protected int reservedSpace = 0;
|
||||
protected boolean customSortOrder = true;
|
||||
@@ -113,6 +114,10 @@ public abstract class FCGuiMonitor<T extends IAEStack<T>> extends FCBaseMEGui
|
||||
protected boolean hasShiftKeyDown = false;
|
||||
private PinsState pinsState;
|
||||
public final boolean hasPinHost;
|
||||
private boolean canBeAutoFocused;
|
||||
private boolean isAutoFocused;
|
||||
protected int currentMouseY;
|
||||
protected int currentMouseX;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public FCGuiMonitor(final InventoryPlayer inventoryPlayer, final ITerminalHost te, final FCContainerMonitor<T> c) {
|
||||
@@ -337,18 +342,19 @@ public abstract class FCGuiMonitor<T extends IAEStack<T>> extends FCBaseMEGui
|
||||
AEConfig.instance.settings.getSetting(Settings.TERMINAL_STYLE)));
|
||||
this.offsetY += 20;
|
||||
|
||||
// Right now 80 > offsetX, but that can be changed later.
|
||||
// noinspection DataFlowIssue
|
||||
this.searchField = new FCGuiTextField(
|
||||
this.fontRendererObj,
|
||||
this.guiLeft + Math.max(80, this.offsetX),
|
||||
this.guiTop + 4,
|
||||
90,
|
||||
12);
|
||||
this.searchField.setEnableBackgroundDrawing(false);
|
||||
this.searchField = new MEGuiTextField(90, 12) {
|
||||
|
||||
@Override
|
||||
public void onTextChange(final String oldText) {
|
||||
final String text = getText();
|
||||
repo.setSearchString(text);
|
||||
repo.updateView();
|
||||
setScrollBar();
|
||||
}
|
||||
};
|
||||
this.searchField.x = this.guiLeft + Math.max(80, this.offsetX);
|
||||
this.searchField.y = this.guiTop + 4;
|
||||
this.searchField.setMaxStringLength(25);
|
||||
this.searchField.setTextColor(0xFFFFFF);
|
||||
this.searchField.setVisible(true);
|
||||
if (ModAndClassUtil.isSearchStringTooltip)
|
||||
searchField.setMessage(ButtonToolTips.SearchStringTooltip.getLocal());
|
||||
|
||||
@@ -384,7 +390,9 @@ public abstract class FCGuiMonitor<T extends IAEStack<T>> extends FCBaseMEGui
|
||||
}
|
||||
|
||||
final Enum<?> setting = AEConfig.instance.settings.getSetting(Settings.SEARCH_MODE);
|
||||
this.searchField.setFocused(SearchBoxMode.AUTOSEARCH == setting || SearchBoxMode.NEI_AUTOSEARCH == setting);
|
||||
this.canBeAutoFocused = SearchBoxMode.AUTOSEARCH == setting || SearchBoxMode.NEI_AUTOSEARCH == setting;
|
||||
this.searchField.setFocused(this.canBeAutoFocused);
|
||||
this.isAutoFocused = this.canBeAutoFocused;
|
||||
|
||||
if (ModAndClassUtil.isSearchBar && (AEConfig.instance.preserveSearchBar || this.isSubGui())) {
|
||||
setSearchString(memoryText, false);
|
||||
@@ -420,6 +428,7 @@ public abstract class FCGuiMonitor<T extends IAEStack<T>> extends FCBaseMEGui
|
||||
|
||||
public void setSearchString(String memoryText, boolean updateView) {
|
||||
this.searchField.setText(memoryText);
|
||||
this.searchField.setCursorPositionEnd();
|
||||
this.repo.setSearchString(memoryText);
|
||||
if (updateView) {
|
||||
this.repo.updateView();
|
||||
@@ -429,13 +438,8 @@ public abstract class FCGuiMonitor<T extends IAEStack<T>> extends FCBaseMEGui
|
||||
|
||||
@Override
|
||||
protected void mouseClicked(final int xCoord, final int yCoord, final int btn) {
|
||||
final Enum<?> searchMode = AEConfig.instance.settings.getSetting(Settings.SEARCH_MODE);
|
||||
if (searchMode != SearchBoxMode.AUTOSEARCH && searchMode != SearchBoxMode.NEI_AUTOSEARCH) {
|
||||
this.searchField.mouseClicked(xCoord, yCoord, btn);
|
||||
}
|
||||
if (btn == 1 && this.searchField.isMouseIn(xCoord, yCoord)) {
|
||||
setSearchString("", true);
|
||||
}
|
||||
this.searchField.mouseClicked(xCoord, yCoord, btn);
|
||||
isAutoFocused = false;
|
||||
super.mouseClicked(xCoord, yCoord, btn);
|
||||
}
|
||||
|
||||
@@ -718,6 +722,9 @@ public abstract class FCGuiMonitor<T extends IAEStack<T>> extends FCBaseMEGui
|
||||
if (this.searchField != null) {
|
||||
this.searchField.drawTextBox();
|
||||
}
|
||||
|
||||
this.currentMouseX = mouseX;
|
||||
this.currentMouseY = mouseY;
|
||||
}
|
||||
|
||||
protected String getBackground() {
|
||||
@@ -740,18 +747,29 @@ public abstract class FCGuiMonitor<T extends IAEStack<T>> extends FCBaseMEGui
|
||||
|
||||
@Override
|
||||
protected void keyTyped(final char character, final int key) {
|
||||
if (!this.checkHotbarKeys(key)) {
|
||||
if (character == ' ' && this.searchField.getText().isEmpty()) {
|
||||
return;
|
||||
}
|
||||
if (character == ' ' && this.searchField.getText().isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.searchField.textboxKeyTyped(character, key)) {
|
||||
this.repo.setSearchString(this.searchField.getText());
|
||||
this.repo.updateView();
|
||||
this.setScrollBar();
|
||||
} else {
|
||||
super.keyTyped(character, key);
|
||||
}
|
||||
boolean skipHotbarCheck = searchField.isFocused()
|
||||
&& (AEConfig.instance.searchBoxFocusPriority == SearchBoxFocusPriority.ALWAYS
|
||||
|| (AEConfig.instance.searchBoxFocusPriority == SearchBoxFocusPriority.NO_AUTOSEARCH
|
||||
&& !isAutoFocused));
|
||||
|
||||
if (!skipHotbarCheck && checkHotbarKeys(key)) {
|
||||
return;
|
||||
}
|
||||
|
||||
final boolean mouseInGui = this
|
||||
.isPointInRegion(0, 0, this.xSize, this.ySize, this.currentMouseX, this.currentMouseY);
|
||||
|
||||
if (this.canBeAutoFocused && !searchField.isFocused() && mouseInGui) {
|
||||
searchField.setFocused(true);
|
||||
isAutoFocused = true;
|
||||
}
|
||||
|
||||
if (!searchField.textboxKeyTyped(character, key)) {
|
||||
super.keyTyped(character, key);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -833,13 +851,6 @@ public abstract class FCGuiMonitor<T extends IAEStack<T>> extends FCBaseMEGui
|
||||
this.standardSize = standardSize;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(final int mouseX, final int mouseY, final float btn) {
|
||||
super.drawScreen(mouseX, mouseY, btn);
|
||||
if (ModAndClassUtil.isSearchBar && AEConfig.instance.preserveSearchBar && searchField != null)
|
||||
handleTooltip(mouseX, mouseY, searchField.new TooltipProvider());
|
||||
}
|
||||
|
||||
public boolean isOverSearchField(int x, int y) {
|
||||
return searchField.isMouseIn(x, y);
|
||||
}
|
||||
@@ -881,4 +892,23 @@ public abstract class FCGuiMonitor<T extends IAEStack<T>> extends FCBaseMEGui
|
||||
public void setPinsState(PinsState state) {
|
||||
configSrc.putSetting(Settings.PINS_STATE, state);
|
||||
}
|
||||
|
||||
@SuppressWarnings("SameParameterValue")
|
||||
protected boolean isPointInRegion(int rectX, int rectY, int rectWidth, int rectHeight, int pointX, int pointY) {
|
||||
pointX -= this.guiLeft;
|
||||
pointY -= this.guiTop;
|
||||
return pointX >= rectX - 1 && pointX < rectX + rectWidth + 1
|
||||
&& pointY >= rectY - 1
|
||||
&& pointY < rectY + rectHeight + 1;
|
||||
}
|
||||
|
||||
// Moving items via hotbar keys in terminals isn't working anyway.
|
||||
// Let's disable hotbar keys processing for terminal slots to allow proper input of numbers in the search field
|
||||
@Override
|
||||
protected boolean checkHotbarKeys(int keyCode) {
|
||||
if (theSlot instanceof SlotME) {
|
||||
return false;
|
||||
}
|
||||
return super.checkHotbarKeys(keyCode);
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,6 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.event.ForgeEventFactory;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
@@ -36,7 +35,6 @@ import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.Upgrades;
|
||||
import appeng.api.implementations.items.IMemoryCard;
|
||||
import appeng.api.implementations.tiles.ITileStorageMonitorable;
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.networking.crafting.ICraftingLink;
|
||||
@@ -69,8 +67,11 @@ import appeng.tile.inventory.AppEngInternalInventory;
|
||||
import appeng.tile.inventory.IAEAppEngInventory;
|
||||
import appeng.tile.inventory.InvOperation;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.inv.AdaptorIInventory;
|
||||
import appeng.util.inv.IInventoryDestination;
|
||||
import appeng.util.inv.WrapperInvSlot;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class PartFluidP2PInterface extends PartP2PTunnelStatic<PartFluidP2PInterface>
|
||||
implements IGridTickable, IStorageMonitorable, IInventoryDestination, IDualHost, ISidedInventory,
|
||||
@@ -79,6 +80,10 @@ public class PartFluidP2PInterface extends PartP2PTunnelStatic<PartFluidP2PInter
|
||||
boolean needUpdateOnNetworkBooted = false;
|
||||
boolean lastPowerStart = false;
|
||||
|
||||
public PartFluidP2PInterface(ItemStack is) {
|
||||
super(is);
|
||||
}
|
||||
|
||||
private final DualityInterface duality = new DualityInterface(this.getProxy(), this) {
|
||||
|
||||
@Override
|
||||
@@ -111,6 +116,7 @@ public class PartFluidP2PInterface extends PartP2PTunnelStatic<PartFluidP2PInter
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TickRateModulation tickingRequest(IGridNode node, int ticksSinceLastCall) {
|
||||
final boolean powerState = proxy.isActive();
|
||||
if (needUpdateOnNetworkBooted || lastPowerStart != powerState) {
|
||||
@@ -136,6 +142,7 @@ public class PartFluidP2PInterface extends PartP2PTunnelStatic<PartFluidP2PInter
|
||||
|
||||
if (p2p != null) {
|
||||
this.setHasConfig(p2p.duality.hasConfig());
|
||||
|
||||
alertDevice = hasWorkToDo();
|
||||
|
||||
} else {
|
||||
@@ -164,7 +171,7 @@ public class PartFluidP2PInterface extends PartP2PTunnelStatic<PartFluidP2PInter
|
||||
super.addDrops(drops);
|
||||
try {
|
||||
for (PartFluidP2PInterface p2p : getOutputs()) p2p.duality.addDrops(drops);
|
||||
} catch (GridAccessException e) {}
|
||||
} catch (GridAccessException ignored) {}
|
||||
} else {
|
||||
if (this.getWaitingToSend() != null) {
|
||||
for (final ItemStack is : this.getWaitingToSend()) {
|
||||
@@ -203,29 +210,46 @@ public class PartFluidP2PInterface extends PartP2PTunnelStatic<PartFluidP2PInter
|
||||
private final DualityFluidInterface dualityFluid = new DualityFluidInterface(this.getProxy(), this);
|
||||
private final AppEngInternalAEInventory config = new AppEngInternalAEInventory(this, 6);
|
||||
|
||||
public PartFluidP2PInterface(ItemStack is) {
|
||||
super(is);
|
||||
}
|
||||
|
||||
private void updateSharingInventory() {
|
||||
duality.readConfig();
|
||||
if (isOutput()) {
|
||||
PartFluidP2PInterface p2p = getInput();
|
||||
if (proxy.isActive() && p2p != null) {
|
||||
if (!duality.sharedInventory && !duality.getStorage().isEmpty()) {
|
||||
ArrayList<ItemStack> drops = new ArrayList<>();
|
||||
AppEngInternalInventory storageAppEng = this.duality.getStorage();
|
||||
AdaptorIInventory p2pInv = new AdaptorIInventory(p2p.duality.getStorage());
|
||||
for (ItemStack itemStack : storageAppEng) {
|
||||
if (itemStack == null) continue;
|
||||
ItemStack drop = p2pInv.addItems(itemStack);
|
||||
if (drop != null && drop.stackSize > 0) {
|
||||
drops.add(drop);
|
||||
}
|
||||
}
|
||||
TileEntity te = getTileEntity();
|
||||
Platform.spawnDrops(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, drops);
|
||||
}
|
||||
duality.setStorage(p2p.duality.getStorage());
|
||||
duality.sharedInventory = true;
|
||||
} else {
|
||||
if (duality.sharedInventory) {
|
||||
duality.setStorage(new AppEngInternalInventory(this, NUMBER_OF_STORAGE_SLOTS));
|
||||
duality.setSlotInv(new WrapperInvSlot(duality.getStorage()));
|
||||
duality.sharedInventory = false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (duality.sharedInventory) {
|
||||
duality.setStorage(new AppEngInternalInventory(this, NUMBER_OF_STORAGE_SLOTS));
|
||||
duality.setSlotInv(new WrapperInvSlot(duality.getStorage()));
|
||||
duality.sharedInventory = false;
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
for (PartFluidP2PInterface p2p : getOutputs()) {
|
||||
p2p.duality.readConfig();
|
||||
}
|
||||
} catch (GridAccessException ignored) {}
|
||||
}
|
||||
duality.readConfig();
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
@@ -242,51 +266,90 @@ public class PartFluidP2PInterface extends PartP2PTunnelStatic<PartFluidP2PInter
|
||||
needUpdateOnNetworkBooted = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInstalledUpgrades(final Upgrades u) {
|
||||
return this.duality.getInstalledUpgrades(u);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getTypeTexture() {
|
||||
return ItemAndBlockHolder.INTERFACE.getBlockTextureFromSide(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void gridChanged() {
|
||||
super.gridChanged();
|
||||
dualityFluid.gridChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(final NBTTagCompound data) {
|
||||
super.readFromNBT(data);
|
||||
this.duality.readFromNBT(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(final NBTTagCompound data) {
|
||||
super.writeToNBT(data);
|
||||
this.duality.writeToNBT(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound getMemoryCardData() {
|
||||
final NBTTagCompound output = super.getMemoryCardData();
|
||||
this.duality.getConfigManager().writeToNBT(output);
|
||||
return output;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pasteMemoryCardData(PartP2PTunnel<?> newTunnel, NBTTagCompound data) throws GridAccessException {
|
||||
this.duality.getConfigManager().readFromNBT(data);
|
||||
super.pasteMemoryCardData(newTunnel, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addToWorld() {
|
||||
super.addToWorld();
|
||||
this.duality.initialize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDrops(final List<ItemStack> drops, final boolean wrenched) {
|
||||
this.duality.addDrops(drops);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int cableConnectionRenderTo() {
|
||||
return 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IConfigManager getConfigManager() {
|
||||
return this.duality.getConfigManager();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getInventoryByName(final String name) {
|
||||
return this.duality.getInventoryByName(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborChanged() {
|
||||
this.duality.updateRedstoneState();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPartActivate(final EntityPlayer player, final Vec3 pos) {
|
||||
AppEngInternalInventory patterns = (AppEngInternalInventory) this.duality.getPatterns();
|
||||
final boolean wasActive = getProxy().isActive();
|
||||
public boolean onPartActivate(final EntityPlayer p, final Vec3 pos) {
|
||||
AppEngInternalInventory patterns = this.duality.getPatterns();
|
||||
|
||||
if (!isOutput()) {
|
||||
final ItemStack is = player.inventory.getCurrentItem();
|
||||
if (is != null && is.getItem() instanceof IMemoryCard mc) {
|
||||
if (ForgeEventFactory.onItemUseStart(player, is, 1) <= 0) return false;
|
||||
try {
|
||||
for (PartFluidP2PInterface p2p : getOutputs()) {
|
||||
p2p.duality.setStorage(new AppEngInternalInventory(this, NUMBER_OF_STORAGE_SLOTS));
|
||||
p2p.duality.setSlotInv(new WrapperInvSlot(duality.getStorage()));
|
||||
p2p.duality.sharedInventory = false;
|
||||
}
|
||||
} catch (GridAccessException ignored) {}
|
||||
}
|
||||
}
|
||||
|
||||
if (super.onPartActivate(player, pos)) {
|
||||
if (super.onPartActivate(p, pos)) {
|
||||
ArrayList<ItemStack> drops = new ArrayList<>();
|
||||
for (int i = 0; i < patterns.getSizeInventory(); i++) {
|
||||
if (patterns.getStackInSlot(i) == null) continue;
|
||||
drops.add(patterns.getStackInSlot(i));
|
||||
}
|
||||
|
||||
if (!duality.sharedInventory && !wasActive) {
|
||||
AppEngInternalInventory storageAppEng = this.duality.getStorage();
|
||||
for (int i = 0; i < NUMBER_OF_STORAGE_SLOTS; i++) {
|
||||
if (storageAppEng.getStackInSlot(i) == null) continue;
|
||||
drops.add(storageAppEng.getStackInSlot(i));
|
||||
}
|
||||
}
|
||||
|
||||
final IPart tile = this.getHost().getPart(this.getSide());
|
||||
if (tile instanceof PartFluidP2PInterface dualTile) {
|
||||
DualityInterface newDuality = dualTile.duality;
|
||||
@@ -299,8 +362,8 @@ public class PartFluidP2PInterface extends PartP2PTunnelStatic<PartFluidP2PInter
|
||||
}
|
||||
|
||||
if (!duality.sharedInventory) {
|
||||
IInventory storage = (IInventory) duality.getStorage();
|
||||
IInventory newStorage = (IInventory) newDuality.getStorage();
|
||||
IInventory storage = duality.getStorage();
|
||||
IInventory newStorage = newDuality.getStorage();
|
||||
for (int i = 0; i < storage.getSizeInventory(); ++i) {
|
||||
newStorage.setInventorySlotContents(i, storage.getStackInSlot(i));
|
||||
}
|
||||
@@ -316,13 +379,13 @@ public class PartFluidP2PInterface extends PartP2PTunnelStatic<PartFluidP2PInter
|
||||
return true;
|
||||
}
|
||||
|
||||
if (player.isSneaking()) {
|
||||
if (p.isSneaking()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Platform.isServer()) {
|
||||
InventoryHandler.openGui(
|
||||
player,
|
||||
p,
|
||||
this.getHost().getTile().getWorldObj(),
|
||||
new BlockPos(this.getHost().getTile()),
|
||||
Objects.requireNonNull(this.getSide()),
|
||||
@@ -333,13 +396,23 @@ public class PartFluidP2PInterface extends PartP2PTunnelStatic<PartFluidP2PInter
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getTypeTexture() {
|
||||
return ItemAndBlockHolder.INTERFACE.getBlockTextureFromSide(0);
|
||||
public IIcon getBreakingTexture() {
|
||||
return this.getItemStack().getIconIndex();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IStorageMonitorable getMonitorable(ForgeDirection side, BaseActionSource src) {
|
||||
return duality.getMonitorable(side, src, this);
|
||||
public boolean canInsert(final ItemStack stack) {
|
||||
return this.duality.canInsert(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMEMonitor<IAEItemStack> getItemInventory() {
|
||||
return this.duality.getItemInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMEMonitor<IAEFluidStack> getFluidInventory() {
|
||||
return this.duality.getFluidInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -364,142 +437,216 @@ public class PartFluidP2PInterface extends PartP2PTunnelStatic<PartFluidP2PInter
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInstalledUpgrades(Upgrades u) {
|
||||
return duality.getInstalledUpgrades(u);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMEMonitor<IAEItemStack> getItemInventory() {
|
||||
return duality.getItemInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMEMonitor<IAEFluidStack> getFluidInventory() {
|
||||
return duality.getFluidInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPriority() {
|
||||
return duality.getPriority();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPriority(int newValue) {
|
||||
duality.setPriority(newValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTunnelNetworkChange() {
|
||||
duality.updateCraftingList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChangeInventory(IInventory inv, int slot, InvOperation op, ItemStack removedStack,
|
||||
ItemStack newStack) {
|
||||
duality.onChangeInventory(inv, slot, op, removedStack, newStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsert(ItemStack stack) {
|
||||
return duality.canInsert(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
return duality.getStorage().getSizeInventory();
|
||||
return this.duality.getStorage().getSizeInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(final int i) {
|
||||
return duality.getStorage().getStackInSlot(i);
|
||||
return this.duality.getStorage().getStackInSlot(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int index, int count) {
|
||||
return duality.getStorage().decrStackSize(index, count);
|
||||
public ItemStack decrStackSize(final int i, final int j) {
|
||||
return this.duality.getStorage().decrStackSize(i, j);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int index) {
|
||||
return duality.getStorage().getStackInSlotOnClosing(index);
|
||||
public ItemStack getStackInSlotOnClosing(final int i) {
|
||||
return this.duality.getStorage().getStackInSlotOnClosing(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int index, ItemStack stack) {
|
||||
duality.getStorage().setInventorySlotContents(index, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getInventoryByName(String name) {
|
||||
return duality.getInventoryByName(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IConfigManager getConfigManager() {
|
||||
return duality.getConfigManager();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getBreakingTexture() {
|
||||
return getItemStack().getIconIndex();
|
||||
public void setInventorySlotContents(final int i, final ItemStack itemstack) {
|
||||
this.duality.getStorage().setInventorySlotContents(i, itemstack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return duality.getStorage().getInventoryName();
|
||||
return this.duality.getStorage().getInventoryName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName() {
|
||||
return duality.getStorage().hasCustomInventoryName();
|
||||
return this.duality.getStorage().hasCustomInventoryName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit() {
|
||||
return duality.getStorage().getInventoryStackLimit();
|
||||
return this.duality.getStorage().getInventoryStackLimit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void markDirty() {
|
||||
duality.markDirty();
|
||||
this.duality.getStorage().markDirty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer player) {
|
||||
return duality.getStorage().isUseableByPlayer(player);
|
||||
public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
|
||||
return this.duality.getStorage().isUseableByPlayer(entityplayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory() {
|
||||
duality.getStorage().openInventory();
|
||||
this.duality.getStorage().openInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory() {
|
||||
duality.getStorage().closeInventory();
|
||||
this.duality.getStorage().closeInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int index, ItemStack stack) {
|
||||
return duality.getStorage().isItemValidForSlot(index, stack);
|
||||
public boolean isItemValidForSlot(final int i, final ItemStack itemstack) {
|
||||
return this.duality.getStorage().isItemValidForSlot(i, itemstack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int side) {
|
||||
return duality.getAccessibleSlotsFromSide(side);
|
||||
public int[] getAccessibleSlotsFromSide(final int s) {
|
||||
return this.duality.getAccessibleSlotsFromSide(s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int p_102007_1_, ItemStack itemStack, int p_102007_3_) {
|
||||
public boolean canInsertItem(final int i, final ItemStack itemstack, final int j) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) {
|
||||
public boolean canExtractItem(final int i, final ItemStack itemstack, final int j) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChangeInventory(final IInventory inv, final int slot, final InvOperation mc,
|
||||
final ItemStack removedStack, final ItemStack newStack) {
|
||||
this.duality.onChangeInventory(inv, slot, mc, removedStack, newStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DualityInterface getInterfaceDuality() {
|
||||
return this.duality;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumSet<ForgeDirection> getTargets() {
|
||||
return EnumSet.of(this.getSide());
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity getTileEntity() {
|
||||
return super.getHost().getTile();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IStorageMonitorable getMonitorable(final ForgeDirection side, final BaseActionSource src) {
|
||||
return this.duality.getMonitorable(side, src, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean pushPattern(final ICraftingPatternDetails patternDetails, final InventoryCrafting table) {
|
||||
return this.duality.pushPattern(patternDetails, table);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBusy() {
|
||||
return this.duality.isBusy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void provideCrafting(final ICraftingProviderHelper craftingTracker) {
|
||||
this.duality.provideCrafting(craftingTracker);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ImmutableSet<ICraftingLink> getRequestedJobs() {
|
||||
return this.duality.getRequestedJobs();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAEItemStack injectCraftedItems(final ICraftingLink link, final IAEItemStack items, final Actionable mode) {
|
||||
return this.duality.injectCraftedItems(link, items, mode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void jobStateChange(final ICraftingLink link) {
|
||||
this.duality.jobStateChange(link);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPriority() {
|
||||
return this.duality.getPriority();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPriority(final int newValue) {
|
||||
this.duality.setPriority(newValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTunnelNetworkChange() {
|
||||
this.duality.updateCraftingList();
|
||||
updateSharingInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTunnelConfigChange() {
|
||||
updateSharingInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getPatterns() {
|
||||
if (isOutput()) {
|
||||
PartFluidP2PInterface input = getInput();
|
||||
if (input != null) {
|
||||
return input.getPatterns();
|
||||
}
|
||||
return IInterfaceHost.super.getPatterns();
|
||||
}
|
||||
return IInterfaceHost.super.getPatterns();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int rows() {
|
||||
if (isOutput()) {
|
||||
PartFluidP2PInterface input = getInput();
|
||||
if (input != null) {
|
||||
return input.rows();
|
||||
}
|
||||
return IInterfaceHost.super.rows();
|
||||
}
|
||||
return IInterfaceHost.super.rows();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int rowSize() {
|
||||
if (isOutput()) {
|
||||
PartFluidP2PInterface input = getInput();
|
||||
if (input != null) {
|
||||
return input.rowSize();
|
||||
}
|
||||
return IInterfaceHost.super.rowSize();
|
||||
}
|
||||
return IInterfaceHost.super.rowSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
if (isOutput()) {
|
||||
PartFluidP2PInterface input = getInput();
|
||||
if (input != null) {
|
||||
return input.getName();
|
||||
}
|
||||
return IInterfaceHost.super.getName();
|
||||
}
|
||||
return IInterfaceHost.super.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getSelfRep() {
|
||||
return this.getItemStack();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int fill(ForgeDirection from, FluidStack resource, boolean doFill) {
|
||||
return dualityFluid.fill(from, resource, doFill);
|
||||
@@ -570,138 +717,9 @@ public class PartFluidP2PInterface extends PartP2PTunnelStatic<PartFluidP2PInter
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DualityInterface getInterfaceDuality() {
|
||||
return duality;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumSet<ForgeDirection> getTargets() {
|
||||
return EnumSet.of(this.getSide());
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity getTileEntity() {
|
||||
return super.getHost().getTile();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void provideCrafting(ICraftingProviderHelper craftingTracker) {
|
||||
duality.provideCrafting(craftingTracker);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean pushPattern(ICraftingPatternDetails patternDetails, InventoryCrafting table) {
|
||||
return duality.pushPattern(patternDetails, table);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBusy() {
|
||||
return duality.isBusy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ImmutableSet<ICraftingLink> getRequestedJobs() {
|
||||
return duality.getRequestedJobs();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAEItemStack injectCraftedItems(ICraftingLink link, IAEItemStack items, Actionable mode) {
|
||||
return duality.injectCraftedItems(link, items, mode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void jobStateChange(ICraftingLink link) {
|
||||
duality.jobStateChange(link);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound data) {
|
||||
super.readFromNBT(data);
|
||||
duality.readFromNBT(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound data) {
|
||||
super.writeToNBT(data);
|
||||
duality.writeToNBT(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound getMemoryCardData() {
|
||||
final NBTTagCompound output = super.getMemoryCardData();
|
||||
this.duality.getConfigManager().writeToNBT(output);
|
||||
return output;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pasteMemoryCardData(PartP2PTunnel<?> newTunnel, NBTTagCompound data) throws GridAccessException {
|
||||
this.duality.getConfigManager().readFromNBT(data);
|
||||
super.pasteMemoryCardData(newTunnel, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addToWorld() {
|
||||
super.addToWorld();
|
||||
this.duality.initialize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDrops(List<ItemStack> drops, boolean wrenched) {
|
||||
super.getDrops(drops, wrenched);
|
||||
duality.addDrops(drops);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldDisplay() {
|
||||
return IInterfaceHost.super.shouldDisplay();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getPatterns() {
|
||||
if (isOutput()) {
|
||||
PartFluidP2PInterface input = getInput();
|
||||
if (input != null) {
|
||||
return input.getPatterns();
|
||||
}
|
||||
return IInterfaceHost.super.getPatterns();
|
||||
}
|
||||
return IInterfaceHost.super.getPatterns();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int rows() {
|
||||
if (isOutput()) {
|
||||
PartFluidP2PInterface input = getInput();
|
||||
if (input != null) {
|
||||
return input.rows();
|
||||
}
|
||||
return IInterfaceHost.super.rows();
|
||||
}
|
||||
return IInterfaceHost.super.rows();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int rowSize() {
|
||||
if (isOutput()) {
|
||||
PartFluidP2PInterface input = getInput();
|
||||
if (input != null) {
|
||||
return input.rowSize();
|
||||
}
|
||||
return IInterfaceHost.super.rowSize();
|
||||
}
|
||||
return IInterfaceHost.super.rowSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
if (isOutput()) {
|
||||
PartFluidP2PInterface input = getInput();
|
||||
if (input != null) {
|
||||
return input.getName();
|
||||
}
|
||||
return IInterfaceHost.super.getName();
|
||||
}
|
||||
return IInterfaceHost.super.getName();
|
||||
}
|
||||
}
|
||||
@@ -282,9 +282,10 @@ public class TileFluidAutoFiller extends AENetworkInvTile
|
||||
if (!initialized) { // run postEvent on AE network is ready
|
||||
initialized = true;
|
||||
postEvent();
|
||||
if (this.returnStack == null) return TickRateModulation.SLEEP;
|
||||
}
|
||||
|
||||
if (this.returnStack == null) return TickRateModulation.SLEEP;
|
||||
|
||||
if (this.getStorageGrid() == null) {
|
||||
return TickRateModulation.SLOWER;
|
||||
}
|
||||
|
||||
+4
-13
@@ -13,7 +13,6 @@ 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;
|
||||
|
||||
@@ -210,19 +209,11 @@ public class WirelessMagnetCardFilterInventory extends BaseWirelessInventory imp
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean doInject(IAEItemStack is, EntityItem itemToGet, World world) {
|
||||
public boolean doInject(IAEItemStack is, EntityItem itemToGet) {
|
||||
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;
|
||||
if (ais == null) return true;
|
||||
itemToGet.getEntityItem().stackSize = (int) ais.getStackSize();
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isItemFiltered(ItemStack inputItemStack) {
|
||||
|
||||
@@ -43,7 +43,7 @@ public class CPacketInventoryAction implements IMessage {
|
||||
|
||||
public CPacketInventoryAction() {}
|
||||
|
||||
public CPacketInventoryAction(final InventoryAction action, final int slot, final int id) {
|
||||
public CPacketInventoryAction(final InventoryAction action, final int slot, final long id) {
|
||||
this.action = action;
|
||||
this.slot = slot;
|
||||
this.id = id;
|
||||
@@ -51,7 +51,7 @@ public class CPacketInventoryAction implements IMessage {
|
||||
this.isEmpty = true;
|
||||
}
|
||||
|
||||
public CPacketInventoryAction(final InventoryAction action, final int slot, final int id, IAEItemStack stack) {
|
||||
public CPacketInventoryAction(final InventoryAction action, final int slot, final long id, IAEItemStack stack) {
|
||||
this.action = action;
|
||||
this.slot = slot;
|
||||
this.id = id;
|
||||
@@ -123,6 +123,9 @@ public class CPacketInventoryAction implements IMessage {
|
||||
if (baseContainer.getTargetStack() != null) {
|
||||
cca.getCraftingItem().putStack(baseContainer.getTargetStack().getItemStack());
|
||||
cca.setItemToCraft(baseContainer.getTargetStack());
|
||||
if (message.id > 0) {
|
||||
cca.setInitialCraftAmount(message.id);
|
||||
}
|
||||
}
|
||||
cca.detectAndSendChanges();
|
||||
}
|
||||
|
||||
@@ -95,7 +95,6 @@ public class SPacketPatternItemRenamer implements IMessage {
|
||||
Slot slot = player.openContainer.getSlot(message.valueIndex);
|
||||
if (slot != null && slot.getHasStack()) {
|
||||
ItemStack nextStack = slot.getStack().copy();
|
||||
nextStack.setRepairCost(2);
|
||||
nextStack.setStackDisplayName(message.name);
|
||||
slot.putStack(nextStack);
|
||||
}
|
||||
|
||||
@@ -70,10 +70,7 @@ public class CommonProxy {
|
||||
.getFilter(wirelessTerm, result.getLeft(), gridNode, player);
|
||||
|
||||
if (inv.isPassFilter(stack)) {
|
||||
if (inv.doInject(
|
||||
AEApi.instance().storage().createItemStack(stack),
|
||||
itemEntity,
|
||||
world)) {
|
||||
if (inv.doInject(AEApi.instance().storage().createItemStack(stack), itemEntity)) {
|
||||
itemEntity.setDead();
|
||||
e.setCanceled(true);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user