mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-10-25 20:22:20 +00:00
[ci skip] spotlessApply with the new settings
This commit is contained in:
1 parent
ab0b8f11d4
commit
69a5c0e6ee
221 files changed
+3125
-2632
No files matched your search
@@ -1,6 +1,9 @@
|
||||
package com.glodblock.github;
|
||||
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
|
||||
import com.glodblock.github.common.Config;
|
||||
import com.glodblock.github.common.storage.FluidCellHandler;
|
||||
import com.glodblock.github.crossmod.opencomputers.OCDriverInit;
|
||||
@@ -12,6 +15,7 @@ import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.loader.RecipeLoader;
|
||||
import com.glodblock.github.proxy.CommonProxy;
|
||||
import com.glodblock.github.util.ModAndClassUtil;
|
||||
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
@@ -19,7 +23,6 @@ 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.network.NetworkRegistry;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
@Mod(
|
||||
modid = FluidCraft.MODID,
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
package com.glodblock.github.client;
|
||||
|
||||
import com.glodblock.github.client.textures.FCPartsTexture;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.client.event.TextureStitchEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import com.glodblock.github.client.textures.FCPartsTexture;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
public class ClientHelper {
|
||||
|
||||
@SubscribeEvent
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.glodblock.github.client.gui;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
|
||||
public class FCGuiLineField extends FCGuiTextField {
|
||||
|
||||
private final int _xPos;
|
||||
private final int _yPos;
|
||||
private final int _width;
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
package com.glodblock.github.client.gui;
|
||||
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.widgets.ITooltip;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiTextField;
|
||||
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.widgets.ITooltip;
|
||||
|
||||
public class FCGuiTextField extends GuiTextField {
|
||||
|
||||
private static final int PADDING = 2;
|
||||
private final FontRenderer _fontRender;
|
||||
private String tooltip;
|
||||
@@ -18,8 +20,7 @@ public class FCGuiTextField extends GuiTextField {
|
||||
private int _color;
|
||||
|
||||
/**
|
||||
* Uses the values to instantiate a padded version of a text field.
|
||||
* Pays attention to the '_' caret.
|
||||
* Uses the values to instantiate a padded version of a text field. Pays attention to the '_' caret.
|
||||
*
|
||||
* @param fontRenderer renderer for the strings
|
||||
* @param xPos absolute left position
|
||||
@@ -27,8 +28,8 @@ public class FCGuiTextField extends GuiTextField {
|
||||
* @param width absolute width
|
||||
* @param height absolute height
|
||||
*/
|
||||
public FCGuiTextField(
|
||||
final FontRenderer fontRenderer, final int xPos, final int yPos, final int width, final int height) {
|
||||
public FCGuiTextField(final FontRenderer fontRenderer, final int xPos, final int yPos, final int width,
|
||||
final int height) {
|
||||
super(
|
||||
fontRenderer,
|
||||
xPos + PADDING,
|
||||
@@ -136,6 +137,7 @@ public class FCGuiTextField extends GuiTextField {
|
||||
}
|
||||
|
||||
public class TooltipProvider implements ITooltip {
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return tooltip;
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
package com.glodblock.github.client.gui;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
import appeng.api.config.InsertionMode;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.SidelessMode;
|
||||
@@ -13,6 +19,7 @@ import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketConfigButton;
|
||||
import appeng.helpers.IInterfaceHost;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.client.gui.container.ContainerDualInterface;
|
||||
import com.glodblock.github.common.parts.PartFluidInterface;
|
||||
@@ -22,10 +29,6 @@ import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.network.CPacketSwitchGuis;
|
||||
import com.glodblock.github.util.ModAndClassUtil;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
public class GuiDualInterface extends GuiUpgradeable {
|
||||
|
||||
@@ -46,15 +49,18 @@ public class GuiDualInterface extends GuiUpgradeable {
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
protected void addButtons() {
|
||||
this.priority =
|
||||
new GuiTabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(), itemRender);
|
||||
this.priority = new GuiTabButton(
|
||||
this.guiLeft + 154,
|
||||
this.guiTop,
|
||||
2 + 4 * 16,
|
||||
GuiText.Priority.getLocal(),
|
||||
itemRender);
|
||||
this.buttonList.add(this.priority);
|
||||
|
||||
this.switcher = new GuiTabButton(
|
||||
this.guiLeft + 132,
|
||||
this.guiTop,
|
||||
host instanceof PartFluidInterface
|
||||
? ItemAndBlockHolder.FLUID_INTERFACE.stack()
|
||||
host instanceof PartFluidInterface ? ItemAndBlockHolder.FLUID_INTERFACE.stack()
|
||||
: ItemAndBlockHolder.INTERFACE.stack(),
|
||||
StatCollector.translateToLocal("ae2fc.tooltip.switch_fluid_interface"),
|
||||
itemRender);
|
||||
@@ -72,13 +78,19 @@ public class GuiDualInterface extends GuiUpgradeable {
|
||||
GuiText.InterfaceTerminalHint.getLocal());
|
||||
this.buttonList.add(this.interfaceMode);
|
||||
|
||||
this.insertionMode =
|
||||
new GuiImgButton(this.guiLeft - 18, this.guiTop + 44, Settings.INSERTION_MODE, InsertionMode.DEFAULT);
|
||||
this.insertionMode = new GuiImgButton(
|
||||
this.guiLeft - 18,
|
||||
this.guiTop + 44,
|
||||
Settings.INSERTION_MODE,
|
||||
InsertionMode.DEFAULT);
|
||||
this.buttonList.add(this.insertionMode);
|
||||
|
||||
if (isTile()) {
|
||||
this.sidelessMode = new GuiImgButton(
|
||||
this.guiLeft - 18, this.guiTop + 62, Settings.SIDELESS_MODE, SidelessMode.SIDELESS);
|
||||
this.guiLeft - 18,
|
||||
this.guiTop + 62,
|
||||
Settings.SIDELESS_MODE,
|
||||
SidelessMode.SIDELESS);
|
||||
this.buttonList.add(this.sidelessMode);
|
||||
}
|
||||
}
|
||||
@@ -100,7 +112,10 @@ public class GuiDualInterface extends GuiUpgradeable {
|
||||
}
|
||||
|
||||
this.fontRendererObj.drawString(
|
||||
getGuiDisplayName(StatCollector.translateToLocal(NameConst.GUI_FLUID_INTERFACE)), 8, 6, 4210752);
|
||||
getGuiDisplayName(StatCollector.translateToLocal(NameConst.GUI_FLUID_INTERFACE)),
|
||||
8,
|
||||
6,
|
||||
4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,16 +1,20 @@
|
||||
package com.glodblock.github.client.gui;
|
||||
|
||||
import appeng.client.gui.widgets.ITooltip;
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import appeng.client.gui.widgets.ITooltip;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
|
||||
public class GuiFCImgButton extends GuiButton implements ITooltip {
|
||||
|
||||
private static final Pattern COMPILE = Pattern.compile("%s");
|
||||
@@ -138,8 +142,8 @@ public class GuiFCImgButton extends GuiButton implements ITooltip {
|
||||
String displayValue = null;
|
||||
|
||||
if (this.buttonSetting != null && this.currentValue != null) {
|
||||
final ButtonAppearance buttonAppearance =
|
||||
appearances.get(new EnumPair(this.buttonSetting, this.currentValue));
|
||||
final ButtonAppearance buttonAppearance = appearances
|
||||
.get(new EnumPair(this.buttonSetting, this.currentValue));
|
||||
if (buttonAppearance == null) {
|
||||
return "No Such Message";
|
||||
}
|
||||
@@ -196,8 +200,7 @@ public class GuiFCImgButton extends GuiButton implements ITooltip {
|
||||
}
|
||||
|
||||
par1Minecraft.renderEngine.bindTexture(FluidCraft.resource("textures/gui/states.png"));
|
||||
this.field_146123_n = par2 >= this.xPosition
|
||||
&& par3 >= this.yPosition
|
||||
this.field_146123_n = par2 >= this.xPosition && par3 >= this.yPosition
|
||||
&& par2 < this.xPosition + this.width
|
||||
&& par3 < this.yPosition + this.height;
|
||||
|
||||
@@ -233,8 +236,7 @@ public class GuiFCImgButton extends GuiButton implements ITooltip {
|
||||
}
|
||||
|
||||
par1Minecraft.renderEngine.bindTexture(FluidCraft.resource("textures/gui/states.png"));
|
||||
this.field_146123_n = par2 >= this.xPosition
|
||||
&& par3 >= this.yPosition
|
||||
this.field_146123_n = par2 >= this.xPosition && par3 >= this.yPosition
|
||||
&& par2 < this.xPosition + this.width
|
||||
&& par3 < this.yPosition + this.height;
|
||||
|
||||
@@ -292,6 +294,7 @@ public class GuiFCImgButton extends GuiButton implements ITooltip {
|
||||
}
|
||||
|
||||
private static class ButtonAppearance {
|
||||
|
||||
public int index;
|
||||
public String displayName;
|
||||
public String displayValue;
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package com.glodblock.github.client.gui;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import appeng.container.implementations.ContainerPriority;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.localization.GuiText;
|
||||
@@ -8,13 +12,12 @@ import appeng.core.sync.packets.PacketValueConfig;
|
||||
import appeng.helpers.IPriorityHost;
|
||||
import appeng.util.calculators.ArithHelper;
|
||||
import appeng.util.calculators.Calculator;
|
||||
|
||||
import com.glodblock.github.client.gui.base.FCGuiAmount;
|
||||
import com.glodblock.github.common.parts.PartFluidStorageBus;
|
||||
import com.glodblock.github.inventory.IDualHost;
|
||||
import com.glodblock.github.inventory.gui.GuiType;
|
||||
import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import java.io.IOException;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
public class GuiFCPriority extends FCGuiAmount {
|
||||
|
||||
@@ -46,11 +49,10 @@ public class GuiFCPriority extends FCGuiAmount {
|
||||
protected void addQty(final int i) {
|
||||
try {
|
||||
this.amountBox.setText(Long.toString(getAmount() + i));
|
||||
} catch (final NumberFormatException ignore) {
|
||||
}
|
||||
} catch (final NumberFormatException ignore) {}
|
||||
try {
|
||||
NetworkHandler.instance.sendToServer(
|
||||
new PacketValueConfig("PriorityHost.Priority", String.valueOf(getAmount())));
|
||||
NetworkHandler.instance
|
||||
.sendToServer(new PacketValueConfig("PriorityHost.Priority", String.valueOf(getAmount())));
|
||||
} catch (IOException e) {
|
||||
AELog.debug(e);
|
||||
}
|
||||
@@ -71,8 +73,8 @@ public class GuiFCPriority extends FCGuiAmount {
|
||||
protected void keyTyped(final char character, final int key) {
|
||||
super.keyTyped(character, key);
|
||||
try {
|
||||
NetworkHandler.instance.sendToServer(
|
||||
new PacketValueConfig("PriorityHost.Priority", String.valueOf(getAmount())));
|
||||
NetworkHandler.instance
|
||||
.sendToServer(new PacketValueConfig("PriorityHost.Priority", String.valueOf(getAmount())));
|
||||
} catch (IOException e) {
|
||||
AELog.debug(e);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
package com.glodblock.github.client.gui;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.container.implementations.ContainerCraftAmount;
|
||||
import appeng.core.localization.GuiText;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.client.gui.base.FCGuiAmount;
|
||||
import com.glodblock.github.common.parts.PartFluidPatternTerminal;
|
||||
@@ -11,9 +16,6 @@ import com.glodblock.github.common.parts.PartFluidTerminal;
|
||||
import com.glodblock.github.inventory.gui.GuiType;
|
||||
import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.network.CPacketCraftRequest;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class GuiFluidCraftAmount extends FCGuiAmount {
|
||||
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
package com.glodblock.github.client.gui;
|
||||
|
||||
import java.text.NumberFormat;
|
||||
import java.util.*;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import org.lwjgl.input.Mouse;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
@@ -10,6 +20,7 @@ import appeng.core.AELog;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.integration.modules.NEI;
|
||||
import appeng.util.Platform;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.client.gui.container.ContainerFluidCraftConfirm;
|
||||
import com.glodblock.github.common.parts.PartFluidPatternTerminal;
|
||||
@@ -20,13 +31,6 @@ import com.glodblock.github.network.CPacketFluidPatternTermBtns;
|
||||
import com.glodblock.github.network.CPacketSwitchGuis;
|
||||
import com.glodblock.github.util.ModAndClassUtil;
|
||||
import com.google.common.base.Joiner;
|
||||
import java.text.NumberFormat;
|
||||
import java.util.*;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import org.lwjgl.input.Mouse;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class GuiFluidCraftConfirm extends AEBaseGui {
|
||||
|
||||
@@ -72,8 +76,13 @@ public class GuiFluidCraftConfirm extends AEBaseGui {
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
|
||||
this.start =
|
||||
new GuiButton(0, this.guiLeft + 162, this.guiTop + this.ySize - 25, 50, 20, GuiText.Start.getLocal());
|
||||
this.start = new GuiButton(
|
||||
0,
|
||||
this.guiLeft + 162,
|
||||
this.guiTop + this.ySize - 25,
|
||||
50,
|
||||
20,
|
||||
GuiText.Start.getLocal());
|
||||
this.start.enabled = false;
|
||||
this.buttonList.add(this.start);
|
||||
|
||||
@@ -89,7 +98,12 @@ public class GuiFluidCraftConfirm extends AEBaseGui {
|
||||
|
||||
if (this.OriginalGui != null) {
|
||||
this.cancel = new GuiButton(
|
||||
0, this.guiLeft + 6, this.guiTop + this.ySize - 25, 50, 20, GuiText.Cancel.getLocal());
|
||||
0,
|
||||
this.guiLeft + 6,
|
||||
this.guiTop + this.ySize - 25,
|
||||
50,
|
||||
20,
|
||||
GuiText.Cancel.getLocal());
|
||||
}
|
||||
|
||||
this.buttonList.add(this.cancel);
|
||||
@@ -137,9 +151,7 @@ public class GuiFluidCraftConfirm extends AEBaseGui {
|
||||
if (this.ccc.getSelectedCpu() >= 0) // && status.selectedCpu < status.cpus.size() )
|
||||
{
|
||||
if (this.ccc.getName().length() > 0) {
|
||||
final String name = this.ccc
|
||||
.getName()
|
||||
.substring(0, Math.min(20, this.ccc.getName().length()));
|
||||
final String name = this.ccc.getName().substring(0, Math.min(20, this.ccc.getName().length()));
|
||||
btnTextText = GuiText.CraftingCPU.getLocal() + ": " + name;
|
||||
} else {
|
||||
btnTextText = GuiText.CraftingCPU.getLocal() + ": #" + this.ccc.getSelectedCpu();
|
||||
@@ -161,8 +173,8 @@ public class GuiFluidCraftConfirm extends AEBaseGui {
|
||||
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||
final long BytesUsed = this.ccc.getUsedBytes();
|
||||
final String byteUsed = NumberFormat.getInstance().format(BytesUsed);
|
||||
final String Add =
|
||||
BytesUsed > 0 ? (byteUsed + ' ' + GuiText.BytesUsed.getLocal()) : GuiText.CalculatingWait.getLocal();
|
||||
final String Add = BytesUsed > 0 ? (byteUsed + ' ' + GuiText.BytesUsed.getLocal())
|
||||
: GuiText.CalculatingWait.getLocal();
|
||||
this.fontRendererObj.drawString(GuiText.CraftingPlan.getLocal() + " - " + Add, 8, 7, 4210752);
|
||||
|
||||
String dsp = null;
|
||||
@@ -171,8 +183,12 @@ public class GuiFluidCraftConfirm extends AEBaseGui {
|
||||
dsp = GuiText.Simulation.getLocal();
|
||||
} else {
|
||||
dsp = this.ccc.getCpuAvailableBytes() > 0
|
||||
? (GuiText.Bytes.getLocal() + ": " + this.ccc.getCpuAvailableBytes() + " : "
|
||||
+ GuiText.CoProcessors.getLocal() + ": " + this.ccc.getCpuCoProcessors())
|
||||
? (GuiText.Bytes.getLocal() + ": "
|
||||
+ this.ccc.getCpuAvailableBytes()
|
||||
+ " : "
|
||||
+ GuiText.CoProcessors.getLocal()
|
||||
+ ": "
|
||||
+ this.ccc.getCpuCoProcessors())
|
||||
: GuiText.Bytes.getLocal() + ": N/A : " + GuiText.CoProcessors.getLocal() + ": N/A";
|
||||
}
|
||||
|
||||
@@ -479,8 +495,8 @@ public class GuiFluidCraftConfirm extends AEBaseGui {
|
||||
final boolean backwards = Mouse.isButtonDown(1);
|
||||
|
||||
if (btn == this.selectCPU) {
|
||||
FluidCraft.proxy.netHandler.sendToServer(
|
||||
new CPacketFluidPatternTermBtns("Terminal.Cpu", backwards ? "Prev" : "Next"));
|
||||
FluidCraft.proxy.netHandler
|
||||
.sendToServer(new CPacketFluidPatternTermBtns("Terminal.Cpu", backwards ? "Prev" : "Next"));
|
||||
}
|
||||
|
||||
if (btn == this.cancel) {
|
||||
@@ -497,7 +513,7 @@ public class GuiFluidCraftConfirm extends AEBaseGui {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
protected void addItemTooltip(ItemStack is, List<String> lineList) {
|
||||
if (isShiftKeyDown()) {
|
||||
List l = is.getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips);
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
package com.glodblock.github.client.gui;
|
||||
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.client.gui.implementations.GuiUpgradeable;
|
||||
import appeng.core.localization.GuiText;
|
||||
|
||||
import com.glodblock.github.client.gui.container.ContainerFluidIO;
|
||||
import com.glodblock.github.common.parts.PartFluidImportBus;
|
||||
import com.glodblock.github.common.parts.base.FCSharedFluidBus;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
public class GuiFluidIO extends GuiUpgradeable {
|
||||
|
||||
private final FCSharedFluidBus bus;
|
||||
|
||||
public GuiFluidIO(InventoryPlayer inventoryPlayer, FCSharedFluidBus te) {
|
||||
@@ -30,10 +33,10 @@ public class GuiFluidIO extends GuiUpgradeable {
|
||||
@Override
|
||||
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||
this.fontRendererObj.drawString(
|
||||
this.getGuiDisplayName(I18n.format(
|
||||
this.bus instanceof PartFluidImportBus
|
||||
? NameConst.GUI_FLUID_IMPORT
|
||||
: NameConst.GUI_FLUID_EXPORT)),
|
||||
this.getGuiDisplayName(
|
||||
I18n.format(
|
||||
this.bus instanceof PartFluidImportBus ? NameConst.GUI_FLUID_IMPORT
|
||||
: NameConst.GUI_FLUID_EXPORT)),
|
||||
8,
|
||||
6,
|
||||
4210752);
|
||||
|
||||
@@ -1,9 +1,22 @@
|
||||
package com.glodblock.github.client.gui;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.widgets.GuiTabButton;
|
||||
import appeng.core.localization.GuiText;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.client.gui.container.ContainerFluidInterface;
|
||||
import com.glodblock.github.common.parts.PartFluidInterface;
|
||||
@@ -16,16 +29,6 @@ import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.network.CPacketSwitchGuis;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import com.glodblock.github.util.RenderUtil;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class GuiFluidInterface extends AEBaseGui {
|
||||
|
||||
@@ -58,11 +61,8 @@ public class GuiFluidInterface extends AEBaseGui {
|
||||
@Override
|
||||
public void func_146977_a(final Slot s) {
|
||||
try {
|
||||
GuiContainer.class
|
||||
.getDeclaredMethod("func_146977_a_original", Slot.class)
|
||||
.invoke(this, s);
|
||||
} catch (final Exception ignore) {
|
||||
}
|
||||
GuiContainer.class.getDeclaredMethod("func_146977_a_original", Slot.class).invoke(this, s);
|
||||
} catch (final Exception ignore) {}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package com.glodblock.github.client.gui;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import appeng.api.config.*;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.client.gui.implementations.GuiUpgradeable;
|
||||
@@ -10,16 +13,16 @@ import appeng.core.AEConfig;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.localization.GuiColors;
|
||||
import appeng.core.localization.GuiText;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.client.gui.container.ContainerFluidLevelEmitter;
|
||||
import com.glodblock.github.common.parts.PartFluidLevelEmitter;
|
||||
import com.glodblock.github.network.CPacketValueConfig;
|
||||
import com.glodblock.github.util.Ae2ReflectClient;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
public class GuiFluidLevelEmitter extends GuiUpgradeable {
|
||||
|
||||
private GuiNumberBox level;
|
||||
private final AppEngRenderItem stackSizeRenderer = Ae2ReflectClient.getStackSizeRenderer(this);
|
||||
private GuiButton plus1;
|
||||
@@ -52,7 +55,10 @@ public class GuiFluidLevelEmitter extends GuiUpgradeable {
|
||||
@Override
|
||||
protected void addButtons() {
|
||||
this.redstoneMode = new GuiImgButton(
|
||||
this.guiLeft - 18, this.guiTop + 8, Settings.REDSTONE_EMITTER, RedstoneMode.LOW_SIGNAL);
|
||||
this.guiLeft - 18,
|
||||
this.guiTop + 8,
|
||||
Settings.REDSTONE_EMITTER,
|
||||
RedstoneMode.LOW_SIGNAL);
|
||||
|
||||
final int a = AEConfig.instance.levelByStackAmounts(0);
|
||||
final int b = AEConfig.instance.levelByStackAmounts(1);
|
||||
@@ -75,9 +81,15 @@ public class GuiFluidLevelEmitter extends GuiUpgradeable {
|
||||
@Override
|
||||
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||
this.fontRendererObj.drawString(
|
||||
NameConst.i18n(NameConst.GUI_FLUID_LEVEL_EMITTER), 8, 6, GuiColors.UpgradableTitle.getColor());
|
||||
NameConst.i18n(NameConst.GUI_FLUID_LEVEL_EMITTER),
|
||||
8,
|
||||
6,
|
||||
GuiColors.UpgradableTitle.getColor());
|
||||
this.fontRendererObj.drawString(
|
||||
GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, GuiColors.UpgradableInventory.getColor());
|
||||
GuiText.inventory.getLocal(),
|
||||
8,
|
||||
this.ySize - 96 + 3,
|
||||
GuiColors.UpgradableInventory.getColor());
|
||||
this.redstoneMode.set(this.cvb.getRedStoneMode());
|
||||
this.level.drawTextBox();
|
||||
if (isShiftKeyDown() && !isMul) {
|
||||
@@ -90,8 +102,8 @@ public class GuiFluidLevelEmitter extends GuiUpgradeable {
|
||||
} else if (!isShiftKeyDown() && isMul) {
|
||||
for (Object btn : this.buttonList) {
|
||||
if (btn instanceof GuiButton) {
|
||||
((GuiButton) btn).displayString = ((GuiButton) btn)
|
||||
.displayString.substring(0, ((GuiButton) btn).displayString.lastIndexOf("000"));
|
||||
((GuiButton) btn).displayString = ((GuiButton) btn).displayString
|
||||
.substring(0, ((GuiButton) btn).displayString.lastIndexOf("000"));
|
||||
}
|
||||
}
|
||||
isMul = false;
|
||||
@@ -115,8 +127,9 @@ public class GuiFluidLevelEmitter extends GuiUpgradeable {
|
||||
protected void actionPerformed(final GuiButton btn) {
|
||||
super.actionPerformed(btn);
|
||||
final boolean isPlus = btn == this.plus1 || btn == this.plus10 || btn == this.plus100 || btn == this.plus1000;
|
||||
final boolean isMinus =
|
||||
btn == this.minus1 || btn == this.minus10 || btn == this.minus100 || btn == this.minus1000;
|
||||
final boolean isMinus = btn == this.minus1 || btn == this.minus10
|
||||
|| btn == this.minus100
|
||||
|| btn == this.minus1000;
|
||||
|
||||
if (isPlus || isMinus) {
|
||||
this.addQty(this.getQty(btn));
|
||||
|
||||
@@ -1,23 +1,26 @@
|
||||
package com.glodblock.github.client.gui;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.util.item.AEItemStack;
|
||||
|
||||
import com.glodblock.github.client.gui.base.FCGuiMonitor;
|
||||
import com.glodblock.github.client.gui.container.ContainerFluidMonitor;
|
||||
import com.glodblock.github.client.me.FluidRepo;
|
||||
import com.glodblock.github.common.item.ItemFluidDrop;
|
||||
import com.glodblock.github.util.Util;
|
||||
import java.util.List;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class GuiFluidMonitor extends FCGuiMonitor<IAEFluidStack> {
|
||||
|
||||
public GuiFluidMonitor(
|
||||
final InventoryPlayer inventoryPlayer, final ITerminalHost te, final ContainerFluidMonitor c) {
|
||||
public GuiFluidMonitor(final InventoryPlayer inventoryPlayer, final ITerminalHost te,
|
||||
final ContainerFluidMonitor c) {
|
||||
super(inventoryPlayer, te, c);
|
||||
this.repo = new FluidRepo(getScrollBar(), this);
|
||||
}
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
package com.glodblock.github.client.gui;
|
||||
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.core.localization.GuiText;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.client.gui.container.ContainerFluidPacketDecoder;
|
||||
import com.glodblock.github.common.tile.TileFluidPacketDecoder;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GuiFluidPacketDecoder extends AEBaseGui {
|
||||
|
||||
|
||||
@@ -1,9 +1,23 @@
|
||||
package com.glodblock.github.client.gui;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.render.AppEngRenderItem;
|
||||
import appeng.core.localization.GuiText;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.client.gui.container.ContainerFluidPatternEncoder;
|
||||
import com.glodblock.github.common.item.ItemFluidPacket;
|
||||
@@ -14,17 +28,6 @@ import com.glodblock.github.inventory.slot.SlotSingleItem;
|
||||
import com.glodblock.github.network.CPacketEncodePattern;
|
||||
import com.glodblock.github.util.Ae2ReflectClient;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
public class GuiFluidPatternEncoder extends AEBaseGui {
|
||||
|
||||
@@ -38,6 +41,7 @@ public class GuiFluidPatternEncoder extends AEBaseGui {
|
||||
super(new ContainerFluidPatternEncoder(ipl, tile));
|
||||
this.cont = (ContainerFluidPatternEncoder) inventorySlots;
|
||||
mouseRegions.addRegion(141, 38, 10, 10, new MouseRegionManager.Handler() {
|
||||
|
||||
@Override
|
||||
public List<String> getTooltip() {
|
||||
return Collections.singletonList(I18n.format(NameConst.TT_ENCODE_PATTERN));
|
||||
@@ -104,14 +108,15 @@ public class GuiFluidPatternEncoder extends AEBaseGui {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
protected void renderToolTip(ItemStack stack, int x, int y) {
|
||||
List list;
|
||||
if (stack.getItem() instanceof ItemFluidPacket) {
|
||||
FluidStack fluid = ItemFluidPacket.getFluidStack(stack);
|
||||
if (fluid != null) {
|
||||
list = Arrays.asList(
|
||||
fluid.getLocalizedName(), String.format(EnumChatFormatting.GRAY + "%,d mB", fluid.amount));
|
||||
fluid.getLocalizedName(),
|
||||
String.format(EnumChatFormatting.GRAY + "%,d mB", fluid.amount));
|
||||
} else {
|
||||
list = stack.getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
package com.glodblock.github.client.gui;
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import appeng.api.config.ActionItems;
|
||||
import appeng.api.config.ItemSubstitution;
|
||||
import appeng.api.config.PatternBeSubstitution;
|
||||
@@ -11,15 +17,11 @@ import appeng.container.slot.OptionalSlotFake;
|
||||
import appeng.container.slot.SlotFakeCraftingMatrix;
|
||||
import appeng.container.slot.SlotPatternTerm;
|
||||
import appeng.core.localization.GuiText;
|
||||
|
||||
import com.glodblock.github.client.gui.base.FCGuiEncodeTerminal;
|
||||
import com.glodblock.github.client.gui.container.ContainerFluidPatternTerminal;
|
||||
import com.glodblock.github.util.ModAndClassUtil;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
public class GuiFluidPatternTerminal extends FCGuiEncodeTerminal {
|
||||
|
||||
@@ -48,29 +50,44 @@ public class GuiFluidPatternTerminal extends FCGuiEncodeTerminal {
|
||||
this.buttonList.add(this.tabProcessButton);
|
||||
|
||||
this.substitutionsEnabledBtn = new GuiImgButton(
|
||||
this.guiLeft + 84, this.guiTop + this.ySize - 163, Settings.ACTIONS, ItemSubstitution.ENABLED);
|
||||
this.guiLeft + 84,
|
||||
this.guiTop + this.ySize - 163,
|
||||
Settings.ACTIONS,
|
||||
ItemSubstitution.ENABLED);
|
||||
this.substitutionsEnabledBtn.setHalfSize(true);
|
||||
this.buttonList.add(this.substitutionsEnabledBtn);
|
||||
|
||||
this.substitutionsDisabledBtn = new GuiImgButton(
|
||||
this.guiLeft + 84, this.guiTop + this.ySize - 163, Settings.ACTIONS, ItemSubstitution.DISABLED);
|
||||
this.guiLeft + 84,
|
||||
this.guiTop + this.ySize - 163,
|
||||
Settings.ACTIONS,
|
||||
ItemSubstitution.DISABLED);
|
||||
this.substitutionsDisabledBtn.setHalfSize(true);
|
||||
this.buttonList.add(this.substitutionsDisabledBtn);
|
||||
|
||||
this.clearBtn = new GuiImgButton(
|
||||
this.guiLeft + 74, this.guiTop + this.ySize - 163, Settings.ACTIONS, ActionItems.CLOSE);
|
||||
this.guiLeft + 74,
|
||||
this.guiTop + this.ySize - 163,
|
||||
Settings.ACTIONS,
|
||||
ActionItems.CLOSE);
|
||||
this.clearBtn.setHalfSize(true);
|
||||
this.buttonList.add(this.clearBtn);
|
||||
|
||||
this.encodeBtn = new GuiImgButton(
|
||||
this.guiLeft + 147, this.guiTop + this.ySize - 142, Settings.ACTIONS, ActionItems.ENCODE);
|
||||
this.guiLeft + 147,
|
||||
this.guiTop + this.ySize - 142,
|
||||
Settings.ACTIONS,
|
||||
ActionItems.ENCODE);
|
||||
this.buttonList.add(this.encodeBtn);
|
||||
|
||||
int combineLeft = 74;
|
||||
int combineTop = 153;
|
||||
if (ModAndClassUtil.isDoubleButton) {
|
||||
this.doubleBtn = new GuiImgButton(
|
||||
this.guiLeft + 74, this.guiTop + this.ySize - 153, Settings.ACTIONS, ActionItems.DOUBLE);
|
||||
this.guiLeft + 74,
|
||||
this.guiTop + this.ySize - 153,
|
||||
Settings.ACTIONS,
|
||||
ActionItems.DOUBLE);
|
||||
this.doubleBtn.setHalfSize(true);
|
||||
this.buttonList.add(this.doubleBtn);
|
||||
combineLeft = 84;
|
||||
@@ -79,7 +96,10 @@ public class GuiFluidPatternTerminal extends FCGuiEncodeTerminal {
|
||||
combineLeft = 74;
|
||||
combineTop -= 11;
|
||||
this.beSubstitutionsEnabledBtn = new GuiImgButton(
|
||||
this.guiLeft + 84, this.guiTop + this.ySize - 153, Settings.ACTIONS, PatternBeSubstitution.ENABLED);
|
||||
this.guiLeft + 84,
|
||||
this.guiTop + this.ySize - 153,
|
||||
Settings.ACTIONS,
|
||||
PatternBeSubstitution.ENABLED);
|
||||
this.beSubstitutionsEnabledBtn.setHalfSize(true);
|
||||
this.buttonList.add(this.beSubstitutionsEnabledBtn);
|
||||
|
||||
@@ -92,12 +112,18 @@ public class GuiFluidPatternTerminal extends FCGuiEncodeTerminal {
|
||||
this.buttonList.add(this.beSubstitutionsDisabledBtn);
|
||||
}
|
||||
this.combineEnableBtn = new GuiFCImgButton(
|
||||
this.guiLeft + combineLeft, this.guiTop + this.ySize - combineTop, "FORCE_COMBINE", "DO_COMBINE");
|
||||
this.guiLeft + combineLeft,
|
||||
this.guiTop + this.ySize - combineTop,
|
||||
"FORCE_COMBINE",
|
||||
"DO_COMBINE");
|
||||
this.combineEnableBtn.setHalfSize(true);
|
||||
this.buttonList.add(this.combineEnableBtn);
|
||||
|
||||
this.combineDisableBtn = new GuiFCImgButton(
|
||||
this.guiLeft + combineLeft, this.guiTop + this.ySize - combineTop, "NOT_COMBINE", "DONT_COMBINE");
|
||||
this.guiLeft + combineLeft,
|
||||
this.guiTop + this.ySize - combineTop,
|
||||
"NOT_COMBINE",
|
||||
"DONT_COMBINE");
|
||||
this.combineDisableBtn.setHalfSize(true);
|
||||
this.buttonList.add(this.combineDisableBtn);
|
||||
}
|
||||
@@ -116,8 +142,7 @@ public class GuiFluidPatternTerminal extends FCGuiEncodeTerminal {
|
||||
protected void handleMouseClick(final Slot slot, final int slotIdx, final int ctrlDown, final int mouseButton) {
|
||||
if (mouseButton == 3) {
|
||||
if (this.container.isCraftingMode()
|
||||
&& (slot instanceof OptionalSlotFake
|
||||
|| slot instanceof SlotFakeCraftingMatrix
|
||||
&& (slot instanceof OptionalSlotFake || slot instanceof SlotFakeCraftingMatrix
|
||||
|| slot instanceof SlotPatternTerm)) {
|
||||
return;
|
||||
}
|
||||
|
||||
+5
-3
@@ -1,8 +1,13 @@
|
||||
package com.glodblock.github.client.gui;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.client.gui.implementations.GuiCraftingStatus;
|
||||
import appeng.client.gui.widgets.GuiTabButton;
|
||||
|
||||
import com.glodblock.github.common.parts.PartFluidPatternTerminal;
|
||||
import com.glodblock.github.common.parts.PartFluidPatternTerminalEx;
|
||||
import com.glodblock.github.common.parts.PartFluidTerminal;
|
||||
@@ -10,9 +15,6 @@ import com.glodblock.github.inventory.InventoryHandler;
|
||||
import com.glodblock.github.inventory.gui.GuiType;
|
||||
import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.util.Ae2ReflectClient;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class GuiFluidPatternTerminalCraftingStatus extends GuiCraftingStatus {
|
||||
|
||||
|
||||
@@ -1,17 +1,20 @@
|
||||
package com.glodblock.github.client.gui;
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
import appeng.api.config.*;
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.client.gui.widgets.GuiImgButton;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.client.gui.base.FCGuiEncodeTerminal;
|
||||
import com.glodblock.github.client.gui.container.ContainerFluidPatternTerminalEx;
|
||||
import com.glodblock.github.network.CPacketFluidPatternTermBtns;
|
||||
import com.glodblock.github.util.ModAndClassUtil;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
public class GuiFluidPatternTerminalEx extends FCGuiEncodeTerminal {
|
||||
|
||||
@@ -27,22 +30,34 @@ public class GuiFluidPatternTerminalEx extends FCGuiEncodeTerminal {
|
||||
super.initGui();
|
||||
|
||||
this.substitutionsEnabledBtn = new GuiImgButton(
|
||||
this.guiLeft + 97, this.guiTop + this.ySize - 163, Settings.ACTIONS, ItemSubstitution.ENABLED);
|
||||
this.guiLeft + 97,
|
||||
this.guiTop + this.ySize - 163,
|
||||
Settings.ACTIONS,
|
||||
ItemSubstitution.ENABLED);
|
||||
this.substitutionsEnabledBtn.setHalfSize(true);
|
||||
this.buttonList.add(this.substitutionsEnabledBtn);
|
||||
|
||||
this.substitutionsDisabledBtn = new GuiImgButton(
|
||||
this.guiLeft + 97, this.guiTop + this.ySize - 163, Settings.ACTIONS, ItemSubstitution.DISABLED);
|
||||
this.guiLeft + 97,
|
||||
this.guiTop + this.ySize - 163,
|
||||
Settings.ACTIONS,
|
||||
ItemSubstitution.DISABLED);
|
||||
this.substitutionsDisabledBtn.setHalfSize(true);
|
||||
this.buttonList.add(this.substitutionsDisabledBtn);
|
||||
|
||||
this.fluidPrioritizedEnabledBtn =
|
||||
new GuiFCImgButton(this.guiLeft + 97, this.guiTop + this.ySize - 114, "FORCE_PRIO", "DO_PRIO");
|
||||
this.fluidPrioritizedEnabledBtn = new GuiFCImgButton(
|
||||
this.guiLeft + 97,
|
||||
this.guiTop + this.ySize - 114,
|
||||
"FORCE_PRIO",
|
||||
"DO_PRIO");
|
||||
this.fluidPrioritizedEnabledBtn.setHalfSize(true);
|
||||
this.buttonList.add(this.fluidPrioritizedEnabledBtn);
|
||||
|
||||
this.fluidPrioritizedDisabledBtn =
|
||||
new GuiFCImgButton(this.guiLeft + 97, this.guiTop + this.ySize - 114, "NOT_PRIO", "DONT_PRIO");
|
||||
this.fluidPrioritizedDisabledBtn = new GuiFCImgButton(
|
||||
this.guiLeft + 97,
|
||||
this.guiTop + this.ySize - 114,
|
||||
"NOT_PRIO",
|
||||
"DONT_PRIO");
|
||||
this.fluidPrioritizedDisabledBtn.setHalfSize(true);
|
||||
this.buttonList.add(this.fluidPrioritizedDisabledBtn);
|
||||
|
||||
@@ -55,33 +70,51 @@ public class GuiFluidPatternTerminalEx extends FCGuiEncodeTerminal {
|
||||
this.buttonList.add(this.invertBtn);
|
||||
|
||||
this.clearBtn = new GuiImgButton(
|
||||
this.guiLeft + 87, this.guiTop + this.ySize - 163, Settings.ACTIONS, ActionItems.CLOSE);
|
||||
this.guiLeft + 87,
|
||||
this.guiTop + this.ySize - 163,
|
||||
Settings.ACTIONS,
|
||||
ActionItems.CLOSE);
|
||||
this.clearBtn.setHalfSize(true);
|
||||
this.buttonList.add(this.clearBtn);
|
||||
|
||||
this.encodeBtn = new GuiImgButton(
|
||||
this.guiLeft + 147, this.guiTop + this.ySize - 142, Settings.ACTIONS, ActionItems.ENCODE);
|
||||
this.guiLeft + 147,
|
||||
this.guiTop + this.ySize - 142,
|
||||
Settings.ACTIONS,
|
||||
ActionItems.ENCODE);
|
||||
this.buttonList.add(this.encodeBtn);
|
||||
|
||||
if (ModAndClassUtil.isDoubleButton) {
|
||||
this.doubleBtn = new GuiImgButton(
|
||||
this.guiLeft + 97, this.guiTop + this.ySize - 153, Settings.ACTIONS, ActionItems.DOUBLE);
|
||||
this.guiLeft + 97,
|
||||
this.guiTop + this.ySize - 153,
|
||||
Settings.ACTIONS,
|
||||
ActionItems.DOUBLE);
|
||||
this.doubleBtn.setHalfSize(true);
|
||||
this.buttonList.add(this.doubleBtn);
|
||||
}
|
||||
|
||||
this.combineEnableBtn =
|
||||
new GuiFCImgButton(this.guiLeft + 87, this.guiTop + this.ySize - 114, "FORCE_COMBINE", "DO_COMBINE");
|
||||
this.combineEnableBtn = new GuiFCImgButton(
|
||||
this.guiLeft + 87,
|
||||
this.guiTop + this.ySize - 114,
|
||||
"FORCE_COMBINE",
|
||||
"DO_COMBINE");
|
||||
this.combineEnableBtn.setHalfSize(true);
|
||||
this.buttonList.add(this.combineEnableBtn);
|
||||
|
||||
this.combineDisableBtn =
|
||||
new GuiFCImgButton(this.guiLeft + 87, this.guiTop + this.ySize - 114, "NOT_COMBINE", "DONT_COMBINE");
|
||||
this.combineDisableBtn = new GuiFCImgButton(
|
||||
this.guiLeft + 87,
|
||||
this.guiTop + this.ySize - 114,
|
||||
"NOT_COMBINE",
|
||||
"DONT_COMBINE");
|
||||
this.combineDisableBtn.setHalfSize(true);
|
||||
this.buttonList.add(this.combineDisableBtn);
|
||||
if (ModAndClassUtil.isBeSubstitutionsButton) {
|
||||
this.beSubstitutionsEnabledBtn = new GuiImgButton(
|
||||
this.guiLeft + 87, this.guiTop + this.ySize - 103, Settings.ACTIONS, PatternBeSubstitution.ENABLED);
|
||||
this.guiLeft + 87,
|
||||
this.guiTop + this.ySize - 103,
|
||||
Settings.ACTIONS,
|
||||
PatternBeSubstitution.ENABLED);
|
||||
this.beSubstitutionsEnabledBtn.setHalfSize(true);
|
||||
this.buttonList.add(this.beSubstitutionsEnabledBtn);
|
||||
|
||||
@@ -173,7 +206,9 @@ public class GuiFluidPatternTerminalEx extends FCGuiEncodeTerminal {
|
||||
}
|
||||
|
||||
private void changeActivePage() {
|
||||
FluidCraft.proxy.netHandler.sendToServer(new CPacketFluidPatternTermBtns(
|
||||
"PatternTerminal.ActivePage", String.valueOf(this.processingScrollBar.getCurrentScroll())));
|
||||
FluidCraft.proxy.netHandler.sendToServer(
|
||||
new CPacketFluidPatternTermBtns(
|
||||
"PatternTerminal.ActivePage",
|
||||
String.valueOf(this.processingScrollBar.getCurrentScroll())));
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,11 @@
|
||||
package com.glodblock.github.client.gui;
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import appeng.container.slot.AppEngSlot;
|
||||
|
||||
import com.glodblock.github.client.gui.container.ContainerFluidPortableCell;
|
||||
import com.glodblock.github.inventory.item.IFluidPortableCell;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
public class GuiFluidPortableCell extends GuiFluidTerminal {
|
||||
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
package com.glodblock.github.client.gui;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
import appeng.api.config.AccessRestriction;
|
||||
import appeng.api.config.ActionItems;
|
||||
import appeng.api.config.Settings;
|
||||
@@ -11,6 +17,7 @@ import appeng.core.localization.GuiColors;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketConfigButton;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.client.gui.container.ContainerFluidStorageBus;
|
||||
import com.glodblock.github.common.parts.PartFluidStorageBus;
|
||||
@@ -18,10 +25,6 @@ import com.glodblock.github.inventory.gui.GuiType;
|
||||
import com.glodblock.github.network.CPacketFluidPatternTermBtns;
|
||||
import com.glodblock.github.network.CPacketSwitchGuis;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
public class GuiFluidStorageBus extends GuiUpgradeable {
|
||||
|
||||
@@ -40,10 +43,17 @@ public class GuiFluidStorageBus extends GuiUpgradeable {
|
||||
protected void addButtons() {
|
||||
this.clear = new GuiImgButton(this.guiLeft - 18, this.guiTop + 8, Settings.ACTIONS, ActionItems.CLOSE);
|
||||
this.partition = new GuiImgButton(this.guiLeft - 18, this.guiTop + 28, Settings.ACTIONS, ActionItems.WRENCH);
|
||||
this.rwMode =
|
||||
new GuiImgButton(this.guiLeft - 18, this.guiTop + 48, Settings.ACCESS, AccessRestriction.READ_WRITE);
|
||||
this.priority =
|
||||
new GuiTabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(), itemRender);
|
||||
this.rwMode = new GuiImgButton(
|
||||
this.guiLeft - 18,
|
||||
this.guiTop + 48,
|
||||
Settings.ACCESS,
|
||||
AccessRestriction.READ_WRITE);
|
||||
this.priority = new GuiTabButton(
|
||||
this.guiLeft + 154,
|
||||
this.guiTop,
|
||||
2 + 4 * 16,
|
||||
GuiText.Priority.getLocal(),
|
||||
itemRender);
|
||||
|
||||
this.buttonList.add(this.priority);
|
||||
this.buttonList.add(this.rwMode);
|
||||
@@ -59,7 +69,10 @@ public class GuiFluidStorageBus extends GuiUpgradeable {
|
||||
6,
|
||||
GuiColors.StorageBusTitle.getColor());
|
||||
this.fontRendererObj.drawString(
|
||||
GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, GuiColors.StorageBusInventory.getColor());
|
||||
GuiText.inventory.getLocal(),
|
||||
8,
|
||||
this.ySize - 96 + 3,
|
||||
GuiColors.StorageBusInventory.getColor());
|
||||
|
||||
if (this.rwMode != null) {
|
||||
this.rwMode.set(((ContainerFluidStorageBus) this.cvb).getReadWriteMode());
|
||||
|
||||
@@ -1,21 +1,8 @@
|
||||
package com.glodblock.github.client.gui;
|
||||
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.client.me.SlotME;
|
||||
import appeng.client.render.AppEngRenderItem;
|
||||
import appeng.container.slot.AppEngSlot;
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.client.gui.container.ContainerFluidMonitor;
|
||||
import com.glodblock.github.common.item.ItemFluidDrop;
|
||||
import com.glodblock.github.inventory.InventoryHandler;
|
||||
import com.glodblock.github.inventory.gui.GuiType;
|
||||
import com.glodblock.github.network.CPacketFluidUpdate;
|
||||
import com.glodblock.github.util.Ae2ReflectClient;
|
||||
import com.glodblock.github.util.Util;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
@@ -25,9 +12,27 @@ import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.client.me.SlotME;
|
||||
import appeng.client.render.AppEngRenderItem;
|
||||
import appeng.container.slot.AppEngSlot;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.client.gui.container.ContainerFluidMonitor;
|
||||
import com.glodblock.github.common.item.ItemFluidDrop;
|
||||
import com.glodblock.github.inventory.InventoryHandler;
|
||||
import com.glodblock.github.inventory.gui.GuiType;
|
||||
import com.glodblock.github.network.CPacketFluidUpdate;
|
||||
import com.glodblock.github.util.Ae2ReflectClient;
|
||||
import com.glodblock.github.util.Util;
|
||||
|
||||
public class GuiFluidTerminal extends GuiFluidMonitor {
|
||||
|
||||
private final AppEngRenderItem stackSizeRenderer = Ae2ReflectClient.getStackSizeRenderer(this);
|
||||
protected EntityPlayer player;
|
||||
public ContainerFluidMonitor container;
|
||||
@@ -39,8 +44,8 @@ public class GuiFluidTerminal extends GuiFluidMonitor {
|
||||
this.showViewBtn = false;
|
||||
}
|
||||
|
||||
public GuiFluidTerminal(
|
||||
final InventoryPlayer inventoryPlayer, final ITerminalHost te, final ContainerFluidMonitor c) {
|
||||
public GuiFluidTerminal(final InventoryPlayer inventoryPlayer, final ITerminalHost te,
|
||||
final ContainerFluidMonitor c) {
|
||||
super(inventoryPlayer, te, c);
|
||||
this.container = c;
|
||||
this.player = inventoryPlayer.player;
|
||||
|
||||
@@ -1,8 +1,17 @@
|
||||
package com.glodblock.github.client.gui;
|
||||
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.core.localization.GuiText;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.client.gui.container.ContainerIngredientBuffer;
|
||||
import com.glodblock.github.common.tile.TileIngredientBuffer;
|
||||
@@ -12,12 +21,6 @@ import com.glodblock.github.inventory.gui.MouseRegionManager;
|
||||
import com.glodblock.github.inventory.gui.TankMouseHandler;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import com.glodblock.github.util.RenderUtil;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class GuiIngredientBuffer extends AEBaseGui {
|
||||
|
||||
@@ -40,7 +43,11 @@ public class GuiIngredientBuffer extends AEBaseGui {
|
||||
TANK_HEIGHT,
|
||||
new TankMouseHandler(cont.getTile().getInternalFluid(), i));
|
||||
mouseRegions.addRegion(
|
||||
TANK_X + 10 + 22 * i, TANK_Y + TANK_HEIGHT + 2, 7, 7, ButtonMouseHandler.dumpTank(cont, i));
|
||||
TANK_X + 10 + 22 * i,
|
||||
TANK_Y + TANK_HEIGHT + 2,
|
||||
7,
|
||||
7,
|
||||
ButtonMouseHandler.dumpTank(cont, i));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
package com.glodblock.github.client.gui;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
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;
|
||||
|
||||
import com.glodblock.github.client.gui.base.FCGuiMonitor;
|
||||
import com.glodblock.github.client.gui.container.ContainerItemMonitor;
|
||||
import com.glodblock.github.util.ModAndClassUtil;
|
||||
import java.util.List;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class GuiItemMonitor extends FCGuiMonitor<IAEItemStack> {
|
||||
|
||||
|
||||
@@ -1,8 +1,17 @@
|
||||
package com.glodblock.github.client.gui;
|
||||
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.core.localization.GuiText;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.client.gui.container.ContainerLargeIngredientBuffer;
|
||||
import com.glodblock.github.common.tile.TileLargeIngredientBuffer;
|
||||
@@ -12,12 +21,6 @@ import com.glodblock.github.inventory.gui.MouseRegionManager;
|
||||
import com.glodblock.github.inventory.gui.TankMouseHandler;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import com.glodblock.github.util.RenderUtil;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class GuiLargeIngredientBuffer extends AEBaseGui {
|
||||
|
||||
@@ -40,7 +43,11 @@ public class GuiLargeIngredientBuffer extends AEBaseGui {
|
||||
TANK_HEIGHT,
|
||||
new TankMouseHandler(cont.getTile().getInternalFluid(), i));
|
||||
mouseRegions.addRegion(
|
||||
TANK_X + 10 + 22 * i, TANK_Y + TANK_HEIGHT + 2, 7, 7, ButtonMouseHandler.dumpTank(cont, i));
|
||||
TANK_X + 10 + 22 * i,
|
||||
TANK_Y + TANK_HEIGHT + 2,
|
||||
7,
|
||||
7,
|
||||
ButtonMouseHandler.dumpTank(cont, i));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,8 +66,8 @@ public class GuiLargeIngredientBuffer extends AEBaseGui {
|
||||
|
||||
@Override
|
||||
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) {
|
||||
fontRendererObj.drawString(
|
||||
getGuiDisplayName(I18n.format(NameConst.GUI_LARGE_INGREDIENT_BUFFER)), 8, 6, 0x404040);
|
||||
fontRendererObj
|
||||
.drawString(getGuiDisplayName(I18n.format(NameConst.GUI_LARGE_INGREDIENT_BUFFER)), 8, 6, 0x404040);
|
||||
fontRendererObj.drawString(GuiText.inventory.getLocal(), 8, ySize - 94, 0x404040);
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
|
||||
|
||||
@@ -1,5 +1,21 @@
|
||||
package com.glodblock.github.client.gui;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.render.AppEngRenderItem;
|
||||
@@ -10,6 +26,7 @@ import codechicken.nei.VisiblityData;
|
||||
import codechicken.nei.api.INEIGuiHandler;
|
||||
import codechicken.nei.api.TaggedInventoryArea;
|
||||
import cofh.core.render.CoFHFontRenderer;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.client.gui.container.ContainerLevelMaintainer;
|
||||
import com.glodblock.github.common.tile.TileLevelMaintainer;
|
||||
@@ -20,19 +37,6 @@ import com.glodblock.github.network.CPacketLevelMaintainer;
|
||||
import com.glodblock.github.util.Ae2ReflectClient;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
@Optional.Interface(modid = "NotEnoughItems", iface = "codechicken.nei.api.INEIGuiHandler")
|
||||
public class GuiLevelMaintainer extends AEBaseGui implements INEIGuiHandler {
|
||||
@@ -146,8 +150,7 @@ public class GuiLevelMaintainer extends AEBaseGui implements INEIGuiHandler {
|
||||
if (stack == null) return true;
|
||||
IAEItemStack fake = stack.copy();
|
||||
if (this.component[slot.getSlotIndex()].getQty().textField.getText().matches("[0-9]+")) {
|
||||
fake.setStackSize(Long.parseLong(
|
||||
this.component[slot.getSlotIndex()].getQty().textField.getText()));
|
||||
fake.setStackSize(Long.parseLong(this.component[slot.getSlotIndex()].getQty().textField.getText()));
|
||||
} else {
|
||||
fake.setStackSize(0);
|
||||
}
|
||||
@@ -209,9 +212,7 @@ public class GuiLevelMaintainer extends AEBaseGui implements INEIGuiHandler {
|
||||
@Override
|
||||
protected void handleMouseClick(final Slot slot, final int slotIdx, final int ctrlDown, final int mouseButton) {
|
||||
if (slot instanceof SlotFluidConvertingFake && this.cont.getPlayerInv().getItemStack() != null) {
|
||||
this.component[slot.getSlotIndex()]
|
||||
.getQty()
|
||||
.textField
|
||||
this.component[slot.getSlotIndex()].getQty().textField
|
||||
.setText(String.valueOf(this.cont.getPlayerInv().getItemStack().stackSize));
|
||||
return;
|
||||
}
|
||||
@@ -276,6 +277,7 @@ public class GuiLevelMaintainer extends AEBaseGui implements INEIGuiHandler {
|
||||
}
|
||||
|
||||
private class Component {
|
||||
|
||||
public boolean isEnable = true;
|
||||
private final Widget qty;
|
||||
private final Widget batch;
|
||||
@@ -285,14 +287,8 @@ public class GuiLevelMaintainer extends AEBaseGui implements INEIGuiHandler {
|
||||
private final FCGuiLineField line;
|
||||
private TileLevelMaintainer.State state;
|
||||
|
||||
public Component(
|
||||
Widget qtyInput,
|
||||
Widget batchInput,
|
||||
GuiFCImgButton submitBtn,
|
||||
GuiFCImgButton enableBtn,
|
||||
GuiFCImgButton disableBtn,
|
||||
FCGuiLineField line,
|
||||
List buttonList) {
|
||||
public Component(Widget qtyInput, Widget batchInput, GuiFCImgButton submitBtn, GuiFCImgButton enableBtn,
|
||||
GuiFCImgButton disableBtn, FCGuiLineField line, List buttonList) {
|
||||
this.qty = qtyInput;
|
||||
this.batch = batchInput;
|
||||
this.enable = enableBtn;
|
||||
@@ -315,8 +311,7 @@ public class GuiLevelMaintainer extends AEBaseGui implements INEIGuiHandler {
|
||||
|
||||
private boolean send(Widget widget) {
|
||||
if (((SlotFluidConvertingFake) cont.inventorySlots.get(widget.idx)).getHasStack()) {
|
||||
if (!widget.textField.getText().isEmpty()
|
||||
&& widget.textField.getText().matches("^[0-9]+")) {
|
||||
if (!widget.textField.getText().isEmpty() && widget.textField.getText().matches("^[0-9]+")) {
|
||||
String str = widget.textField.getText().replaceAll("^(0+)", "");
|
||||
widget.textField.setText(str.isEmpty() ? "0" : str);
|
||||
FluidCraft.proxy.netHandler.sendToServer(
|
||||
@@ -337,12 +332,12 @@ public class GuiLevelMaintainer extends AEBaseGui implements INEIGuiHandler {
|
||||
if (this.send(this.getQty())) this.send(this.getBatch());
|
||||
didSomething = true;
|
||||
} else if (this.enable == btn) {
|
||||
FluidCraft.proxy.netHandler.sendToServer(
|
||||
new CPacketLevelMaintainer("TileLevelMaintainer.Enable", this.getIndex()));
|
||||
FluidCraft.proxy.netHandler
|
||||
.sendToServer(new CPacketLevelMaintainer("TileLevelMaintainer.Enable", this.getIndex()));
|
||||
didSomething = true;
|
||||
} else if (this.disable == btn) {
|
||||
FluidCraft.proxy.netHandler.sendToServer(
|
||||
new CPacketLevelMaintainer("TileLevelMaintainer.Disable", this.getIndex()));
|
||||
FluidCraft.proxy.netHandler
|
||||
.sendToServer(new CPacketLevelMaintainer("TileLevelMaintainer.Disable", this.getIndex()));
|
||||
didSomething = true;
|
||||
}
|
||||
return didSomething;
|
||||
@@ -374,23 +369,27 @@ public class GuiLevelMaintainer extends AEBaseGui implements INEIGuiHandler {
|
||||
switch (this.state) {
|
||||
case Idling:
|
||||
this.line.setColor(0xFF55FF55);
|
||||
message.add(NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_CURRENT)
|
||||
+ NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_IDLE));
|
||||
message.add(
|
||||
NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_CURRENT)
|
||||
+ NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_IDLE));
|
||||
break;
|
||||
case Crafting:
|
||||
this.line.setColor(0xFFFFFF55);
|
||||
message.add(NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_CURRENT)
|
||||
+ NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_LINK));
|
||||
message.add(
|
||||
NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_CURRENT)
|
||||
+ NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_LINK));
|
||||
break;
|
||||
case Exporting:
|
||||
this.line.setColor(0xFFAA00AA);
|
||||
message.add(NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_CURRENT)
|
||||
+ NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_EXPORT));
|
||||
message.add(
|
||||
NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_CURRENT)
|
||||
+ NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_EXPORT));
|
||||
break;
|
||||
default:
|
||||
this.line.setColor(0);
|
||||
message.add(NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_CURRENT)
|
||||
+ NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_NONE));
|
||||
message.add(
|
||||
NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_CURRENT)
|
||||
+ NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_NONE));
|
||||
}
|
||||
message.add("");
|
||||
if (isShiftKeyDown()) {
|
||||
@@ -421,6 +420,7 @@ public class GuiLevelMaintainer extends AEBaseGui implements INEIGuiHandler {
|
||||
}
|
||||
|
||||
private class Widget {
|
||||
|
||||
public final int idx;
|
||||
public final String action;
|
||||
private final FCGuiTextField textField;
|
||||
@@ -440,9 +440,11 @@ public class GuiLevelMaintainer extends AEBaseGui implements INEIGuiHandler {
|
||||
if (isShiftKeyDown()) {
|
||||
this.setTooltip(render.wrapFormattedStringToWidth(NameConst.i18n(this.tooltip), xSize / 2));
|
||||
} else {
|
||||
this.setTooltip(render.wrapFormattedStringToWidth(
|
||||
NameConst.i18n(this.tooltip, "\n", false) + "\n" + NameConst.i18n(NameConst.TT_SHIFT_FOR_MORE),
|
||||
(int) Math.floor(xSize * 0.8)));
|
||||
this.setTooltip(
|
||||
render.wrapFormattedStringToWidth(
|
||||
NameConst.i18n(this.tooltip, "\n", false) + "\n"
|
||||
+ NameConst.i18n(NameConst.TT_SHIFT_FOR_MORE),
|
||||
(int) Math.floor(xSize * 0.8)));
|
||||
}
|
||||
this.textField.drawTextBox();
|
||||
}
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
package com.glodblock.github.client.gui;
|
||||
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.core.localization.GuiText;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.client.gui.container.ContainerOCPatternEditor;
|
||||
import com.glodblock.github.common.tile.TileOCPatternEditor;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GuiOCPatternEditor extends AEBaseGui {
|
||||
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
package com.glodblock.github.client.gui;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.core.localization.GuiText;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.client.gui.base.FCGuiAmount;
|
||||
import com.glodblock.github.client.gui.container.ContainerPatternValueAmount;
|
||||
@@ -10,9 +15,6 @@ import com.glodblock.github.common.parts.PartFluidPatternTerminalEx;
|
||||
import com.glodblock.github.inventory.gui.GuiType;
|
||||
import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.network.CPacketPatternValueSet;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class GuiPatternValueAmount extends FCGuiAmount {
|
||||
|
||||
@@ -48,10 +50,11 @@ public class GuiPatternValueAmount extends FCGuiAmount {
|
||||
super.actionPerformed(btn);
|
||||
try {
|
||||
if (btn == this.submit && btn.enabled) {
|
||||
FluidCraft.proxy.netHandler.sendToServer(new CPacketPatternValueSet(
|
||||
originalGui.ordinal(),
|
||||
getAmount(),
|
||||
((ContainerPatternValueAmount) this.inventorySlots).getValueIndex()));
|
||||
FluidCraft.proxy.netHandler.sendToServer(
|
||||
new CPacketPatternValueSet(
|
||||
originalGui.ordinal(),
|
||||
getAmount(),
|
||||
((ContainerPatternValueAmount) this.inventorySlots).getValueIndex()));
|
||||
}
|
||||
} catch (final NumberFormatException e) {
|
||||
this.amountBox.setText("1");
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
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;
|
||||
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.widgets.GuiTabButton;
|
||||
import appeng.container.AEBaseContainer;
|
||||
@@ -7,13 +12,10 @@ import appeng.core.AEConfig;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.util.calculators.ArithHelper;
|
||||
import appeng.util.calculators.Calculator;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.inventory.gui.GuiType;
|
||||
import com.glodblock.github.network.CPacketSwitchGuis;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiTextField;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public abstract class FCGuiAmount extends AEBaseGui {
|
||||
|
||||
@@ -61,11 +63,19 @@ public abstract class FCGuiAmount extends AEBaseGui {
|
||||
if (this.originalGui != null && this.myIcon != null) {
|
||||
this.buttonList.add(
|
||||
this.originalGuiBtn = new GuiTabButton(
|
||||
this.guiLeft + 154, this.guiTop, this.myIcon, this.myIcon.getDisplayName(), itemRender));
|
||||
this.guiLeft + 154,
|
||||
this.guiTop,
|
||||
this.myIcon,
|
||||
this.myIcon.getDisplayName(),
|
||||
itemRender));
|
||||
}
|
||||
|
||||
this.amountBox = new GuiTextField(
|
||||
this.fontRendererObj, this.guiLeft + 62, this.guiTop + 57, 59, this.fontRendererObj.FONT_HEIGHT);
|
||||
this.fontRendererObj,
|
||||
this.guiLeft + 62,
|
||||
this.guiTop + 57,
|
||||
59,
|
||||
this.fontRendererObj.FONT_HEIGHT);
|
||||
this.amountBox.setEnableBackgroundDrawing(false);
|
||||
this.amountBox.setMaxStringLength(16);
|
||||
this.amountBox.setTextColor(0xFFFFFF);
|
||||
@@ -97,8 +107,9 @@ public abstract class FCGuiAmount extends AEBaseGui {
|
||||
FluidCraft.proxy.netHandler.sendToServer(new CPacketSwitchGuis(this.originalGui));
|
||||
}
|
||||
final boolean isPlus = btn == this.plus1 || btn == this.plus10 || btn == this.plus100 || btn == this.plus1000;
|
||||
final boolean isMinus =
|
||||
btn == this.minus1 || btn == this.minus10 || btn == this.minus100 || btn == this.minus1000;
|
||||
final boolean isMinus = btn == this.minus1 || btn == this.minus10
|
||||
|| btn == this.minus100
|
||||
|| btn == this.minus1000;
|
||||
|
||||
if (isPlus || isMinus) {
|
||||
this.addQty(this.getQty(btn));
|
||||
@@ -117,8 +128,7 @@ public abstract class FCGuiAmount extends AEBaseGui {
|
||||
}
|
||||
String out = Long.toString(resultI);
|
||||
this.amountBox.setText(out);
|
||||
} catch (final NumberFormatException ignore) {
|
||||
}
|
||||
} catch (final NumberFormatException ignore) {}
|
||||
}
|
||||
|
||||
protected abstract void setOriginGUI(Object target);
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
package com.glodblock.github.client.gui.base;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.client.gui.widgets.GuiImgButton;
|
||||
@@ -9,6 +15,7 @@ import appeng.client.render.AppEngRenderItem;
|
||||
import appeng.container.slot.AppEngSlot;
|
||||
import appeng.container.slot.SlotFake;
|
||||
import appeng.util.item.AEItemStack;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.client.gui.GuiFCImgButton;
|
||||
import com.glodblock.github.client.gui.GuiItemMonitor;
|
||||
@@ -20,10 +27,6 @@ import com.glodblock.github.inventory.slot.SlotSingleItem;
|
||||
import com.glodblock.github.network.CPacketFluidPatternTermBtns;
|
||||
import com.glodblock.github.util.Ae2ReflectClient;
|
||||
import com.glodblock.github.util.ModAndClassUtil;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
public abstract class FCGuiEncodeTerminal extends GuiItemMonitor {
|
||||
|
||||
@@ -51,8 +54,8 @@ public abstract class FCGuiEncodeTerminal extends GuiItemMonitor {
|
||||
protected final GuiScrollbar processingScrollBar = new GuiScrollbar();
|
||||
protected final AppEngRenderItem stackSizeRenderer = Ae2ReflectClient.getStackSizeRenderer(this);
|
||||
|
||||
public FCGuiEncodeTerminal(
|
||||
final InventoryPlayer inventoryPlayer, final ITerminalHost te, final FCContainerEncodeTerminal c) {
|
||||
public FCGuiEncodeTerminal(final InventoryPlayer inventoryPlayer, final ITerminalHost te,
|
||||
final FCContainerEncodeTerminal c) {
|
||||
super(inventoryPlayer, te, c);
|
||||
this.container = (FCContainerEncodeTerminal) this.inventorySlots;
|
||||
c.setGui(this);
|
||||
@@ -65,35 +68,46 @@ public abstract class FCGuiEncodeTerminal extends GuiItemMonitor {
|
||||
if (btn == craftingStatusBtn) {
|
||||
InventoryHandler.switchGui(GuiType.CRAFTING_STATUS);
|
||||
} else if (this.tabCraftButton == btn || this.tabProcessButton == btn) {
|
||||
FluidCraft.proxy.netHandler.sendToServer(new CPacketFluidPatternTermBtns(
|
||||
"PatternTerminal.CraftMode", this.tabProcessButton == btn ? MODE_CRAFTING : MODE_PROCESSING));
|
||||
FluidCraft.proxy.netHandler.sendToServer(
|
||||
new CPacketFluidPatternTermBtns(
|
||||
"PatternTerminal.CraftMode",
|
||||
this.tabProcessButton == btn ? MODE_CRAFTING : MODE_PROCESSING));
|
||||
} else if (this.encodeBtn == btn) {
|
||||
FluidCraft.proxy.netHandler.sendToServer(new CPacketFluidPatternTermBtns(
|
||||
"PatternTerminal.Encode", (isCtrlKeyDown() ? 1 : 0) << 1 | (isShiftKeyDown() ? 1 : 0)));
|
||||
FluidCraft.proxy.netHandler.sendToServer(
|
||||
new CPacketFluidPatternTermBtns(
|
||||
"PatternTerminal.Encode",
|
||||
(isCtrlKeyDown() ? 1 : 0) << 1 | (isShiftKeyDown() ? 1 : 0)));
|
||||
} else if (this.clearBtn == btn) {
|
||||
FluidCraft.proxy.netHandler.sendToServer(new CPacketFluidPatternTermBtns("PatternTerminal.Clear", "1"));
|
||||
} else if (this.substitutionsEnabledBtn == btn || this.substitutionsDisabledBtn == btn) {
|
||||
FluidCraft.proxy.netHandler.sendToServer(new CPacketFluidPatternTermBtns(
|
||||
"PatternTerminal.Substitute",
|
||||
this.substitutionsEnabledBtn == btn ? SUBSTITUTION_DISABLE : SUBSTITUTION_ENABLE));
|
||||
FluidCraft.proxy.netHandler.sendToServer(
|
||||
new CPacketFluidPatternTermBtns(
|
||||
"PatternTerminal.Substitute",
|
||||
this.substitutionsEnabledBtn == btn ? SUBSTITUTION_DISABLE : SUBSTITUTION_ENABLE));
|
||||
} else if (this.fluidPrioritizedEnabledBtn == btn || this.fluidPrioritizedDisabledBtn == btn) {
|
||||
FluidCraft.proxy.netHandler.sendToServer(new CPacketFluidPatternTermBtns(
|
||||
"PatternTerminal.Prioritize", container.prioritize ? PRIORITY_DISABLE : PRIORITY_ENABLE));
|
||||
FluidCraft.proxy.netHandler.sendToServer(
|
||||
new CPacketFluidPatternTermBtns(
|
||||
"PatternTerminal.Prioritize",
|
||||
container.prioritize ? PRIORITY_DISABLE : PRIORITY_ENABLE));
|
||||
} else if (this.invertBtn == btn) {
|
||||
FluidCraft.proxy.netHandler.sendToServer(
|
||||
new CPacketFluidPatternTermBtns("PatternTerminal.Invert", container.inverted ? "0" : "1"));
|
||||
} else if (this.combineDisableBtn == btn || this.combineEnableBtn == btn) {
|
||||
FluidCraft.proxy.netHandler.sendToServer(new CPacketFluidPatternTermBtns(
|
||||
"PatternTerminal.Combine", this.combineDisableBtn == btn ? "1" : "0"));
|
||||
FluidCraft.proxy.netHandler.sendToServer(
|
||||
new CPacketFluidPatternTermBtns(
|
||||
"PatternTerminal.Combine",
|
||||
this.combineDisableBtn == btn ? "1" : "0"));
|
||||
} else if (ModAndClassUtil.isDoubleButton && doubleBtn == btn) {
|
||||
FluidCraft.proxy.netHandler.sendToServer(new CPacketFluidPatternTermBtns(
|
||||
"PatternTerminal.Double", Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) ? "1" : "0"));
|
||||
FluidCraft.proxy.netHandler.sendToServer(
|
||||
new CPacketFluidPatternTermBtns(
|
||||
"PatternTerminal.Double",
|
||||
Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) ? "1" : "0"));
|
||||
} else if (ModAndClassUtil.isBeSubstitutionsButton && beSubstitutionsDisabledBtn == btn) {
|
||||
FluidCraft.proxy.netHandler.sendToServer(
|
||||
new CPacketFluidPatternTermBtns("PatternTerminal.beSubstitute", "1"));
|
||||
FluidCraft.proxy.netHandler
|
||||
.sendToServer(new CPacketFluidPatternTermBtns("PatternTerminal.beSubstitute", "1"));
|
||||
} else if (ModAndClassUtil.isBeSubstitutionsButton && beSubstitutionsEnabledBtn == btn) {
|
||||
FluidCraft.proxy.netHandler.sendToServer(
|
||||
new CPacketFluidPatternTermBtns("PatternTerminal.beSubstitute", "0"));
|
||||
FluidCraft.proxy.netHandler
|
||||
.sendToServer(new CPacketFluidPatternTermBtns("PatternTerminal.beSubstitute", "0"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,20 @@
|
||||
package com.glodblock.github.client.gui.base;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
import appeng.api.config.*;
|
||||
import appeng.api.implementations.tiles.IViewCellStorage;
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
@@ -32,24 +47,13 @@ import appeng.util.Platform;
|
||||
import appeng.util.item.AEItemStack;
|
||||
import codechicken.nei.LayoutManager;
|
||||
import codechicken.nei.util.TextHistory;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.client.gui.FCGuiTextField;
|
||||
import com.glodblock.github.client.gui.container.base.FCContainerMonitor;
|
||||
import com.glodblock.github.network.CPacketInventoryAction;
|
||||
import com.glodblock.github.util.Ae2ReflectClient;
|
||||
import com.glodblock.github.util.ModAndClassUtil;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.List;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
public abstract class FCGuiMonitor<T extends IAEStack<T>> extends AEBaseMEGui
|
||||
implements ISortSource, IConfigManagerHost, IDropToFillTextField {
|
||||
@@ -98,9 +102,10 @@ public abstract class FCGuiMonitor<T extends IAEStack<T>> extends AEBaseMEGui
|
||||
|
||||
protected void setScrollBar() {
|
||||
this.getScrollBar().setTop(18).setLeft(175).setHeight(this.rows * 18 - 2);
|
||||
this.getScrollBar()
|
||||
.setRange(
|
||||
0, (this.repo.size() + this.perRow - 1) / this.perRow - this.rows, Math.max(1, this.rows / 6));
|
||||
this.getScrollBar().setRange(
|
||||
0,
|
||||
(this.repo.size() + this.perRow - 1) / this.perRow - this.rows,
|
||||
Math.max(1, this.rows / 6));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -114,8 +119,7 @@ public abstract class FCGuiMonitor<T extends IAEStack<T>> extends AEBaseMEGui
|
||||
final GuiImgButton iBtn = (GuiImgButton) btn;
|
||||
if (iBtn.getSetting() != Settings.ACTIONS) {
|
||||
final Enum<?> cv = iBtn.getCurrentValue();
|
||||
final Enum<?> next =
|
||||
Platform.rotateEnum(cv, backwards, iBtn.getSetting().getPossibleValues());
|
||||
final Enum<?> next = Platform.rotateEnum(cv, backwards, iBtn.getSetting().getPossibleValues());
|
||||
if (btn == this.terminalStyleBox) {
|
||||
AEConfig.instance.settings.putSetting(iBtn.getSetting(), next);
|
||||
} else if (btn == this.searchBoxSettings) {
|
||||
@@ -124,8 +128,8 @@ public abstract class FCGuiMonitor<T extends IAEStack<T>> extends AEBaseMEGui
|
||||
AEConfig.instance.preserveSearchBar = next == YesNo.YES;
|
||||
} else {
|
||||
try {
|
||||
NetworkHandler.instance.sendToServer(
|
||||
new PacketValueConfig(iBtn.getSetting().name(), next.name()));
|
||||
NetworkHandler.instance
|
||||
.sendToServer(new PacketValueConfig(iBtn.getSetting().name(), next.name()));
|
||||
} catch (final IOException e) {
|
||||
AELog.debug(e);
|
||||
}
|
||||
@@ -149,8 +153,7 @@ public abstract class FCGuiMonitor<T extends IAEStack<T>> extends AEBaseMEGui
|
||||
Keyboard.enableRepeatEvents(true);
|
||||
|
||||
this.maxRows = this.getMaxRows();
|
||||
this.perRow = AEConfig.instance.getConfigManager().getSetting(Settings.TERMINAL_STYLE) != TerminalStyle.FULL
|
||||
? 9
|
||||
this.perRow = AEConfig.instance.getConfigManager().getSetting(Settings.TERMINAL_STYLE) != TerminalStyle.FULL ? 9
|
||||
: 9 + ((this.width - this.standardSize) / 18);
|
||||
|
||||
final boolean hasNEI = IntegrationRegistry.INSTANCE.isEnabled(IntegrationType.NEI);
|
||||
@@ -202,7 +205,10 @@ public abstract class FCGuiMonitor<T extends IAEStack<T>> extends AEBaseMEGui
|
||||
if (this.customSortOrder) {
|
||||
this.buttonList.add(
|
||||
this.SortByBox = new GuiImgButton(
|
||||
this.guiLeft - 18, offset, Settings.SORT_BY, this.configSrc.getSetting(Settings.SORT_BY)));
|
||||
this.guiLeft - 18,
|
||||
offset,
|
||||
Settings.SORT_BY,
|
||||
this.configSrc.getSetting(Settings.SORT_BY)));
|
||||
offset += 20;
|
||||
}
|
||||
if (this.showViewBtn) {
|
||||
@@ -250,7 +256,11 @@ public abstract class FCGuiMonitor<T extends IAEStack<T>> extends AEBaseMEGui
|
||||
offset += 20;
|
||||
|
||||
this.searchField = new FCGuiTextField(
|
||||
this.fontRendererObj, this.guiLeft + Math.max(80, this.offsetX), this.guiTop + 4, 90, 12);
|
||||
this.fontRendererObj,
|
||||
this.guiLeft + Math.max(80, this.offsetX),
|
||||
this.guiTop + 4,
|
||||
90,
|
||||
12);
|
||||
this.searchField.setEnableBackgroundDrawing(false);
|
||||
this.searchField.setMaxStringLength(25);
|
||||
this.searchField.setTextColor(0xFFFFFF);
|
||||
@@ -259,11 +269,8 @@ public abstract class FCGuiMonitor<T extends IAEStack<T>> extends AEBaseMEGui
|
||||
searchField.setMessage(ButtonToolTips.SearchStringTooltip.getLocal());
|
||||
|
||||
if (this.viewCell) {
|
||||
if (ModAndClassUtil.isCraftStatus
|
||||
&& AEConfig.instance
|
||||
.getConfigManager()
|
||||
.getSetting(Settings.CRAFTING_STATUS)
|
||||
.equals(CraftingStatus.BUTTON)) {
|
||||
if (ModAndClassUtil.isCraftStatus && AEConfig.instance.getConfigManager()
|
||||
.getSetting(Settings.CRAFTING_STATUS).equals(CraftingStatus.BUTTON)) {
|
||||
this.buttonList.add(
|
||||
this.craftingStatusImgBtn = new GuiImgButton(
|
||||
this.guiLeft - 18,
|
||||
@@ -356,15 +363,12 @@ public abstract class FCGuiMonitor<T extends IAEStack<T>> extends AEBaseMEGui
|
||||
} else {
|
||||
direction = TextHistory.Direction.NEXT;
|
||||
}
|
||||
history.get(direction, this.searchField.getText())
|
||||
.map(newText -> {
|
||||
setSearchString(newText, true);
|
||||
return true;
|
||||
})
|
||||
.orElse(false);
|
||||
history.get(direction, this.searchField.getText()).map(newText -> {
|
||||
setSearchString(newText, true);
|
||||
return true;
|
||||
}).orElse(false);
|
||||
return;
|
||||
} catch (NoSuchFieldException | IllegalAccessException ignore) {
|
||||
}
|
||||
} catch (NoSuchFieldException | IllegalAccessException ignore) {}
|
||||
}
|
||||
}
|
||||
super.handleMouseInput();
|
||||
@@ -391,8 +395,8 @@ public abstract class FCGuiMonitor<T extends IAEStack<T>> extends AEBaseMEGui
|
||||
}
|
||||
|
||||
if (slot instanceof SlotFake) {
|
||||
InventoryAction action =
|
||||
ctrlDown == 1 ? InventoryAction.SPLIT_OR_PLACE_SINGLE : InventoryAction.PICKUP_OR_SET_DOWN;
|
||||
InventoryAction action = ctrlDown == 1 ? InventoryAction.SPLIT_OR_PLACE_SINGLE
|
||||
: InventoryAction.PICKUP_OR_SET_DOWN;
|
||||
if (Keyboard.isKeyDown(Keyboard.KEY_LMENU) || Keyboard.isKeyDown(Keyboard.KEY_RMENU)) {
|
||||
if (action == InventoryAction.SPLIT_OR_PLACE_SINGLE) {
|
||||
action = InventoryAction.MOVE_REGION;
|
||||
@@ -457,13 +461,12 @@ public abstract class FCGuiMonitor<T extends IAEStack<T>> extends AEBaseMEGui
|
||||
InventoryAction action = null;
|
||||
switch (mouseButton) {
|
||||
case 0: // pickup / set-down.
|
||||
{
|
||||
ItemStack heldStack = player.inventory.getItemStack();
|
||||
if (slot.getStack() == null && heldStack != null)
|
||||
action = InventoryAction.SPLIT_OR_PLACE_SINGLE;
|
||||
else if (slot.getStack() != null && (heldStack == null || heldStack.stackSize <= 1))
|
||||
action = InventoryAction.PICKUP_OR_SET_DOWN;
|
||||
}
|
||||
{
|
||||
ItemStack heldStack = player.inventory.getItemStack();
|
||||
if (slot.getStack() == null && heldStack != null) action = InventoryAction.SPLIT_OR_PLACE_SINGLE;
|
||||
else if (slot.getStack() != null && (heldStack == null || heldStack.stackSize <= 1))
|
||||
action = InventoryAction.PICKUP_OR_SET_DOWN;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
action = ctrlDown == 1 ? InventoryAction.PICKUP_SINGLE : InventoryAction.SHIFT_CLICK;
|
||||
@@ -494,8 +497,7 @@ public abstract class FCGuiMonitor<T extends IAEStack<T>> extends AEBaseMEGui
|
||||
case 0: // pickup / set-down.
|
||||
action = ctrlDown == 1 ? InventoryAction.SPLIT_OR_PLACE_SINGLE : InventoryAction.PICKUP_OR_SET_DOWN;
|
||||
stack = ((SlotME) slot).getAEStack();
|
||||
if (stack != null
|
||||
&& action == InventoryAction.PICKUP_OR_SET_DOWN
|
||||
if (stack != null && action == InventoryAction.PICKUP_OR_SET_DOWN
|
||||
&& stack.getStackSize() == 0
|
||||
&& player.inventory.getItemStack() == null) {
|
||||
action = InventoryAction.AUTO_CRAFT;
|
||||
@@ -523,12 +525,14 @@ public abstract class FCGuiMonitor<T extends IAEStack<T>> extends AEBaseMEGui
|
||||
}
|
||||
if (action == InventoryAction.AUTO_CRAFT) {
|
||||
((AEBaseContainer) this.inventorySlots).setTargetStack(stack);
|
||||
FluidCraft.proxy.netHandler.sendToServer(new CPacketInventoryAction(
|
||||
action, Ae2ReflectClient.getInventorySlots(this).size(), 0, stack));
|
||||
FluidCraft.proxy.netHandler.sendToServer(
|
||||
new CPacketInventoryAction(action, Ae2ReflectClient.getInventorySlots(this).size(), 0, stack));
|
||||
} else if (action != null) {
|
||||
((AEBaseContainer) this.inventorySlots).setTargetStack(stack);
|
||||
final PacketInventoryAction p = new PacketInventoryAction(
|
||||
action, Ae2ReflectClient.getInventorySlots(this).size(), 0);
|
||||
action,
|
||||
Ae2ReflectClient.getInventorySlots(this).size(),
|
||||
0);
|
||||
NetworkHandler.instance.sendToServer(p);
|
||||
}
|
||||
|
||||
@@ -575,11 +579,9 @@ public abstract class FCGuiMonitor<T extends IAEStack<T>> extends AEBaseMEGui
|
||||
if (this.viewCell) {
|
||||
boolean update = false;
|
||||
for (int i = 0; i < 5; i++) {
|
||||
if (this.myCurrentViewCells[i]
|
||||
!= this.monitorableContainer.getCellViewSlot(i).getStack()) {
|
||||
if (this.myCurrentViewCells[i] != this.monitorableContainer.getCellViewSlot(i).getStack()) {
|
||||
update = true;
|
||||
this.myCurrentViewCells[i] =
|
||||
this.monitorableContainer.getCellViewSlot(i).getStack();
|
||||
this.myCurrentViewCells[i] = this.monitorableContainer.getCellViewSlot(i).getStack();
|
||||
}
|
||||
}
|
||||
if (update) {
|
||||
@@ -601,8 +603,7 @@ public abstract class FCGuiMonitor<T extends IAEStack<T>> extends AEBaseMEGui
|
||||
}
|
||||
|
||||
protected int getMaxRows() {
|
||||
return AEConfig.instance.getConfigManager().getSetting(Settings.TERMINAL_STYLE) == TerminalStyle.SMALL
|
||||
? 6
|
||||
return AEConfig.instance.getConfigManager().getSetting(Settings.TERMINAL_STYLE) == TerminalStyle.SMALL ? 6
|
||||
: Integer.MAX_VALUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
package com.glodblock.github.client.gui.container;
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.SidelessMode;
|
||||
import appeng.api.util.IConfigManager;
|
||||
import appeng.container.guisync.GuiSync;
|
||||
import appeng.container.implementations.ContainerInterface;
|
||||
import appeng.helpers.IInterfaceHost;
|
||||
|
||||
import com.glodblock.github.common.tile.TileFluidInterface;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
public class ContainerDualInterface extends ContainerInterface {
|
||||
|
||||
|
||||
+17
-13
@@ -1,5 +1,19 @@
|
||||
package com.glodblock.github.client.gui.container;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
@@ -21,6 +35,7 @@ import appeng.container.guisync.GuiSync;
|
||||
import appeng.container.implementations.CraftingCPURecord;
|
||||
import appeng.core.AELog;
|
||||
import appeng.util.Platform;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.common.parts.PartFluidPatternTerminal;
|
||||
import com.glodblock.github.common.parts.PartFluidPatternTerminalEx;
|
||||
@@ -30,17 +45,6 @@ import com.glodblock.github.network.SPacketMEInventoryUpdate;
|
||||
import com.glodblock.github.util.Ae2Reflect;
|
||||
import com.glodblock.github.util.BlockPos;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.Future;
|
||||
import javax.annotation.Nonnull;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ContainerFluidCraftConfirm extends AEBaseContainer {
|
||||
|
||||
@@ -162,8 +166,8 @@ public class ContainerFluidCraftConfirm extends AEBaseContainer {
|
||||
|
||||
final SPacketMEInventoryUpdate a = new SPacketMEInventoryUpdate((byte) 0);
|
||||
final SPacketMEInventoryUpdate b = new SPacketMEInventoryUpdate((byte) 1);
|
||||
final SPacketMEInventoryUpdate c =
|
||||
this.result.isSimulation() ? new SPacketMEInventoryUpdate((byte) 2) : null;
|
||||
final SPacketMEInventoryUpdate c = this.result.isSimulation() ? new SPacketMEInventoryUpdate((byte) 2)
|
||||
: null;
|
||||
|
||||
final IItemList<IAEItemStack> plan = AEApi.instance().storage().createItemList();
|
||||
this.result.populatePlan(plan);
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
package com.glodblock.github.client.gui.container;
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.YesNo;
|
||||
import appeng.api.util.IConfigManager;
|
||||
import appeng.tile.inventory.AppEngInternalAEInventory;
|
||||
|
||||
import com.glodblock.github.client.gui.container.base.FCContainerFluidConfigurable;
|
||||
import com.glodblock.github.common.parts.PartFluidExportBus;
|
||||
import com.glodblock.github.common.parts.base.FCSharedFluidBus;
|
||||
import com.glodblock.github.util.Ae2Reflect;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
public class ContainerFluidIO extends FCContainerFluidConfigurable {
|
||||
|
||||
private final FCSharedFluidBus bus;
|
||||
|
||||
public ContainerFluidIO(InventoryPlayer ip, FCSharedFluidBus te) {
|
||||
|
||||
+12
-12
@@ -1,20 +1,23 @@
|
||||
package com.glodblock.github.client.gui.container;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.slot.IOptionalSlotHost;
|
||||
import appeng.util.item.AEFluidStack;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.common.item.ItemFluidPacket;
|
||||
import com.glodblock.github.inventory.IDualHost;
|
||||
import com.glodblock.github.inventory.slot.OptionalFluidSlotFakeTypeOnly;
|
||||
import com.glodblock.github.network.SPacketFluidUpdate;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
|
||||
public class ContainerFluidInterface extends AEBaseContainer implements IOptionalSlotHost {
|
||||
|
||||
@@ -27,8 +30,8 @@ public class ContainerFluidInterface extends AEBaseContainer implements IOptiona
|
||||
final int y = 35;
|
||||
final int x = 35;
|
||||
for (int i = 0; i < 6; i++) {
|
||||
addSlotToContainer(new OptionalFluidSlotFakeTypeOnly(
|
||||
inv, tile.getDualityFluid().getConfig(), this, i, x, y, i, 0, 0));
|
||||
addSlotToContainer(
|
||||
new OptionalFluidSlotFakeTypeOnly(inv, tile.getDualityFluid().getConfig(), this, i, x, y, i, 0, 0));
|
||||
}
|
||||
bindPlayerInventory(ipl, 0, 149);
|
||||
}
|
||||
@@ -50,10 +53,7 @@ public class ContainerFluidInterface extends AEBaseContainer implements IOptiona
|
||||
tmp.put(i, tile.getInternalFluid().getFluidInSlot(i));
|
||||
}
|
||||
for (int i = 0; i < tile.getConfig().getSizeInventory(); i++) {
|
||||
tmp.put(
|
||||
i + 100,
|
||||
AEFluidStack.create(
|
||||
ItemFluidPacket.getFluidStack(tile.getConfig().getStackInSlot(i))));
|
||||
tmp.put(i + 100, AEFluidStack.create(ItemFluidPacket.getFluidStack(tile.getConfig().getStackInSlot(i))));
|
||||
}
|
||||
for (final Object g : this.crafters) {
|
||||
if (g instanceof EntityPlayer) {
|
||||
|
||||
+11
-6
@@ -1,22 +1,26 @@
|
||||
package com.glodblock.github.client.gui.container;
|
||||
|
||||
import net.minecraft.client.gui.GuiTextField;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
|
||||
import appeng.api.config.*;
|
||||
import appeng.api.implementations.IUpgradeableHost;
|
||||
import appeng.container.guisync.GuiSync;
|
||||
import appeng.tile.inventory.AppEngInternalAEInventory;
|
||||
import appeng.util.Platform;
|
||||
|
||||
import com.glodblock.github.client.gui.container.base.FCContainerFluidConfigurable;
|
||||
import com.glodblock.github.common.parts.PartFluidLevelEmitter;
|
||||
import com.glodblock.github.inventory.slot.OptionalFluidSlotFakeTypeOnly;
|
||||
import com.glodblock.github.util.Ae2Reflect;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.gui.GuiTextField;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
|
||||
public class ContainerFluidLevelEmitter extends FCContainerFluidConfigurable {
|
||||
|
||||
private final PartFluidLevelEmitter lvlEmitter;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -81,8 +85,9 @@ public class ContainerFluidLevelEmitter extends FCContainerFluidConfigurable {
|
||||
|
||||
if (Platform.isServer()) {
|
||||
this.EmitterValue = this.lvlEmitter.getReportingValue();
|
||||
this.setRedStoneMode((RedstoneMode)
|
||||
Ae2Reflect.getUpgradeableHost(this).getConfigManager().getSetting(Settings.REDSTONE_EMITTER));
|
||||
this.setRedStoneMode(
|
||||
(RedstoneMode) Ae2Reflect.getUpgradeableHost(this).getConfigManager()
|
||||
.getSetting(Settings.REDSTONE_EMITTER));
|
||||
}
|
||||
|
||||
this.standardDetectAndSendChanges();
|
||||
|
||||
+40
-38
@@ -1,5 +1,21 @@
|
||||
package com.glodblock.github.client.gui.container;
|
||||
|
||||
import java.nio.BufferOverflowException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.IFluidContainerItem;
|
||||
|
||||
import org.apache.commons.lang3.tuple.MutablePair;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.implementations.guiobjects.IPortableCell;
|
||||
@@ -22,6 +38,7 @@ import appeng.me.helpers.ChannelPowerSrc;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.item.AEFluidStack;
|
||||
import appeng.util.item.AEItemStack;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.client.gui.container.base.FCContainerMonitor;
|
||||
import com.glodblock.github.common.item.ItemFluidDrop;
|
||||
@@ -30,29 +47,17 @@ import com.glodblock.github.network.CPacketFluidUpdate;
|
||||
import com.glodblock.github.network.SPacketFluidUpdate;
|
||||
import com.glodblock.github.network.SPacketMEInventoryUpdate;
|
||||
import com.glodblock.github.util.Util;
|
||||
import java.nio.BufferOverflowException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.IFluidContainerItem;
|
||||
import org.apache.commons.lang3.tuple.MutablePair;
|
||||
|
||||
public class ContainerFluidMonitor extends FCContainerMonitor<IAEFluidStack> {
|
||||
|
||||
private final IItemList<IAEFluidStack> fluids = AEApi.instance().storage().createFluidList();
|
||||
|
||||
public ContainerFluidMonitor(final InventoryPlayer ip, final ITerminalHost monitorable) {
|
||||
this(ip, monitorable, true);
|
||||
}
|
||||
|
||||
protected ContainerFluidMonitor(
|
||||
final InventoryPlayer ip, final ITerminalHost monitorable, final boolean bindInventory) {
|
||||
protected ContainerFluidMonitor(final InventoryPlayer ip, final ITerminalHost monitorable,
|
||||
final boolean bindInventory) {
|
||||
super(ip, monitorable, bindInventory);
|
||||
if (Platform.isServer()) {
|
||||
this.serverCM = monitorable.getConfigManager();
|
||||
@@ -106,8 +111,7 @@ public class ContainerFluidMonitor extends FCContainerMonitor<IAEFluidStack> {
|
||||
public ItemStack transferStackInSlot(final EntityPlayer p, final int idx) {
|
||||
if (Platform.isClient()) {
|
||||
Slot clickSlot = (Slot) this.inventorySlots.get(idx);
|
||||
if ((clickSlot instanceof SlotPlayerInv || clickSlot instanceof SlotPlayerHotBar)
|
||||
&& clickSlot.getHasStack()
|
||||
if ((clickSlot instanceof SlotPlayerInv || clickSlot instanceof SlotPlayerHotBar) && clickSlot.getHasStack()
|
||||
&& Util.FluidUtil.isFluidContainer(clickSlot.getStack())) {
|
||||
ItemStack tis = clickSlot.getStack();
|
||||
Map<Integer, IAEFluidStack> tmp = new HashMap<>();
|
||||
@@ -172,8 +176,8 @@ public class ContainerFluidMonitor extends FCContainerMonitor<IAEFluidStack> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postChange(
|
||||
IBaseMonitor<IAEFluidStack> monitor, Iterable<IAEFluidStack> change, BaseActionSource actionSource) {
|
||||
public void postChange(IBaseMonitor<IAEFluidStack> monitor, Iterable<IAEFluidStack> change,
|
||||
BaseActionSource actionSource) {
|
||||
for (final IAEFluidStack is : change) {
|
||||
this.fluids.add(is);
|
||||
}
|
||||
@@ -207,8 +211,8 @@ public class ContainerFluidMonitor extends FCContainerMonitor<IAEFluidStack> {
|
||||
this.dropItem(is);
|
||||
}
|
||||
|
||||
public void postChange(
|
||||
Iterable<IAEFluidStack> change, ItemStack fluidContainer, EntityPlayer player, int slotIndex) {
|
||||
public void postChange(Iterable<IAEFluidStack> change, ItemStack fluidContainer, EntityPlayer player,
|
||||
int slotIndex) {
|
||||
for (IAEFluidStack fluid : change) {
|
||||
IAEFluidStack nfluid = this.monitor.getStorageList().findPrecise(fluid);
|
||||
ItemStack out = fluidContainer.copy();
|
||||
@@ -220,8 +224,7 @@ public class ContainerFluidMonitor extends FCContainerMonitor<IAEFluidStack> {
|
||||
MutablePair<Integer, ItemStack> fillStack = Util.FluidUtil.fillStack(out, toExtract.getFluidStack());
|
||||
if (fillStack.right == null || fillStack.left <= 0) continue;
|
||||
toExtract.setStackSize((long) fillStack.left * fluidContainer.stackSize);
|
||||
IAEFluidStack tmp = this.host
|
||||
.getFluidInventory()
|
||||
IAEFluidStack tmp = this.host.getFluidInventory()
|
||||
.extractItems(toExtract, Actionable.SIMULATE, this.getActionSource());
|
||||
if (tmp == null) continue;
|
||||
fillStack.right.stackSize = (int) (tmp.getStackSize() / fillStack.left);
|
||||
@@ -232,7 +235,8 @@ public class ContainerFluidMonitor extends FCContainerMonitor<IAEFluidStack> {
|
||||
if ((int) (tmp.getStackSize() % fillStack.left) > 0) {
|
||||
this.dropItem(
|
||||
Util.FluidUtil.setFluidContainerAmount(
|
||||
fillStack.right, (int) (tmp.getStackSize() % fillStack.left)),
|
||||
fillStack.right,
|
||||
(int) (tmp.getStackSize() % fillStack.left)),
|
||||
1);
|
||||
out.stackSize++;
|
||||
}
|
||||
@@ -245,11 +249,10 @@ public class ContainerFluidMonitor extends FCContainerMonitor<IAEFluidStack> {
|
||||
AEFluidStack fluidStack = Util.getAEFluidFromItem(fluidContainer);
|
||||
final IAEFluidStack aeFluidStack = fluidStack.copy();
|
||||
// simulate result is incorrect. so I'm using other solution and ec2 both mod have same issues
|
||||
final IAEFluidStack notInserted = this.host
|
||||
.getFluidInventory()
|
||||
final IAEFluidStack notInserted = this.host.getFluidInventory()
|
||||
.injectItems(aeFluidStack, Actionable.MODULATE, this.getActionSource());
|
||||
MutablePair<Integer, ItemStack> drainStack =
|
||||
Util.FluidUtil.drainStack(out.copy(), aeFluidStack.getFluidStack());
|
||||
MutablePair<Integer, ItemStack> drainStack = Util.FluidUtil
|
||||
.drainStack(out.copy(), aeFluidStack.getFluidStack());
|
||||
if (notInserted != null && notInserted.getStackSize() > 0) {
|
||||
if (fluidStack.getStackSize() == notInserted.getStackSize()) continue;
|
||||
aeFluidStack.decStackSize(notInserted.getStackSize());
|
||||
@@ -257,14 +260,14 @@ public class ContainerFluidMonitor extends FCContainerMonitor<IAEFluidStack> {
|
||||
if (drainStack.left > aeFluidStack.getStackSize()
|
||||
&& FluidContainerRegistry.isContainer(drainStack.right)) {
|
||||
aeFluidStack.setStackSize(drainStack.left - aeFluidStack.getStackSize());
|
||||
this.host
|
||||
.getFluidInventory()
|
||||
this.host.getFluidInventory()
|
||||
.extractItems(aeFluidStack, Actionable.MODULATE, this.getActionSource());
|
||||
continue;
|
||||
}
|
||||
|
||||
this.dropItem(
|
||||
drainStack.right, (int) (aeFluidStack.getStackSize() / drainStack.left)); // drop empty item
|
||||
this.dropItem(drainStack.right, (int) (aeFluidStack.getStackSize() / drainStack.left)); // drop
|
||||
// empty
|
||||
// item
|
||||
out.stackSize = (int) (notInserted.getStackSize() / drainStack.left);
|
||||
if (drainStack.right.getItem() instanceof IFluidContainerItem) {
|
||||
if (notInserted.getStackSize() % drainStack.left > 0) {
|
||||
@@ -276,8 +279,7 @@ public class ContainerFluidMonitor extends FCContainerMonitor<IAEFluidStack> {
|
||||
} else if (FluidContainerRegistry.isContainer(drainStack.right)) {
|
||||
if (notInserted.getStackSize() % drainStack.left > 0) {
|
||||
aeFluidStack.setStackSize(aeFluidStack.getStackSize() % drainStack.left);
|
||||
this.host
|
||||
.getFluidInventory()
|
||||
this.host.getFluidInventory()
|
||||
.extractItems(aeFluidStack, Actionable.MODULATE, this.getActionSource());
|
||||
out.stackSize++;
|
||||
}
|
||||
@@ -287,8 +289,8 @@ public class ContainerFluidMonitor extends FCContainerMonitor<IAEFluidStack> {
|
||||
if (slotIndex == -1) {
|
||||
out.stackSize = fluidContainer.stackSize;
|
||||
} else {
|
||||
out.stackSize =
|
||||
(int) (fluidContainer.stackSize - (aeFluidStack.getStackSize() / drainStack.left));
|
||||
out.stackSize = (int) (fluidContainer.stackSize
|
||||
- (aeFluidStack.getStackSize() / drainStack.left));
|
||||
}
|
||||
this.dropItem(drainStack.right, fluidContainer.stackSize); // drop empty item
|
||||
}
|
||||
@@ -303,8 +305,8 @@ public class ContainerFluidMonitor extends FCContainerMonitor<IAEFluidStack> {
|
||||
(EntityPlayerMP) player);
|
||||
} else {
|
||||
player.inventory.setItemStack(null);
|
||||
FluidCraft.proxy.netHandler.sendTo(
|
||||
new SPacketFluidUpdate(new HashMap<>()), (EntityPlayerMP) player);
|
||||
FluidCraft.proxy.netHandler
|
||||
.sendTo(new SPacketFluidUpdate(new HashMap<>()), (EntityPlayerMP) player);
|
||||
}
|
||||
} else {
|
||||
player.inventory.setInventorySlotContents(slotIndex, out.stackSize > 0 ? out : null);
|
||||
|
||||
+3
-1
@@ -2,10 +2,12 @@ package com.glodblock.github.client.gui.container;
|
||||
|
||||
import static com.glodblock.github.loader.ItemAndBlockHolder.PACKET;
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import appeng.container.AEBaseContainer;
|
||||
|
||||
import com.glodblock.github.common.tile.TileFluidPacketDecoder;
|
||||
import com.glodblock.github.inventory.slot.FCSlotRestrictedInput;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
public class ContainerFluidPacketDecoder extends AEBaseContainer {
|
||||
|
||||
|
||||
+33
-18
@@ -1,10 +1,20 @@
|
||||
package com.glodblock.github.client.gui.container;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.slot.SlotRestrictedInput;
|
||||
import appeng.helpers.InventoryAction;
|
||||
|
||||
import com.glodblock.github.common.item.ItemFluidDrop;
|
||||
import com.glodblock.github.common.item.ItemFluidEncodedPattern;
|
||||
import com.glodblock.github.common.item.ItemFluidPacket;
|
||||
@@ -16,13 +26,6 @@ import com.glodblock.github.inventory.slot.SlotFluidConvertingFake;
|
||||
import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.util.FluidPatternDetails;
|
||||
import com.glodblock.github.util.Util;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerFluidPatternEncoder extends AEBaseContainer implements IPatternConsumer {
|
||||
|
||||
@@ -39,10 +42,22 @@ public class ContainerFluidPatternEncoder extends AEBaseContainer implements IPa
|
||||
}
|
||||
addSlotToContainer(new SlotFluidConvertingFake(output, y, 113, 17 + y * 18));
|
||||
}
|
||||
addSlotToContainer(new SlotRestrictedInput(
|
||||
SlotRestrictedInput.PlacableItemType.BLANK_PATTERN, tile.getInventory(), 0, 138, 20, ipl));
|
||||
addSlotToContainer(new SlotRestrictedInput(
|
||||
SlotRestrictedInput.PlacableItemType.ENCODED_PATTERN, tile.getInventory(), 1, 138, 50, ipl));
|
||||
addSlotToContainer(
|
||||
new SlotRestrictedInput(
|
||||
SlotRestrictedInput.PlacableItemType.BLANK_PATTERN,
|
||||
tile.getInventory(),
|
||||
0,
|
||||
138,
|
||||
20,
|
||||
ipl));
|
||||
addSlotToContainer(
|
||||
new SlotRestrictedInput(
|
||||
SlotRestrictedInput.PlacableItemType.ENCODED_PATTERN,
|
||||
tile.getInventory(),
|
||||
1,
|
||||
138,
|
||||
50,
|
||||
ipl));
|
||||
bindPlayerInventory(ipl, 0, 84);
|
||||
}
|
||||
|
||||
@@ -51,9 +66,8 @@ public class ContainerFluidPatternEncoder extends AEBaseContainer implements IPa
|
||||
}
|
||||
|
||||
private static boolean isNotPattern(ItemStack stack) {
|
||||
return stack == null
|
||||
|| !(AEApi.instance().definitions().materials().blankPattern().isSameAs(stack)
|
||||
|| (stack.getItem() instanceof ItemFluidEncodedPattern));
|
||||
return stack == null || !(AEApi.instance().definitions().materials().blankPattern().isSameAs(stack)
|
||||
|| (stack.getItem() instanceof ItemFluidEncodedPattern));
|
||||
}
|
||||
|
||||
public boolean canEncodePattern() {
|
||||
@@ -61,8 +75,7 @@ public class ContainerFluidPatternEncoder extends AEBaseContainer implements IPa
|
||||
&& isNotPattern(tile.getInventory().getStackInSlot(1))) {
|
||||
return false;
|
||||
}
|
||||
find_input:
|
||||
{
|
||||
find_input: {
|
||||
for (IAEItemStack stack : tile.getCraftingSlots()) {
|
||||
if (stack != null && stack.getStackSize() > 0) {
|
||||
break find_input;
|
||||
@@ -136,8 +149,10 @@ public class ContainerFluidPatternEncoder extends AEBaseContainer implements IPa
|
||||
if (stack == null) {
|
||||
slot.putStack(Util.copyStackWithSize(inSlot, Math.max(1, inSlot.stackSize - 1)));
|
||||
} else if (stack.isItemEqual(inSlot)) {
|
||||
slot.putStack(Util.copyStackWithSize(
|
||||
inSlot, Math.min(inSlot.getMaxStackSize(), inSlot.stackSize + 1)));
|
||||
slot.putStack(
|
||||
Util.copyStackWithSize(
|
||||
inSlot,
|
||||
Math.min(inSlot.getMaxStackSize(), inSlot.stackSize + 1)));
|
||||
} else {
|
||||
((SlotFluidConvertingFake) slot)
|
||||
.putConvertedStack(Objects.requireNonNull(Util.copyStackWithSize(stack, 1)));
|
||||
|
||||
+14
-9
@@ -1,18 +1,20 @@
|
||||
package com.glodblock.github.client.gui.container;
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.container.slot.OptionalSlotFake;
|
||||
import appeng.container.slot.SlotFakeCraftingMatrix;
|
||||
import appeng.container.slot.SlotPatternOutputs;
|
||||
import appeng.container.slot.SlotPatternTerm;
|
||||
import appeng.util.Platform;
|
||||
|
||||
import com.glodblock.github.client.gui.container.base.FCContainerEncodeTerminal;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
|
||||
public class ContainerFluidPatternTerminal extends FCContainerEncodeTerminal {
|
||||
|
||||
@@ -25,8 +27,11 @@ public class ContainerFluidPatternTerminal extends FCContainerEncodeTerminal {
|
||||
for (int y = 0; y < 3; y++) {
|
||||
for (int x = 0; x < 3; x++) {
|
||||
this.addSlotToContainer(
|
||||
this.craftingSlots[x + y * 3] =
|
||||
new SlotFakeCraftingMatrix(this.crafting, x + y * 3, 18 + x * 18, -76 + y * 18));
|
||||
this.craftingSlots[x + y * 3] = new SlotFakeCraftingMatrix(
|
||||
this.crafting,
|
||||
x + y * 3,
|
||||
18 + x * 18,
|
||||
-76 + y * 18));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,7 +106,7 @@ public class ContainerFluidPatternTerminal extends FCContainerEncodeTerminal {
|
||||
if (this.isCraftingMode()) {
|
||||
final ItemStack out = this.getAndUpdateOutput();
|
||||
if (out != null && out.stackSize > 0) {
|
||||
return new ItemStack[] {out};
|
||||
return new ItemStack[] { out };
|
||||
}
|
||||
}
|
||||
return super.getOutputs();
|
||||
|
||||
+12
-17
@@ -1,15 +1,17 @@
|
||||
package com.glodblock.github.client.gui.container;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.container.slot.IOptionalSlotHost;
|
||||
import appeng.container.slot.OptionalSlotFake;
|
||||
import appeng.helpers.InventoryAction;
|
||||
import appeng.util.Platform;
|
||||
|
||||
import com.glodblock.github.client.gui.container.base.FCContainerEncodeTerminal;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
|
||||
public class ContainerFluidPatternTerminalEx extends FCContainerEncodeTerminal {
|
||||
|
||||
@@ -27,8 +29,8 @@ public class ContainerFluidPatternTerminalEx extends FCContainerEncodeTerminal {
|
||||
for (int y = 0; y < CRAFTING_GRID_HEIGHT; y++) {
|
||||
for (int x = 0; x < CRAFTING_GRID_WIDTH; x++) {
|
||||
this.addSlotToContainer(
|
||||
this.craftingSlots[x + y * CRAFTING_GRID_WIDTH + page * CRAFTING_GRID_SLOTS] =
|
||||
new ProcessingSlotFake(
|
||||
this.craftingSlots[x + y * CRAFTING_GRID_WIDTH
|
||||
+ page * CRAFTING_GRID_SLOTS] = new ProcessingSlotFake(
|
||||
crafting,
|
||||
this,
|
||||
x + y * CRAFTING_GRID_WIDTH + page * CRAFTING_GRID_SLOTS,
|
||||
@@ -42,8 +44,8 @@ public class ContainerFluidPatternTerminalEx extends FCContainerEncodeTerminal {
|
||||
for (int x = 0; x < CRAFTING_GRID_WIDTH; x++) {
|
||||
for (int y = 0; y < CRAFTING_GRID_HEIGHT; y++) {
|
||||
this.addSlotToContainer(
|
||||
this.outputSlots[x * CRAFTING_GRID_HEIGHT + y + page * CRAFTING_GRID_SLOTS] =
|
||||
new ProcessingSlotFake(
|
||||
this.outputSlots[x * CRAFTING_GRID_HEIGHT + y
|
||||
+ page * CRAFTING_GRID_SLOTS] = new ProcessingSlotFake(
|
||||
output,
|
||||
this,
|
||||
x * CRAFTING_GRID_HEIGHT + y + page * CRAFTING_GRID_SLOTS,
|
||||
@@ -135,15 +137,8 @@ public class ContainerFluidPatternTerminalEx extends FCContainerEncodeTerminal {
|
||||
private static final int POSITION_SHIFT = 9000;
|
||||
private boolean hidden = false;
|
||||
|
||||
public ProcessingSlotFake(
|
||||
IInventory inv,
|
||||
IOptionalSlotHost containerBus,
|
||||
int idx,
|
||||
int x,
|
||||
int y,
|
||||
int offX,
|
||||
int offY,
|
||||
int groupNum) {
|
||||
public ProcessingSlotFake(IInventory inv, IOptionalSlotHost containerBus, int idx, int x, int y, int offX,
|
||||
int offY, int groupNum) {
|
||||
super(inv, containerBus, idx, x, y, offX, offY, groupNum);
|
||||
this.setRenderDisabled(false);
|
||||
}
|
||||
|
||||
+8
-5
@@ -1,11 +1,13 @@
|
||||
package com.glodblock.github.client.gui.container;
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.PowerMultiplier;
|
||||
import appeng.util.Platform;
|
||||
|
||||
import com.glodblock.github.inventory.item.IFluidPortableCell;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerFluidPortableCell extends ContainerFluidMonitor {
|
||||
|
||||
@@ -30,8 +32,7 @@ public class ContainerFluidPortableCell extends ContainerFluidMonitor {
|
||||
|
||||
@Override
|
||||
public void detectAndSendChanges() {
|
||||
final ItemStack currentItem = this.slot < 0
|
||||
? this.getPlayerInv().getCurrentItem()
|
||||
final ItemStack currentItem = this.slot < 0 ? this.getPlayerInv().getCurrentItem()
|
||||
: this.getPlayerInv().getStackInSlot(this.slot);
|
||||
if (this.civ != null) {
|
||||
if (currentItem != this.civ.getItemStack()) {
|
||||
@@ -52,7 +53,9 @@ public class ContainerFluidPortableCell extends ContainerFluidMonitor {
|
||||
this.ticks++;
|
||||
if (this.ticks > 10 && this.civ != null) {
|
||||
this.civ.extractAEPower(
|
||||
this.getPowerMultiplier() * this.ticks, Actionable.MODULATE, PowerMultiplier.CONFIG);
|
||||
this.getPowerMultiplier() * this.ticks,
|
||||
Actionable.MODULATE,
|
||||
PowerMultiplier.CONFIG);
|
||||
this.ticks = 0;
|
||||
}
|
||||
super.detectAndSendChanges();
|
||||
|
||||
+33
-24
@@ -1,5 +1,10 @@
|
||||
package com.glodblock.github.client.gui.container;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.*;
|
||||
import appeng.api.storage.IMEInventory;
|
||||
@@ -10,14 +15,12 @@ import appeng.container.slot.SlotRestrictedInput;
|
||||
import appeng.tile.inventory.AppEngInternalAEInventory;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.iterators.NullIterator;
|
||||
|
||||
import com.glodblock.github.client.gui.container.base.FCContainerFluidConfigurable;
|
||||
import com.glodblock.github.common.item.ItemFluidPacket;
|
||||
import com.glodblock.github.common.parts.PartFluidStorageBus;
|
||||
import com.glodblock.github.inventory.slot.OptionalFluidSlotFakeTypeOnly;
|
||||
import com.glodblock.github.util.Ae2Reflect;
|
||||
import java.util.Iterator;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
|
||||
public class ContainerFluidStorageBus extends FCContainerFluidConfigurable {
|
||||
|
||||
@@ -51,41 +54,46 @@ public class ContainerFluidStorageBus extends FCContainerFluidConfigurable {
|
||||
new OptionalFluidSlotFakeTypeOnly(config, null, this, y * 9 + x, xo, yo, x, y, y));
|
||||
}
|
||||
}
|
||||
this.addSlotToContainer((new SlotRestrictedInput(
|
||||
SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.getInventoryPlayer()))
|
||||
.setNotDraggable());
|
||||
this.addSlotToContainer((new SlotRestrictedInput(
|
||||
this.addSlotToContainer(
|
||||
(new SlotRestrictedInput(
|
||||
SlotRestrictedInput.PlacableItemType.UPGRADES,
|
||||
upgrades,
|
||||
0,
|
||||
187,
|
||||
8,
|
||||
this.getInventoryPlayer())).setNotDraggable());
|
||||
this.addSlotToContainer(
|
||||
(new SlotRestrictedInput(
|
||||
SlotRestrictedInput.PlacableItemType.UPGRADES,
|
||||
upgrades,
|
||||
1,
|
||||
187,
|
||||
8 + 18,
|
||||
this.getInventoryPlayer()))
|
||||
.setNotDraggable());
|
||||
this.addSlotToContainer((new SlotRestrictedInput(
|
||||
this.getInventoryPlayer())).setNotDraggable());
|
||||
this.addSlotToContainer(
|
||||
(new SlotRestrictedInput(
|
||||
SlotRestrictedInput.PlacableItemType.UPGRADES,
|
||||
upgrades,
|
||||
2,
|
||||
187,
|
||||
8 + 18 * 2,
|
||||
this.getInventoryPlayer()))
|
||||
.setNotDraggable());
|
||||
this.addSlotToContainer((new SlotRestrictedInput(
|
||||
this.getInventoryPlayer())).setNotDraggable());
|
||||
this.addSlotToContainer(
|
||||
(new SlotRestrictedInput(
|
||||
SlotRestrictedInput.PlacableItemType.UPGRADES,
|
||||
upgrades,
|
||||
3,
|
||||
187,
|
||||
8 + 18 * 3,
|
||||
this.getInventoryPlayer()))
|
||||
.setNotDraggable());
|
||||
this.addSlotToContainer((new SlotRestrictedInput(
|
||||
this.getInventoryPlayer())).setNotDraggable());
|
||||
this.addSlotToContainer(
|
||||
(new SlotRestrictedInput(
|
||||
SlotRestrictedInput.PlacableItemType.UPGRADES,
|
||||
upgrades,
|
||||
4,
|
||||
187,
|
||||
8 + 18 * 4,
|
||||
this.getInventoryPlayer()))
|
||||
.setNotDraggable());
|
||||
this.getInventoryPlayer())).setNotDraggable());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -113,10 +121,11 @@ public class ContainerFluidStorageBus extends FCContainerFluidConfigurable {
|
||||
this.verifyPermissions(SecurityPermissions.BUILD, false);
|
||||
|
||||
if (Platform.isServer()) {
|
||||
this.setReadWriteMode((AccessRestriction)
|
||||
Ae2Reflect.getUpgradeList(this).getConfigManager().getSetting(Settings.ACCESS));
|
||||
this.setStorageFilter((StorageFilter)
|
||||
Ae2Reflect.getUpgradeList(this).getConfigManager().getSetting(Settings.STORAGE_FILTER));
|
||||
this.setReadWriteMode(
|
||||
(AccessRestriction) Ae2Reflect.getUpgradeList(this).getConfigManager().getSetting(Settings.ACCESS));
|
||||
this.setStorageFilter(
|
||||
(StorageFilter) Ae2Reflect.getUpgradeList(this).getConfigManager()
|
||||
.getSetting(Settings.STORAGE_FILTER));
|
||||
}
|
||||
|
||||
this.standardDetectAndSendChanges();
|
||||
@@ -142,8 +151,8 @@ public class ContainerFluidStorageBus extends FCContainerFluidConfigurable {
|
||||
final IMEInventory<IAEFluidStack> cellInv = this.bus.getInternalHandler();
|
||||
Iterator<IAEFluidStack> i = new NullIterator<>();
|
||||
if (cellInv != null) {
|
||||
final IItemList<IAEFluidStack> list =
|
||||
cellInv.getAvailableItems(AEApi.instance().storage().createFluidList());
|
||||
final IItemList<IAEFluidStack> list = cellInv
|
||||
.getAvailableItems(AEApi.instance().storage().createFluidList());
|
||||
i = list.iterator();
|
||||
}
|
||||
|
||||
|
||||
+10
-7
@@ -1,19 +1,22 @@
|
||||
package com.glodblock.github.client.gui.container;
|
||||
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.slot.SlotNormal;
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.client.gui.ITankDump;
|
||||
import com.glodblock.github.common.tile.TileIngredientBuffer;
|
||||
import com.glodblock.github.network.SPacketFluidUpdate;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.slot.SlotNormal;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.client.gui.ITankDump;
|
||||
import com.glodblock.github.common.tile.TileIngredientBuffer;
|
||||
import com.glodblock.github.network.SPacketFluidUpdate;
|
||||
|
||||
public class ContainerIngredientBuffer extends AEBaseContainer implements ITankDump {
|
||||
|
||||
private final TileIngredientBuffer tile;
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
package com.glodblock.github.client.gui.container;
|
||||
|
||||
import java.nio.BufferOverflowException;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.implementations.guiobjects.IPortableCell;
|
||||
import appeng.api.implementations.tiles.IMEChest;
|
||||
@@ -17,25 +25,21 @@ import appeng.api.storage.data.IItemList;
|
||||
import appeng.container.slot.SlotRestrictedInput;
|
||||
import appeng.me.helpers.ChannelPowerSrc;
|
||||
import appeng.util.Platform;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.client.gui.container.base.FCContainerMonitor;
|
||||
import com.glodblock.github.network.SPacketMEInventoryUpdate;
|
||||
import java.nio.BufferOverflowException;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class ContainerItemMonitor extends FCContainerMonitor<IAEItemStack> {
|
||||
|
||||
private final IItemList<IAEItemStack> items = AEApi.instance().storage().createItemList();
|
||||
|
||||
public ContainerItemMonitor(final InventoryPlayer ip, final ITerminalHost monitorable) {
|
||||
this(ip, monitorable, true);
|
||||
}
|
||||
|
||||
protected ContainerItemMonitor(
|
||||
final InventoryPlayer ip, final ITerminalHost monitorable, final boolean bindInventory) {
|
||||
protected ContainerItemMonitor(final InventoryPlayer ip, final ITerminalHost monitorable,
|
||||
final boolean bindInventory) {
|
||||
super(ip, monitorable, bindInventory);
|
||||
if (Platform.isServer()) {
|
||||
this.serverCM = monitorable.getConfigManager();
|
||||
@@ -140,9 +144,7 @@ public class ContainerItemMonitor extends FCContainerMonitor<IAEItemStack> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postChange(
|
||||
final IBaseMonitor<IAEItemStack> monitor,
|
||||
final Iterable<IAEItemStack> change,
|
||||
public void postChange(final IBaseMonitor<IAEItemStack> monitor, final Iterable<IAEItemStack> change,
|
||||
final BaseActionSource source) {
|
||||
for (final IAEItemStack is : change) {
|
||||
this.items.add(is);
|
||||
|
||||
+4
-2
@@ -1,10 +1,12 @@
|
||||
package com.glodblock.github.client.gui.container;
|
||||
|
||||
import appeng.container.slot.SlotNormal;
|
||||
import com.glodblock.github.common.tile.TileLargeIngredientBuffer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
|
||||
import appeng.container.slot.SlotNormal;
|
||||
|
||||
import com.glodblock.github.common.tile.TileLargeIngredientBuffer;
|
||||
|
||||
public class ContainerLargeIngredientBuffer extends ContainerIngredientBuffer {
|
||||
|
||||
public ContainerLargeIngredientBuffer(InventoryPlayer ipl, TileLargeIngredientBuffer tile) {
|
||||
|
||||
+8
-5
@@ -1,16 +1,19 @@
|
||||
package com.glodblock.github.client.gui.container;
|
||||
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.util.item.AEItemStack;
|
||||
import com.glodblock.github.common.tile.TileLevelMaintainer;
|
||||
import com.glodblock.github.inventory.AeItemStackHandler;
|
||||
import com.glodblock.github.inventory.slot.SlotFluidConvertingFake;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.util.item.AEItemStack;
|
||||
|
||||
import com.glodblock.github.common.tile.TileLevelMaintainer;
|
||||
import com.glodblock.github.inventory.AeItemStackHandler;
|
||||
import com.glodblock.github.inventory.slot.SlotFluidConvertingFake;
|
||||
|
||||
public class ContainerLevelMaintainer extends AEBaseContainer {
|
||||
|
||||
private final TileLevelMaintainer tile;
|
||||
private final SlotFluidConvertingFake[] requestSlots = new SlotFluidConvertingFake[TileLevelMaintainer.REQ_COUNT];
|
||||
|
||||
|
||||
+11
-8
@@ -1,9 +1,11 @@
|
||||
package com.glodblock.github.client.gui.container;
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.slot.SlotRestrictedInput;
|
||||
|
||||
import com.glodblock.github.common.tile.TileOCPatternEditor;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
public class ContainerOCPatternEditor extends AEBaseContainer {
|
||||
|
||||
@@ -11,13 +13,14 @@ public class ContainerOCPatternEditor extends AEBaseContainer {
|
||||
super(ipl, tile);
|
||||
for (int i = 0; i < 4; i++) {
|
||||
for (int j = 0; j < 4; j++) {
|
||||
addSlotToContainer(new SlotRestrictedInput(
|
||||
SlotRestrictedInput.PlacableItemType.PATTERN,
|
||||
tile.getInternalInventory(),
|
||||
j * 4 + i,
|
||||
55 + i * 18,
|
||||
17 + j * 18,
|
||||
ipl));
|
||||
addSlotToContainer(
|
||||
new SlotRestrictedInput(
|
||||
SlotRestrictedInput.PlacableItemType.PATTERN,
|
||||
tile.getInternalInventory(),
|
||||
j * 4 + i,
|
||||
55 + i * 18,
|
||||
17 + j * 18,
|
||||
ipl));
|
||||
}
|
||||
}
|
||||
bindPlayerInventory(ipl, 0, 104);
|
||||
|
||||
+3
-2
@@ -1,13 +1,14 @@
|
||||
package com.glodblock.github.client.gui.container;
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.guisync.GuiSync;
|
||||
import appeng.container.slot.SlotInaccessible;
|
||||
import appeng.tile.inventory.AppEngInternalInventory;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
|
||||
public class ContainerPatternValueAmount extends AEBaseContainer {
|
||||
|
||||
|
||||
+34
-54
@@ -1,5 +1,22 @@
|
||||
package com.glodblock.github.client.gui.container.base;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.IFluidContainerItem;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.definitions.IDefinitions;
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
@@ -14,6 +31,7 @@ import appeng.tile.inventory.IAEAppEngInventory;
|
||||
import appeng.tile.inventory.InvOperation;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.item.AEItemStack;
|
||||
|
||||
import com.glodblock.github.client.gui.container.ContainerItemMonitor;
|
||||
import com.glodblock.github.common.item.ItemFluidDrop;
|
||||
import com.glodblock.github.common.item.ItemFluidEncodedPattern;
|
||||
@@ -23,21 +41,6 @@ import com.glodblock.github.inventory.IPatternConsumer;
|
||||
import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.util.FluidPatternDetails;
|
||||
import com.glodblock.github.util.Util;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.IFluidContainerItem;
|
||||
|
||||
public abstract class FCContainerEncodeTerminal extends ContainerItemMonitor
|
||||
implements IAEAppEngInventory, IOptionalSlotHost, IContainerCraftingPacket, IPatternConsumer {
|
||||
@@ -154,8 +157,7 @@ public abstract class FCContainerEncodeTerminal extends ContainerItemMonitor
|
||||
public ItemStack transferStackInSlot(EntityPlayer p, int idx) {
|
||||
Slot clickSlot = (Slot) this.inventorySlots.get(idx);
|
||||
ItemStack is = clickSlot.getStack();
|
||||
if (is != null
|
||||
&& !patternSlotOUT.getHasStack()
|
||||
if (is != null && !patternSlotOUT.getHasStack()
|
||||
&& is.stackSize == 1
|
||||
&& (is.getItem() instanceof ItemFluidEncodedPattern || is.getItem() instanceof ItemEncodedPattern)) {
|
||||
ItemStack output = is.copy();
|
||||
@@ -173,20 +175,16 @@ public abstract class FCContainerEncodeTerminal extends ContainerItemMonitor
|
||||
}
|
||||
|
||||
protected static boolean canDoubleStacks(SlotFake[] slots) {
|
||||
List<SlotFake> enabledSlots =
|
||||
Arrays.stream(slots).filter(SlotFake::isEnabled).collect(Collectors.toList());
|
||||
long emptySlots =
|
||||
enabledSlots.stream().filter(s -> s.getStack() == null).count();
|
||||
long fullSlots = enabledSlots.stream()
|
||||
.filter(s -> s.getStack() != null && s.getStack().stackSize * 2 > 127)
|
||||
List<SlotFake> enabledSlots = Arrays.stream(slots).filter(SlotFake::isEnabled).collect(Collectors.toList());
|
||||
long emptySlots = enabledSlots.stream().filter(s -> s.getStack() == null).count();
|
||||
long fullSlots = enabledSlots.stream().filter(s -> s.getStack() != null && s.getStack().stackSize * 2 > 127)
|
||||
.count();
|
||||
return fullSlots <= emptySlots;
|
||||
}
|
||||
|
||||
protected static void doubleStacksInternal(SlotFake[] slots) {
|
||||
List<ItemStack> overFlowStacks = new ArrayList<>();
|
||||
List<SlotFake> enabledSlots =
|
||||
Arrays.stream(slots).filter(SlotFake::isEnabled).collect(Collectors.toList());
|
||||
List<SlotFake> enabledSlots = Arrays.stream(slots).filter(SlotFake::isEnabled).collect(Collectors.toList());
|
||||
for (final Slot s : enabledSlots) {
|
||||
ItemStack st = s.getStack();
|
||||
if (st == null) continue;
|
||||
@@ -214,26 +212,20 @@ public abstract class FCContainerEncodeTerminal extends ContainerItemMonitor
|
||||
}
|
||||
|
||||
protected static boolean containsItem(SlotFake[] slots) {
|
||||
List<SlotFake> enabledSlots =
|
||||
Arrays.stream(slots).filter(SlotFake::isEnabled).collect(Collectors.toList());
|
||||
long item = enabledSlots.stream()
|
||||
.filter(s -> s.getStack() != null && !Util.isFluidPacket(s.getStack()))
|
||||
List<SlotFake> enabledSlots = Arrays.stream(slots).filter(SlotFake::isEnabled).collect(Collectors.toList());
|
||||
long item = enabledSlots.stream().filter(s -> s.getStack() != null && !Util.isFluidPacket(s.getStack()))
|
||||
.count();
|
||||
return item > 0;
|
||||
}
|
||||
|
||||
protected static boolean containsFluid(SlotFake[] slots) {
|
||||
List<SlotFake> enabledSlots =
|
||||
Arrays.stream(slots).filter(SlotFake::isEnabled).collect(Collectors.toList());
|
||||
long fluid = enabledSlots.stream()
|
||||
.filter(s -> Util.isFluidPacket(s.getStack()))
|
||||
.count();
|
||||
List<SlotFake> enabledSlots = Arrays.stream(slots).filter(SlotFake::isEnabled).collect(Collectors.toList());
|
||||
long fluid = enabledSlots.stream().filter(s -> Util.isFluidPacket(s.getStack())).count();
|
||||
return fluid > 0;
|
||||
}
|
||||
|
||||
protected static boolean nonNullSlot(SlotFake[] slots) {
|
||||
List<SlotFake> enabledSlots =
|
||||
Arrays.stream(slots).filter(SlotFake::isEnabled).collect(Collectors.toList());
|
||||
List<SlotFake> enabledSlots = Arrays.stream(slots).filter(SlotFake::isEnabled).collect(Collectors.toList());
|
||||
long object = enabledSlots.stream().filter(s -> s.getStack() != null).count();
|
||||
return object > 0;
|
||||
}
|
||||
@@ -296,12 +288,8 @@ public abstract class FCContainerEncodeTerminal extends ContainerItemMonitor
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChangeInventory(
|
||||
final IInventory inv,
|
||||
final int slot,
|
||||
final InvOperation mc,
|
||||
final ItemStack removedStack,
|
||||
final ItemStack newStack) {
|
||||
public void onChangeInventory(final IInventory inv, final int slot, final InvOperation mc,
|
||||
final ItemStack removedStack, final ItemStack newStack) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
@@ -377,22 +365,14 @@ public abstract class FCContainerEncodeTerminal extends ContainerItemMonitor
|
||||
}
|
||||
|
||||
// add a new encoded pattern.
|
||||
for (final ItemStack encodedPatternStack : AEApi.instance()
|
||||
.definitions()
|
||||
.items()
|
||||
.encodedPattern()
|
||||
.maybeStack(1)
|
||||
.asSet()) {
|
||||
for (final ItemStack encodedPatternStack : AEApi.instance().definitions().items().encodedPattern()
|
||||
.maybeStack(1).asSet()) {
|
||||
output = encodedPatternStack;
|
||||
this.patternSlotOUT.putStack(output);
|
||||
}
|
||||
} else if (output.getItem() instanceof ItemFluidEncodedPattern) {
|
||||
for (final ItemStack encodedPatternStack : AEApi.instance()
|
||||
.definitions()
|
||||
.items()
|
||||
.encodedPattern()
|
||||
.maybeStack(1)
|
||||
.asSet()) {
|
||||
for (final ItemStack encodedPatternStack : AEApi.instance().definitions().items().encodedPattern()
|
||||
.maybeStack(1).asSet()) {
|
||||
output = encodedPatternStack;
|
||||
this.patternSlotOUT.putStack(output);
|
||||
}
|
||||
|
||||
+14
-11
@@ -1,5 +1,15 @@
|
||||
package com.glodblock.github.client.gui.container.base;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import appeng.api.config.Upgrades;
|
||||
import appeng.api.implementations.IUpgradeableHost;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
@@ -8,20 +18,13 @@ import appeng.container.slot.AppEngSlot;
|
||||
import appeng.tile.inventory.AppEngInternalAEInventory;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.item.AEFluidStack;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.common.item.ItemFluidPacket;
|
||||
import com.glodblock.github.inventory.slot.OptionalFluidSlotFakeTypeOnly;
|
||||
import com.glodblock.github.network.SPacketFluidUpdate;
|
||||
import com.glodblock.github.util.Ae2Reflect;
|
||||
import com.glodblock.github.util.Util;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
public abstract class FCContainerFluidConfigurable extends ContainerUpgradeable {
|
||||
|
||||
@@ -99,9 +102,9 @@ public abstract class FCContainerFluidConfigurable extends ContainerUpgradeable
|
||||
final AppEngInternalAEInventory inv = this.getFakeFluidInv();
|
||||
final Map<Integer, IAEFluidStack> tmp = new HashMap<>();
|
||||
for (int i = 0; i < inv.getSizeInventory(); ++i) {
|
||||
if (inv.getStackInSlot(i) != null
|
||||
&& !this.isValidForConfig(
|
||||
i, AEFluidStack.create(ItemFluidPacket.getFluidStack(inv.getStackInSlot(i))))) {
|
||||
if (inv.getStackInSlot(i) != null && !this.isValidForConfig(
|
||||
i,
|
||||
AEFluidStack.create(ItemFluidPacket.getFluidStack(inv.getStackInSlot(i))))) {
|
||||
inv.setInventorySlotContents(i, null);
|
||||
}
|
||||
tmp.put(i, AEFluidStack.create(ItemFluidPacket.getFluidStack(inv.getStackInSlot(i))));
|
||||
|
||||
+18
-15
@@ -1,5 +1,16 @@
|
||||
package com.glodblock.github.client.gui.container.base;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import appeng.api.config.*;
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.networking.energy.IEnergyGrid;
|
||||
@@ -20,14 +31,6 @@ import appeng.helpers.WirelessTerminalGuiObject;
|
||||
import appeng.util.ConfigManager;
|
||||
import appeng.util.IConfigManagerHost;
|
||||
import appeng.util.Platform;
|
||||
import java.io.IOException;
|
||||
import javax.annotation.Nonnull;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public abstract class FCContainerMonitor<T extends IAEStack<T>> extends AEBaseContainer
|
||||
implements IConfigManagerHost, IConfigurableObject, IMEMonitorHandlerReceiver<T> {
|
||||
@@ -51,8 +54,8 @@ public abstract class FCContainerMonitor<T extends IAEStack<T>> extends AEBaseCo
|
||||
this(ip, monitorable, true);
|
||||
}
|
||||
|
||||
protected FCContainerMonitor(
|
||||
final InventoryPlayer ip, final ITerminalHost monitorable, final boolean bindInventory) {
|
||||
protected FCContainerMonitor(final InventoryPlayer ip, final ITerminalHost monitorable,
|
||||
final boolean bindInventory) {
|
||||
super(
|
||||
ip,
|
||||
monitorable instanceof TileEntity ? (TileEntity) monitorable : null,
|
||||
@@ -83,7 +86,8 @@ public abstract class FCContainerMonitor<T extends IAEStack<T>> extends AEBaseCo
|
||||
for (final Object crafter : this.crafters) {
|
||||
try {
|
||||
NetworkHandler.instance.sendTo(
|
||||
new PacketValueConfig(set.name(), sideLocal.name()), (EntityPlayerMP) crafter);
|
||||
new PacketValueConfig(set.name(), sideLocal.name()),
|
||||
(EntityPlayerMP) crafter);
|
||||
} catch (final IOException e) {
|
||||
AELog.debug(e);
|
||||
}
|
||||
@@ -93,8 +97,8 @@ public abstract class FCContainerMonitor<T extends IAEStack<T>> extends AEBaseCo
|
||||
processItemList();
|
||||
this.updatePowerStatus();
|
||||
final boolean oldAccessible = this.canAccessViewCells;
|
||||
this.canAccessViewCells =
|
||||
this.host instanceof WirelessTerminalGuiObject || this.hasAccess(SecurityPermissions.BUILD, false);
|
||||
this.canAccessViewCells = this.host instanceof WirelessTerminalGuiObject
|
||||
|| this.hasAccess(SecurityPermissions.BUILD, false);
|
||||
if (this.canAccessViewCells != oldAccessible) {
|
||||
for (int y = 0; y < 5; y++) {
|
||||
if (this.cellView[y] != null) {
|
||||
@@ -122,8 +126,7 @@ public abstract class FCContainerMonitor<T extends IAEStack<T>> extends AEBaseCo
|
||||
this.setPowered(
|
||||
this.getPowerSource().extractAEPower(1, Actionable.SIMULATE, PowerMultiplier.CONFIG) > 0.8);
|
||||
}
|
||||
} catch (final Throwable ignore) {
|
||||
}
|
||||
} catch (final Throwable ignore) {}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,23 +1,25 @@
|
||||
/*
|
||||
* This file is part of Applied Energistics 2.
|
||||
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
||||
*
|
||||
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Applied Energistics 2 is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
||||
* This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied
|
||||
* Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
|
||||
* Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
|
||||
* later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
|
||||
* Public License for more details. You should have received a copy of the GNU Lesser General Public License along with
|
||||
* Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
||||
*/
|
||||
|
||||
package com.glodblock.github.client.me;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.*;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
@@ -28,17 +30,11 @@ import appeng.client.me.ItemRepo;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.items.storage.ItemViewCell;
|
||||
import appeng.util.prioitylist.IPartitionList;
|
||||
|
||||
import com.glodblock.github.common.item.ItemFluidDrop;
|
||||
import com.glodblock.github.util.FluidSorters;
|
||||
import com.glodblock.github.util.Util;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.regex.Pattern;
|
||||
import javax.annotation.Nonnull;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
|
||||
public class FluidRepo extends ItemRepo {
|
||||
|
||||
@@ -186,8 +182,8 @@ public class FluidRepo extends ItemRepo {
|
||||
private void updateNEI(final String filter) {
|
||||
try {
|
||||
if (this.NEIWord == null || !this.NEIWord.equals(filter)) {
|
||||
final Class c =
|
||||
ReflectionHelper.getClass(this.getClass().getClassLoader(), "codechicken.nei.LayoutManager");
|
||||
final Class c = ReflectionHelper
|
||||
.getClass(this.getClass().getClassLoader(), "codechicken.nei.LayoutManager");
|
||||
final Field fldSearchField = c.getField("searchField");
|
||||
final Object searchField = fldSearchField.get(c);
|
||||
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
package com.glodblock.github.client.render;
|
||||
|
||||
import com.glodblock.github.common.item.ItemFluidDrop;
|
||||
import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.util.RenderUtil;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.ItemRenderer;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
@@ -18,8 +14,16 @@ import net.minecraftforge.client.IItemRenderer;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.glodblock.github.common.item.ItemFluidDrop;
|
||||
import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.util.RenderUtil;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ItemDropRender implements IItemRenderer {
|
||||
|
||||
@@ -91,8 +95,7 @@ public class ItemDropRender implements IItemRenderer {
|
||||
if (colour == 0xFFFFFF) {
|
||||
TextureAtlasSprite sprite;
|
||||
try {
|
||||
sprite = Minecraft.getMinecraft()
|
||||
.getTextureMapBlocks()
|
||||
sprite = Minecraft.getMinecraft().getTextureMapBlocks()
|
||||
.getTextureExtry(fluid.getStillIcon().getIconName());
|
||||
} catch (NullPointerException e) {
|
||||
colourCache.put(fluid.getName(), colour);
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
package com.glodblock.github.client.render;
|
||||
|
||||
import com.glodblock.github.common.item.ItemFluidPacket;
|
||||
import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.util.RenderUtil;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.ItemRenderer;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -13,8 +8,16 @@ import net.minecraftforge.client.IItemRenderer;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.glodblock.github.common.item.ItemFluidPacket;
|
||||
import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.util.RenderUtil;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ItemPacketRender implements IItemRenderer {
|
||||
|
||||
@@ -45,9 +48,7 @@ public class ItemPacketRender implements IItemRenderer {
|
||||
if (fluid != null) {
|
||||
RGB = fluid.getFluid().getColor(fluid);
|
||||
}
|
||||
IIcon icon = fluid == null
|
||||
? FluidRegistry.WATER.getStillIcon()
|
||||
: fluid.getFluid().getStillIcon();
|
||||
IIcon icon = fluid == null ? FluidRegistry.WATER.getStillIcon() : fluid.getFluid().getStillIcon();
|
||||
|
||||
if (RGB != 0xFFFFFF) {
|
||||
GL11.glColor3f((RGB >> 16 & 0xFF) / 255.0F, (RGB >> 8 & 0xFF) / 255.0F, (RGB & 0xFF) / 255.0F);
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
package com.glodblock.github.client.render;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.common.tile.TileWalrus;
|
||||
import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -12,9 +8,16 @@ import net.minecraftforge.client.IItemRenderer;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
import net.minecraftforge.client.model.AdvancedModelLoader;
|
||||
import net.minecraftforge.client.model.IModelCustom;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.common.tile.TileWalrus;
|
||||
import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
|
||||
public class ItemWalrusRender implements IItemRenderer {
|
||||
|
||||
IModelCustom modelWalrus = AdvancedModelLoader.loadModel(FluidCraft.resource("models/walrus.obj"));
|
||||
ResourceLocation textureWalrus = FluidCraft.resource("textures/blocks/walrus.png");
|
||||
|
||||
@@ -54,8 +57,8 @@ public class ItemWalrusRender implements IItemRenderer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(
|
||||
IItemRenderer.ItemRenderType type, ItemStack item, IItemRenderer.ItemRendererHelper helper) {
|
||||
public boolean shouldUseRenderHelper(IItemRenderer.ItemRenderType type, ItemStack item,
|
||||
IItemRenderer.ItemRendererHelper helper) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,5 @@
|
||||
package com.glodblock.github.client.render;
|
||||
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.render.BlockRenderInfo;
|
||||
import com.glodblock.github.common.block.BlockFluidBuffer;
|
||||
import com.glodblock.github.common.tile.TileFluidBuffer;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
@@ -11,8 +7,15 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.render.BlockRenderInfo;
|
||||
|
||||
import com.glodblock.github.common.block.BlockFluidBuffer;
|
||||
import com.glodblock.github.common.tile.TileFluidBuffer;
|
||||
|
||||
public class RenderBlockFluidBuffer extends BaseBlockRender<BlockFluidBuffer, TileFluidBuffer> {
|
||||
|
||||
public RenderBlockFluidBuffer() {
|
||||
@@ -20,13 +23,8 @@ public class RenderBlockFluidBuffer extends BaseBlockRender<BlockFluidBuffer, Ti
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderInWorld(
|
||||
final BlockFluidBuffer block,
|
||||
final IBlockAccess world,
|
||||
final int x,
|
||||
final int y,
|
||||
final int z,
|
||||
final RenderBlocks renderer) {
|
||||
public boolean renderInWorld(final BlockFluidBuffer block, final IBlockAccess world, final int x, final int y,
|
||||
final int z, final RenderBlocks renderer) {
|
||||
final TileFluidBuffer ti = block.getTileEntity(world, x, y, z);
|
||||
final BlockRenderInfo info = block.getRendererInstance();
|
||||
this.renderFluid(ti, x, y, z, renderer);
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
package com.glodblock.github.client.render;
|
||||
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.render.BlockRenderInfo;
|
||||
import appeng.tile.misc.TileInterface;
|
||||
import com.glodblock.github.client.textures.FCPartsTexture;
|
||||
import com.glodblock.github.common.block.BlockFluidInterface;
|
||||
import com.glodblock.github.common.tile.TileFluidInterface;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.render.BlockRenderInfo;
|
||||
import appeng.tile.misc.TileInterface;
|
||||
|
||||
import com.glodblock.github.client.textures.FCPartsTexture;
|
||||
import com.glodblock.github.common.block.BlockFluidInterface;
|
||||
import com.glodblock.github.common.tile.TileFluidInterface;
|
||||
|
||||
public class RenderBlockFluidInterface extends BaseBlockRender<BlockFluidInterface, TileFluidInterface> {
|
||||
|
||||
public RenderBlockFluidInterface() {
|
||||
@@ -18,20 +20,20 @@ public class RenderBlockFluidInterface extends BaseBlockRender<BlockFluidInterfa
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderInWorld(
|
||||
final BlockFluidInterface block,
|
||||
final IBlockAccess world,
|
||||
final int x,
|
||||
final int y,
|
||||
final int z,
|
||||
final RenderBlocks renderer) {
|
||||
public boolean renderInWorld(final BlockFluidInterface block, final IBlockAccess world, final int x, final int y,
|
||||
final int z, final RenderBlocks renderer) {
|
||||
final TileInterface ti = block.getTileEntity(world, x, y, z);
|
||||
final BlockRenderInfo info = block.getRendererInstance();
|
||||
|
||||
if (ti != null && ti.getForward() != ForgeDirection.UNKNOWN) {
|
||||
final IIcon side = FCPartsTexture.BlockFluidInterfaceAlternate_Arrow.getIcon();
|
||||
info.setTemporaryRenderIcons(
|
||||
FCPartsTexture.BlockInterfaceAlternate.getIcon(), block.getIcon(0, 0), side, side, side, side);
|
||||
FCPartsTexture.BlockInterfaceAlternate.getIcon(),
|
||||
block.getIcon(0, 0),
|
||||
side,
|
||||
side,
|
||||
side,
|
||||
side);
|
||||
}
|
||||
|
||||
final boolean fz = super.renderInWorld(block, world, x, y, z, renderer);
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
package com.glodblock.github.client.render;
|
||||
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.render.BlockRenderInfo;
|
||||
import com.glodblock.github.client.textures.FCPartsTexture;
|
||||
import com.glodblock.github.common.block.BlockLevelMaintainer;
|
||||
import com.glodblock.github.common.tile.TileLevelMaintainer;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.render.BlockRenderInfo;
|
||||
|
||||
import com.glodblock.github.client.textures.FCPartsTexture;
|
||||
import com.glodblock.github.common.block.BlockLevelMaintainer;
|
||||
import com.glodblock.github.common.tile.TileLevelMaintainer;
|
||||
|
||||
public class RenderBlockLevelMaintainer extends BaseBlockRender<BlockLevelMaintainer, TileLevelMaintainer> {
|
||||
|
||||
public RenderBlockLevelMaintainer() {
|
||||
@@ -16,13 +18,8 @@ public class RenderBlockLevelMaintainer extends BaseBlockRender<BlockLevelMainta
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderInWorld(
|
||||
final BlockLevelMaintainer block,
|
||||
final IBlockAccess world,
|
||||
final int x,
|
||||
final int y,
|
||||
final int z,
|
||||
final RenderBlocks renderer) {
|
||||
public boolean renderInWorld(final BlockLevelMaintainer block, final IBlockAccess world, final int x, final int y,
|
||||
final int z, final RenderBlocks renderer) {
|
||||
final TileLevelMaintainer ti = block.getTileEntity(world, x, y, z);
|
||||
final BlockRenderInfo info = block.getRendererInstance();
|
||||
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
package com.glodblock.github.client.render;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.model.AdvancedModelLoader;
|
||||
import net.minecraftforge.client.model.IModelCustom;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
|
||||
public class RenderBlockWalrus extends TileEntitySpecialRenderer {
|
||||
|
||||
IModelCustom modelWalrus = AdvancedModelLoader.loadModel(FluidCraft.resource("models/walrus.obj"));
|
||||
ResourceLocation textureWalrus = FluidCraft.resource("textures/blocks/walrus.png");
|
||||
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
package com.glodblock.github.client.textures;
|
||||
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import com.glodblock.github.util.NameConst;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public enum FCPartsTexture {
|
||||
|
||||
PartFluidTerminal_Bright("fluid_terminal_bright"),
|
||||
PartFluidTerminal_Dark("fluid_terminal_dark"),
|
||||
PartFluidTerminal_Colored("fluid_terminal_medium"),
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
package com.glodblock.github.common;
|
||||
|
||||
import cpw.mods.fml.relauncher.FMLInjectionData;
|
||||
import java.io.File;
|
||||
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
|
||||
import cpw.mods.fml.relauncher.FMLInjectionData;
|
||||
|
||||
public class Config {
|
||||
|
||||
private static final Configuration Config =
|
||||
new Configuration(new File(new File((File) FMLInjectionData.data()[6], "config"), "ae2fc.cfg"));
|
||||
private static final Configuration Config = new Configuration(
|
||||
new File(new File((File) FMLInjectionData.data()[6], "config"), "ae2fc.cfg"));
|
||||
|
||||
public static boolean fluidCells;
|
||||
public static boolean noFluidPacket;
|
||||
@@ -38,7 +40,10 @@ public class Config {
|
||||
true,
|
||||
"Enable this to add Fluid Import/Export Bus like EC2's one.");
|
||||
removeRecipe = Config.getBoolean(
|
||||
"Disable all recipes", "Fluid Craft for AE2", false, "Disable all recipes, for quick tweaker.");
|
||||
"Disable all recipes",
|
||||
"Fluid Craft for AE2",
|
||||
false,
|
||||
"Disable all recipes, for quick tweaker.");
|
||||
blacklistEssentiaGas = Config.getBoolean(
|
||||
"Blacklist Essentia Gas",
|
||||
"Fluid Craft for AE2",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.glodblock.github.common.block;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -12,6 +13,6 @@ public abstract class BaseBlockContainer extends BlockContainer {
|
||||
super(p_i45386_1_);
|
||||
}
|
||||
|
||||
public void addInformation(
|
||||
ItemStack itemStack, EntityPlayer player, List<String> toolTip, boolean advancedToolTips) {}
|
||||
public void addInformation(ItemStack itemStack, EntityPlayer player, List<String> toolTip,
|
||||
boolean advancedToolTips) {}
|
||||
}
|
||||
@@ -2,8 +2,18 @@ package com.glodblock.github.common.block;
|
||||
|
||||
import static net.minecraft.client.gui.GuiScreen.isShiftKeyDown;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.util.Platform;
|
||||
|
||||
import com.glodblock.github.client.render.RenderBlockFluidBuffer;
|
||||
import com.glodblock.github.common.item.FCBaseItemBlock;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
@@ -11,16 +21,10 @@ import com.glodblock.github.common.tile.TileFluidBuffer;
|
||||
import com.glodblock.github.crossmod.waila.Tooltip;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import com.glodblock.github.util.Util;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.List;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
public class BlockFluidBuffer extends FCBaseBlock {
|
||||
|
||||
@@ -33,8 +37,8 @@ public class BlockFluidBuffer extends FCBaseBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onActivated(
|
||||
World world, int x, int y, int z, EntityPlayer player, int facing, float hitX, float hitY, float hitZ) {
|
||||
public boolean onActivated(World world, int x, int y, int z, EntityPlayer player, int facing, float hitX,
|
||||
float hitY, float hitZ) {
|
||||
ItemStack itemStack = player.inventory.getCurrentItem();
|
||||
FluidStack fs = Util.getFluidFromItem(itemStack);
|
||||
if (Platform.isServer()) {
|
||||
@@ -43,8 +47,9 @@ public class BlockFluidBuffer extends FCBaseBlock {
|
||||
if (player.isSneaking() && itemStack == null) return !tile.setFluid(null);
|
||||
IAEFluidStack ias = tile.getAEStoreFluidStack();
|
||||
if (fs == null && ias != null) {
|
||||
player.addChatMessage(new ChatComponentText(
|
||||
Tooltip.fluidFormat(ias.getFluid().getLocalizedName(), ias.getStackSize())));
|
||||
player.addChatMessage(
|
||||
new ChatComponentText(
|
||||
Tooltip.fluidFormat(ias.getFluid().getLocalizedName(), ias.getStackSize())));
|
||||
return false;
|
||||
} else {
|
||||
tile.setFluid(fs);
|
||||
@@ -70,10 +75,7 @@ public class BlockFluidBuffer extends FCBaseBlock {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(
|
||||
final ItemStack itemStack,
|
||||
final EntityPlayer player,
|
||||
final List<String> toolTip,
|
||||
public void addInformation(final ItemStack itemStack, final EntityPlayer player, final List<String> toolTip,
|
||||
final boolean advancedToolTips) {
|
||||
if (isShiftKeyDown()) {
|
||||
toolTip.add(NameConst.i18n(NameConst.TT_FLUID_BUFFER_DESC));
|
||||
|
||||
@@ -2,18 +2,21 @@ package com.glodblock.github.common.block;
|
||||
|
||||
import static net.minecraft.client.gui.GuiScreen.isShiftKeyDown;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import com.glodblock.github.common.item.FCBaseItemBlock;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.common.tile.TileFluidDiscretizer;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import com.glodblock.github.util.RenderUtil;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.List;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class BlockFluidDiscretizer extends FCBaseBlock {
|
||||
|
||||
@@ -34,10 +37,7 @@ public class BlockFluidDiscretizer extends FCBaseBlock {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(
|
||||
final ItemStack itemStack,
|
||||
final EntityPlayer player,
|
||||
final List<String> toolTip,
|
||||
public void addInformation(final ItemStack itemStack, final EntityPlayer player, final List<String> toolTip,
|
||||
final boolean advancedToolTips) {
|
||||
|
||||
if (isShiftKeyDown()) {
|
||||
|
||||
@@ -1,10 +1,18 @@
|
||||
package com.glodblock.github.common.block;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.api.util.IOrientable;
|
||||
import appeng.block.AEBaseItemBlock;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.tile.misc.TileInterface;
|
||||
import appeng.util.Platform;
|
||||
|
||||
import com.glodblock.github.client.render.RenderBlockFluidInterface;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.common.tile.TileFluidInterface;
|
||||
@@ -12,14 +20,10 @@ import com.glodblock.github.inventory.InventoryHandler;
|
||||
import com.glodblock.github.inventory.gui.GuiType;
|
||||
import com.glodblock.github.util.BlockPos;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.EnumSet;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockFluidInterface extends FCBaseBlock {
|
||||
|
||||
@@ -38,16 +42,8 @@ public class BlockFluidInterface extends FCBaseBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onActivated(
|
||||
final World world,
|
||||
final int x,
|
||||
final int y,
|
||||
final int z,
|
||||
final EntityPlayer player,
|
||||
final int facing,
|
||||
final float hitX,
|
||||
final float hitY,
|
||||
final float hitZ) {
|
||||
public boolean onActivated(final World world, final int x, final int y, final int z, final EntityPlayer player,
|
||||
final int facing, final float hitX, final float hitY, final float hitZ) {
|
||||
if (player.isSneaking()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,14 @@ package com.glodblock.github.common.block;
|
||||
|
||||
import static net.minecraft.client.gui.GuiScreen.isShiftKeyDown;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.glodblock.github.common.item.FCBaseItemBlock;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.common.tile.TileFluidPacketDecoder;
|
||||
@@ -10,15 +18,10 @@ import com.glodblock.github.inventory.gui.GuiType;
|
||||
import com.glodblock.github.util.BlockPos;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import com.glodblock.github.util.RenderUtil;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.List;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockFluidPacketDecoder extends FCBaseBlock {
|
||||
|
||||
@@ -30,8 +33,8 @@ public class BlockFluidPacketDecoder extends FCBaseBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onActivated(
|
||||
World world, int x, int y, int z, EntityPlayer player, int facing, float hitX, float hitY, float hitZ) {
|
||||
public boolean onActivated(World world, int x, int y, int z, EntityPlayer player, int facing, float hitX,
|
||||
float hitY, float hitZ) {
|
||||
if (player.isSneaking()) {
|
||||
return false;
|
||||
}
|
||||
@@ -60,10 +63,7 @@ public class BlockFluidPacketDecoder extends FCBaseBlock {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(
|
||||
final ItemStack itemStack,
|
||||
final EntityPlayer player,
|
||||
final List<String> toolTip,
|
||||
public void addInformation(final ItemStack itemStack, final EntityPlayer player, final List<String> toolTip,
|
||||
final boolean advancedToolTips) {
|
||||
if (isShiftKeyDown()) {
|
||||
toolTip.addAll(
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
package com.glodblock.github.common.block;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.block.AEBaseItemBlock;
|
||||
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.common.tile.TileFluidPatternEncoder;
|
||||
import com.glodblock.github.inventory.InventoryHandler;
|
||||
@@ -8,10 +14,6 @@ import com.glodblock.github.inventory.gui.GuiType;
|
||||
import com.glodblock.github.util.BlockPos;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockFluidPatternEncoder extends FCBaseBlock {
|
||||
|
||||
@@ -23,8 +25,8 @@ public class BlockFluidPatternEncoder extends FCBaseBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onActivated(
|
||||
World world, int x, int y, int z, EntityPlayer player, int facing, float hitX, float hitY, float hitZ) {
|
||||
public boolean onActivated(World world, int x, int y, int z, EntityPlayer player, int facing, float hitX,
|
||||
float hitY, float hitZ) {
|
||||
if (player.isSneaking()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
package com.glodblock.github.common.block;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.block.AEBaseItemBlock;
|
||||
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.common.tile.TileIngredientBuffer;
|
||||
import com.glodblock.github.inventory.InventoryHandler;
|
||||
@@ -8,10 +14,6 @@ import com.glodblock.github.inventory.gui.GuiType;
|
||||
import com.glodblock.github.util.BlockPos;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockIngredientBuffer extends FCBaseBlock {
|
||||
|
||||
@@ -24,8 +26,8 @@ public class BlockIngredientBuffer extends FCBaseBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onActivated(
|
||||
World world, int x, int y, int z, EntityPlayer player, int facing, float hitX, float hitY, float hitZ) {
|
||||
public boolean onActivated(World world, int x, int y, int z, EntityPlayer player, int facing, float hitX,
|
||||
float hitY, float hitZ) {
|
||||
if (player.isSneaking()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
package com.glodblock.github.common.block;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.block.AEBaseItemBlock;
|
||||
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.common.tile.TileLargeIngredientBuffer;
|
||||
import com.glodblock.github.inventory.InventoryHandler;
|
||||
@@ -8,10 +14,6 @@ import com.glodblock.github.inventory.gui.GuiType;
|
||||
import com.glodblock.github.util.BlockPos;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockLargeIngredientBuffer extends FCBaseBlock {
|
||||
|
||||
@@ -24,8 +26,8 @@ public class BlockLargeIngredientBuffer extends FCBaseBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onActivated(
|
||||
World world, int x, int y, int z, EntityPlayer player, int facing, float hitX, float hitY, float hitZ) {
|
||||
public boolean onActivated(World world, int x, int y, int z, EntityPlayer player, int facing, float hitX,
|
||||
float hitY, float hitZ) {
|
||||
if (player.isSneaking()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -3,8 +3,18 @@ package com.glodblock.github.common.block;
|
||||
import static net.minecraft.client.gui.GuiScreen.isCtrlKeyDown;
|
||||
import static net.minecraft.client.gui.GuiScreen.isShiftKeyDown;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
import appeng.util.Platform;
|
||||
|
||||
import com.glodblock.github.client.render.RenderBlockLevelMaintainer;
|
||||
import com.glodblock.github.common.item.FCBaseItemBlock;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
@@ -15,16 +25,10 @@ import com.glodblock.github.util.BlockPos;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import com.glodblock.github.util.RenderUtil;
|
||||
import com.glodblock.github.util.Util;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.List;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockLevelMaintainer extends FCBaseBlock {
|
||||
|
||||
@@ -50,8 +54,8 @@ public class BlockLevelMaintainer extends FCBaseBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onActivated(
|
||||
World world, int x, int y, int z, EntityPlayer player, int facing, float hitX, float hitY, float hitZ) {
|
||||
public boolean onActivated(World world, int x, int y, int z, EntityPlayer player, int facing, float hitX,
|
||||
float hitY, float hitZ) {
|
||||
if (player.isSneaking()) {
|
||||
return false;
|
||||
}
|
||||
@@ -76,10 +80,7 @@ public class BlockLevelMaintainer extends FCBaseBlock {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(
|
||||
final ItemStack itemStack,
|
||||
final EntityPlayer player,
|
||||
final List<String> toolTip,
|
||||
public void addInformation(final ItemStack itemStack, final EntityPlayer player, final List<String> toolTip,
|
||||
final boolean advancedToolTips) {
|
||||
if (isShiftKeyDown() && isCtrlKeyDown()) {
|
||||
toolTip.add(NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_WHO_AM_I));
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
package com.glodblock.github.common.block;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.block.AEBaseItemBlock;
|
||||
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.common.tile.TileOCPatternEditor;
|
||||
import com.glodblock.github.inventory.InventoryHandler;
|
||||
@@ -9,10 +15,6 @@ import com.glodblock.github.util.BlockPos;
|
||||
import com.glodblock.github.util.ModAndClassUtil;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockOCPatternEditor extends FCBaseBlock {
|
||||
|
||||
@@ -24,8 +26,8 @@ public class BlockOCPatternEditor extends FCBaseBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onActivated(
|
||||
World world, int x, int y, int z, EntityPlayer player, int facing, float hitX, float hitY, float hitZ) {
|
||||
public boolean onActivated(World world, int x, int y, int z, EntityPlayer player, int facing, float hitX,
|
||||
float hitY, float hitZ) {
|
||||
if (player.isSneaking()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2,14 +2,8 @@ package com.glodblock.github.common.block;
|
||||
|
||||
import static net.minecraft.client.gui.GuiScreen.isShiftKeyDown;
|
||||
|
||||
import com.glodblock.github.common.item.BaseItemBlockContainer;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.common.tile.TileWalrus;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -20,6 +14,15 @@ import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.glodblock.github.common.item.BaseItemBlockContainer;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.common.tile.TileWalrus;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockWalrus extends BaseBlockContainer {
|
||||
|
||||
public BlockWalrus() {
|
||||
@@ -100,10 +103,7 @@ public class BlockWalrus extends BaseBlockContainer {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(
|
||||
final ItemStack itemStack,
|
||||
final EntityPlayer player,
|
||||
final List<String> toolTip,
|
||||
public void addInformation(final ItemStack itemStack, final EntityPlayer player, final List<String> toolTip,
|
||||
final boolean advancedToolTips) {
|
||||
|
||||
if (isShiftKeyDown()) {
|
||||
|
||||
@@ -1,18 +1,22 @@
|
||||
package com.glodblock.github.common.block;
|
||||
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.core.features.AEFeature;
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.loader.IRegister;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.core.features.AEFeature;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.loader.IRegister;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public abstract class FCBaseBlock extends AEBaseTileBlock implements IRegister<FCBaseBlock> {
|
||||
|
||||
public FCBaseBlock(Material mat, String name) {
|
||||
@@ -40,14 +44,11 @@ public abstract class FCBaseBlock extends AEBaseTileBlock implements IRegister<F
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(
|
||||
final ItemStack itemStack,
|
||||
final EntityPlayer player,
|
||||
final List<String> toolTip,
|
||||
public void addInformation(final ItemStack itemStack, final EntityPlayer player, final List<String> toolTip,
|
||||
final boolean advancedToolTips) {}
|
||||
|
||||
public void addCheckedInformation(
|
||||
ItemStack itemStack, EntityPlayer player, List<String> toolTip, boolean advancedToolTips) {
|
||||
public void addCheckedInformation(ItemStack itemStack, EntityPlayer player, List<String> toolTip,
|
||||
boolean advancedToolTips) {
|
||||
this.addInformation(itemStack, player, toolTip, advancedToolTips);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
package com.glodblock.github.common.item;
|
||||
|
||||
import com.glodblock.github.common.block.BaseBlockContainer;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import com.glodblock.github.common.block.BaseBlockContainer;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BaseItemBlockContainer extends ItemBlock {
|
||||
|
||||
private final BaseBlockContainer blockType;
|
||||
|
||||
public BaseItemBlockContainer(Block id) {
|
||||
@@ -20,8 +24,8 @@ public class BaseItemBlockContainer extends ItemBlock {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings("unchecked")
|
||||
public void addInformation(
|
||||
final ItemStack itemStack, final EntityPlayer player, final List toolTip, final boolean advancedToolTips) {
|
||||
public void addInformation(final ItemStack itemStack, final EntityPlayer player, final List toolTip,
|
||||
final boolean advancedToolTips) {
|
||||
blockType.addInformation(itemStack, player, toolTip, advancedToolTips);
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,10 @@
|
||||
package com.glodblock.github.common.item;
|
||||
|
||||
import com.glodblock.github.loader.IRegister;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import com.glodblock.github.loader.IRegister;
|
||||
|
||||
public abstract class FCBaseItem extends Item implements IRegister<FCBaseItem> {
|
||||
|
||||
public ItemStack stack(int size, int meta) {
|
||||
|
||||
@@ -1,15 +1,20 @@
|
||||
package com.glodblock.github.common.item;
|
||||
|
||||
import appeng.block.AEBaseItemBlock;
|
||||
import com.glodblock.github.common.block.FCBaseBlock;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.block.AEBaseItemBlock;
|
||||
|
||||
import com.glodblock.github.common.block.FCBaseBlock;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class FCBaseItemBlock extends AEBaseItemBlock {
|
||||
|
||||
private final FCBaseBlock blockType;
|
||||
|
||||
public FCBaseItemBlock(Block id) {
|
||||
@@ -18,10 +23,7 @@ public class FCBaseItemBlock extends AEBaseItemBlock {
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addCheckedInformation(
|
||||
final ItemStack itemStack,
|
||||
final EntityPlayer player,
|
||||
final List<String> toolTip,
|
||||
public void addCheckedInformation(final ItemStack itemStack, final EntityPlayer player, final List<String> toolTip,
|
||||
final boolean advancedToolTips) {
|
||||
blockType.addCheckedInformation(itemStack, player, toolTip, advancedToolTips);
|
||||
super.addCheckedInformation(itemStack, player, toolTip, advancedToolTips);
|
||||
|
||||
@@ -1,5 +1,22 @@
|
||||
package com.glodblock.github.common.item;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.event.ForgeEventFactory;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.config.IncludeExclude;
|
||||
@@ -18,6 +35,7 @@ import appeng.items.contents.CellUpgrades;
|
||||
import appeng.util.InventoryAdaptor;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.ReadableNumberConverter;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.common.Config;
|
||||
import com.glodblock.github.common.storage.CellType;
|
||||
@@ -29,27 +47,14 @@ import com.glodblock.github.loader.IRegister;
|
||||
import com.glodblock.github.util.ModAndClassUtil;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.event.ForgeEventFactory;
|
||||
|
||||
public class ItemBasicFluidStorageCell extends AEBaseItem
|
||||
implements IStorageFluidCell, IRegister<ItemBasicFluidStorageCell> {
|
||||
|
||||
private final CellType component;
|
||||
private final int totalBytes;
|
||||
private final int perType;
|
||||
@@ -122,8 +127,8 @@ public class ItemBasicFluidStorageCell extends AEBaseItem
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
icon.put(
|
||||
this.totalBytes / 1024,
|
||||
iconRegister.registerIcon(
|
||||
NameConst.RES_KEY + NameConst.ITEM_FLUID_STORAGE + "." + this.totalBytes / 1024));
|
||||
iconRegister
|
||||
.registerIcon(NameConst.RES_KEY + NameConst.ITEM_FLUID_STORAGE + "." + this.totalBytes / 1024));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -134,34 +139,49 @@ public class ItemBasicFluidStorageCell extends AEBaseItem
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCheckedInformation(
|
||||
final ItemStack stack, final EntityPlayer player, final List<String> lines, final boolean displayMoreInfo) {
|
||||
final IMEInventoryHandler<?> inventory =
|
||||
AEApi.instance().registries().cell().getCellInventory(stack, null, StorageChannel.FLUIDS);
|
||||
public void addCheckedInformation(final ItemStack stack, final EntityPlayer player, final List<String> lines,
|
||||
final boolean displayMoreInfo) {
|
||||
final IMEInventoryHandler<?> inventory = AEApi.instance().registries().cell()
|
||||
.getCellInventory(stack, null, StorageChannel.FLUIDS);
|
||||
|
||||
if (inventory instanceof IFluidCellInventoryHandler) {
|
||||
final IFluidCellInventoryHandler handler = (IFluidCellInventoryHandler) inventory;
|
||||
final IFluidCellInventory cellInventory = handler.getCellInv();
|
||||
|
||||
if (cellInventory != null) {
|
||||
lines.add(EnumChatFormatting.WHITE + String.valueOf(cellInventory.getUsedBytes())
|
||||
+ EnumChatFormatting.GRAY + " " + GuiText.Of.getLocal() + " "
|
||||
+ EnumChatFormatting.DARK_GREEN + cellInventory.getTotalBytes() + " "
|
||||
+ EnumChatFormatting.GRAY + GuiText.BytesUsed.getLocal());
|
||||
lines.add(EnumChatFormatting.WHITE + String.valueOf(cellInventory.getStoredFluidTypes())
|
||||
+ EnumChatFormatting.GRAY + " " + GuiText.Of.getLocal() + " "
|
||||
+ EnumChatFormatting.DARK_GREEN + cellInventory.getTotalFluidTypes() + " "
|
||||
+ EnumChatFormatting.GRAY + GuiText.Types.getLocal());
|
||||
lines.add(
|
||||
EnumChatFormatting.WHITE + String.valueOf(cellInventory.getUsedBytes())
|
||||
+ EnumChatFormatting.GRAY
|
||||
+ " "
|
||||
+ GuiText.Of.getLocal()
|
||||
+ " "
|
||||
+ EnumChatFormatting.DARK_GREEN
|
||||
+ cellInventory.getTotalBytes()
|
||||
+ " "
|
||||
+ EnumChatFormatting.GRAY
|
||||
+ GuiText.BytesUsed.getLocal());
|
||||
lines.add(
|
||||
EnumChatFormatting.WHITE + String.valueOf(cellInventory.getStoredFluidTypes())
|
||||
+ EnumChatFormatting.GRAY
|
||||
+ " "
|
||||
+ GuiText.Of.getLocal()
|
||||
+ " "
|
||||
+ EnumChatFormatting.DARK_GREEN
|
||||
+ cellInventory.getTotalFluidTypes()
|
||||
+ " "
|
||||
+ EnumChatFormatting.GRAY
|
||||
+ GuiText.Types.getLocal());
|
||||
|
||||
if (GuiScreen.isCtrlKeyDown()) {
|
||||
if (cellInventory.getStoredFluidTypes() > 0) {
|
||||
lines.add(StatCollector.translateToLocal(NameConst.TT_CELL_CONTENTS));
|
||||
for (IAEFluidStack fluid : cellInventory.getContents()) {
|
||||
if (fluid != null) {
|
||||
lines.add(String.format(
|
||||
" %s x%s mB",
|
||||
fluid.getFluidStack().getLocalizedName(),
|
||||
format.toWideReadableForm(fluid.getStackSize())));
|
||||
lines.add(
|
||||
String.format(
|
||||
" %s x%s mB",
|
||||
fluid.getFluidStack().getLocalizedName(),
|
||||
format.toWideReadableForm(fluid.getStackSize())));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -172,17 +192,14 @@ public class ItemBasicFluidStorageCell extends AEBaseItem
|
||||
}
|
||||
|
||||
if (handler.isPreformatted()) {
|
||||
final String list = (handler.getIncludeExcludeMode() == IncludeExclude.WHITELIST
|
||||
? GuiText.Included
|
||||
: GuiText.Excluded)
|
||||
.getLocal();
|
||||
final String list = (handler.getIncludeExcludeMode() == IncludeExclude.WHITELIST ? GuiText.Included
|
||||
: GuiText.Excluded).getLocal();
|
||||
lines.add(GuiText.Partitioned.getLocal() + " - " + list + ' ' + GuiText.Precise.getLocal());
|
||||
|
||||
if (GuiScreen.isShiftKeyDown()) {
|
||||
lines.add(GuiText.Filter.getLocal() + ": ");
|
||||
for (IAEFluidStack aeFluidStack : handler.getPartitionInv()) {
|
||||
if (aeFluidStack != null)
|
||||
lines.add(" " + aeFluidStack.getFluidStack().getLocalizedName());
|
||||
if (aeFluidStack != null) lines.add(" " + aeFluidStack.getFluidStack().getLocalizedName());
|
||||
}
|
||||
} else {
|
||||
lines.add(StatCollector.translateToLocal(NameConst.TT_SHIFT_FOR_MORE));
|
||||
@@ -273,8 +290,8 @@ public class ItemBasicFluidStorageCell extends AEBaseItem
|
||||
return false;
|
||||
}
|
||||
final InventoryPlayer playerInventory = player.inventory;
|
||||
final IMEInventoryHandler<?> inv =
|
||||
AEApi.instance().registries().cell().getCellInventory(stack, null, StorageChannel.FLUIDS);
|
||||
final IMEInventoryHandler<?> inv = AEApi.instance().registries().cell()
|
||||
.getCellInventory(stack, null, StorageChannel.FLUIDS);
|
||||
if (inv != null && playerInventory.getCurrentItem() == stack) {
|
||||
final InventoryAdaptor ia = InventoryAdaptor.getAdaptor(player, ForgeDirection.UNKNOWN);
|
||||
final IItemList<IAEFluidStack> list = inv.getAvailableItems(StorageChannel.FLUIDS.createList());
|
||||
@@ -298,12 +315,8 @@ public class ItemBasicFluidStorageCell extends AEBaseItem
|
||||
}
|
||||
|
||||
// drop empty storage cell case
|
||||
for (final ItemStack storageCellStack : AEApi.instance()
|
||||
.definitions()
|
||||
.materials()
|
||||
.emptyStorageCell()
|
||||
.maybeStack(1)
|
||||
.asSet()) {
|
||||
for (final ItemStack storageCellStack : AEApi.instance().definitions().materials()
|
||||
.emptyStorageCell().maybeStack(1).asSet()) {
|
||||
final ItemStack extraA = ia.addItems(storageCellStack);
|
||||
if (extraA != null) {
|
||||
player.dropPlayerItemWithRandomChoice(extraA, false);
|
||||
@@ -320,28 +333,15 @@ public class ItemBasicFluidStorageCell extends AEBaseItem
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUseFirst(
|
||||
final ItemStack stack,
|
||||
final EntityPlayer player,
|
||||
final World world,
|
||||
final int x,
|
||||
final int y,
|
||||
final int z,
|
||||
final int side,
|
||||
final float hitX,
|
||||
final float hitY,
|
||||
final float hitZ) {
|
||||
public boolean onItemUseFirst(final ItemStack stack, final EntityPlayer player, final World world, final int x,
|
||||
final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ) {
|
||||
if (ForgeEventFactory.onItemUseStart(player, stack, 1) <= 0) return true;
|
||||
return this.disassembleDrive(stack, world, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getContainerItem(final ItemStack itemStack) {
|
||||
for (final ItemStack stack : AEApi.instance()
|
||||
.definitions()
|
||||
.materials()
|
||||
.emptyStorageCell()
|
||||
.maybeStack(1)
|
||||
for (final ItemStack stack : AEApi.instance().definitions().materials().emptyStorageCell().maybeStack(1)
|
||||
.asSet()) {
|
||||
return stack;
|
||||
}
|
||||
|
||||
@@ -1,15 +1,8 @@
|
||||
package com.glodblock.github.common.item;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.common.Config;
|
||||
import com.glodblock.github.common.storage.CellType;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -18,6 +11,16 @@ import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.common.Config;
|
||||
import com.glodblock.github.common.storage.CellType;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemBasicFluidStoragePart extends FCBaseItem {
|
||||
|
||||
public static final int types = 8;
|
||||
@@ -42,7 +45,9 @@ public class ItemBasicFluidStoragePart extends FCBaseItem {
|
||||
public String getItemStackDisplayName(ItemStack stack) {
|
||||
int meta = stack.getItemDamage();
|
||||
return StatCollector.translateToLocalFormatted(
|
||||
"item.fluid_part." + meta + ".name", CellType.getTypeColor(meta), EnumChatFormatting.RESET);
|
||||
"item.fluid_part." + meta + ".name",
|
||||
CellType.getTypeColor(meta),
|
||||
EnumChatFormatting.RESET);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,19 +1,22 @@
|
||||
package com.glodblock.github.common.item;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.parts.IPartItem;
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.common.parts.PartFluidConversionMonitor;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.parts.IPartItem;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.common.parts.PartFluidConversionMonitor;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemFluidConversionMonitor extends FCBaseItem implements IPartItem {
|
||||
|
||||
public ItemFluidConversionMonitor() {
|
||||
@@ -23,17 +26,8 @@ public class ItemFluidConversionMonitor extends FCBaseItem implements IPartItem
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(
|
||||
ItemStack stack,
|
||||
EntityPlayer player,
|
||||
World world,
|
||||
int x,
|
||||
int y,
|
||||
int z,
|
||||
int side,
|
||||
float xOffset,
|
||||
float yOffset,
|
||||
float zOffset) {
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
|
||||
float xOffset, float yOffset, float zOffset) {
|
||||
return AEApi.instance().partHelper().placeBus(player.getHeldItem(), x, y, z, side, player, world);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +1,10 @@
|
||||
package com.glodblock.github.common.item;
|
||||
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.util.item.AEFluidStack;
|
||||
import appeng.util.item.AEItemStack;
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -27,6 +19,19 @@ import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.util.item.AEFluidStack;
|
||||
import appeng.util.item.AEItemStack;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemFluidDrop extends FCBaseItem {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -48,8 +53,8 @@ public class ItemFluidDrop extends FCBaseItem {
|
||||
if (ItemFluidPacket.isDisplay(stack)) {
|
||||
return fluid != null ? fluid.getLocalizedName() : StatCollector.translateToLocalFormatted("error.unknown");
|
||||
}
|
||||
return StatCollector.translateToLocalFormatted(
|
||||
"item.fluid_drop.name", fluid == null ? "???" : fluid.getLocalizedName());
|
||||
return StatCollector
|
||||
.translateToLocalFormatted("item.fluid_drop.name", fluid == null ? "???" : fluid.getLocalizedName());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
package com.glodblock.github.common.item;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.networking.crafting.ICraftingPatternDetails;
|
||||
import appeng.items.misc.ItemEncodedPattern;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.loader.IRegister;
|
||||
import com.glodblock.github.util.FluidPatternDetails;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemFluidEncodedPattern extends ItemEncodedPattern implements IRegister<ItemFluidEncodedPattern> {
|
||||
|
||||
|
||||
@@ -1,20 +1,24 @@
|
||||
package com.glodblock.github.common.item;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.parts.IPartItem;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.common.Config;
|
||||
import com.glodblock.github.common.parts.PartFluidExportBus;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import javax.annotation.Nullable;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemFluidExportBus extends FCBaseItem implements IPartItem {
|
||||
|
||||
@@ -31,17 +35,8 @@ public class ItemFluidExportBus extends FCBaseItem implements IPartItem {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(
|
||||
ItemStack stack,
|
||||
EntityPlayer player,
|
||||
World world,
|
||||
int x,
|
||||
int y,
|
||||
int z,
|
||||
int side,
|
||||
float xOffset,
|
||||
float yOffset,
|
||||
float zOffset) {
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
|
||||
float xOffset, float yOffset, float zOffset) {
|
||||
return AEApi.instance().partHelper().placeBus(player.getHeldItem(), x, y, z, side, player, world);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,20 +1,24 @@
|
||||
package com.glodblock.github.common.item;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.parts.IPartItem;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.common.Config;
|
||||
import com.glodblock.github.common.parts.PartFluidImportBus;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import javax.annotation.Nullable;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemFluidImportBus extends FCBaseItem implements IPartItem {
|
||||
|
||||
@@ -31,17 +35,8 @@ public class ItemFluidImportBus extends FCBaseItem implements IPartItem {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(
|
||||
ItemStack stack,
|
||||
EntityPlayer player,
|
||||
World world,
|
||||
int x,
|
||||
int y,
|
||||
int z,
|
||||
int side,
|
||||
float xOffset,
|
||||
float yOffset,
|
||||
float zOffset) {
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
|
||||
float xOffset, float yOffset, float zOffset) {
|
||||
return AEApi.instance().partHelper().placeBus(player.getHeldItem(), x, y, z, side, player, world);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,21 +1,25 @@
|
||||
package com.glodblock.github.common.item;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.parts.IPart;
|
||||
import appeng.api.parts.IPartItem;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.client.textures.FCPartsTexture;
|
||||
import com.glodblock.github.common.parts.PartFluidLevelEmitter;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class ItemFluidLevelEmitter extends FCBaseItem implements IPartItem {
|
||||
|
||||
@@ -32,17 +36,8 @@ public class ItemFluidLevelEmitter extends FCBaseItem implements IPartItem {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(
|
||||
ItemStack stack,
|
||||
EntityPlayer player,
|
||||
World world,
|
||||
int x,
|
||||
int y,
|
||||
int z,
|
||||
int side,
|
||||
float xOffset,
|
||||
float yOffset,
|
||||
float zOffset) {
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
|
||||
float xOffset, float yOffset, float zOffset) {
|
||||
return AEApi.instance().partHelper().placeBus(player.getHeldItem(), x, y, z, side, player, world);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,17 +1,10 @@
|
||||
package com.glodblock.github.common.item;
|
||||
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.util.item.AEItemStack;
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -23,6 +16,18 @@ import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.util.item.AEItemStack;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemFluidPacket extends FCBaseItem {
|
||||
|
||||
public ItemFluidPacket() {
|
||||
@@ -34,8 +39,8 @@ public class ItemFluidPacket extends FCBaseItem {
|
||||
if (stack == null || !stack.hasTagCompound()) {
|
||||
return null;
|
||||
}
|
||||
FluidStack fluid = FluidStack.loadFluidStackFromNBT(
|
||||
Objects.requireNonNull(stack.getTagCompound()).getCompoundTag("FluidStack"));
|
||||
FluidStack fluid = FluidStack
|
||||
.loadFluidStackFromNBT(Objects.requireNonNull(stack.getTagCompound()).getCompoundTag("FluidStack"));
|
||||
return (fluid != null && fluid.amount > 0) ? fluid : null;
|
||||
}
|
||||
|
||||
@@ -46,8 +51,7 @@ public class ItemFluidPacket extends FCBaseItem {
|
||||
if (display) {
|
||||
return fluid != null ? fluid.getLocalizedName() : super.getItemStackDisplayName(stack);
|
||||
}
|
||||
return fluid != null
|
||||
? String.format("%s, %,d mB", fluid.getLocalizedName(), fluid.amount)
|
||||
return fluid != null ? String.format("%s, %,d mB", fluid.getLocalizedName(), fluid.amount)
|
||||
: super.getItemStackDisplayName(stack);
|
||||
}
|
||||
|
||||
@@ -65,8 +69,7 @@ public class ItemFluidPacket extends FCBaseItem {
|
||||
boolean display = isDisplay(stack);
|
||||
if (display) return;
|
||||
if (fluid != null) {
|
||||
for (String line : StatCollector.translateToLocalFormatted(NameConst.TT_FLUID_PACKET)
|
||||
.split("\\\\n")) {
|
||||
for (String line : StatCollector.translateToLocalFormatted(NameConst.TT_FLUID_PACKET).split("\\\\n")) {
|
||||
tooltip.add(EnumChatFormatting.GRAY + line);
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -1,19 +1,22 @@
|
||||
package com.glodblock.github.common.item;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.parts.IPartItem;
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.common.parts.PartFluidStorageMonitor;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.parts.IPartItem;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.common.parts.PartFluidStorageMonitor;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemFluidStorageMonitor extends FCBaseItem implements IPartItem {
|
||||
|
||||
public ItemFluidStorageMonitor() {
|
||||
@@ -23,17 +26,8 @@ public class ItemFluidStorageMonitor extends FCBaseItem implements IPartItem {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(
|
||||
ItemStack stack,
|
||||
EntityPlayer player,
|
||||
World world,
|
||||
int x,
|
||||
int y,
|
||||
int z,
|
||||
int side,
|
||||
float xOffset,
|
||||
float yOffset,
|
||||
float zOffset) {
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
|
||||
float xOffset, float yOffset, float zOffset) {
|
||||
return AEApi.instance().partHelper().placeBus(player.getHeldItem(), x, y, z, side, player, world);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,20 +1,24 @@
|
||||
package com.glodblock.github.common.item;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.parts.IPartItem;
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.common.parts.PartFluidInterface;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.parts.IPartItem;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.common.parts.PartFluidInterface;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemPartFluidInterface extends FCBaseItem implements IPartItem {
|
||||
|
||||
public ItemPartFluidInterface() {
|
||||
@@ -30,17 +34,8 @@ public class ItemPartFluidInterface extends FCBaseItem implements IPartItem {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(
|
||||
ItemStack stack,
|
||||
EntityPlayer player,
|
||||
World world,
|
||||
int x,
|
||||
int y,
|
||||
int z,
|
||||
int side,
|
||||
float xOffset,
|
||||
float yOffset,
|
||||
float zOffset) {
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
|
||||
float xOffset, float yOffset, float zOffset) {
|
||||
return AEApi.instance().partHelper().placeBus(player.getHeldItem(), x, y, z, side, player, world);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,20 +1,24 @@
|
||||
package com.glodblock.github.common.item;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.parts.IPartItem;
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.common.parts.PartFluidPatternTerminal;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.parts.IPartItem;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.common.parts.PartFluidPatternTerminal;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemPartFluidPatternTerminal extends FCBaseItem implements IPartItem {
|
||||
|
||||
public ItemPartFluidPatternTerminal() {
|
||||
@@ -30,17 +34,8 @@ public class ItemPartFluidPatternTerminal extends FCBaseItem implements IPartIte
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(
|
||||
ItemStack stack,
|
||||
EntityPlayer player,
|
||||
World world,
|
||||
int x,
|
||||
int y,
|
||||
int z,
|
||||
int side,
|
||||
float xOffset,
|
||||
float yOffset,
|
||||
float zOffset) {
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
|
||||
float xOffset, float yOffset, float zOffset) {
|
||||
return AEApi.instance().partHelper().placeBus(player.getHeldItem(), x, y, z, side, player, world);
|
||||
}
|
||||
|
||||
|
||||
+15
-20
@@ -1,20 +1,24 @@
|
||||
package com.glodblock.github.common.item;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.parts.IPartItem;
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.common.parts.PartFluidPatternTerminalEx;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.parts.IPartItem;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.common.parts.PartFluidPatternTerminalEx;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemPartFluidPatternTerminalEx extends FCBaseItem implements IPartItem {
|
||||
|
||||
public ItemPartFluidPatternTerminalEx() {
|
||||
@@ -30,17 +34,8 @@ public class ItemPartFluidPatternTerminalEx extends FCBaseItem implements IPartI
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(
|
||||
ItemStack stack,
|
||||
EntityPlayer player,
|
||||
World world,
|
||||
int x,
|
||||
int y,
|
||||
int z,
|
||||
int side,
|
||||
float xOffset,
|
||||
float yOffset,
|
||||
float zOffset) {
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
|
||||
float xOffset, float yOffset, float zOffset) {
|
||||
return AEApi.instance().partHelper().placeBus(player.getHeldItem(), x, y, z, side, player, world);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,20 +1,24 @@
|
||||
package com.glodblock.github.common.item;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.parts.IPartItem;
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.common.parts.PartFluidStorageBus;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.parts.IPartItem;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.common.parts.PartFluidStorageBus;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemPartFluidStorageBus extends FCBaseItem implements IPartItem {
|
||||
|
||||
public ItemPartFluidStorageBus() {
|
||||
@@ -30,17 +34,8 @@ public class ItemPartFluidStorageBus extends FCBaseItem implements IPartItem {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(
|
||||
ItemStack stack,
|
||||
EntityPlayer player,
|
||||
World world,
|
||||
int x,
|
||||
int y,
|
||||
int z,
|
||||
int side,
|
||||
float xOffset,
|
||||
float yOffset,
|
||||
float zOffset) {
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
|
||||
float xOffset, float yOffset, float zOffset) {
|
||||
return AEApi.instance().partHelper().placeBus(player.getHeldItem(), x, y, z, side, player, world);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,24 +2,30 @@ package com.glodblock.github.common.item;
|
||||
|
||||
import static net.minecraft.client.gui.GuiScreen.isShiftKeyDown;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.parts.IPartItem;
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.common.parts.PartFluidTerminal;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.parts.IPartItem;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.common.parts.PartFluidTerminal;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemPartFluidTerminal extends FCBaseItem implements IPartItem {
|
||||
|
||||
public ItemPartFluidTerminal() {
|
||||
this.setMaxStackSize(64);
|
||||
this.setUnlocalizedName(NameConst.ITEM_PART_FLUID_TERMINAL);
|
||||
@@ -33,17 +39,8 @@ public class ItemPartFluidTerminal extends FCBaseItem implements IPartItem {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(
|
||||
ItemStack stack,
|
||||
EntityPlayer player,
|
||||
World world,
|
||||
int x,
|
||||
int y,
|
||||
int z,
|
||||
int side,
|
||||
float xOffset,
|
||||
float yOffset,
|
||||
float zOffset) {
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
|
||||
float xOffset, float yOffset, float zOffset) {
|
||||
return AEApi.instance().partHelper().placeBus(player.getHeldItem(), x, y, z, side, player, world);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,17 @@
|
||||
package com.glodblock.github.common.item;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.storage.IMEInventoryHandler;
|
||||
@@ -11,6 +23,7 @@ import appeng.items.contents.CellConfig;
|
||||
import appeng.items.contents.CellUpgrades;
|
||||
import appeng.items.tools.powered.powersink.AEBasePoweredItem;
|
||||
import appeng.util.Platform;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.common.Config;
|
||||
import com.glodblock.github.common.storage.IFluidCellInventory;
|
||||
@@ -27,19 +40,10 @@ import com.glodblock.github.util.ModAndClassUtil;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import com.glodblock.github.util.RenderUtil;
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class ItemPortableFluidCell extends AEBasePoweredItem
|
||||
implements IStorageFluidCell, IItemInventory, IRegister<ItemPortableFluidCell> {
|
||||
@@ -70,28 +74,43 @@ public class ItemPortableFluidCell extends AEBasePoweredItem
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void addCheckedInformation(
|
||||
final ItemStack stack, final EntityPlayer player, final List<String> lines, final boolean displayMoreInfo) {
|
||||
public void addCheckedInformation(final ItemStack stack, final EntityPlayer player, final List<String> lines,
|
||||
final boolean displayMoreInfo) {
|
||||
super.addCheckedInformation(stack, player, lines, displayMoreInfo);
|
||||
final IMEInventoryHandler<?> inventory =
|
||||
AEApi.instance().registries().cell().getCellInventory(stack, null, StorageChannel.FLUIDS);
|
||||
final IMEInventoryHandler<?> inventory = AEApi.instance().registries().cell()
|
||||
.getCellInventory(stack, null, StorageChannel.FLUIDS);
|
||||
if (inventory instanceof IFluidCellInventoryHandler) {
|
||||
final IFluidCellInventoryHandler handler = (IFluidCellInventoryHandler) inventory;
|
||||
final IFluidCellInventory cellInventory = handler.getCellInv();
|
||||
if (cellInventory != null) {
|
||||
lines.add(EnumChatFormatting.WHITE + String.valueOf(cellInventory.getUsedBytes())
|
||||
+ EnumChatFormatting.GRAY + " " + GuiText.Of.getLocal() + " "
|
||||
+ EnumChatFormatting.DARK_GREEN + cellInventory.getTotalBytes() + " "
|
||||
+ EnumChatFormatting.GRAY + GuiText.BytesUsed.getLocal());
|
||||
lines.add(EnumChatFormatting.WHITE + String.valueOf(cellInventory.getStoredFluidTypes())
|
||||
+ EnumChatFormatting.GRAY + " " + GuiText.Of.getLocal() + " "
|
||||
+ EnumChatFormatting.DARK_GREEN + cellInventory.getTotalFluidTypes() + " "
|
||||
+ EnumChatFormatting.GRAY + GuiText.Types.getLocal());
|
||||
lines.add(
|
||||
EnumChatFormatting.WHITE + String.valueOf(cellInventory.getUsedBytes())
|
||||
+ EnumChatFormatting.GRAY
|
||||
+ " "
|
||||
+ GuiText.Of.getLocal()
|
||||
+ " "
|
||||
+ EnumChatFormatting.DARK_GREEN
|
||||
+ cellInventory.getTotalBytes()
|
||||
+ " "
|
||||
+ EnumChatFormatting.GRAY
|
||||
+ GuiText.BytesUsed.getLocal());
|
||||
lines.add(
|
||||
EnumChatFormatting.WHITE + String.valueOf(cellInventory.getStoredFluidTypes())
|
||||
+ EnumChatFormatting.GRAY
|
||||
+ " "
|
||||
+ GuiText.Of.getLocal()
|
||||
+ " "
|
||||
+ EnumChatFormatting.DARK_GREEN
|
||||
+ cellInventory.getTotalFluidTypes()
|
||||
+ " "
|
||||
+ EnumChatFormatting.GRAY
|
||||
+ GuiText.Types.getLocal());
|
||||
}
|
||||
}
|
||||
if (GuiScreen.isShiftKeyDown()) {
|
||||
lines.addAll(RenderUtil.listFormattedStringToWidth(
|
||||
StatCollector.translateToLocalFormatted(NameConst.TT_CELL_PORTABLE)));
|
||||
lines.addAll(
|
||||
RenderUtil.listFormattedStringToWidth(
|
||||
StatCollector.translateToLocalFormatted(NameConst.TT_CELL_PORTABLE)));
|
||||
} else {
|
||||
lines.add(StatCollector.translateToLocal(NameConst.TT_SHIFT_FOR_MORE));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,19 @@
|
||||
package com.glodblock.github.common.parts;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.IFluidContainerItem;
|
||||
|
||||
import org.apache.commons.lang3.tuple.MutablePair;
|
||||
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.networking.energy.IEnergySource;
|
||||
import appeng.api.networking.security.PlayerSource;
|
||||
@@ -8,21 +22,12 @@ import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.me.GridAccessException;
|
||||
import appeng.util.InventoryAdaptor;
|
||||
import appeng.util.Platform;
|
||||
|
||||
import com.glodblock.github.common.item.ItemFluidPacket;
|
||||
import com.glodblock.github.util.Util;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.IFluidContainerItem;
|
||||
import org.apache.commons.lang3.tuple.MutablePair;
|
||||
|
||||
public class PartFluidConversionMonitor extends PartFluidStorageMonitor {
|
||||
|
||||
public PartFluidConversionMonitor(ItemStack is) {
|
||||
super(is);
|
||||
}
|
||||
@@ -47,8 +52,7 @@ public class PartFluidConversionMonitor extends PartFluidStorageMonitor {
|
||||
} else {
|
||||
fluidStack = Util.FluidUtil.getFluidFromContainer(item);
|
||||
}
|
||||
if (this.getDisplayed() == null
|
||||
|| fluidStack == null
|
||||
if (this.getDisplayed() == null || fluidStack == null
|
||||
|| fluidStack.getFluid() != ((IAEFluidStack) this.getDisplayed()).getFluid()) {
|
||||
return false;
|
||||
}
|
||||
@@ -59,18 +63,16 @@ public class PartFluidConversionMonitor extends PartFluidStorageMonitor {
|
||||
}
|
||||
final IEnergySource energy = this.getProxy().getEnergy();
|
||||
final IMEMonitor<IAEFluidStack> cell = this.getProxy().getStorage().getFluidInventory();
|
||||
final IAEFluidStack input =
|
||||
(IAEFluidStack) this.getDisplayed().copy().setStackSize(fluidStack.amount);
|
||||
final IAEFluidStack failedToInsert =
|
||||
Platform.poweredInsert(energy, cell, input, new PlayerSource(player, this));
|
||||
final IAEFluidStack input = (IAEFluidStack) this.getDisplayed().copy().setStackSize(fluidStack.amount);
|
||||
final IAEFluidStack failedToInsert = Platform
|
||||
.poweredInsert(energy, cell, input, new PlayerSource(player, this));
|
||||
if (failedToInsert != null && failedToInsert.getStackSize() == input.getStackSize()) {
|
||||
return false;
|
||||
} else if (failedToInsert == null || failedToInsert.getStackSize() != input.getStackSize()) {
|
||||
if (item.getItem() instanceof ItemFluidPacket) {
|
||||
if (failedToInsert != null) {
|
||||
player.getCurrentEquippedItem()
|
||||
.setTagCompound(
|
||||
ItemFluidPacket.newStack(failedToInsert).getTagCompound());
|
||||
.setTagCompound(ItemFluidPacket.newStack(failedToInsert).getTagCompound());
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
@@ -85,9 +87,7 @@ public class PartFluidConversionMonitor extends PartFluidStorageMonitor {
|
||||
} else if (FluidContainerRegistry.isContainer(tmp)) {
|
||||
IAEFluidStack insertedFluid = input.copy();
|
||||
insertedFluid.decStackSize(failedToInsert.getStackSize());
|
||||
this.getProxy()
|
||||
.getStorage()
|
||||
.getFluidInventory()
|
||||
this.getProxy().getStorage().getFluidInventory()
|
||||
.extractItems(insertedFluid, Actionable.MODULATE, new PlayerSource(player, this));
|
||||
return false;
|
||||
}
|
||||
@@ -119,15 +119,14 @@ public class PartFluidConversionMonitor extends PartFluidStorageMonitor {
|
||||
}
|
||||
|
||||
final IEnergySource energy = this.getProxy().getEnergy();
|
||||
final IMEMonitor<IAEFluidStack> cell =
|
||||
this.getProxy().getStorage().getFluidInventory();
|
||||
final IMEMonitor<IAEFluidStack> cell = this.getProxy().getStorage().getFluidInventory();
|
||||
ItemStack tank = eq.copy();
|
||||
tank.stackSize = 1;
|
||||
MutablePair<Integer, ItemStack> fillStack = Util.FluidUtil.fillStack(tank, input.getFluidStack());
|
||||
input.setStackSize(fillStack.left);
|
||||
|
||||
final IAEFluidStack retrieved =
|
||||
Platform.poweredExtraction(energy, cell, input, new PlayerSource(player, this));
|
||||
final IAEFluidStack retrieved = Platform
|
||||
.poweredExtraction(energy, cell, input, new PlayerSource(player, this));
|
||||
if (retrieved != null) {
|
||||
if (!player.inventory.addItemStackToInventory(fillStack.right)) {
|
||||
player.entityDropItem(fillStack.right.copy(), 0);
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
package com.glodblock.github.common.parts;
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
|
||||
import appeng.api.config.*;
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.networking.crafting.ICraftingGrid;
|
||||
@@ -22,19 +28,16 @@ import appeng.me.GridAccessException;
|
||||
import appeng.util.InventoryAdaptor;
|
||||
import appeng.util.item.AEFluidStack;
|
||||
import appeng.util.item.AEItemStack;
|
||||
|
||||
import com.glodblock.github.client.textures.FCPartsTexture;
|
||||
import com.glodblock.github.common.item.ItemFluidDrop;
|
||||
import com.glodblock.github.common.item.ItemFluidPacket;
|
||||
import com.glodblock.github.common.parts.base.FCSharedFluidBus;
|
||||
import com.glodblock.github.inventory.FluidConvertingInventoryAdaptor;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
|
||||
public class PartFluidExportBus extends FCSharedFluidBus implements ICraftingRequester {
|
||||
|
||||
@@ -83,12 +86,11 @@ public class PartFluidExportBus extends FCSharedFluidBus implements ICraftingReq
|
||||
final InventoryAdaptor destination = this.getHandler(te);
|
||||
final ICraftingGrid cg = this.getProxy().getCrafting();
|
||||
final IFluidHandler fh = (IFluidHandler) te;
|
||||
final IMEMonitor<IAEFluidStack> inv =
|
||||
this.getProxy().getStorage().getFluidInventory();
|
||||
final IMEMonitor<IAEFluidStack> inv = this.getProxy().getStorage().getFluidInventory();
|
||||
|
||||
for (int i = 0; i < this.getInventoryByName("config").getSizeInventory(); i++) {
|
||||
IAEFluidStack fluid = AEFluidStack.create(ItemFluidPacket.getFluidStack(
|
||||
this.getInventoryByName("config").getStackInSlot(i)));
|
||||
IAEFluidStack fluid = AEFluidStack
|
||||
.create(ItemFluidPacket.getFluidStack(this.getInventoryByName("config").getStackInSlot(i)));
|
||||
if (fluid != null) {
|
||||
boolean isAllowed = true;
|
||||
|
||||
@@ -175,8 +177,8 @@ public class PartFluidExportBus extends FCSharedFluidBus implements ICraftingReq
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderStatic(
|
||||
final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer) {
|
||||
public void renderStatic(final int x, final int y, final int z, final IPartRenderHelper rh,
|
||||
final RenderBlocks renderer) {
|
||||
this.setRenderCache(rh.useSimplifiedRendering(x, y, z, this, this.getRenderCache()));
|
||||
rh.setTexture(
|
||||
CableBusTextures.PartExportSides.getIcon(),
|
||||
@@ -228,9 +230,7 @@ public class PartFluidExportBus extends FCSharedFluidBus implements ICraftingReq
|
||||
}
|
||||
|
||||
protected InventoryAdaptor getHandler(TileEntity target) {
|
||||
return target != null
|
||||
? FluidConvertingInventoryAdaptor.wrap(target, this.getSide().getOpposite())
|
||||
: null;
|
||||
return target != null ? FluidConvertingInventoryAdaptor.wrap(target, this.getSide().getOpposite()) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
package com.glodblock.github.common.parts;
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
|
||||
import appeng.api.config.*;
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.networking.security.BaseActionSource;
|
||||
@@ -13,18 +21,13 @@ import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.client.texture.CableBusTextures;
|
||||
import appeng.me.GridAccessException;
|
||||
import appeng.util.item.AEFluidStack;
|
||||
|
||||
import com.glodblock.github.client.textures.FCPartsTexture;
|
||||
import com.glodblock.github.common.item.ItemFluidPacket;
|
||||
import com.glodblock.github.common.parts.base.FCSharedFluidBus;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
|
||||
public class PartFluidImportBus extends FCSharedFluidBus {
|
||||
|
||||
@@ -65,8 +68,7 @@ public class PartFluidImportBus extends FCSharedFluidBus {
|
||||
if (te instanceof IFluidHandler) {
|
||||
try {
|
||||
final IFluidHandler fh = (IFluidHandler) te;
|
||||
final IMEMonitor<IAEFluidStack> inv =
|
||||
this.getProxy().getStorage().getFluidInventory();
|
||||
final IMEMonitor<IAEFluidStack> inv = this.getProxy().getStorage().getFluidInventory();
|
||||
|
||||
int maxDrain = this.calculateAmountToSend();
|
||||
boolean drained = false;
|
||||
@@ -84,8 +86,8 @@ public class PartFluidImportBus extends FCSharedFluidBus {
|
||||
|
||||
final AEFluidStack aeFluidStack = AEFluidStack.create(fluidStack);
|
||||
if (aeFluidStack != null) {
|
||||
final IAEFluidStack notInserted =
|
||||
inv.injectItems(aeFluidStack, Actionable.MODULATE, this.source);
|
||||
final IAEFluidStack notInserted = inv
|
||||
.injectItems(aeFluidStack, Actionable.MODULATE, this.source);
|
||||
|
||||
if (notInserted != null && notInserted.getStackSize() > 0) {
|
||||
aeFluidStack.decStackSize(notInserted.getStackSize());
|
||||
@@ -113,8 +115,8 @@ public class PartFluidImportBus extends FCSharedFluidBus {
|
||||
|
||||
private boolean isInFilter(FluidStack fluid) {
|
||||
for (int i = 0; i < this.getInventoryByName("config").getSizeInventory(); i++) {
|
||||
final IAEFluidStack stack = AEFluidStack.create(ItemFluidPacket.getFluidStack(
|
||||
this.getInventoryByName("config").getStackInSlot(i)));
|
||||
final IAEFluidStack stack = AEFluidStack
|
||||
.create(ItemFluidPacket.getFluidStack(this.getInventoryByName("config").getStackInSlot(i)));
|
||||
if (stack != null && stack.getFluidStack().equals(fluid)) {
|
||||
return true;
|
||||
}
|
||||
@@ -124,8 +126,8 @@ public class PartFluidImportBus extends FCSharedFluidBus {
|
||||
|
||||
private boolean filterEnabled() {
|
||||
for (int i = 0; i < this.getInventoryByName("config").getSizeInventory(); i++) {
|
||||
final IAEFluidStack stack = AEFluidStack.create(ItemFluidPacket.getFluidStack(
|
||||
this.getInventoryByName("config").getStackInSlot(i)));
|
||||
final IAEFluidStack stack = AEFluidStack
|
||||
.create(ItemFluidPacket.getFluidStack(this.getInventoryByName("config").getStackInSlot(i)));
|
||||
if (stack != null) {
|
||||
return true;
|
||||
}
|
||||
@@ -168,8 +170,8 @@ public class PartFluidImportBus extends FCSharedFluidBus {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderStatic(
|
||||
final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer) {
|
||||
public void renderStatic(final int x, final int y, final int z, final IPartRenderHelper rh,
|
||||
final RenderBlocks renderer) {
|
||||
this.setRenderCache(rh.useSimplifiedRendering(x, y, z, this, this.getRenderCache()));
|
||||
rh.setTexture(
|
||||
CableBusTextures.PartImportSides.getIcon(),
|
||||
|
||||
@@ -1,5 +1,18 @@
|
||||
package com.glodblock.github.common.parts;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.Upgrades;
|
||||
import appeng.api.networking.IGridNode;
|
||||
@@ -21,6 +34,7 @@ import appeng.parts.misc.PartInterface;
|
||||
import appeng.tile.inventory.AppEngInternalAEInventory;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.item.AEFluidStack;
|
||||
|
||||
import com.glodblock.github.client.textures.FCPartsTexture;
|
||||
import com.glodblock.github.common.item.ItemFluidPacket;
|
||||
import com.glodblock.github.inventory.AEFluidInventory;
|
||||
@@ -31,21 +45,11 @@ import com.glodblock.github.inventory.gui.GuiType;
|
||||
import com.glodblock.github.util.BlockPos;
|
||||
import com.glodblock.github.util.DualityFluidInterface;
|
||||
import com.glodblock.github.util.Util;
|
||||
|
||||
import cpw.mods.fml.common.network.ByteBufUtils;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
|
||||
public class PartFluidInterface extends PartInterface implements IDualHost {
|
||||
|
||||
@@ -59,8 +63,8 @@ public class PartFluidInterface extends PartInterface implements IDualHost {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderStatic(
|
||||
final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer) {
|
||||
public void renderStatic(final int x, final int y, final int z, final IPartRenderHelper rh,
|
||||
final RenderBlocks renderer) {
|
||||
this.setRenderCache(rh.useSimplifiedRendering(x, y, z, this, this.getRenderCache()));
|
||||
rh.setTexture(
|
||||
CableBusTextures.PartMonitorSides.getIcon(),
|
||||
@@ -200,10 +204,7 @@ public class PartFluidInterface extends PartInterface implements IDualHost {
|
||||
|
||||
private IMEMonitor<IAEFluidStack> getFluidGrid() {
|
||||
try {
|
||||
return getProxy()
|
||||
.getGrid()
|
||||
.<IStorageGrid>getCache(IStorageGrid.class)
|
||||
.getFluidInventory();
|
||||
return getProxy().getGrid().<IStorageGrid>getCache(IStorageGrid.class).getFluidInventory();
|
||||
} catch (GridAccessException e) {
|
||||
return null;
|
||||
}
|
||||
@@ -284,7 +285,8 @@ public class PartFluidInterface extends PartInterface implements IDualHost {
|
||||
public void setConfig(int id, IAEFluidStack fluid) {
|
||||
if (id >= 0 && id < 6) {
|
||||
config.setInventorySlotContents(
|
||||
id, ItemFluidPacket.newDisplayStack(fluid == null ? null : fluid.getFluidStack()));
|
||||
id,
|
||||
ItemFluidPacket.newDisplayStack(fluid == null ? null : fluid.getFluidStack()));
|
||||
fluidDuality.getConfig().setFluidInSlot(id, fluidDuality.getStandardFluid(fluid));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,22 @@
|
||||
package com.glodblock.github.common.parts;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import appeng.api.config.*;
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.networking.crafting.*;
|
||||
@@ -33,28 +50,15 @@ import appeng.parts.automation.PartUpgradeable;
|
||||
import appeng.tile.inventory.AppEngInternalAEInventory;
|
||||
import appeng.tile.inventory.InvOperation;
|
||||
import appeng.util.Platform;
|
||||
|
||||
import com.glodblock.github.common.item.ItemFluidPacket;
|
||||
import com.glodblock.github.inventory.InventoryHandler;
|
||||
import com.glodblock.github.inventory.gui.GuiType;
|
||||
import com.glodblock.github.util.BlockPos;
|
||||
import com.glodblock.github.util.Util;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.Objects;
|
||||
import java.util.Random;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
public class PartFluidLevelEmitter extends PartUpgradeable
|
||||
implements IStackWatcherHost, ICraftingWatcherHost, IMEMonitorHandlerReceiver<IAEFluidStack>, IGridTickable {
|
||||
@@ -127,10 +131,9 @@ public class PartFluidLevelEmitter extends PartUpgradeable
|
||||
return false;
|
||||
}
|
||||
|
||||
final boolean flipState =
|
||||
this.getConfigManager().getSetting(Settings.REDSTONE_EMITTER) == RedstoneMode.LOW_SIGNAL;
|
||||
return flipState
|
||||
? this.reportingValue >= this.lastReportedValue + 1
|
||||
final boolean flipState = this.getConfigManager().getSetting(Settings.REDSTONE_EMITTER)
|
||||
== RedstoneMode.LOW_SIGNAL;
|
||||
return flipState ? this.reportingValue >= this.lastReportedValue + 1
|
||||
: this.reportingValue < this.lastReportedValue + 1;
|
||||
}
|
||||
|
||||
@@ -211,12 +214,8 @@ public class PartFluidLevelEmitter extends PartUpgradeable
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStackChange(
|
||||
final IItemList o,
|
||||
final IAEStack fullStack,
|
||||
final IAEStack diffStack,
|
||||
final BaseActionSource src,
|
||||
final StorageChannel chan) {
|
||||
public void onStackChange(final IItemList o, final IAEStack fullStack, final IAEStack diffStack,
|
||||
final BaseActionSource src, final StorageChannel chan) {
|
||||
if (chan == StorageChannel.FLUIDS && fullStack.equals(this.getIAEFluidStack())) {
|
||||
this.lastReportedValue = fullStack.getStackSize();
|
||||
this.updateState();
|
||||
@@ -257,9 +256,7 @@ public class PartFluidLevelEmitter extends PartUpgradeable
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postChange(
|
||||
final IBaseMonitor<IAEFluidStack> monitor,
|
||||
final Iterable<IAEFluidStack> change,
|
||||
public void postChange(final IBaseMonitor<IAEFluidStack> monitor, final Iterable<IAEFluidStack> change,
|
||||
final BaseActionSource actionSource) {
|
||||
if (canDoWork()) {
|
||||
if (delayedUpdatesQueued) {
|
||||
@@ -504,8 +501,8 @@ public class PartFluidLevelEmitter extends PartUpgradeable
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderStatic(
|
||||
final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer) {
|
||||
public void renderStatic(final int x, final int y, final int z, final IPartRenderHelper rh,
|
||||
final RenderBlocks renderer) {
|
||||
rh.setTexture(this.getItemStack().getIconIndex());
|
||||
// rh.setTexture( CableBusTextures.ItemPartLevelEmitterOn.getIcon() );
|
||||
|
||||
@@ -518,8 +515,7 @@ public class PartFluidLevelEmitter extends PartUpgradeable
|
||||
renderer.renderAllFaces = true;
|
||||
|
||||
final Tessellator tess = Tessellator.instance;
|
||||
tess.setBrightness(rh.getBlock()
|
||||
.getMixedBrightnessForBlock(this.getHost().getTile().getWorldObj(), x, y, z));
|
||||
tess.setBrightness(rh.getBlock().getMixedBrightnessForBlock(this.getHost().getTile().getWorldObj(), x, y, z));
|
||||
tess.setColorOpaque_F(1.0F, 1.0F, 1.0F);
|
||||
|
||||
this.renderTorchAtAngle(x, y, z);
|
||||
@@ -584,12 +580,8 @@ public class PartFluidLevelEmitter extends PartUpgradeable
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChangeInventory(
|
||||
final IInventory inv,
|
||||
final int slot,
|
||||
final InvOperation mc,
|
||||
final ItemStack removedStack,
|
||||
final ItemStack newStack) {
|
||||
public void onChangeInventory(final IInventory inv, final int slot, final InvOperation mc,
|
||||
final ItemStack removedStack, final ItemStack newStack) {
|
||||
if (inv == this.config) {
|
||||
this.configureWatchers();
|
||||
}
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
package com.glodblock.github.common.parts;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import appeng.api.implementations.ICraftingPatternItem;
|
||||
import appeng.api.networking.crafting.ICraftingPatternDetails;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.tile.inventory.BiggerAppEngInventory;
|
||||
import appeng.tile.inventory.InvOperation;
|
||||
|
||||
import com.glodblock.github.client.textures.FCPartsTexture;
|
||||
import com.glodblock.github.common.item.ItemFluidDrop;
|
||||
import com.glodblock.github.common.item.ItemFluidPacket;
|
||||
import com.glodblock.github.common.parts.base.FCFluidEncodeTerminal;
|
||||
import com.glodblock.github.inventory.gui.GuiType;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class PartFluidPatternTerminal extends FCFluidEncodeTerminal {
|
||||
|
||||
@@ -35,18 +37,14 @@ public class PartFluidPatternTerminal extends FCFluidEncodeTerminal {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChangeInventory(
|
||||
final IInventory inv,
|
||||
final int slot,
|
||||
final InvOperation mc,
|
||||
final ItemStack removedStack,
|
||||
final ItemStack newStack) {
|
||||
public void onChangeInventory(final IInventory inv, final int slot, final InvOperation mc,
|
||||
final ItemStack removedStack, final ItemStack newStack) {
|
||||
if (inv == this.pattern && slot == 1) {
|
||||
final ItemStack is = inv.getStackInSlot(1);
|
||||
if (is != null && is.getItem() instanceof ICraftingPatternItem) {
|
||||
final ICraftingPatternItem pattern = (ICraftingPatternItem) is.getItem();
|
||||
final ICraftingPatternDetails details =
|
||||
pattern.getPatternForItem(is, this.getHost().getTile().getWorldObj());
|
||||
final ICraftingPatternDetails details = pattern
|
||||
.getPatternForItem(is, this.getHost().getTile().getWorldObj());
|
||||
if (details != null) {
|
||||
final IAEItemStack[] inItems = details.getInputs();
|
||||
final IAEItemStack[] outItems = details.getOutputs();
|
||||
@@ -70,8 +68,8 @@ public class PartFluidPatternTerminal extends FCFluidEncodeTerminal {
|
||||
if (inItems[i] != null) {
|
||||
final IAEItemStack item = inItems[i];
|
||||
if (item != null && item.getItem() instanceof ItemFluidDrop) {
|
||||
ItemStack packet =
|
||||
ItemFluidPacket.newStack(ItemFluidDrop.getFluidStack(item.getItemStack()));
|
||||
ItemStack packet = ItemFluidPacket
|
||||
.newStack(ItemFluidDrop.getFluidStack(item.getItemStack()));
|
||||
this.crafting.setInventorySlotContents(i, packet);
|
||||
} else this.crafting.setInventorySlotContents(i, item == null ? null : item.getItemStack());
|
||||
}
|
||||
@@ -81,8 +79,8 @@ public class PartFluidPatternTerminal extends FCFluidEncodeTerminal {
|
||||
if (outItems[i] != null) {
|
||||
final IAEItemStack item = outItems[i];
|
||||
if (item != null && item.getItem() instanceof ItemFluidDrop) {
|
||||
ItemStack packet =
|
||||
ItemFluidPacket.newStack(ItemFluidDrop.getFluidStack(item.getItemStack()));
|
||||
ItemStack packet = ItemFluidPacket
|
||||
.newStack(ItemFluidDrop.getFluidStack(item.getItemStack()));
|
||||
this.output.setInventorySlotContents(i, packet);
|
||||
} else this.output.setInventorySlotContents(i, item == null ? null : item.getItemStack());
|
||||
}
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
package com.glodblock.github.common.parts;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import appeng.api.implementations.ICraftingPatternItem;
|
||||
import appeng.api.networking.crafting.ICraftingPatternDetails;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.tile.inventory.BiggerAppEngInventory;
|
||||
import appeng.tile.inventory.InvOperation;
|
||||
|
||||
import com.glodblock.github.client.textures.FCPartsTexture;
|
||||
import com.glodblock.github.common.item.ItemFluidDrop;
|
||||
import com.glodblock.github.common.item.ItemFluidPacket;
|
||||
import com.glodblock.github.common.parts.base.FCFluidEncodeTerminal;
|
||||
import com.glodblock.github.inventory.gui.GuiType;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class PartFluidPatternTerminalEx extends FCFluidEncodeTerminal {
|
||||
|
||||
@@ -33,19 +35,15 @@ public class PartFluidPatternTerminalEx extends FCFluidEncodeTerminal {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChangeInventory(
|
||||
final IInventory inv,
|
||||
final int slot,
|
||||
final InvOperation mc,
|
||||
final ItemStack removedStack,
|
||||
final ItemStack newStack) {
|
||||
public void onChangeInventory(final IInventory inv, final int slot, final InvOperation mc,
|
||||
final ItemStack removedStack, final ItemStack newStack) {
|
||||
if (inv == this.pattern && slot == 1) {
|
||||
final ItemStack is = inv.getStackInSlot(1);
|
||||
|
||||
if (is != null && is.getItem() instanceof ICraftingPatternItem) {
|
||||
final ICraftingPatternItem pattern = (ICraftingPatternItem) is.getItem();
|
||||
final ICraftingPatternDetails details =
|
||||
pattern.getPatternForItem(is, this.getHost().getTile().getWorldObj());
|
||||
final ICraftingPatternDetails details = pattern
|
||||
.getPatternForItem(is, this.getHost().getTile().getWorldObj());
|
||||
|
||||
if (details != null) {
|
||||
final IAEItemStack[] inItems = details.getInputs();
|
||||
@@ -84,8 +82,8 @@ public class PartFluidPatternTerminalEx extends FCFluidEncodeTerminal {
|
||||
final IAEItemStack item = inItems[i];
|
||||
if (item != null) {
|
||||
if (item.getItem() instanceof ItemFluidDrop) {
|
||||
ItemStack packet =
|
||||
ItemFluidPacket.newStack(ItemFluidDrop.getFluidStack(item.getItemStack()));
|
||||
ItemStack packet = ItemFluidPacket
|
||||
.newStack(ItemFluidDrop.getFluidStack(item.getItemStack()));
|
||||
this.crafting.setInventorySlotContents(i, packet);
|
||||
} else this.crafting.setInventorySlotContents(i, item.getItemStack());
|
||||
}
|
||||
@@ -96,8 +94,8 @@ public class PartFluidPatternTerminalEx extends FCFluidEncodeTerminal {
|
||||
final IAEItemStack item = outItems[i];
|
||||
if (item != null) {
|
||||
if (item.getItem() instanceof ItemFluidDrop) {
|
||||
ItemStack packet =
|
||||
ItemFluidPacket.newStack(ItemFluidDrop.getFluidStack(item.getItemStack()));
|
||||
ItemStack packet = ItemFluidPacket
|
||||
.newStack(ItemFluidDrop.getFluidStack(item.getItemStack()));
|
||||
this.output.setInventorySlotContents(i, packet);
|
||||
} else this.output.setInventorySlotContents(i, item.getItemStack());
|
||||
}
|
||||
@@ -107,8 +105,8 @@ public class PartFluidPatternTerminalEx extends FCFluidEncodeTerminal {
|
||||
final IAEItemStack item = outItems[i];
|
||||
if (item != null) {
|
||||
if (item.getItem() instanceof ItemFluidDrop) {
|
||||
ItemStack packet =
|
||||
ItemFluidPacket.newStack(ItemFluidDrop.getFluidStack(item.getItemStack()));
|
||||
ItemStack packet = ItemFluidPacket
|
||||
.newStack(ItemFluidDrop.getFluidStack(item.getItemStack()));
|
||||
this.output.setInventorySlotContents(i >= 4 ? 12 + i : i, packet);
|
||||
} else this.output.setInventorySlotContents(i >= 4 ? 12 + i : i, item.getItemStack());
|
||||
}
|
||||
|
||||
@@ -1,5 +1,18 @@
|
||||
package com.glodblock.github.common.parts;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.*;
|
||||
import appeng.api.networking.IGridNode;
|
||||
@@ -36,6 +49,7 @@ import appeng.tile.networking.TileCableBus;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.item.AEFluidStack;
|
||||
import appeng.util.prioitylist.PrecisePriorityList;
|
||||
|
||||
import com.glodblock.github.client.textures.FCPartsTexture;
|
||||
import com.glodblock.github.common.item.ItemFluidPacket;
|
||||
import com.glodblock.github.common.tile.TileFluidInterface;
|
||||
@@ -43,20 +57,10 @@ import com.glodblock.github.inventory.*;
|
||||
import com.glodblock.github.inventory.gui.GuiType;
|
||||
import com.glodblock.github.util.BlockPos;
|
||||
import com.glodblock.github.util.ModAndClassUtil;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import extracells.tileentity.TileEntityFluidInterface;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
|
||||
public class PartFluidStorageBus extends PartUpgradeable
|
||||
implements IGridTickable, ICellContainer, IMEMonitorHandlerReceiver<IAEFluidStack>, IPriorityHost {
|
||||
@@ -150,12 +154,8 @@ public class PartFluidStorageBus extends PartUpgradeable
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChangeInventory(
|
||||
final IInventory inv,
|
||||
final int slot,
|
||||
final InvOperation mc,
|
||||
final ItemStack removedStack,
|
||||
final ItemStack newStack) {
|
||||
public void onChangeInventory(final IInventory inv, final int slot, final InvOperation mc,
|
||||
final ItemStack removedStack, final ItemStack newStack) {
|
||||
super.onChangeInventory(inv, slot, mc, removedStack, newStack);
|
||||
|
||||
if (inv == this.config) {
|
||||
@@ -164,8 +164,7 @@ public class PartFluidStorageBus extends PartUpgradeable
|
||||
}
|
||||
|
||||
protected void resetCache(final boolean fullReset) {
|
||||
if (this.getHost() == null
|
||||
|| this.getHost().getTile() == null
|
||||
if (this.getHost() == null || this.getHost().getTile() == null
|
||||
|| this.getHost().getTile().getWorldObj() == null
|
||||
|| this.getHost().getTile().getWorldObj().isRemote) {
|
||||
return;
|
||||
@@ -179,8 +178,7 @@ public class PartFluidStorageBus extends PartUpgradeable
|
||||
|
||||
try {
|
||||
this.getProxy().getTick().alertDevice(this.getProxy().getNode());
|
||||
} catch (final GridAccessException ignore) {
|
||||
}
|
||||
} catch (final GridAccessException ignore) {}
|
||||
}
|
||||
|
||||
protected void resetCache() {
|
||||
@@ -191,8 +189,8 @@ public class PartFluidStorageBus extends PartUpgradeable
|
||||
IItemList<IAEFluidStack> before = AEApi.instance().storage().createFluidList();
|
||||
if (in != null) {
|
||||
if (accessChanged) {
|
||||
AccessRestriction currentAccess =
|
||||
(AccessRestriction) this.getConfigManager().getSetting(Settings.ACCESS);
|
||||
AccessRestriction currentAccess = (AccessRestriction) this.getConfigManager()
|
||||
.getSetting(Settings.ACCESS);
|
||||
if (!currentAccess.hasPermission(AccessRestriction.READ)) {
|
||||
readOncePass = true;
|
||||
}
|
||||
@@ -226,21 +224,16 @@ public class PartFluidStorageBus extends PartUpgradeable
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postChange(
|
||||
final IBaseMonitor<IAEFluidStack> monitor,
|
||||
final Iterable<IAEFluidStack> change,
|
||||
public void postChange(final IBaseMonitor<IAEFluidStack> monitor, final Iterable<IAEFluidStack> change,
|
||||
final BaseActionSource source) {
|
||||
if (this.getProxy().isActive()) {
|
||||
AccessRestriction currentAccess =
|
||||
(AccessRestriction) this.getConfigManager().getSetting(Settings.ACCESS);
|
||||
AccessRestriction currentAccess = (AccessRestriction) this.getConfigManager().getSetting(Settings.ACCESS);
|
||||
if (readOncePass) {
|
||||
readOncePass = false;
|
||||
try {
|
||||
this.getProxy()
|
||||
.getStorage()
|
||||
this.getProxy().getStorage()
|
||||
.postAlterationOfStoredItems(StorageChannel.FLUIDS, change, this.source);
|
||||
} catch (final GridAccessException ignore) {
|
||||
}
|
||||
} catch (final GridAccessException ignore) {}
|
||||
return;
|
||||
}
|
||||
if (!currentAccess.hasPermission(AccessRestriction.READ)) {
|
||||
@@ -248,8 +241,7 @@ public class PartFluidStorageBus extends PartUpgradeable
|
||||
}
|
||||
try {
|
||||
this.getProxy().getStorage().postAlterationOfStoredItems(StorageChannel.FLUIDS, change, source);
|
||||
} catch (final GridAccessException ignore) {
|
||||
}
|
||||
} catch (final GridAccessException ignore) {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -330,7 +322,7 @@ public class PartFluidStorageBus extends PartUpgradeable
|
||||
return TickRateModulation.SLEEP;
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
public MEInventoryHandler<IAEFluidStack> getInternalHandler() {
|
||||
if (this.cached) {
|
||||
return this.handler;
|
||||
@@ -349,13 +341,11 @@ public class PartFluidStorageBus extends PartUpgradeable
|
||||
this.handler = null;
|
||||
this.monitor = null;
|
||||
if (target != null) {
|
||||
final IExternalStorageHandler esh = AEApi.instance()
|
||||
.registries()
|
||||
.externalStorage()
|
||||
final IExternalStorageHandler esh = AEApi.instance().registries().externalStorage()
|
||||
.getHandler(target, this.getSide().getOpposite(), StorageChannel.FLUIDS, this.source);
|
||||
if (esh != null) {
|
||||
final IMEInventory<?> inv =
|
||||
esh.getInventory(target, this.getSide().getOpposite(), StorageChannel.FLUIDS, this.source);
|
||||
final IMEInventory<?> inv = esh
|
||||
.getInventory(target, this.getSide().getOpposite(), StorageChannel.FLUIDS, this.source);
|
||||
if (inv instanceof MEMonitorIFluidHandler) {
|
||||
final MEMonitorIFluidHandler h = (MEMonitorIFluidHandler) inv;
|
||||
h.setMode((StorageFilter) this.getConfigManager().getSetting(Settings.STORAGE_FILTER));
|
||||
@@ -364,18 +354,15 @@ public class PartFluidStorageBus extends PartUpgradeable
|
||||
}
|
||||
if (inv != null) {
|
||||
this.handler = new MEInventoryHandler(inv, StorageChannel.FLUIDS);
|
||||
this.handler.setBaseAccess(
|
||||
(AccessRestriction) this.getConfigManager().getSetting(Settings.ACCESS));
|
||||
this.handler.setBaseAccess((AccessRestriction) this.getConfigManager().getSetting(Settings.ACCESS));
|
||||
this.handler.setWhitelist(
|
||||
this.getInstalledUpgrades(Upgrades.INVERTER) > 0
|
||||
? IncludeExclude.BLACKLIST
|
||||
this.getInstalledUpgrades(Upgrades.INVERTER) > 0 ? IncludeExclude.BLACKLIST
|
||||
: IncludeExclude.WHITELIST);
|
||||
this.handler.setPriority(this.priority);
|
||||
if (inv instanceof IMEMonitor) {
|
||||
((IBaseMonitor) inv).addListener(this, this.handler);
|
||||
}
|
||||
final IItemList<IAEFluidStack> priorityList =
|
||||
AEApi.instance().storage().createFluidList();
|
||||
final IItemList<IAEFluidStack> priorityList = AEApi.instance().storage().createFluidList();
|
||||
|
||||
final int slotsToUse = 18 + this.getInstalledUpgrades(Upgrades.CAPACITY) * 9;
|
||||
for (int x = 0; x < this.config.getSizeInventory() && x < slotsToUse; x++) {
|
||||
@@ -396,15 +383,13 @@ public class PartFluidStorageBus extends PartUpgradeable
|
||||
} else {
|
||||
tm.wakeDevice(this.getProxy().getNode());
|
||||
}
|
||||
} catch (final GridAccessException ignore) {
|
||||
}
|
||||
} catch (final GridAccessException ignore) {}
|
||||
}
|
||||
|
||||
try {
|
||||
// force grid to update handlers...
|
||||
((GridStorageCache) this.getProxy().getGrid().getCache(IStorageGrid.class)).cellUpdate(null);
|
||||
} catch (final GridAccessException ignore) {
|
||||
}
|
||||
} catch (final GridAccessException ignore) {}
|
||||
|
||||
return this.handler;
|
||||
}
|
||||
@@ -475,8 +460,8 @@ public class PartFluidStorageBus extends PartUpgradeable
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderStatic(
|
||||
final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer) {
|
||||
public void renderStatic(final int x, final int y, final int z, final IPartRenderHelper rh,
|
||||
final RenderBlocks renderer) {
|
||||
this.setRenderCache(rh.useSimplifiedRendering(x, y, z, this, this.getRenderCache()));
|
||||
rh.setTexture(
|
||||
CableBusTextures.PartStorageSides.getIcon(),
|
||||
|
||||
Loaded 100 of 221 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user