mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-11 15:57:55 +00:00
68 files changed
+1276
-276
No files matched your search
@@ -1,3 +0,0 @@
|
||||
# Any Github changes require admin approval
|
||||
/.github/** @GTNewHorizons/admin
|
||||
|
||||
@@ -40,46 +40,8 @@ Unofficial AE2([PAE2](https://www.curseforge.com/minecraft/mc-mods/ae2-extended-
|
||||
|
||||
Official AE2 isn't supported, you can use origin [AE2FC](https://github.com/phantamanta44/ae2-fluid-crafting) if you are playing with Official AE2.
|
||||
|
||||
## Basic Devices
|
||||
|
||||
### Fluid Discretizer
|
||||
The **Fluid Discretizer** is a device that, when attached to ME network, exposes the contents of its fluid storage grid as items, which take the form of "fluid drops".
|
||||
It does this by functioning as a sort of storage bus: when fluid drops are removed from its storage via the item grid, it extracts the corresponding fluid from the fluid grid.
|
||||
Conversely, when fluid drops inserted into its storage via the item grid, it injects the corresponding fluid into the fluid grid.
|
||||
Each fluid drop is equivalent to one mB of its respective fluid, which means a full stack of them is equivalent to 64 mB.
|
||||
Fluid drops have an important property: when an ME interface attempts to export fluid drops to a machine, it will attempt to convert them to fluid.
|
||||
This means an interface exporting drops of gelid cryotheum into a fluid transposer will successfully fill the transposer's internal tank rather than inserting the drops as items.
|
||||
This is the central mechanic that makes fluid autocrafting possible.
|
||||
Note that the only way to convert between fluids and fluid drops is a discretizer attached to an ME network.
|
||||
While you could theoretically use this as a very convoluted method of transporting fluids, it is not recomomended to do so.
|
||||
|
||||
### Fluid Pattern Encoder
|
||||
Most crafting recipes involving fluids require far more than 64 mB of a particular fluid, and so the standard pattern terminal will not do for encoding such recipes into patterns.
|
||||
This problem is solved by the **Fluid Pattern Encoder**, a utility that functions similarly to a pattern terminal.
|
||||
When a fluid-handling item (e.g. a bucket or tank) is inserted into the crafting ingredient slots, they will be converted into an equivalent stack of the corresponding fluid drops.
|
||||
Using this, patterns for recipes that require more than a stack of fluid drops can easily be encoded.
|
||||
AE2 Fluid Crafting also comes with a handy JEI integration module that allows the fluid pattern encoder to encode any JEI recipe involving fluids.
|
||||
This is the recommended way to play with the mod, since encoding patterns by hand is a little cumbersome.
|
||||
|
||||
### Fluid Pattern Terminal
|
||||
|
||||
Encoding recipes in a big and bulky workbench separate from the rest of your AE2 equipment can be a little inconvenient.
|
||||
Luckily, we have the **Fluid Pattern Terminal**, which combines the functionality of the standard pattern terminal and the fluid pattern encoder.
|
||||
Now, you can encode your fluid recipes using the same familiar interface you know and love!
|
||||
|
||||
### Fluid Pattern Interface
|
||||
|
||||
The standard ME interface lets you emit items and fluid packets with AE2FC, but it will only accept items, as in vanilla AE2.
|
||||
This is a little inconvenient when you want to build compact setups for autocrafting with fluid outputs, where you would need to use both an item interface for inputs, and a separate fluid interface for outputs.
|
||||
To make things easier, we have the **Fluid Pattern Interface**, which functions as a combination of an item interface and a fluid interface!
|
||||
Its GUI is the same as normal ME interface, but it can emit fluids directly instead of fluid packets! It also accepts fluid and item inputs.
|
||||
Automating fluid crafting machines has never been this quick and painless!
|
||||
|
||||
### Fluid Packets
|
||||
|
||||
When putting fluid pattern in a normal ME interface, it will emit fluid packets as fluid.
|
||||
So if you prefer to deal with item instead of fluids, you can transport these packets and turn them back to fluid with **ME Fluid Packet Decoder**.
|
||||
Simply connect the decoder to your ME network and insert the fluid packet; the decoder will, if possible, inject the fluid into your fluid storage grid.
|
||||
## How to Use It
|
||||
https://github.com/GlodBlock/AE2FluidCraft-Rework/wiki
|
||||
|
||||
## Credited Works
|
||||
|
||||
|
||||
+7
-2
@@ -5,18 +5,23 @@ dependencies {
|
||||
compile('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-87-GTNH:dev')
|
||||
compile('curse.maven:cofh-core-69162:2388751')
|
||||
compile('com.github.GTNewHorizons:ExtraCells2:2.5.9:dev') {transitive = false}
|
||||
compile("com.github.GTNewHorizons:ForestryMC:4.4.7:dev")
|
||||
compile("com.github.GTNewHorizons:WirelessCraftingTerminal:1.8.8.5:dev")
|
||||
|
||||
compileOnly("com.github.GTNewHorizons:ForestryMC:4.4.4:dev")
|
||||
compileOnly("com.github.GTNewHorizons:ForestryMC:4.4.7:dev")
|
||||
compileOnly("com.github.GTNewHorizons:EnderIO:2.3.1.27:dev")
|
||||
compileOnly("com.github.GTNewHorizons:EnderCore:0.2.6:dev")
|
||||
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.40.41:dev')
|
||||
compileOnly('com.github.GTNewHorizons:StructureLib:1.0.15:dev')
|
||||
compileOnly('net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev')
|
||||
compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
|
||||
compileOnly('com.github.GTNewHorizons:AppleCore:3.1.9:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.27:dev') {transitive = false}
|
||||
compileOnly("com.gregoriust.gregtech:gregtech_1.7.10:6.14.23:dev") {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.7.5.23-GTNH:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.3.19-GTNH:dev') {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:EnderIO:2.3.1.29:dev") {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:GTplusplus:1.7.49:dev") {transitive = false}
|
||||
|
||||
|
||||
runtime("com.github.GTNewHorizons:Baubles:1.0.1.14:dev")
|
||||
}
|
||||
+1
-1
@@ -39,7 +39,7 @@ apiPackage =
|
||||
|
||||
# Specify the configuration file for Forge's access transformers here. I must be placed into /src/main/resources/META-INF/
|
||||
# Example value: mymodid_at.cfg
|
||||
accessTransformersFile =
|
||||
accessTransformersFile = ae2fc_at.cfg
|
||||
|
||||
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
|
||||
usesMixins = false
|
||||
|
||||
@@ -20,7 +20,7 @@ import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
@Mod(modid = FluidCraft.MODID, version = FluidCraft.VERSION, name = FluidCraft.MODNAME)
|
||||
@Mod(modid = FluidCraft.MODID, version = FluidCraft.VERSION, name = FluidCraft.MODNAME, dependencies = "required-after:appliedenergistics2")
|
||||
public class FluidCraft {
|
||||
|
||||
public static final String MODID = "GRADLETOKEN_MODID";
|
||||
@@ -43,8 +43,6 @@ public class FluidCraft {
|
||||
@Mod.EventHandler
|
||||
public static void init(FMLInitializationEvent event) {
|
||||
ModAndClassUtil.init();
|
||||
AEApi.instance().registries().cell().addCellHandler(new FluidCellHandler());
|
||||
ItemAndBlockHolder.loadSetting();
|
||||
proxy.init(event);
|
||||
}
|
||||
|
||||
@@ -52,6 +50,9 @@ public class FluidCraft {
|
||||
public static void postInit(FMLPostInitializationEvent event) {
|
||||
NetworkRegistry.INSTANCE.registerGuiHandler(FluidCraft.INSTANCE, new InventoryHandler());
|
||||
|
||||
AEApi.instance().registries().cell().addCellHandler(new FluidCellHandler());
|
||||
ItemAndBlockHolder.loadSetting();
|
||||
|
||||
if (!Config.removeRecipe) {
|
||||
(new RecipeLoader()).run();
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ public class GuiBaseFluidPatternTerminal extends GuiFCBaseMonitor {
|
||||
private static final String CRAFTMODE_CRFTING = "1";
|
||||
private static final String CRAFTMODE_PROCESSING = "0";
|
||||
|
||||
public final FCBasePartContainer container;
|
||||
public FCBasePartContainer container;
|
||||
|
||||
private GuiTabButton tabCraftButton;
|
||||
private GuiTabButton tabProcessButton;
|
||||
@@ -40,11 +40,14 @@ public class GuiBaseFluidPatternTerminal extends GuiFCBaseMonitor {
|
||||
private GuiImgButton clearBtn;
|
||||
private GuiImgButton doubleBtn;
|
||||
|
||||
private GuiFCImgButton combineEnableBtn;
|
||||
private GuiFCImgButton combineDisableBtn;
|
||||
|
||||
public GuiBaseFluidPatternTerminal(final InventoryPlayer inventoryPlayer, final ITerminalHost te )
|
||||
{
|
||||
super( inventoryPlayer, te, new FCBasePartContainer( inventoryPlayer, te ) );
|
||||
this.container = (FCBasePartContainer) this.inventorySlots;
|
||||
Ae2ReflectClient.setReservedSpace(this, 81);
|
||||
setReservedSpace(81);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -68,6 +71,10 @@ public class GuiBaseFluidPatternTerminal extends GuiFCBaseMonitor {
|
||||
{
|
||||
FluidCraft.proxy.netHandler.sendToServer( new CPacketFluidPatternTermBtns( "PatternTerminal.Substitute", this.substitutionsEnabledBtn == btn ? SUBSITUTION_DISABLE : SUBSITUTION_ENABLE ) );
|
||||
}
|
||||
else if( this.combineDisableBtn == btn || this.combineEnableBtn == btn )
|
||||
{
|
||||
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") );
|
||||
@@ -100,11 +107,22 @@ public class GuiBaseFluidPatternTerminal extends GuiFCBaseMonitor {
|
||||
this.encodeBtn = new GuiImgButton( this.guiLeft + 147, this.guiTop + this.ySize - 142, Settings.ACTIONS, ActionItems.ENCODE );
|
||||
this.buttonList.add( this.encodeBtn );
|
||||
|
||||
int combineLeft = 74;
|
||||
|
||||
if (ModAndClassUtil.isDoubleButton) {
|
||||
this.doubleBtn = new GuiImgButton( this.guiLeft + 74, this.guiTop + this.ySize - 153, Settings.ACTIONS, ActionItems.DOUBLE );
|
||||
this.doubleBtn.setHalfSize( true );
|
||||
this.buttonList.add( this.doubleBtn );
|
||||
combineLeft = 84;
|
||||
}
|
||||
|
||||
this.combineEnableBtn = new GuiFCImgButton( this.guiLeft + combineLeft, this.guiTop + this.ySize - 153, "FORCE_COMBINE", "DO_COMBINE" );
|
||||
this.combineEnableBtn.setHalfSize( true );
|
||||
this.buttonList.add( this.combineEnableBtn );
|
||||
|
||||
this.combineDisableBtn = new GuiFCImgButton( this.guiLeft + combineLeft, this.guiTop + this.ySize - 153, "NOT_COMBINE", "DONT_COMBINE" );
|
||||
this.combineDisableBtn.setHalfSize( true );
|
||||
this.buttonList.add( this.combineDisableBtn );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -136,8 +154,27 @@ public class GuiBaseFluidPatternTerminal extends GuiFCBaseMonitor {
|
||||
this.substitutionsDisabledBtn.visible = true;
|
||||
}
|
||||
|
||||
if (!this.container.isCraftingMode())
|
||||
{
|
||||
if ( this.container.combine )
|
||||
{
|
||||
this.combineEnableBtn.visible = true;
|
||||
this.combineDisableBtn.visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.combineEnableBtn.visible = false;
|
||||
this.combineDisableBtn.visible = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.combineEnableBtn.visible = false;
|
||||
this.combineDisableBtn.visible = false;
|
||||
}
|
||||
|
||||
super.drawFG( offsetX, offsetY, mouseX, mouseY );
|
||||
this.fontRendererObj.drawString(StatCollector.translateToLocal(NameConst.GUI_FLUID_PATTERN_TERMINAL), 8, this.ySize - 96 + 2 - Ae2ReflectClient.getReservedSpace(this), 4210752 );
|
||||
this.fontRendererObj.drawString(StatCollector.translateToLocal(NameConst.GUI_FLUID_PATTERN_TERMINAL), 8, this.ySize - 96 + 2 - getReservedSpace(), 4210752 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -34,13 +34,15 @@ public class GuiBaseFluidPatternTerminalEx extends GuiFCBaseMonitor {
|
||||
private GuiImgButton clearBtn;
|
||||
private GuiImgButton doubleBtn;
|
||||
|
||||
private GuiFCImgButton combineEnableBtn;
|
||||
private GuiFCImgButton combineDisableBtn;
|
||||
private final GuiScrollbar processingScrollBar = new GuiScrollbar();
|
||||
|
||||
public GuiBaseFluidPatternTerminalEx(final InventoryPlayer inventoryPlayer, final ITerminalHost te )
|
||||
{
|
||||
super( inventoryPlayer, te, new FCBasePartContainerEx( inventoryPlayer, te ) );
|
||||
this.container = (FCBasePartContainerEx) this.inventorySlots;
|
||||
Ae2ReflectClient.setReservedSpace(this, 81);
|
||||
setReservedSpace(81);
|
||||
|
||||
processingScrollBar.setHeight(70).setWidth(7).setLeft(6).setRange(0, 1, 1);
|
||||
processingScrollBar.setTexture(FluidCraft.MODID, "gui/pattern3.png", 242, 0);
|
||||
@@ -67,6 +69,10 @@ public class GuiBaseFluidPatternTerminalEx extends GuiFCBaseMonitor {
|
||||
{
|
||||
FluidCraft.proxy.netHandler.sendToServer( new CPacketFluidPatternTermBtns( "PatternTerminalEx.Invert", container.inverted ? "0" : "1" ) );
|
||||
}
|
||||
else if( this.combineDisableBtn == btn || this.combineEnableBtn == btn )
|
||||
{
|
||||
FluidCraft.proxy.netHandler.sendToServer( new CPacketFluidPatternTermBtns( "PatternTerminalEx.Combine", this.combineDisableBtn == btn ? "1" : "0" ) );
|
||||
}
|
||||
else if (ModAndClassUtil.isDoubleButton && doubleBtn == btn)
|
||||
{
|
||||
FluidCraft.proxy.netHandler.sendToServer( new CPacketFluidPatternTermBtns( "PatternTerminalEx.Double", Keyboard.isKeyDown( Keyboard.KEY_LSHIFT ) ? "1": "0") );
|
||||
@@ -104,6 +110,14 @@ public class GuiBaseFluidPatternTerminalEx extends GuiFCBaseMonitor {
|
||||
this.buttonList.add( this.doubleBtn );
|
||||
}
|
||||
|
||||
this.combineEnableBtn = new GuiFCImgButton( this.guiLeft + 87, this.guiTop + this.ySize - 143, "FORCE_COMBINE", "DO_COMBINE" );
|
||||
this.combineEnableBtn.setHalfSize( true );
|
||||
this.buttonList.add( this.combineEnableBtn );
|
||||
|
||||
this.combineDisableBtn = new GuiFCImgButton( this.guiLeft + 87, this.guiTop + this.ySize - 143, "NOT_COMBINE", "DONT_COMBINE" );
|
||||
this.combineDisableBtn.setHalfSize( true );
|
||||
this.buttonList.add( this.combineDisableBtn );
|
||||
|
||||
processingScrollBar.setTop(this.ySize - 164);
|
||||
}
|
||||
|
||||
@@ -124,8 +138,19 @@ public class GuiBaseFluidPatternTerminalEx extends GuiFCBaseMonitor {
|
||||
this.substitutionsDisabledBtn.visible = true;
|
||||
}
|
||||
|
||||
if ( this.container.combine )
|
||||
{
|
||||
this.combineEnableBtn.visible = true;
|
||||
this.combineDisableBtn.visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.combineEnableBtn.visible = false;
|
||||
this.combineDisableBtn.visible = true;
|
||||
}
|
||||
|
||||
super.drawFG( offsetX, offsetY, mouseX, mouseY );
|
||||
this.fontRendererObj.drawString( StatCollector.translateToLocal(NameConst.GUI_FLUID_PATTERN_TERMINAL_EX), 8, this.ySize - 96 + 2 - Ae2ReflectClient.getReservedSpace(this), 4210752 );
|
||||
this.fontRendererObj.drawString( StatCollector.translateToLocal(NameConst.GUI_FLUID_PATTERN_TERMINAL_EX), 8, this.ySize - 96 + 2 - getReservedSpace(), 4210752 );
|
||||
this.processingScrollBar.draw(this);
|
||||
}
|
||||
|
||||
@@ -167,6 +192,8 @@ public class GuiBaseFluidPatternTerminalEx extends GuiFCBaseMonitor {
|
||||
doubleBtn.xPosition = this.guiLeft + 97 + offset;
|
||||
clearBtn.xPosition = this.guiLeft + 87 + offset;
|
||||
invertBtn.xPosition = this.guiLeft + 87 + offset;
|
||||
combineEnableBtn.xPosition = this.guiLeft + 87 + offset;
|
||||
combineDisableBtn.xPosition = this.guiLeft + 87 + offset;
|
||||
|
||||
processingScrollBar.setCurrentScroll(container.activePage);
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ public class GuiFCBaseMonitor extends AEBaseMEGui implements ISortSource, IConfi
|
||||
private final boolean viewCell;
|
||||
private final ItemStack[] myCurrentViewCells = new ItemStack[5];
|
||||
public FCBaseMonitorContain monitorableContainer;
|
||||
private GuiTabButton craftingStatusBtn;
|
||||
public GuiTabButton craftingStatusBtn;
|
||||
private GuiImgButton craftingStatusImgBtn;
|
||||
private FCGuiTextField searchField;
|
||||
private int perRow = 9;
|
||||
@@ -77,11 +77,6 @@ public class GuiFCBaseMonitor extends AEBaseMEGui implements ISortSource, IConfi
|
||||
private GuiImgButton terminalStyleBox;
|
||||
private GuiImgButton searchStringSave;
|
||||
|
||||
public GuiFCBaseMonitor(final InventoryPlayer inventoryPlayer, final ITerminalHost te )
|
||||
{
|
||||
this( inventoryPlayer, te, new FCBasePartContainer( inventoryPlayer, te ) );
|
||||
}
|
||||
|
||||
public GuiFCBaseMonitor( final InventoryPlayer inventoryPlayer, final ITerminalHost te, final FCBaseMonitorContain c )
|
||||
{
|
||||
|
||||
@@ -136,8 +131,8 @@ public class GuiFCBaseMonitor extends AEBaseMEGui implements ISortSource, IConfi
|
||||
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<?> cv = iBtn.getCurrentValue();
|
||||
final Enum<?> next = Platform.rotateEnum( cv, backwards, iBtn.getSetting().getPossibleValues() );
|
||||
|
||||
if( btn == this.terminalStyleBox )
|
||||
{
|
||||
@@ -180,6 +175,7 @@ public class GuiFCBaseMonitor extends AEBaseMEGui implements ISortSource, IConfi
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void initGui()
|
||||
{
|
||||
Keyboard.enableRepeatEvents( true );
|
||||
@@ -195,7 +191,7 @@ public class GuiFCBaseMonitor extends AEBaseMEGui implements ISortSource, IConfi
|
||||
final int magicNumber = 114 + 1;
|
||||
final int extraSpace = this.height - magicNumber - NEI - top - this.reservedSpace;
|
||||
|
||||
this.rows = (int) Math.floor( extraSpace / 18 );
|
||||
this.rows = (int) Math.floor( extraSpace / 18.0 );
|
||||
if( this.rows > this.maxRows )
|
||||
{
|
||||
top += ( this.rows - this.maxRows ) * 18 / 2;
|
||||
@@ -284,7 +280,7 @@ public class GuiFCBaseMonitor extends AEBaseMEGui implements ISortSource, IConfi
|
||||
}
|
||||
|
||||
// Enum setting = AEConfig.INSTANCE.getSetting( "Terminal", SearchBoxMode.class, SearchBoxMode.AUTOSEARCH );
|
||||
final Enum setting = AEConfig.instance.settings.getSetting( Settings.SEARCH_MODE );
|
||||
final Enum<?> setting = AEConfig.instance.settings.getSetting( Settings.SEARCH_MODE );
|
||||
this.searchField.setFocused( SearchBoxMode.AUTOSEARCH == setting || SearchBoxMode.NEI_AUTOSEARCH == setting );
|
||||
|
||||
if (ModAndClassUtil.isSearchBar && (AEConfig.instance.preserveSearchBar || this.isSubGui()))
|
||||
@@ -346,7 +342,7 @@ public class GuiFCBaseMonitor extends AEBaseMEGui implements ISortSource, IConfi
|
||||
@Override
|
||||
protected void mouseClicked( final int xCoord, final int yCoord, final int btn )
|
||||
{
|
||||
final Enum searchMode = AEConfig.instance.settings.getSetting( Settings.SEARCH_MODE );
|
||||
final Enum<?> searchMode = AEConfig.instance.settings.getSetting( Settings.SEARCH_MODE );
|
||||
|
||||
if( searchMode != SearchBoxMode.AUTOSEARCH && searchMode != SearchBoxMode.NEI_AUTOSEARCH )
|
||||
{
|
||||
@@ -413,7 +409,7 @@ public class GuiFCBaseMonitor extends AEBaseMEGui implements ISortSource, IConfi
|
||||
return; // prevent weird double clicks..
|
||||
}
|
||||
|
||||
InventoryAction action = null;
|
||||
InventoryAction action;
|
||||
if( isShiftKeyDown() )
|
||||
{
|
||||
action = InventoryAction.CRAFT_SHIFT;
|
||||
@@ -673,19 +669,19 @@ public class GuiFCBaseMonitor extends AEBaseMEGui implements ISortSource, IConfi
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enum getSortBy()
|
||||
public Enum<?> getSortBy()
|
||||
{
|
||||
return this.configSrc.getSetting( Settings.SORT_BY );
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enum getSortDir()
|
||||
public Enum<?> getSortDir()
|
||||
{
|
||||
return this.configSrc.getSetting( Settings.SORT_DIRECTION );
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enum getSortDisplay()
|
||||
public Enum<?> getSortDisplay()
|
||||
{
|
||||
return this.configSrc.getSetting( Settings.VIEW_MODE );
|
||||
}
|
||||
@@ -711,12 +707,12 @@ public class GuiFCBaseMonitor extends AEBaseMEGui implements ISortSource, IConfi
|
||||
this.repo.updateView();
|
||||
}
|
||||
|
||||
int getReservedSpace()
|
||||
public int getReservedSpace()
|
||||
{
|
||||
return this.reservedSpace;
|
||||
}
|
||||
|
||||
void setReservedSpace( final int reservedSpace )
|
||||
public void setReservedSpace( final int reservedSpace )
|
||||
{
|
||||
this.reservedSpace = reservedSpace;
|
||||
}
|
||||
@@ -726,7 +722,7 @@ public class GuiFCBaseMonitor extends AEBaseMEGui implements ISortSource, IConfi
|
||||
return this.customSortOrder;
|
||||
}
|
||||
|
||||
void setCustomSortOrder( final boolean customSortOrder )
|
||||
public void setCustomSortOrder( final boolean customSortOrder )
|
||||
{
|
||||
this.customSortOrder = customSortOrder;
|
||||
}
|
||||
@@ -736,7 +732,7 @@ public class GuiFCBaseMonitor extends AEBaseMEGui implements ISortSource, IConfi
|
||||
return this.standardSize;
|
||||
}
|
||||
|
||||
void setStandardSize( final int standardSize )
|
||||
public void setStandardSize( final int standardSize )
|
||||
{
|
||||
this.standardSize = standardSize;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,298 @@
|
||||
package com.glodblock.github.client.gui;
|
||||
|
||||
import appeng.client.gui.widgets.ITooltip;
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class GuiFCImgButton extends GuiButton implements ITooltip {
|
||||
|
||||
private static final Pattern COMPILE = Pattern.compile( "%s" );
|
||||
private static final Pattern PATTERN_NEW_LINE = Pattern.compile( "\\n", Pattern.LITERAL );
|
||||
private static Map<EnumPair, ButtonAppearance> appearances;
|
||||
private final String buttonSetting;
|
||||
private boolean halfSize = false;
|
||||
private String fillVar;
|
||||
private String currentValue;
|
||||
private static final String prefix = NameConst.TT_KEY;
|
||||
|
||||
public GuiFCImgButton( final int x, final int y, final String idx, final String val ) {
|
||||
super(0, 0, 16, "");
|
||||
|
||||
this.buttonSetting = idx;
|
||||
this.currentValue = val;
|
||||
this.xPosition = x;
|
||||
this.yPosition = y;
|
||||
this.width = 16;
|
||||
this.height = 16;
|
||||
|
||||
if( appearances == null ) {
|
||||
appearances = new HashMap<>();
|
||||
this.registerApp( 0, "NOT_COMBINE", "DONT_COMBINE", "not_combine" );
|
||||
this.registerApp( 1, "FORCE_COMBINE", "DO_COMBINE", "combine" );
|
||||
}
|
||||
}
|
||||
|
||||
private void registerApp(final int iconIndex, final String setting, final String val, final String title )
|
||||
{
|
||||
final ButtonAppearance a = new ButtonAppearance();
|
||||
a.displayName = StatCollector.translateToLocal(prefix + title);
|
||||
a.displayValue = StatCollector.translateToLocal(prefix + title + ".hint");
|
||||
a.index = iconIndex;
|
||||
appearances.put( new EnumPair( setting, val ), a );
|
||||
}
|
||||
|
||||
public void setVisibility( final boolean vis )
|
||||
{
|
||||
this.visible = vis;
|
||||
this.enabled = vis;
|
||||
}
|
||||
|
||||
private int getIconIndex()
|
||||
{
|
||||
if( this.buttonSetting != null && this.currentValue != null )
|
||||
{
|
||||
final ButtonAppearance app = appearances.get(new EnumPair( this.buttonSetting, this.currentValue ));
|
||||
if( app == null )
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
return app.index;
|
||||
}
|
||||
return 8;
|
||||
}
|
||||
|
||||
public String getSetting()
|
||||
{
|
||||
return this.buttonSetting;
|
||||
}
|
||||
|
||||
public String getCurrentValue()
|
||||
{
|
||||
return this.currentValue;
|
||||
}
|
||||
|
||||
public void set( final String e )
|
||||
{
|
||||
if(!this.currentValue.equals(e))
|
||||
{
|
||||
this.currentValue = e;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isHalfSize()
|
||||
{
|
||||
return this.halfSize;
|
||||
}
|
||||
|
||||
public void setHalfSize( final boolean halfSize )
|
||||
{
|
||||
this.halfSize = halfSize;
|
||||
}
|
||||
|
||||
public String getFillVar()
|
||||
{
|
||||
return this.fillVar;
|
||||
}
|
||||
|
||||
public void setFillVar( final String fillVar )
|
||||
{
|
||||
this.fillVar = fillVar;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int xPos()
|
||||
{
|
||||
return this.xPosition;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int yPos()
|
||||
{
|
||||
return this.yPosition;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWidth()
|
||||
{
|
||||
return this.halfSize ? 8 : 16;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getHeight()
|
||||
{
|
||||
return this.halfSize ? 8 : 16;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisible()
|
||||
{
|
||||
return this.visible;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
String displayName = null;
|
||||
String displayValue = null;
|
||||
|
||||
if( this.buttonSetting != null && this.currentValue != null )
|
||||
{
|
||||
final ButtonAppearance buttonAppearance = appearances.get( new EnumPair( this.buttonSetting, this.currentValue ) );
|
||||
if( buttonAppearance == null )
|
||||
{
|
||||
return "No Such Message";
|
||||
}
|
||||
displayName = buttonAppearance.displayName;
|
||||
displayValue = buttonAppearance.displayValue;
|
||||
}
|
||||
|
||||
if( displayName != null )
|
||||
{
|
||||
String name = StatCollector.translateToLocal( displayName );
|
||||
String value = StatCollector.translateToLocal( displayValue );
|
||||
|
||||
if( name == null || name.isEmpty() )
|
||||
{
|
||||
name = displayName;
|
||||
}
|
||||
if( value == null || value.isEmpty() )
|
||||
{
|
||||
value = displayValue;
|
||||
}
|
||||
|
||||
if( this.fillVar != null )
|
||||
{
|
||||
value = COMPILE.matcher( value ).replaceFirst( this.fillVar );
|
||||
}
|
||||
|
||||
value = PATTERN_NEW_LINE.matcher( value ).replaceAll( "\n" );
|
||||
final StringBuilder sb = new StringBuilder( value );
|
||||
|
||||
int i = sb.lastIndexOf( "\n" );
|
||||
if( i <= 0 )
|
||||
{
|
||||
i = 0;
|
||||
}
|
||||
while( i + 30 < sb.length() && ( i = sb.lastIndexOf( " ", i + 30 ) ) != -1 )
|
||||
{
|
||||
sb.replace( i, i + 1, "\n" );
|
||||
}
|
||||
|
||||
return name + '\n' + sb;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawButton(final Minecraft par1Minecraft, final int par2, final int par3 )
|
||||
{
|
||||
if( this.visible )
|
||||
{
|
||||
final int iconIndex = this.getIconIndex();
|
||||
|
||||
if( this.halfSize )
|
||||
{
|
||||
this.width = 8;
|
||||
this.height = 8;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef( this.xPosition, this.yPosition, 0.0F );
|
||||
GL11.glScalef( 0.5f / 16 * 3, 0.5f / 16 * 3, 0.5f / 16 * 3 );
|
||||
|
||||
if( this.enabled )
|
||||
{
|
||||
GL11.glColor4f( 1.0f, 1.0f, 1.0f, 1.0f );
|
||||
}
|
||||
else
|
||||
{
|
||||
GL11.glColor4f( 0.5f, 0.5f, 0.5f, 1.0f );
|
||||
}
|
||||
|
||||
par1Minecraft.renderEngine.bindTexture( FluidCraft.resource("textures/gui/states.png") );
|
||||
this.field_146123_n = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height;
|
||||
|
||||
final int uv_y = (int) Math.floor( iconIndex / 3.0 );
|
||||
final int uv_x = iconIndex - uv_y * 3;
|
||||
|
||||
this.drawTexturedModalRect( 0, 0, Math.round(32F * 16F / 3F), Math.round(32F * 16F / 3F), Math.round(16F * 16F / 3F), Math.round(16F * 16F / 3F) );
|
||||
this.drawTexturedModalRect( 0, 0, Math.round(uv_x * 16F * 16F / 3F), Math.round(uv_y * 16F * 16F / 3F), Math.round(16F * 16F / 3F), Math.round(16F * 16F / 3F) );
|
||||
this.mouseDragged( par1Minecraft, par2, par3 );
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
else
|
||||
{
|
||||
if( this.enabled )
|
||||
{
|
||||
GL11.glColor4f( 1.0f, 1.0f, 1.0f, 1.0f );
|
||||
}
|
||||
else
|
||||
{
|
||||
GL11.glColor4f( 0.5f, 0.5f, 0.5f, 1.0f );
|
||||
}
|
||||
|
||||
par1Minecraft.renderEngine.bindTexture( FluidCraft.resource("textures/gui/states.png") );
|
||||
this.field_146123_n = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height;
|
||||
|
||||
final int uv_y = (int) Math.floor( iconIndex / 3.0 );
|
||||
final int uv_x = iconIndex - uv_y * 3;
|
||||
|
||||
this.drawTexturedModalRect( this.xPosition, this.yPosition, 32, 32, 16, 16 );
|
||||
this.drawTexturedModalRect( this.xPosition, this.yPosition, uv_x * 16, uv_y * 16, 16, 16 );
|
||||
this.mouseDragged( par1Minecraft, par2, par3 );
|
||||
}
|
||||
}
|
||||
GL11.glColor4f( 1.0f, 1.0f, 1.0f, 1.0f );
|
||||
}
|
||||
|
||||
private static final class EnumPair
|
||||
{
|
||||
|
||||
final String setting;
|
||||
final String value;
|
||||
|
||||
EnumPair( final String a, final String b )
|
||||
{
|
||||
this.setting = a;
|
||||
this.value = b;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
return this.setting.hashCode() ^ this.value.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals( final Object obj )
|
||||
{
|
||||
if( obj == null )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if( this.getClass() != obj.getClass() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
final EnumPair other = (EnumPair) obj;
|
||||
return other.setting.equals(this.setting) && other.value.equals(this.value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static class ButtonAppearance
|
||||
{
|
||||
public int index;
|
||||
public String displayName;
|
||||
public String displayValue;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,7 +11,6 @@ import com.glodblock.github.common.item.ItemFluidPacket;
|
||||
import com.glodblock.github.inventory.InventoryHandler;
|
||||
import com.glodblock.github.inventory.gui.GuiType;
|
||||
import com.glodblock.github.inventory.slot.SlotSingleItem;
|
||||
import com.glodblock.github.util.Ae2Reflect;
|
||||
import com.glodblock.github.util.Ae2ReflectClient;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
@@ -27,13 +26,15 @@ public class GuiFluidPatternTerminal extends GuiBaseFluidPatternTerminal {
|
||||
ContainerFluidPatternTerminal container = new ContainerFluidPatternTerminal(inventoryPlayer, te);
|
||||
container.setGui(this);
|
||||
this.inventorySlots = container;
|
||||
Ae2ReflectClient.setGuiContainer(this, container);
|
||||
this.container = container;
|
||||
this.monitorableContainer = container;
|
||||
this.configSrc = container.getConfigManager();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
craftingStatusBtn = Ae2ReflectClient.getCraftingStatusButton(this);
|
||||
craftingStatusBtn = super.craftingStatusBtn;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -35,7 +35,7 @@ public class GuiFluidPatternTerminalEx extends GuiBaseFluidPatternTerminalEx {
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
craftingStatusBtn = Ae2ReflectClient.getCraftingStatusButton(this);
|
||||
craftingStatusBtn = super.craftingStatusBtn;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.glodblock.github.client.gui;
|
||||
|
||||
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;
|
||||
import com.glodblock.github.inventory.IAEFluidTank;
|
||||
import com.glodblock.github.inventory.gui.ButtonMouseHandler;
|
||||
import com.glodblock.github.inventory.gui.MouseRegionManager;
|
||||
import com.glodblock.github.inventory.gui.TankMouseHandler;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class GuiLargeIngredientBuffer extends AEBaseGui {
|
||||
|
||||
private static final ResourceLocation TEX_BG = FluidCraft.resource("textures/gui/large_ingredient_buffer.png");
|
||||
private static final int TANK_X = 13, TANK_X_OFF = 22, TANK_Y = 18;
|
||||
private static final int TANK_WIDTH = 16, TANK_HEIGHT = 37;
|
||||
|
||||
private final ContainerLargeIngredientBuffer cont;
|
||||
private final MouseRegionManager mouseRegions = new MouseRegionManager(this);
|
||||
|
||||
public GuiLargeIngredientBuffer(InventoryPlayer ipl, TileLargeIngredientBuffer tile) {
|
||||
super(new ContainerLargeIngredientBuffer(ipl, tile));
|
||||
this.cont = (ContainerLargeIngredientBuffer) inventorySlots;
|
||||
this.ySize = 222;
|
||||
for (int i = 0; i < 7; i++) {
|
||||
mouseRegions.addRegion(TANK_X + TANK_X_OFF * i, TANK_Y, TANK_WIDTH, TANK_HEIGHT,
|
||||
new TankMouseHandler(cont.getTile().getFluidInventory(), i));
|
||||
mouseRegions.addRegion(TANK_X + 10 + 22 * i, TANK_Y + TANK_HEIGHT + 2, 7, 7,
|
||||
ButtonMouseHandler.dumpTank(cont, i));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mouseClicked(int xCoord, int yCoord, int btn) {
|
||||
if (mouseRegions.onClick(xCoord, yCoord, btn)) {
|
||||
super.mouseClicked(xCoord, yCoord, btn);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) {
|
||||
mc.getTextureManager().bindTexture(TEX_BG);
|
||||
drawTexturedModalRect(offsetX, offsetY, 0, 0, 176, ySize);
|
||||
}
|
||||
|
||||
@Override
|
||||
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(GuiText.inventory.getLocal(), 8, ySize - 94, 0x404040);
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
|
||||
IAEFluidTank fluidInv = cont.getTile().getFluidInventory();
|
||||
mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
|
||||
for (int i = 0; i < 7; i++) {
|
||||
renderFluidIntoGui(TANK_X + i * TANK_X_OFF, TANK_Y, TANK_WIDTH, TANK_HEIGHT,
|
||||
fluidInv.getFluidInSlot(i), fluidInv.getTankInfo(ForgeDirection.UNKNOWN)[i].capacity);
|
||||
}
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
|
||||
mouseRegions.render(mouseX, mouseY);
|
||||
}
|
||||
|
||||
public void renderFluidIntoGui(int x, int y, int width, int height,
|
||||
@Nullable IAEFluidStack aeFluidStack, int capacity) {
|
||||
if (aeFluidStack != null) {
|
||||
GL11.glDisable(2896);
|
||||
GL11.glColor3f(1.0F, 1.0F, 1.0F);
|
||||
int hi = (int) (height * ((double) aeFluidStack.getStackSize() / capacity));
|
||||
if (aeFluidStack.getStackSize() > 0 && hi > 0) {
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
IIcon fluidIcon = aeFluidStack.getFluid().getStillIcon();
|
||||
GL11.glColor3f((float)(aeFluidStack.getFluid().getColor() >> 16 & 255) / 255.0F, (float)(aeFluidStack.getFluid().getColor() >> 8 & 255) / 255.0F, (float)(aeFluidStack.getFluid().getColor() & 255) / 255.0F);
|
||||
for (int th = 0; th <= hi; th += 16) {
|
||||
if (hi - th <= 0) break;
|
||||
this.drawTexturedModelRectFromIcon(x, y + height - Math.min(16, hi - th) - th, fluidIcon, width, Math.min(16, hi - th));
|
||||
}
|
||||
GL11.glColor3f(1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void update(int slot, IAEFluidStack aeFluidStack) {
|
||||
cont.getTile().getFluidInventory().setFluidInSlot(slot, aeFluidStack);
|
||||
}
|
||||
|
||||
}
|
||||
+4
-1
@@ -28,6 +28,8 @@ import com.glodblock.github.inventory.InventoryHandler;
|
||||
import com.glodblock.github.inventory.gui.GuiType;
|
||||
import com.glodblock.github.network.SPacketMEInventoryUpdate;
|
||||
import com.glodblock.github.util.Ae2Reflect;
|
||||
import com.glodblock.github.util.BlockPos;
|
||||
import com.glodblock.github.util.Util;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
@@ -39,6 +41,7 @@ import net.minecraft.world.World;
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
public class ContainerFluidCraftConfirm extends AEBaseContainer {
|
||||
@@ -312,7 +315,7 @@ public class ContainerFluidCraftConfirm extends AEBaseContainer {
|
||||
this.setAutoStart( false );
|
||||
if( g != null && originalGui != null && this.getOpenContext() != null )
|
||||
{
|
||||
InventoryHandler.switchGui(originalGui);
|
||||
InventoryHandler.openGui(this.getInventoryPlayer().player, getWorld(), new BlockPos(this.getOpenContext().getTile()), Objects.requireNonNull(Util.from(this.getOpenContext().getSide())), originalGui);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
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.TankDumpable;
|
||||
import com.glodblock.github.common.tile.TileLargeIngredientBuffer;
|
||||
import com.glodblock.github.network.SPacketFluidUpdate;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class ContainerLargeIngredientBuffer extends AEBaseContainer implements TankDumpable {
|
||||
|
||||
private final TileLargeIngredientBuffer tile;
|
||||
|
||||
public ContainerLargeIngredientBuffer(InventoryPlayer ipl, TileLargeIngredientBuffer tile) {
|
||||
super(ipl, tile);
|
||||
this.tile = tile;
|
||||
IInventory inv = tile.getInternalInventory();
|
||||
for (int i = 0; i < 3; i++) {
|
||||
for (int j = 0; j < 9; j++) {
|
||||
addSlotToContainer(new SlotNormal(inv, i * 9 + j, 8 + 18 * j, 72 + 18 * i));
|
||||
}
|
||||
}
|
||||
bindPlayerInventory(ipl, 0, 140);
|
||||
}
|
||||
|
||||
public TileLargeIngredientBuffer getTile() {
|
||||
return tile;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDumpTank(int index) {
|
||||
return tile.getFluidInventory().getFluidInSlot(index) != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dumpTank(int index) {
|
||||
if (index >= 0 && index < tile.getFluidInventory().getSlots()) {
|
||||
tile.getFluidInventory().setFluidInSlot(index, null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void detectAndSendChanges()
|
||||
{
|
||||
super.detectAndSendChanges();
|
||||
Map<Integer, IAEFluidStack> tmp = new HashMap<>();
|
||||
for (int i = 0; i < tile.getFluidInventory().getSlots(); i ++) {
|
||||
tmp.put(i, tile.getFluidInventory().getFluidInSlot(i));
|
||||
}
|
||||
for( final Object g : this.crafters )
|
||||
{
|
||||
if( g instanceof EntityPlayer)
|
||||
{
|
||||
FluidCraft.proxy.netHandler.sendTo(new SPacketFluidUpdate(tmp), (EntityPlayerMP) g);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -58,6 +58,8 @@ public class FCBasePartContainer extends FCBaseMonitorContain implements IAEAppE
|
||||
public boolean craftingMode = true;
|
||||
@GuiSync( 96 )
|
||||
public boolean substitute = false;
|
||||
@GuiSync( 95 )
|
||||
public boolean combine = false;
|
||||
|
||||
public FCBasePartContainer(final InventoryPlayer ip, final ITerminalHost monitorable )
|
||||
{
|
||||
@@ -457,6 +459,7 @@ public class FCBasePartContainer extends FCBaseMonitorContain implements IAEAppE
|
||||
}
|
||||
|
||||
this.substitute = this.patternTerminal.isSubstitution();
|
||||
this.combine = this.patternTerminal.shouldCombine();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -60,6 +60,8 @@ public class FCBasePartContainerEx extends FCBaseMonitorContain implements IAEAp
|
||||
protected final ProcessingSlotFake[] outputSlots = new ProcessingSlotFake[CRAFTING_GRID_SLOTS * CRAFTING_GRID_PAGES];
|
||||
protected final SlotRestrictedInput patternSlotIN;
|
||||
protected final SlotRestrictedInput patternSlotOUT;
|
||||
@GuiSync( 96 + (17-9) + 11 )
|
||||
public boolean combine = false;
|
||||
@GuiSync( 96 + (17-9) + 12 )
|
||||
public boolean substitute = false;
|
||||
@GuiSync( 96 + (17-9) + 16 )
|
||||
@@ -248,7 +250,7 @@ public class FCBasePartContainerEx extends FCBaseMonitorContain implements IAEAp
|
||||
|
||||
if( hasValue )
|
||||
{
|
||||
return list.toArray( new ItemStack[list.size()] );
|
||||
return list.toArray(new ItemStack[0]);
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -303,6 +305,7 @@ public class FCBasePartContainerEx extends FCBaseMonitorContain implements IAEAp
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
this.substitute = this.patternTerminal.isSubstitution();
|
||||
this.combine = this.patternTerminal.shouldCombine();
|
||||
if (inverted != patternTerminal.isInverted() || activePage != patternTerminal.getActivePage()) {
|
||||
inverted = patternTerminal.isInverted();
|
||||
activePage = patternTerminal.getActivePage();
|
||||
|
||||
@@ -2,8 +2,10 @@ 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;
|
||||
import net.minecraft.util.IIcon;
|
||||
@@ -22,12 +24,12 @@ public class ItemPacketRender implements IItemRenderer {
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
return type == ItemRenderType.INVENTORY;
|
||||
return type != ItemRenderType.FIRST_PERSON_MAP;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
|
||||
return false;
|
||||
return type == ItemRenderType.ENTITY;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -50,18 +52,11 @@ public class ItemPacketRender implements IItemRenderer {
|
||||
GL11.glColor3f((RGB >> 16 & 0xFF) / 255.0F, (RGB >> 8 & 0xFF) / 255.0F, (RGB & 0xFF) / 255.0F);
|
||||
}
|
||||
|
||||
Tessellator tess = Tessellator.instance;
|
||||
tess.startDrawingQuads();
|
||||
// draw a simple rectangle for the inventory icon
|
||||
final float x_min = icon.getMinU();
|
||||
final float x_max = icon.getMaxU();
|
||||
final float y_min = icon.getMinV();
|
||||
final float y_max = icon.getMaxV();
|
||||
tess.addVertexWithUV( 0, 16, 0, x_min, y_max);
|
||||
tess.addVertexWithUV(16, 16, 0, x_max, y_max);
|
||||
tess.addVertexWithUV(16, 0, 0, x_max, y_min);
|
||||
tess.addVertexWithUV( 0, 0, 0, x_min, y_min);
|
||||
tess.draw();
|
||||
if (type.equals(ItemRenderType.INVENTORY)) {
|
||||
RenderUtil.renderItemIcon(icon, 16.0D, 0.001D, 0.0F, 0.0F, -1.0F);
|
||||
} else {
|
||||
ItemRenderer.renderItemIn2D(Tessellator.instance, icon.getMaxU(), icon.getMinV(), icon.getMinU(), icon.getMaxV(), icon.getIconWidth(), icon.getIconHeight(), 0.0625F);
|
||||
}
|
||||
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
|
||||
@@ -13,6 +13,7 @@ public class Config {
|
||||
public static boolean noFluidPacket;
|
||||
public static boolean fluidIOBus;
|
||||
public static boolean removeRecipe;
|
||||
public static boolean blacklistEssentiaGas;
|
||||
|
||||
public static void run() {
|
||||
loadCategory();
|
||||
@@ -21,9 +22,10 @@ public class Config {
|
||||
|
||||
private static void loadProperty() {
|
||||
fluidCells = Config.getBoolean("Enable Fluid Storage Cell", "Fluid Craft for AE2", true, "Enable this to generate the fluid storage cells. If you are playing with EC2, you can turn it off.");
|
||||
noFluidPacket = Config.getBoolean("No Fluid Packet", "Fluid Craft for AE2", false, "Enable this to make normal ME Interface can emit fluid with fluid pattern, like the Fluid Interface.");
|
||||
noFluidPacket = Config.getBoolean("No Fluid Packet", "Fluid Craft for AE2", false, "Enable this to make normal ME Interface can emit fluid with fluid pattern, like the ME Dual Interface.");
|
||||
fluidIOBus = Config.getBoolean("Enable AE2FC's Fluid I/O Bus", "Fluid Craft for AE2", 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.");
|
||||
blacklistEssentiaGas = Config.getBoolean("Blacklist Essentia Gas", "Fluid Craft for AE2", true, "Blacklist Essentia Gas from Thaumic Energistics, so they won't be stored in Fluid Storage Cells.");
|
||||
|
||||
if (Config.hasChanged())
|
||||
Config.save();
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.glodblock.github.common.block;
|
||||
|
||||
import appeng.block.AEBaseItemBlock;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.common.tile.TileFluidDiscretizer;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
@@ -19,6 +20,7 @@ public class BlockFluidDiscretizer extends FCBaseBlock {
|
||||
public BlockFluidDiscretizer register() {
|
||||
GameRegistry.registerBlock(this, AEBaseItemBlock.class, NameConst.BLOCK_FLUID_DISCRETIZER);
|
||||
GameRegistry.registerTileEntity(TileFluidDiscretizer.class, NameConst.BLOCK_FLUID_DISCRETIZER);
|
||||
setCreativeTab(FluidCraftingTabs.INSTANCE);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import appeng.core.sync.GuiBridge;
|
||||
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;
|
||||
import com.glodblock.github.inventory.InventoryHandler;
|
||||
import com.glodblock.github.inventory.gui.GuiType;
|
||||
@@ -78,6 +79,7 @@ public class BlockFluidInterface extends FCBaseBlock {
|
||||
public BlockFluidInterface register() {
|
||||
GameRegistry.registerBlock(this, AEBaseItemBlock.class, NameConst.BLOCK_FLUID_INTERFACE);
|
||||
GameRegistry.registerTileEntity(TileFluidInterface.class, NameConst.BLOCK_FLUID_INTERFACE);
|
||||
setCreativeTab(FluidCraftingTabs.INSTANCE);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.glodblock.github.common.block;
|
||||
|
||||
import appeng.block.AEBaseItemBlock;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.common.tile.TileFluidPacketDecoder;
|
||||
import com.glodblock.github.inventory.InventoryHandler;
|
||||
import com.glodblock.github.inventory.gui.GuiType;
|
||||
@@ -40,6 +41,7 @@ public class BlockFluidPacketDecoder extends FCBaseBlock {
|
||||
public BlockFluidPacketDecoder register() {
|
||||
GameRegistry.registerBlock(this, AEBaseItemBlock.class, NameConst.BLOCK_FLUID_PACKET_DECODER);
|
||||
GameRegistry.registerTileEntity(TileFluidPacketDecoder.class, NameConst.BLOCK_FLUID_PACKET_DECODER);
|
||||
setCreativeTab(FluidCraftingTabs.INSTANCE);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.glodblock.github.common.block;
|
||||
|
||||
import appeng.block.AEBaseItemBlock;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.common.tile.TileFluidPatternEncoder;
|
||||
import com.glodblock.github.inventory.InventoryHandler;
|
||||
import com.glodblock.github.inventory.gui.GuiType;
|
||||
@@ -40,6 +41,7 @@ public class BlockFluidPatternEncoder extends FCBaseBlock {
|
||||
public BlockFluidPatternEncoder register() {
|
||||
GameRegistry.registerBlock(this, AEBaseItemBlock.class, NameConst.BLOCK_FLUID_PATTERN_ENCODER);
|
||||
GameRegistry.registerTileEntity(TileFluidPatternEncoder.class, NameConst.BLOCK_FLUID_PATTERN_ENCODER);
|
||||
setCreativeTab(FluidCraftingTabs.INSTANCE);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.glodblock.github.common.block;
|
||||
|
||||
import appeng.block.AEBaseItemBlock;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.common.tile.TileIngredientBuffer;
|
||||
import com.glodblock.github.inventory.InventoryHandler;
|
||||
import com.glodblock.github.inventory.gui.GuiType;
|
||||
@@ -41,6 +42,7 @@ public class BlockIngredientBuffer extends FCBaseBlock {
|
||||
public BlockIngredientBuffer register() {
|
||||
GameRegistry.registerBlock(this, AEBaseItemBlock.class, NameConst.BLOCK_INGREDIENT_BUFFER);
|
||||
GameRegistry.registerTileEntity(TileIngredientBuffer.class, NameConst.BLOCK_INGREDIENT_BUFFER);
|
||||
setCreativeTab(FluidCraftingTabs.INSTANCE);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.glodblock.github.common.block;
|
||||
|
||||
import appeng.block.AEBaseItemBlock;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.common.tile.TileLargeIngredientBuffer;
|
||||
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 net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockLargeIngredientBuffer extends FCBaseBlock {
|
||||
|
||||
public BlockLargeIngredientBuffer() {
|
||||
super(Material.iron, NameConst.BLOCK_LARGE_INGREDIENT_BUFFER);
|
||||
setTileEntity(TileLargeIngredientBuffer.class);
|
||||
setOpaque(false);
|
||||
setFullBlock(false);
|
||||
this.lightOpacity = 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
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;
|
||||
}
|
||||
TileLargeIngredientBuffer tile = getTileEntity(world, x, y, z);
|
||||
if (tile != null) {
|
||||
if (!world.isRemote) {
|
||||
InventoryHandler.openGui(player, world, new BlockPos(x, y, z), EnumFacing.getFront(facing), GuiType.LARGE_INGREDIENT_BUFFER);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public BlockLargeIngredientBuffer register() {
|
||||
GameRegistry.registerBlock(this, AEBaseItemBlock.class, NameConst.BLOCK_LARGE_INGREDIENT_BUFFER);
|
||||
GameRegistry.registerTileEntity(TileLargeIngredientBuffer.class, NameConst.BLOCK_LARGE_INGREDIENT_BUFFER);
|
||||
setCreativeTab(FluidCraftingTabs.INSTANCE);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ItemStack stack(int size) {
|
||||
return new ItemStack(this, size);
|
||||
}
|
||||
|
||||
public ItemStack stack() {
|
||||
return new ItemStack(this, 1);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.glodblock.github.common.block;
|
||||
|
||||
import appeng.block.AEBaseItemBlock;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.common.tile.TileOCPatternEditor;
|
||||
import com.glodblock.github.crossmod.opencomputers.OCDriverInit;
|
||||
import com.glodblock.github.inventory.InventoryHandler;
|
||||
@@ -44,6 +45,7 @@ public class BlockOCPatternEditor extends FCBaseBlock {
|
||||
GameRegistry.registerBlock(this, AEBaseItemBlock.class, NameConst.BLOCK_OC_PATTERN_EDITOR);
|
||||
GameRegistry.registerTileEntity(TileOCPatternEditor.class, NameConst.BLOCK_OC_PATTERN_EDITOR);
|
||||
OCDriverInit.run();
|
||||
setCreativeTab(FluidCraftingTabs.INSTANCE);
|
||||
return this;
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -23,6 +23,8 @@ import com.glodblock.github.common.storage.CellType;
|
||||
import com.glodblock.github.common.storage.IFluidCellInventory;
|
||||
import com.glodblock.github.common.storage.IFluidCellInventoryHandler;
|
||||
import com.glodblock.github.common.storage.IStorageFluidCell;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
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;
|
||||
@@ -157,6 +159,9 @@ public class ItemBasicFluidStorageCell extends AEBaseItem implements IStorageFlu
|
||||
|
||||
@Override
|
||||
public boolean isBlackListed(ItemStack cellItem, IAEFluidStack requestedAddition) {
|
||||
if (Config.blacklistEssentiaGas && ModAndClassUtil.ThE && requestedAddition != null) {
|
||||
return ModAndClassUtil.essentiaGas.isInstance(requestedAddition.getFluid());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -325,6 +330,7 @@ public class ItemBasicFluidStorageCell extends AEBaseItem implements IStorageFlu
|
||||
public ItemBasicFluidStorageCell register() {
|
||||
if (!Config.fluidCells) return null;
|
||||
GameRegistry.registerItem(this, NameConst.ITEM_FLUID_STORAGE + this.totalBytes / 1024 , FluidCraft.MODID);
|
||||
setCreativeTab(FluidCraftingTabs.INSTANCE);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.glodblock.github.common.item;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.common.Config;
|
||||
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;
|
||||
@@ -59,6 +60,7 @@ public class ItemBasicFluidStoragePart extends Item {
|
||||
public ItemBasicFluidStoragePart register() {
|
||||
if (!Config.fluidCells) return null;
|
||||
GameRegistry.registerItem(this, NameConst.ITEM_FLUID_PART, FluidCraft.MODID);
|
||||
setCreativeTab(FluidCraftingTabs.INSTANCE);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ 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;
|
||||
@@ -39,6 +40,7 @@ public class ItemFluidExportBus extends Item implements IPartItem {
|
||||
public ItemFluidExportBus register() {
|
||||
if (!Config.fluidIOBus) return null;
|
||||
GameRegistry.registerItem(this, NameConst.ITEM_PART_FLUID_EXPORT, FluidCraft.MODID);
|
||||
setCreativeTab(FluidCraftingTabs.INSTANCE);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ 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;
|
||||
@@ -39,6 +40,7 @@ public class ItemFluidImportBus extends Item implements IPartItem {
|
||||
public ItemFluidImportBus register() {
|
||||
if (!Config.fluidIOBus) return null;
|
||||
GameRegistry.registerItem(this, NameConst.ITEM_PART_FLUID_IMPORT, FluidCraft.MODID);
|
||||
setCreativeTab(FluidCraftingTabs.INSTANCE);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ 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;
|
||||
@@ -37,6 +38,7 @@ public class ItemPartFluidInterface extends Item implements IPartItem {
|
||||
|
||||
public ItemPartFluidInterface register() {
|
||||
GameRegistry.registerItem(this, NameConst.ITEM_PART_FLUID_INTERFACE, FluidCraft.MODID);
|
||||
setCreativeTab(FluidCraftingTabs.INSTANCE);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ 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;
|
||||
@@ -37,6 +38,7 @@ public class ItemPartFluidPatternTerminal extends Item implements IPartItem {
|
||||
|
||||
public ItemPartFluidPatternTerminal register() {
|
||||
GameRegistry.registerItem(this, NameConst.ITEM_PART_FLUID_PATTERN_TERMINAL, FluidCraft.MODID);
|
||||
setCreativeTab(FluidCraftingTabs.INSTANCE);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ 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;
|
||||
@@ -37,6 +38,7 @@ public class ItemPartFluidPatternTerminalEx extends Item implements IPartItem {
|
||||
|
||||
public ItemPartFluidPatternTerminalEx register() {
|
||||
GameRegistry.registerItem(this, NameConst.ITEM_PART_FLUID_PATTERN_TERMINAL_EX, FluidCraft.MODID);
|
||||
setCreativeTab(FluidCraftingTabs.INSTANCE);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ public class PartFluidPatternTerminal extends FCBasePart {
|
||||
|
||||
private boolean craftingMode = true;
|
||||
private boolean substitute = false;
|
||||
private boolean combine = false;
|
||||
|
||||
public PartFluidPatternTerminal(ItemStack is) {
|
||||
super(is, true);
|
||||
@@ -81,6 +82,7 @@ public class PartFluidPatternTerminal extends FCBasePart {
|
||||
super.readFromNBT( data );
|
||||
this.setCraftingRecipe( data.getBoolean( "craftingMode" ) );
|
||||
this.setSubstitution( data.getBoolean( "substitute" ) );
|
||||
this.setCombineMode( data.getBoolean("combine") );
|
||||
this.pattern.readFromNBT( data, "pattern" );
|
||||
this.output.readFromNBT( data, "outputList" );
|
||||
this.crafting.readFromNBT( data, "craftingGrid" );
|
||||
@@ -92,6 +94,7 @@ public class PartFluidPatternTerminal extends FCBasePart {
|
||||
super.writeToNBT( data );
|
||||
data.setBoolean( "craftingMode", this.craftingMode );
|
||||
data.setBoolean( "substitute", this.substitute );
|
||||
data.setBoolean( "combine", this.combine );
|
||||
this.pattern.writeToNBT( data, "pattern" );
|
||||
this.output.writeToNBT( data, "outputList" );
|
||||
this.crafting.writeToNBT( data, "craftingGrid" );
|
||||
@@ -198,11 +201,21 @@ public class PartFluidPatternTerminal extends FCBasePart {
|
||||
return this.substitute;
|
||||
}
|
||||
|
||||
public boolean shouldCombine()
|
||||
{
|
||||
return this.combine;
|
||||
}
|
||||
|
||||
public void setSubstitution( boolean canSubstitute )
|
||||
{
|
||||
this.substitute = canSubstitute;
|
||||
}
|
||||
|
||||
public void setCombineMode(boolean shouldCombine)
|
||||
{
|
||||
this.combine = shouldCombine;
|
||||
}
|
||||
|
||||
public void onChangeCrafting(IAEItemStack[] newCrafting, IAEItemStack[] newOutput) {
|
||||
IInventory crafting = this.getInventoryByName("crafting");
|
||||
IInventory output = this.getInventoryByName("output");
|
||||
|
||||
@@ -38,6 +38,7 @@ public class PartFluidPatternTerminalEx extends FCBasePart {
|
||||
private final AppEngInternalInventory pattern = new AppEngInternalInventory( this, 2 );
|
||||
|
||||
private boolean substitute = false;
|
||||
private boolean combine = false;
|
||||
private boolean inverted = false;
|
||||
private int activePage = 0;
|
||||
|
||||
@@ -79,6 +80,9 @@ public class PartFluidPatternTerminalEx extends FCBasePart {
|
||||
public void readFromNBT( final NBTTagCompound data )
|
||||
{
|
||||
super.readFromNBT( data );
|
||||
|
||||
this.setSubstitution( data.getBoolean( "substitute" ) );
|
||||
this.setCombineMode( data.getBoolean("combine") );
|
||||
this.pattern.readFromNBT( data, "pattern" );
|
||||
this.output.readFromNBT( data, "outputList" );
|
||||
this.crafting.readFromNBT( data, "craftingGrid" );
|
||||
@@ -92,6 +96,9 @@ public class PartFluidPatternTerminalEx extends FCBasePart {
|
||||
public void writeToNBT( final NBTTagCompound data )
|
||||
{
|
||||
super.writeToNBT( data );
|
||||
|
||||
data.setBoolean( "substitute", this.substitute );
|
||||
data.setBoolean( "combine", this.combine );
|
||||
this.pattern.writeToNBT( data, "pattern" );
|
||||
this.output.writeToNBT( data, "outputList" );
|
||||
this.crafting.writeToNBT( data, "craftingGrid" );
|
||||
@@ -199,6 +206,16 @@ public class PartFluidPatternTerminalEx extends FCBasePart {
|
||||
this.getHost().markForSave();
|
||||
}
|
||||
|
||||
public boolean shouldCombine()
|
||||
{
|
||||
return this.combine;
|
||||
}
|
||||
|
||||
public void setCombineMode(boolean shouldCombine)
|
||||
{
|
||||
this.combine = shouldCombine;
|
||||
}
|
||||
|
||||
public boolean isSubstitution()
|
||||
{
|
||||
return this.substitute;
|
||||
|
||||
@@ -11,6 +11,8 @@ import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.item.AEFluidStack;
|
||||
import com.glodblock.github.common.Config;
|
||||
import com.glodblock.github.util.ModAndClassUtil;
|
||||
import com.glodblock.github.util.Util;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -178,8 +180,7 @@ public class FluidCellInventory implements IFluidCellInventory {
|
||||
|
||||
@Override
|
||||
public long getRemainingFluidCount() {
|
||||
final long remaining = this.getFreeBytes() * 8 + this.getUnusedFluidCount();
|
||||
|
||||
final long remaining = this.getFreeBytes() * 8 * 256 + this.getUnusedFluidCount();
|
||||
return remaining > 0 ? remaining : 0;
|
||||
}
|
||||
|
||||
@@ -388,19 +389,19 @@ public class FluidCellInventory implements IFluidCellInventory {
|
||||
|
||||
if( this.canHoldNewFluid() ) // room for new type, and for at least one item!
|
||||
{
|
||||
final int remainingItemCount = (int) this.getRemainingFluidCount() - this.getBytesPerType() * 8;
|
||||
final long remainingItemCount = this.getRemainingFluidCount() - this.getBytesPerType() * 8;
|
||||
|
||||
if( remainingItemCount > 0 )
|
||||
{
|
||||
if( input.getStackSize() > remainingItemCount )
|
||||
{
|
||||
final FluidStack toReturn = Util.cloneFluidStack(sharedFluidStack);
|
||||
toReturn.amount = sharedFluidStack.amount - remainingItemCount;
|
||||
toReturn.amount = (int) (sharedFluidStack.amount - remainingItemCount);
|
||||
|
||||
if( mode == Actionable.MODULATE )
|
||||
{
|
||||
final FluidStack toWrite = Util.cloneFluidStack( sharedFluidStack );
|
||||
toWrite.amount = remainingItemCount;
|
||||
toWrite.amount = (int) remainingItemCount;
|
||||
|
||||
this.cellItems.add( AEFluidStack.create( toWrite ) );
|
||||
this.updateFluidCount( toWrite.amount );
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.glodblock.github.common.tabs;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
public class FluidCraftingTabs extends CreativeTabs {
|
||||
|
||||
public static final FluidCraftingTabs INSTANCE = new FluidCraftingTabs(FluidCraft.MODID);
|
||||
|
||||
public FluidCraftingTabs(String name){
|
||||
super(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getTabIconItem() {
|
||||
return ItemAndBlockHolder.DISCRETIZER.stack().getItem();
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.glodblock.github.common.tile;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.networking.GridFlags;
|
||||
import appeng.api.networking.crafting.ICraftingGrid;
|
||||
@@ -19,7 +20,6 @@ import appeng.me.GridAccessException;
|
||||
import appeng.me.cache.CraftingGridCache;
|
||||
import appeng.me.storage.MEInventoryHandler;
|
||||
import appeng.tile.grid.AENetworkTile;
|
||||
import appeng.util.Platform;
|
||||
import com.glodblock.github.common.item.ItemFluidDrop;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -48,8 +48,6 @@ public class TileFluidDiscretizer extends AENetworkTile implements IPriorityHost
|
||||
@Override
|
||||
@SuppressWarnings("rawtypes")
|
||||
public List<IMEInventoryHandler> getCellArray(StorageChannel channel) {
|
||||
/*conflict = !checkDiscreatizer();
|
||||
if (conflict) return Collections.emptyList();*/
|
||||
if (getProxy().isActive()) {
|
||||
if (channel == StorageChannel.ITEMS) {
|
||||
return Collections.singletonList(fluidDropInv.invHandler);
|
||||
@@ -131,6 +129,25 @@ public class TileFluidDiscretizer extends AENetworkTile implements IPriorityHost
|
||||
updateState();
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void onBootUp(MENetworkBootingStatusChange event) {
|
||||
try {
|
||||
IMEInventory<IAEItemStack> inventory = this.getProxy().getStorage().getItemInventory();
|
||||
IItemList<IAEItemStack> items = inventory.getAvailableItems(AEApi.instance().storage().createItemList());
|
||||
IItemList<IAEItemStack> drops = AEApi.instance().storage().createItemList();
|
||||
for (IAEItemStack item : items) {
|
||||
if (item != null && item.getItem() instanceof ItemFluidDrop) {
|
||||
drops.add(item);
|
||||
}
|
||||
}
|
||||
for (IAEItemStack drop : drops) {
|
||||
inventory.extractItems(drop, Actionable.MODULATE, ownActionSource);
|
||||
inventory.injectItems(drop, Actionable.MODULATE, ownActionSource);
|
||||
}
|
||||
} catch (GridAccessException ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
private class FluidDiscretizingInventory implements IMEInventory<IAEItemStack>, IMEMonitorHandlerReceiver<IAEFluidStack> {
|
||||
|
||||
private final MEInventoryHandler<IAEItemStack> invHandler = new MEInventoryHandler<>(this, getChannel());
|
||||
@@ -142,7 +159,6 @@ public class TileFluidDiscretizer extends AENetworkTile implements IPriorityHost
|
||||
|
||||
@Override
|
||||
public IAEItemStack injectItems(IAEItemStack request, Actionable type, BaseActionSource src) {
|
||||
/*if (conflict) return request;*/
|
||||
IAEFluidStack fluidStack = ItemFluidDrop.getAeFluidStack(request);
|
||||
if (fluidStack == null) {
|
||||
return request;
|
||||
@@ -165,7 +181,6 @@ public class TileFluidDiscretizer extends AENetworkTile implements IPriorityHost
|
||||
|
||||
@Override
|
||||
public IAEItemStack extractItems(IAEItemStack request, Actionable mode, BaseActionSource src) {
|
||||
/*if (conflict) return null;*/
|
||||
IAEFluidStack fluidStack = ItemFluidDrop.getAeFluidStack(request);
|
||||
if (fluidStack == null) {
|
||||
return null;
|
||||
@@ -188,7 +203,6 @@ public class TileFluidDiscretizer extends AENetworkTile implements IPriorityHost
|
||||
|
||||
@Override
|
||||
public IItemList<IAEItemStack> getAvailableItems(IItemList<IAEItemStack> out) {
|
||||
/*if (conflict) return out;*/
|
||||
if (itemCache == null) {
|
||||
itemCache = new ArrayList<>();
|
||||
IMEMonitor<IAEFluidStack> fluidGrid = getFluidGrid();
|
||||
@@ -253,7 +267,6 @@ public class TileFluidDiscretizer extends AENetworkTile implements IPriorityHost
|
||||
@Override
|
||||
@SuppressWarnings("rawtypes")
|
||||
public IAEFluidStack injectItems(IAEFluidStack input, Actionable type, BaseActionSource src) {
|
||||
/*if (conflict) return null;*/
|
||||
ICraftingGrid craftingGrid;
|
||||
try {
|
||||
craftingGrid = getProxy().getGrid().getCache(ICraftingGrid.class);
|
||||
|
||||
@@ -2,18 +2,12 @@ package com.glodblock.github.common.tile;
|
||||
|
||||
import appeng.api.config.Upgrades;
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.networking.energy.IEnergyGrid;
|
||||
import appeng.api.networking.events.MENetworkChannelsChanged;
|
||||
import appeng.api.networking.events.MENetworkEventSubscribe;
|
||||
import appeng.api.networking.events.MENetworkPowerStatusChange;
|
||||
import appeng.api.networking.security.BaseActionSource;
|
||||
import appeng.api.networking.security.MachineSource;
|
||||
import appeng.api.networking.storage.IStorageGrid;
|
||||
import appeng.api.networking.ticking.TickRateModulation;
|
||||
import appeng.api.networking.ticking.TickingRequest;
|
||||
import appeng.api.storage.IMEMonitor;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.me.GridAccessException;
|
||||
import appeng.tile.TileEvent;
|
||||
import appeng.tile.events.TileEventType;
|
||||
import appeng.tile.inventory.AppEngInternalAEInventory;
|
||||
@@ -52,11 +46,13 @@ public class TileFluidInterface extends TileInterface implements IFluidHandler,
|
||||
@MENetworkEventSubscribe
|
||||
public void stateChange(final MENetworkChannelsChanged c) {
|
||||
fluidDuality.onChannelStateChange(c);
|
||||
super.stateChange(c);
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void stateChange(final MENetworkPowerStatusChange c) {
|
||||
fluidDuality.onPowerStateChange(c);
|
||||
super.stateChange(c);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,154 @@
|
||||
package com.glodblock.github.common.tile;
|
||||
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.tile.AEBaseInvTile;
|
||||
import appeng.tile.TileEvent;
|
||||
import appeng.tile.events.TileEventType;
|
||||
import appeng.tile.inventory.AppEngInternalInventory;
|
||||
import appeng.tile.inventory.InvOperation;
|
||||
import appeng.util.item.AEFluidStack;
|
||||
import com.glodblock.github.inventory.AEFluidInventory;
|
||||
import com.glodblock.github.inventory.IAEFluidInventory;
|
||||
import com.glodblock.github.inventory.IAEFluidTank;
|
||||
import cpw.mods.fml.common.network.ByteBufUtils;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.io.IOException;
|
||||
|
||||
public class TileLargeIngredientBuffer extends AEBaseInvTile implements IAEFluidInventory, IFluidHandler {
|
||||
|
||||
private final AppEngInternalInventory invItems = new AppEngInternalInventory(this, 27);
|
||||
private final AEFluidInventory invFluids = new AEFluidInventory(this, 7, 64000);
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IInventory getInternalInventory() {
|
||||
return invItems;
|
||||
}
|
||||
|
||||
public IAEFluidTank getFluidInventory() {
|
||||
return invFluids;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeRotated() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added) {
|
||||
markForUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsBySide(ForgeDirection whichSide) {
|
||||
return new int[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFluidInventoryChanged(IAEFluidTank inv, int slot) {
|
||||
saveChanges();
|
||||
markForUpdate();
|
||||
}
|
||||
|
||||
@TileEvent(TileEventType.NETWORK_WRITE)
|
||||
protected void writeToStream(ByteBuf data) throws IOException {
|
||||
for (int i = 0; i < invItems.getSizeInventory(); i++) {
|
||||
ByteBufUtils.writeItemStack(data, invItems.getStackInSlot(i));
|
||||
}
|
||||
int fluidMask = 0;
|
||||
for (int i = 0; i < invFluids.getSlots(); i++) {
|
||||
if (invFluids.getFluidInSlot(i) != null) {
|
||||
fluidMask |= 1 << i;
|
||||
}
|
||||
}
|
||||
data.writeByte(fluidMask);
|
||||
for (int i = 0; i < invFluids.getSlots(); i++) {
|
||||
IAEFluidStack fluid = invFluids.getFluidInSlot(i);
|
||||
if (fluid != null) {
|
||||
fluid.writeToPacket(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@TileEvent(TileEventType.NETWORK_READ)
|
||||
protected boolean readFromStream(ByteBuf data) throws IOException {
|
||||
boolean changed = false;
|
||||
for (int i = 0; i < invItems.getSizeInventory(); i++) {
|
||||
ItemStack stack = ByteBufUtils.readItemStack(data);
|
||||
if (!ItemStack.areItemStacksEqual(stack, invItems.getStackInSlot(i))) {
|
||||
invItems.setInventorySlotContents(i, stack);
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
int fluidMask = data.readByte();
|
||||
for (int i = 0; i < invFluids.getSlots(); i++) {
|
||||
if ((fluidMask & (1 << i)) != 0) {
|
||||
IAEFluidStack fluid = AEFluidStack.loadFluidStackFromPacket(data);
|
||||
if (fluid != null) { // this shouldn't happen, but better safe than sorry
|
||||
IAEFluidStack origFluid = invFluids.getFluidInSlot(i);
|
||||
if (!fluid.equals(origFluid) || fluid.getStackSize() != origFluid.getStackSize()) {
|
||||
invFluids.setFluidInSlot(i, fluid);
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
} else if (invFluids.getFluidInSlot(i) != null) {
|
||||
invFluids.setFluidInSlot(i, null);
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
|
||||
@TileEvent(TileEventType.WORLD_NBT_READ)
|
||||
public void readFromNBTEvent(NBTTagCompound data) {
|
||||
invItems.readFromNBT(data, "ItemInv");
|
||||
invFluids.readFromNBT(data, "FluidInv");
|
||||
}
|
||||
|
||||
@TileEvent(TileEventType.WORLD_NBT_WRITE)
|
||||
public NBTTagCompound writeToNBTEvent(NBTTagCompound data) {
|
||||
invItems.writeToNBT(data, "ItemInv");
|
||||
invFluids.writeToNBT(data, "FluidInv");
|
||||
return data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int fill(ForgeDirection from, FluidStack resource, boolean doFill) {
|
||||
return invFluids.fill(from, resource, doFill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) {
|
||||
return invFluids.drain(from, resource, doDrain);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) {
|
||||
return invFluids.drain(from, maxDrain, doDrain);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canFill(ForgeDirection from, Fluid fluid) {
|
||||
return invFluids.canFill(from, fluid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDrain(ForgeDirection from, Fluid fluid) {
|
||||
return invFluids.canDrain(from, fluid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTankInfo[] getTankInfo(ForgeDirection from) {
|
||||
return invFluids.getTankInfo(from);
|
||||
}
|
||||
}
|
||||
@@ -26,6 +26,7 @@ public class FCClassTransformer implements IClassTransformer {
|
||||
break;
|
||||
case "appeng.client.gui.implementations.GuiCraftingCPU":
|
||||
case "appeng.client.gui.implementations.GuiCraftConfirm":
|
||||
case "net.p455w0rd.wirelesscraftingterminal.client.gui.GuiCraftConfirm":
|
||||
tform = GuiCraftingTransformer.INSTANCE;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -16,7 +16,6 @@ import com.glodblock.github.common.tile.TileFluidInterface;
|
||||
import com.glodblock.github.inventory.FluidConvertingInventoryAdaptor;
|
||||
import com.glodblock.github.inventory.FluidConvertingInventoryCrafting;
|
||||
import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.util.Ae2Reflect;
|
||||
import com.glodblock.github.util.SetBackedMachineSet;
|
||||
import com.glodblock.github.util.Util;
|
||||
import com.google.common.collect.Sets;
|
||||
@@ -33,7 +32,7 @@ import java.util.Set;
|
||||
public class CoreModHooks {
|
||||
|
||||
public static InventoryCrafting wrapCraftingBuffer(InventoryCrafting inv) {
|
||||
return new FluidConvertingInventoryCrafting(Ae2Reflect.getCraftContainer(inv), Ae2Reflect.getCraftWidth(inv), inv.getSizeInventory()/Ae2Reflect.getCraftWidth(inv));
|
||||
return new FluidConvertingInventoryCrafting(inv.eventHandler, inv.inventoryWidth, inv.getSizeInventory()/inv.inventoryWidth);
|
||||
}
|
||||
|
||||
public static IAEItemStack wrapFluidPacketStack(IAEItemStack stack) {
|
||||
|
||||
@@ -32,7 +32,7 @@ public class FluidConvertingInventoryAdaptor extends InventoryAdaptor {
|
||||
TileEntity inter = capProvider.getWorldObj().getTileEntity(capProvider.xCoord + f.offsetX, capProvider.yCoord + f.offsetY, capProvider.zCoord + f.offsetZ);
|
||||
if (!Config.noFluidPacket && !(inter instanceof TileFluidInterface || (inter instanceof TileCableBus && ((TileCableBus) inter).getPart(f.getOpposite()) instanceof PartFluidInterface)))
|
||||
return InventoryAdaptor.getAdaptor(capProvider, f);
|
||||
IInventory item = capProvider instanceof IInventory ? (IInventory) capProvider : null;
|
||||
InventoryAdaptor item = InventoryAdaptor.getAdaptor(capProvider, f);
|
||||
IFluidHandler fluid = capProvider instanceof IFluidHandler ? (IFluidHandler) capProvider : null;
|
||||
return new FluidConvertingInventoryAdaptor(item, fluid, face);
|
||||
}
|
||||
@@ -41,8 +41,8 @@ public class FluidConvertingInventoryAdaptor extends InventoryAdaptor {
|
||||
private final IFluidHandler invFluids;
|
||||
private final ForgeDirection side;
|
||||
|
||||
public FluidConvertingInventoryAdaptor(@Nullable IInventory invItems, @Nullable IFluidHandler invFluids, EnumFacing facing) {
|
||||
this.invItems = invItems != null ? InventoryAdaptor.getAdaptor(invItems, Util.from(facing)) : null;
|
||||
public FluidConvertingInventoryAdaptor(@Nullable InventoryAdaptor invItems, @Nullable IFluidHandler invFluids, EnumFacing facing) {
|
||||
this.invItems = invItems;
|
||||
this.invFluids = invFluids;
|
||||
this.side = Util.from(facing);
|
||||
}
|
||||
|
||||
@@ -128,6 +128,18 @@ public enum GuiType {
|
||||
}
|
||||
}),
|
||||
|
||||
LARGE_INGREDIENT_BUFFER(new TileGuiFactory<TileLargeIngredientBuffer>(TileLargeIngredientBuffer.class) {
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, TileLargeIngredientBuffer inv) {
|
||||
return new ContainerLargeIngredientBuffer(player.inventory, inv);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object createClientGui(EntityPlayer player, TileLargeIngredientBuffer inv) {
|
||||
return new GuiLargeIngredientBuffer(player.inventory, inv);
|
||||
}
|
||||
}),
|
||||
|
||||
FLUID_PAT_TERM_CRAFTING_STATUS(new PartGuiFactory<FCBasePart>(FCBasePart.class) {
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, FCBasePart inv) {
|
||||
|
||||
@@ -22,8 +22,8 @@ public class MouseRegionManager {
|
||||
}
|
||||
|
||||
public boolean onClick(int mX, int mY, int button) {
|
||||
mX -= Ae2ReflectClient.getGuiLeft(gui);
|
||||
mY -= Ae2ReflectClient.getGuiTop(gui);
|
||||
mX -= gui.guiLeft;
|
||||
mY -= gui.guiTop;
|
||||
for (Region region : regions) {
|
||||
if (region.containsMouse(mX, mY) && region.handler.onClick(button)) {
|
||||
gui.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1F));
|
||||
@@ -34,8 +34,8 @@ public class MouseRegionManager {
|
||||
}
|
||||
|
||||
public void render(int mX, int mY) {
|
||||
mX -= Ae2ReflectClient.getGuiLeft(gui);
|
||||
mY -= Ae2ReflectClient.getGuiTop(gui);
|
||||
mX -= gui.guiLeft;
|
||||
mY -= gui.guiTop;
|
||||
for (Region region : regions) {
|
||||
if (region.containsMouse(mX, mY)) {
|
||||
List<String> tooltip = region.handler.getTooltip();
|
||||
|
||||
@@ -7,6 +7,14 @@ import com.glodblock.github.common.storage.CellType;
|
||||
|
||||
public class ItemAndBlockHolder {
|
||||
|
||||
public static BlockFluidDiscretizer DISCRETIZER = new BlockFluidDiscretizer().register();
|
||||
public static BlockFluidPatternEncoder ENCODER = new BlockFluidPatternEncoder().register();
|
||||
public static BlockFluidPacketDecoder DECODER = new BlockFluidPacketDecoder().register();
|
||||
public static BlockFluidInterface INTERFACE = new BlockFluidInterface().register();
|
||||
public static BlockIngredientBuffer BUFFER = new BlockIngredientBuffer().register();
|
||||
public static BlockLargeIngredientBuffer LARGE_BUFFER = new BlockLargeIngredientBuffer().register();
|
||||
public static BlockOCPatternEditor OC_EDITOR = new BlockOCPatternEditor().register();
|
||||
|
||||
public static ItemFluidDrop DROP = new ItemFluidDrop().register();
|
||||
public static ItemFluidEncodedPattern PATTERN = new ItemFluidEncodedPattern().register();
|
||||
public static ItemPartFluidPatternTerminal FLUID_TERMINAL = new ItemPartFluidPatternTerminal().register();
|
||||
@@ -24,13 +32,6 @@ public class ItemAndBlockHolder {
|
||||
public static ItemBasicFluidStorageCell CELL4096K = new ItemBasicFluidStorageCell(CellType.Cell4096kPart, 4096).register();
|
||||
public static ItemBasicFluidStoragePart CELL_PART = new ItemBasicFluidStoragePart().register();
|
||||
|
||||
public static BlockFluidDiscretizer DISCRETIZER = new BlockFluidDiscretizer().register();
|
||||
public static BlockFluidPatternEncoder ENCODER = new BlockFluidPatternEncoder().register();
|
||||
public static BlockFluidPacketDecoder DECODER = new BlockFluidPacketDecoder().register();
|
||||
public static BlockFluidInterface INTERFACE = new BlockFluidInterface().register();
|
||||
public static BlockIngredientBuffer BUFFER = new BlockIngredientBuffer().register();
|
||||
public static BlockOCPatternEditor OC_EDITOR = new BlockOCPatternEditor().register();
|
||||
|
||||
public static void loadSetting() {
|
||||
if (!Config.fluidCells) return;
|
||||
CellType.Cell1kPart.setItemInstance(CELL_PART);
|
||||
|
||||
@@ -48,6 +48,7 @@ public class RecipeLoader implements Runnable {
|
||||
GameRegistry.addShapelessRecipe(FLUID_TERMINAL.stack(), AE2_PATTERN_TERM, ENCODER);
|
||||
GameRegistry.addShapelessRecipe(FLUID_TERMINAL_EX.stack(), FLUID_TERMINAL.stack(), AE2_PROCESS_CAL, AE2_PROCESS_ENG, AE2_PROCESS_LOG);
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(BUFFER.stack(), "ILI", "AGF", "IBI", 'I', "ingotIron", 'G', AE2_QUARTZ_GLASS, 'L', AE2_CELL_1K, 'A', AE2_CORE_ANN, 'F', AE2_CORE_FOM, 'B', BUCKET));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(LARGE_BUFFER.stack(), "BGB", "GEG", "BGB", 'B', BUFFER.stack(), 'G', AE2_QUARTZ_GLASS, 'E', AE2_PROCESS_ENG));
|
||||
|
||||
if (Config.fluidCells) {
|
||||
OreDictionary.registerOre("anyCertusCrystal", AE2_PURE_CERTUS);
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.glodblock.github.nei;
|
||||
|
||||
import com.glodblock.github.nei.object.OrderStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class NEIUtils {
|
||||
|
||||
public static List<OrderStack<?>> compress(List<OrderStack<?>> list) {
|
||||
List<OrderStack<?>> comp = new LinkedList<>();
|
||||
for (OrderStack<?> orderStack : list) {
|
||||
if (orderStack == null) continue;
|
||||
if (orderStack.getStack() instanceof FluidStack) {
|
||||
comp.add(orderStack);
|
||||
continue;
|
||||
}
|
||||
ItemStack currentStack = (ItemStack) orderStack.getStack();
|
||||
if (currentStack.stackSize == 0) continue;
|
||||
boolean find = false;
|
||||
for (OrderStack<?> storedStack : comp) {
|
||||
if (storedStack == null || !(orderStack.getStack() instanceof ItemStack)) continue;
|
||||
ItemStack firstStack = (ItemStack) storedStack.getStack();
|
||||
boolean areItemStackEqual = firstStack.isItemEqual(currentStack) && ItemStack.areItemStackTagsEqual(firstStack, currentStack);
|
||||
if (areItemStackEqual && (firstStack.stackSize + currentStack.stackSize) <= firstStack.getMaxStackSize()) {
|
||||
find = true;
|
||||
((ItemStack) storedStack.getStack()).stackSize = firstStack.stackSize + currentStack.stackSize;
|
||||
}
|
||||
}
|
||||
if (!find) {
|
||||
comp.add(orderStack);
|
||||
}
|
||||
}
|
||||
return comp.stream().filter(Objects::nonNull).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public static List<OrderStack<?>> clearNull(List<OrderStack<?>> list) {
|
||||
List<OrderStack<?>> cleared = new LinkedList<>();
|
||||
HashMap<Integer, Object> map = new HashMap<>();
|
||||
int upper = 0;
|
||||
for (OrderStack<?> orderStack : list) {
|
||||
if (orderStack != null && orderStack.getStack() != null) {
|
||||
if (orderStack.getStack() instanceof ItemStack && ((ItemStack) orderStack.getStack()).stackSize == 0)
|
||||
continue;
|
||||
map.put(orderStack.getIndex(), orderStack.getStack());
|
||||
upper = Math.max(upper, orderStack.getIndex());
|
||||
}
|
||||
}
|
||||
int id = 0;
|
||||
for (int i = 0; i <= upper; i ++) {
|
||||
if (map.containsKey(i)) {
|
||||
cleared.add(new OrderStack<>(map.get(i), id));
|
||||
id ++;
|
||||
}
|
||||
}
|
||||
return cleared;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -67,6 +67,19 @@ public class DefaultExtractorLoader implements Runnable {
|
||||
FluidRecipe.addRecipeMap(null, new ForestryRecipeExtractor(new NEIHandlerStill()));
|
||||
}
|
||||
|
||||
if (ModAndClassUtil.IC2) {
|
||||
FluidRecipe.addRecipeMap("blastfurnace", new IndustrialCraftRecipeExtractor());
|
||||
FluidRecipe.addRecipeMap("BlockCutter", new IndustrialCraftRecipeExtractor());
|
||||
FluidRecipe.addRecipeMap("centrifuge", new IndustrialCraftRecipeExtractor());
|
||||
FluidRecipe.addRecipeMap("compressor", new IndustrialCraftRecipeExtractor());
|
||||
FluidRecipe.addRecipeMap("extractor", new IndustrialCraftRecipeExtractor());
|
||||
FluidRecipe.addRecipeMap("fluidcanner", new IndustrialCraftRecipeExtractor());
|
||||
FluidRecipe.addRecipeMap("macerator", new IndustrialCraftRecipeExtractor());
|
||||
FluidRecipe.addRecipeMap("metalformer", new IndustrialCraftRecipeExtractor());
|
||||
FluidRecipe.addRecipeMap("oreWashing", new IndustrialCraftRecipeExtractor());
|
||||
FluidRecipe.addRecipeMap("solidcanner", new IndustrialCraftRecipeExtractor());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+5
-8
@@ -5,7 +5,6 @@ import codechicken.nei.recipe.IRecipeHandler;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import com.glodblock.github.nei.object.IRecipeExtractorLegacy;
|
||||
import com.glodblock.github.nei.object.OrderStack;
|
||||
import com.glodblock.github.util.NEIUtil;
|
||||
import forestry.core.recipes.nei.PositionedFluidTank;
|
||||
import forestry.core.recipes.nei.RecipeHandlerBase;
|
||||
import forestry.factory.recipes.nei.NEIHandlerFabricator;
|
||||
@@ -55,14 +54,13 @@ public class ForestryRecipeExtractor implements IRecipeExtractorLegacy {
|
||||
public List<OrderStack<?>> getInputIngredients(List<PositionedStack> rawInputs, IRecipeHandler recipe, int index) {
|
||||
TemplateRecipeHandler tRecipe = (TemplateRecipeHandler) recipe;
|
||||
List<OrderStack<?>> tmp = new ArrayList<>();
|
||||
List<PositionedStack> compressed = NEIUtil.compress(rawInputs);
|
||||
if (tRecipe.arecipes.get(index) instanceof RecipeHandlerBase.CachedBaseRecipe) {
|
||||
tmp = getInputIngredients(compressed);
|
||||
tmp = getInputIngredients(rawInputs);
|
||||
List<PositionedFluidTank> tanks = ((RecipeHandlerBase.CachedBaseRecipe) tRecipe.arecipes.get(index)).getFluidTanks();
|
||||
if (tanks.size() > 0 && !(handler instanceof NEIHandlerSqueezer)) {
|
||||
FluidStack fluid = tanks.get(0).tank.getFluid();
|
||||
if (fluid != null) {
|
||||
tmp.add(new OrderStack<>(fluid, compressed.size()));
|
||||
tmp.add(new OrderStack<>(fluid, rawInputs.size()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -74,20 +72,19 @@ public class ForestryRecipeExtractor implements IRecipeExtractorLegacy {
|
||||
TemplateRecipeHandler tRecipe = (TemplateRecipeHandler) recipe;
|
||||
removeGlass(rawOutputs);
|
||||
List<OrderStack<?>> tmp = new ArrayList<>();
|
||||
List<PositionedStack> compressed = NEIUtil.compress(rawOutputs);
|
||||
if (tRecipe.arecipes.get(index) instanceof RecipeHandlerBase.CachedBaseRecipe) {
|
||||
tmp = getOutputIngredients(compressed);
|
||||
tmp = getOutputIngredients(rawOutputs);
|
||||
List<PositionedFluidTank> tanks = ((RecipeHandlerBase.CachedBaseRecipe) tRecipe.arecipes.get(index)).getFluidTanks();
|
||||
if (tanks.size() > 0 && handler instanceof NEIHandlerSqueezer) {
|
||||
FluidStack fluid = tanks.get(0).tank.getFluid();
|
||||
if (fluid != null) {
|
||||
tmp.add(new OrderStack<>(fluid, compressed.size()));
|
||||
tmp.add(new OrderStack<>(fluid, rawOutputs.size()));
|
||||
}
|
||||
}
|
||||
else if (tanks.size() > 1) {
|
||||
FluidStack fluid = tanks.get(1).tank.getFluid();
|
||||
if (fluid != null) {
|
||||
tmp.add(new OrderStack<>(fluid, compressed.size()));
|
||||
tmp.add(new OrderStack<>(fluid, rawOutputs.size()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+8
-11
@@ -3,7 +3,6 @@ package com.glodblock.github.nei.recipes.extractor;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import com.glodblock.github.nei.object.IRecipeExtractor;
|
||||
import com.glodblock.github.nei.object.OrderStack;
|
||||
import com.glodblock.github.util.NEIUtil;
|
||||
import gregtech.api.enums.ItemList;
|
||||
import gregtech.common.items.GT_FluidDisplayItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -25,11 +24,10 @@ public class GregTech5RecipeExtractor implements IRecipeExtractor {
|
||||
@Override
|
||||
public List<OrderStack<?>> getInputIngredients(List<PositionedStack> rawInputs) {
|
||||
if (removeSpecial) removeSpecial(rawInputs);
|
||||
List<PositionedStack> compressed = NEIUtil.compress(rawInputs);
|
||||
List<OrderStack<?>> tmp = new LinkedList<>();
|
||||
for (int i = 0; i < compressed.size(); i ++) {
|
||||
if (compressed.get(i) == null) continue;
|
||||
ItemStack item = compressed.get(i).items[0];
|
||||
for (int i = 0; i < rawInputs.size(); i ++) {
|
||||
if (rawInputs.get(i) == null) continue;
|
||||
ItemStack item = rawInputs.get(i).items[0].copy();
|
||||
OrderStack<?> stack;
|
||||
if (item.getItem() instanceof GT_FluidDisplayItem) {
|
||||
NBTTagCompound aNBT = item.getTagCompound();
|
||||
@@ -38,7 +36,7 @@ public class GregTech5RecipeExtractor implements IRecipeExtractor {
|
||||
stack = new OrderStack<>(new FluidStack(FluidRegistry.getFluid(item.getItemDamage()), amt), i);
|
||||
tmp.add(stack);
|
||||
} else {
|
||||
stack = OrderStack.pack(compressed.get(i), i);
|
||||
stack = OrderStack.pack(rawInputs.get(i), i);
|
||||
if (stack != null) tmp.add(stack);
|
||||
}
|
||||
}
|
||||
@@ -47,11 +45,10 @@ public class GregTech5RecipeExtractor implements IRecipeExtractor {
|
||||
|
||||
@Override
|
||||
public List<OrderStack<?>> getOutputIngredients(List<PositionedStack> rawOutputs) {
|
||||
List<PositionedStack> compressed = NEIUtil.compress(rawOutputs);
|
||||
List<OrderStack<?>> tmp = new LinkedList<>();
|
||||
for (int i = 0; i < compressed.size(); i ++) {
|
||||
if (compressed.get(i) == null) continue;
|
||||
ItemStack item = compressed.get(i).items[0];
|
||||
for (int i = 0; i < rawOutputs.size(); i ++) {
|
||||
if (rawOutputs.get(i) == null) continue;
|
||||
ItemStack item = rawOutputs.get(i).items[0].copy();
|
||||
OrderStack<?> stack;
|
||||
if (item.getItem() instanceof GT_FluidDisplayItem) {
|
||||
NBTTagCompound aNBT = item.getTagCompound();
|
||||
@@ -60,7 +57,7 @@ public class GregTech5RecipeExtractor implements IRecipeExtractor {
|
||||
stack = new OrderStack<>(new FluidStack(FluidRegistry.getFluid(item.getItemDamage()), amt), i);
|
||||
tmp.add(stack);
|
||||
} else {
|
||||
stack = OrderStack.pack(compressed.get(i), i);
|
||||
stack = OrderStack.pack(rawOutputs.get(i), i);
|
||||
if (stack != null) tmp.add(stack);
|
||||
}
|
||||
}
|
||||
|
||||
+8
-11
@@ -3,7 +3,6 @@ package com.glodblock.github.nei.recipes.extractor;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import com.glodblock.github.nei.object.IRecipeExtractor;
|
||||
import com.glodblock.github.nei.object.OrderStack;
|
||||
import com.glodblock.github.util.NEIUtil;
|
||||
import gregapi.item.ItemFluidDisplay;
|
||||
import gregapi.recipes.Recipe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -23,11 +22,10 @@ public class GregTech6RecipeExtractor implements IRecipeExtractor {
|
||||
@Override
|
||||
public List<OrderStack<?>> getInputIngredients(List<PositionedStack> rawInputs) {
|
||||
this.removeMachine(rawInputs);
|
||||
List<PositionedStack> compressed = NEIUtil.compress(rawInputs);
|
||||
List<OrderStack<?>> tmp = new LinkedList<>();
|
||||
for (int i = 0; i < compressed.size(); i ++) {
|
||||
if (compressed.get(i) == null) continue;
|
||||
ItemStack item = compressed.get(i).items[0];
|
||||
for (int i = 0; i < rawInputs.size(); i ++) {
|
||||
if (rawInputs.get(i) == null) continue;
|
||||
ItemStack item = rawInputs.get(i).items[0].copy();
|
||||
OrderStack<?> stack;
|
||||
if (item.getItem() instanceof ItemFluidDisplay) {
|
||||
FluidStack fluid = ((ItemFluidDisplay) item.getItem()).getFluid(item);
|
||||
@@ -35,7 +33,7 @@ public class GregTech6RecipeExtractor implements IRecipeExtractor {
|
||||
stack = new OrderStack<>(fluid, i);
|
||||
tmp.add(stack);
|
||||
} else {
|
||||
stack = OrderStack.pack(compressed.get(i), i);
|
||||
stack = OrderStack.pack(rawInputs.get(i), i);
|
||||
if (stack != null) tmp.add(stack);
|
||||
}
|
||||
}
|
||||
@@ -44,11 +42,10 @@ public class GregTech6RecipeExtractor implements IRecipeExtractor {
|
||||
|
||||
@Override
|
||||
public List<OrderStack<?>> getOutputIngredients(List<PositionedStack> rawOutputs) {
|
||||
List<PositionedStack> compressed = NEIUtil.compress(rawOutputs);
|
||||
List<OrderStack<?>> tmp = new LinkedList<>();
|
||||
for (int i = 0; i < compressed.size(); i ++) {
|
||||
if (compressed.get(i) == null) continue;
|
||||
ItemStack item = compressed.get(i).items[0];
|
||||
for (int i = 0; i < rawOutputs.size(); i ++) {
|
||||
if (rawOutputs.get(i) == null) continue;
|
||||
ItemStack item = rawOutputs.get(i).items[0].copy();
|
||||
OrderStack<?> stack;
|
||||
if (item.getItem() instanceof ItemFluidDisplay) {
|
||||
FluidStack fluid = ((ItemFluidDisplay) item.getItem()).getFluid(item);
|
||||
@@ -56,7 +53,7 @@ public class GregTech6RecipeExtractor implements IRecipeExtractor {
|
||||
stack = new OrderStack<>(fluid, i);
|
||||
tmp.add(stack);
|
||||
} else {
|
||||
stack = OrderStack.pack(compressed.get(i), i);
|
||||
stack = OrderStack.pack(rawOutputs.get(i), i);
|
||||
if (stack != null) tmp.add(stack);
|
||||
}
|
||||
}
|
||||
|
||||
+114
@@ -0,0 +1,114 @@
|
||||
package com.glodblock.github.nei.recipes.extractor;
|
||||
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.IRecipeHandler;
|
||||
import com.glodblock.github.nei.object.IRecipeExtractor;
|
||||
import com.glodblock.github.nei.object.OrderStack;
|
||||
import com.glodblock.github.util.Ae2Reflect;
|
||||
import ic2.neiIntegration.core.recipehandler.FluidCannerRecipeHandler;
|
||||
import ic2.neiIntegration.core.recipehandler.OreWashingRecipeHandler;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class IndustrialCraftRecipeExtractor implements IRecipeExtractor {
|
||||
|
||||
@Override
|
||||
public List<OrderStack<?>> getInputIngredients(List<PositionedStack> rawInputs) {
|
||||
List<OrderStack<?>> tmp = new LinkedList<>();
|
||||
for (int i = 0; i < rawInputs.size(); i ++) {
|
||||
if (rawInputs.get(i) == null) continue;
|
||||
tmp.add(OrderStack.pack(rawInputs.get(i), i));
|
||||
}
|
||||
return tmp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OrderStack<?>> getOutputIngredients(List<PositionedStack> rawOutputs) {
|
||||
List<OrderStack<?>> tmp = new LinkedList<>();
|
||||
for (int i = 0; i < rawOutputs.size(); i ++) {
|
||||
if (rawOutputs.get(i) == null) continue;
|
||||
tmp.add(OrderStack.pack(rawOutputs.get(i), i));
|
||||
}
|
||||
return tmp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OrderStack<?>> getInputIngredients(List<PositionedStack> rawInputs, IRecipeHandler recipe, int index) {
|
||||
List<OrderStack<?>> stacks = new LinkedList<>();
|
||||
|
||||
if (recipe instanceof FluidCannerRecipeHandler) {
|
||||
FluidCannerRecipeHandler.CachedFluidCannerRecipe cachedRecipe = (FluidCannerRecipeHandler.CachedFluidCannerRecipe) ((FluidCannerRecipeHandler) recipe).arecipes.get(index);
|
||||
FluidStack input = ReflectIC2.getInputFluid(cachedRecipe);
|
||||
PositionedStack add = rawInputs.size() > 1 ? rawInputs.get(1) : null;
|
||||
stacks.add(OrderStack.pack(add, 0));
|
||||
stacks.add(new OrderStack<>(input, 1));
|
||||
}
|
||||
else if (recipe instanceof OreWashingRecipeHandler) {
|
||||
stacks = getInputIngredients(rawInputs);
|
||||
int water = ReflectIC2.getOreWasherWater((OreWashingRecipeHandler) recipe, index);
|
||||
stacks.add(new OrderStack<>(new FluidStack(FluidRegistry.WATER, water), stacks.size()));
|
||||
} else {
|
||||
stacks = getInputIngredients(rawInputs);
|
||||
}
|
||||
|
||||
return stacks.stream().filter(Objects::nonNull).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OrderStack<?>> getOutputIngredients(List<PositionedStack> rawOutputs, IRecipeHandler recipe, int index) {
|
||||
List<OrderStack<?>> stacks = new LinkedList<>();
|
||||
|
||||
if (recipe instanceof FluidCannerRecipeHandler) {
|
||||
FluidCannerRecipeHandler.CachedFluidCannerRecipe cachedRecipe = (FluidCannerRecipeHandler.CachedFluidCannerRecipe) ((FluidCannerRecipeHandler) recipe).arecipes.get(index);
|
||||
FluidStack output = ReflectIC2.getOutputFluid(cachedRecipe);
|
||||
stacks.add(new OrderStack<>(output, 0));
|
||||
} else {
|
||||
stacks = getOutputIngredients(rawOutputs);
|
||||
}
|
||||
|
||||
return stacks.stream().filter(Objects::nonNull).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
private static class ReflectIC2 {
|
||||
|
||||
private final static Field inputsF;
|
||||
private final static Field resultF;
|
||||
|
||||
private final static Method oreWasherWater;
|
||||
|
||||
static {
|
||||
try {
|
||||
inputsF = Ae2Reflect.reflectField(FluidCannerRecipeHandler.CachedFluidCannerRecipe.class, "fluidInput");
|
||||
resultF = Ae2Reflect.reflectField(FluidCannerRecipeHandler.CachedFluidCannerRecipe.class, "fluidOutput");
|
||||
oreWasherWater = Ae2Reflect.reflectMethod(OreWashingRecipeHandler.class, "getreqWater", int.class);
|
||||
} catch (NoSuchFieldException | NoSuchMethodException e) {
|
||||
throw new IllegalStateException("Failed to initialize IC2 reflection hacks!", e);
|
||||
}
|
||||
}
|
||||
|
||||
private static FluidStack getInputFluid(FluidCannerRecipeHandler.CachedFluidCannerRecipe recipe) {
|
||||
return Ae2Reflect.readField(recipe, inputsF);
|
||||
}
|
||||
|
||||
private static FluidStack getOutputFluid(FluidCannerRecipeHandler.CachedFluidCannerRecipe recipe) {
|
||||
return Ae2Reflect.readField(recipe, resultF);
|
||||
}
|
||||
|
||||
private static int getOreWasherWater(OreWashingRecipeHandler recipeHandler, int index) {
|
||||
try {
|
||||
return (int) oreWasherWater.invoke(recipeHandler, index);
|
||||
} catch (Exception e) {
|
||||
throw new IllegalStateException("Failed to invoke method: " + oreWasherWater, e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -80,6 +80,9 @@ public class CPacketFluidPatternTermBtns implements IMessage {
|
||||
case "PatternTerminal.Double":
|
||||
cpt.doubleStacks(Value.equals("1"));
|
||||
break;
|
||||
case "PatternTerminal.Combine":
|
||||
cpt.getPatternTerminal().setCombineMode(Value.equals("1"));
|
||||
break;
|
||||
}
|
||||
} else if( Name.startsWith( "PatternTerminalEx." ) && (c instanceof ContainerFluidPatternTerminalEx))
|
||||
{
|
||||
@@ -103,6 +106,9 @@ public class CPacketFluidPatternTermBtns implements IMessage {
|
||||
case "PatternTerminalEx.Double":
|
||||
cpt.doubleStacks(Value.equals("1"));
|
||||
break;
|
||||
case "PatternTerminalEx.Combine":
|
||||
cpt.getPatternTerminal().setCombineMode(Value.equals("1"));
|
||||
break;
|
||||
case "PatternTerminalEx.ActivePage":
|
||||
cpt.getPatternTerminal().setActivePage(Integer.parseInt(Value));
|
||||
break;
|
||||
|
||||
@@ -62,7 +62,6 @@ public class CPacketSwitchGuis implements IMessage {
|
||||
InventoryHandler.openGui(player, player.worldObj, new BlockPos(te), Objects.requireNonNull(Util.from(context.getSide())), message.guiType);
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.glodblock.github.network;
|
||||
import com.glodblock.github.client.gui.container.ContainerFluidPatternTerminal;
|
||||
import com.glodblock.github.client.gui.container.ContainerFluidPatternTerminalEx;
|
||||
import com.glodblock.github.common.item.ItemFluidPacket;
|
||||
import com.glodblock.github.nei.NEIUtils;
|
||||
import com.glodblock.github.nei.object.OrderStack;
|
||||
import cpw.mods.fml.common.network.ByteBufUtils;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
@@ -18,6 +19,8 @@ import net.minecraftforge.fluids.FluidStack;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class CPacketTransferRecipe implements IMessage {
|
||||
|
||||
@@ -80,6 +83,7 @@ public class CPacketTransferRecipe implements IMessage {
|
||||
Container c = ctx.getServerHandler().playerEntity.openContainer;
|
||||
if (c instanceof ContainerFluidPatternTerminal) {
|
||||
ContainerFluidPatternTerminal cf = (ContainerFluidPatternTerminal) c;
|
||||
boolean combine = cf.combine;
|
||||
cf.getPatternTerminal().setCraftingRecipe(message.isCraft);
|
||||
IInventory inputSlot = cf.getInventoryByName("crafting");
|
||||
IInventory outputSlot = cf.getInventoryByName("output");
|
||||
@@ -89,6 +93,16 @@ public class CPacketTransferRecipe implements IMessage {
|
||||
for (int i = 0; i < outputSlot.getSizeInventory(); i ++) {
|
||||
outputSlot.setInventorySlotContents(i, null);
|
||||
}
|
||||
|
||||
if (!message.isCraft) {
|
||||
if (combine) {
|
||||
message.inputs = NEIUtils.compress(message.inputs);
|
||||
message.outputs = NEIUtils.compress(message.outputs);
|
||||
}
|
||||
message.inputs = NEIUtils.clearNull(message.inputs);
|
||||
message.outputs = NEIUtils.clearNull(message.outputs);
|
||||
}
|
||||
|
||||
for (OrderStack<?> stack : message.inputs) {
|
||||
if (stack != null) {
|
||||
int index = stack.getIndex();
|
||||
@@ -123,6 +137,7 @@ public class CPacketTransferRecipe implements IMessage {
|
||||
c.onCraftMatrixChanged(outputSlot);
|
||||
} else if (c instanceof ContainerFluidPatternTerminalEx) {
|
||||
ContainerFluidPatternTerminalEx cf = (ContainerFluidPatternTerminalEx) c;
|
||||
boolean combine = cf.combine;
|
||||
IInventory inputSlot = cf.getInventoryByName("crafting");
|
||||
IInventory outputSlot = cf.getInventoryByName("output");
|
||||
for (int i = 0; i < inputSlot.getSizeInventory(); i ++) {
|
||||
@@ -131,6 +146,14 @@ public class CPacketTransferRecipe implements IMessage {
|
||||
for (int i = 0; i < outputSlot.getSizeInventory(); i ++) {
|
||||
outputSlot.setInventorySlotContents(i, null);
|
||||
}
|
||||
|
||||
if (combine) {
|
||||
message.inputs = NEIUtils.compress(message.inputs);
|
||||
message.outputs = NEIUtils.compress(message.outputs);
|
||||
}
|
||||
message.inputs = NEIUtils.clearNull(message.inputs);
|
||||
message.outputs = NEIUtils.clearNull(message.outputs);
|
||||
|
||||
for (OrderStack<?> stack : message.inputs) {
|
||||
if (stack != null) {
|
||||
int index = stack.getIndex();
|
||||
|
||||
@@ -5,6 +5,7 @@ import appeng.util.item.AEFluidStack;
|
||||
import com.glodblock.github.client.gui.GuiFluidIO;
|
||||
import com.glodblock.github.client.gui.GuiFluidInterface;
|
||||
import com.glodblock.github.client.gui.GuiIngredientBuffer;
|
||||
import com.glodblock.github.client.gui.GuiLargeIngredientBuffer;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
@@ -75,6 +76,10 @@ public class SPacketFluidUpdate implements IMessage {
|
||||
for (Map.Entry<Integer, IAEFluidStack> e : message.list.entrySet() ) {
|
||||
( (GuiIngredientBuffer) gs ).update(e.getKey(), e.getValue());
|
||||
}
|
||||
} else if (gs instanceof GuiLargeIngredientBuffer) {
|
||||
for (Map.Entry<Integer, IAEFluidStack> e : message.list.entrySet() ) {
|
||||
( (GuiLargeIngredientBuffer) gs ).update(e.getKey(), e.getValue());
|
||||
}
|
||||
} else if( gs instanceof GuiFluidIO)
|
||||
{
|
||||
for (Map.Entry<Integer, IAEFluidStack> e : message.list.entrySet() ) {
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.glodblock.github.proxy;
|
||||
import com.glodblock.github.loader.ListenerLoader;
|
||||
import com.glodblock.github.loader.RenderLoader;
|
||||
import com.glodblock.github.nei.recipes.DefaultExtractorLoader;
|
||||
import com.glodblock.github.util.ModAndClassUtil;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
@@ -24,6 +25,8 @@ public class ClientProxy extends CommonProxy {
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event){
|
||||
super.postInit(event);
|
||||
(new DefaultExtractorLoader()).run();
|
||||
if (ModAndClassUtil.NEI) {
|
||||
(new DefaultExtractorLoader()).run();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,36 +3,20 @@ package com.glodblock.github.util;
|
||||
import appeng.api.implementations.IUpgradeableHost;
|
||||
import appeng.api.networking.crafting.ICraftingCPU;
|
||||
import appeng.api.storage.IMEInventory;
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.implementations.GuiCraftingStatus;
|
||||
import appeng.client.gui.widgets.GuiTabButton;
|
||||
import appeng.client.render.AppEngRenderItem;
|
||||
import appeng.container.implementations.ContainerUpgradeable;
|
||||
import appeng.container.implementations.CraftingCPURecord;
|
||||
import appeng.me.storage.MEInventoryHandler;
|
||||
import appeng.me.storage.MEPassThrough;
|
||||
import appeng.util.inv.ItemSlot;
|
||||
import appeng.util.prioitylist.IPartitionList;
|
||||
import com.glodblock.github.client.gui.GuiBaseFluidPatternTerminal;
|
||||
import com.glodblock.github.client.gui.GuiFCBaseMonitor;
|
||||
import com.glodblock.github.client.gui.container.ContainerFluidPatternTerminal;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class Ae2Reflect {
|
||||
|
||||
private static final Field fInventory_container;
|
||||
private static final Field fInventory_containerUpgrade;
|
||||
private static final Field fInventory_width;
|
||||
private static final Field fAEPass_internal;
|
||||
private static final Field fAEInv_partitionList;
|
||||
private static final Field fCPU_cpu;
|
||||
@@ -43,9 +27,7 @@ public class Ae2Reflect {
|
||||
|
||||
static {
|
||||
try {
|
||||
fInventory_container = reflectField(InventoryCrafting.class, "eventHandler", "field_70465_c", "c");
|
||||
fInventory_containerUpgrade = reflectField(ContainerUpgradeable.class, "upgradeable");
|
||||
fInventory_width = reflectField(InventoryCrafting.class, "inventoryWidth", "field_70464_b", "b");
|
||||
fAEPass_internal = reflectField(MEPassThrough.class, "internal");
|
||||
fAEInv_partitionList = reflectField(MEInventoryHandler.class, "myPartitionList");
|
||||
fCPU_cpu = Ae2Reflect.reflectField(CraftingCPURecord.class, "cpu");
|
||||
@@ -104,14 +86,6 @@ public class Ae2Reflect {
|
||||
return Ae2Reflect.readField(me, fAEPass_internal);
|
||||
}
|
||||
|
||||
public static Container getCraftContainer(InventoryCrafting inv) {
|
||||
return Ae2Reflect.readField(inv, fInventory_container);
|
||||
}
|
||||
|
||||
public static int getCraftWidth(InventoryCrafting inv) {
|
||||
return Ae2Reflect.readField(inv, fInventory_width);
|
||||
}
|
||||
|
||||
public static void setItemSlotExtractable(ItemSlot slot, boolean extractable) {
|
||||
try {
|
||||
mItemSlot_setExtractable.invoke(slot, extractable);
|
||||
|
||||
@@ -4,12 +4,8 @@ import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.implementations.GuiCraftingStatus;
|
||||
import appeng.client.gui.widgets.GuiTabButton;
|
||||
import appeng.client.render.AppEngRenderItem;
|
||||
import com.glodblock.github.client.gui.GuiBaseFluidPatternTerminal;
|
||||
import com.glodblock.github.client.gui.GuiFCBaseMonitor;
|
||||
import com.glodblock.github.client.gui.container.ContainerFluidPatternTerminal;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@@ -23,34 +19,18 @@ public class Ae2ReflectClient {
|
||||
|
||||
private static final Field fAEBaseGui_stackSizeRenderer;
|
||||
private static final Field fGuiCraftingStatus_originalGuiBtn;
|
||||
private static final Field fGuiPatternTerm_container;
|
||||
private static final Field fGuiCPUStatus_icon;
|
||||
private static final Field fGuiMEMonitorable_monitorableContainer;
|
||||
private static final Field fGuiMEMonitorable_configSrc;
|
||||
private static final Field fGuiMEMonitorable_craftingStatusBtn;
|
||||
private static final Field fGuiContainer_guiLeft;
|
||||
private static final Field fGuiContainer_guiTop;
|
||||
private static final Field fGui_drag;
|
||||
private static final Method mGuiPatternTerm_inventorySlots;
|
||||
private static final Method mGuiPatternTerm_reservedSpace;
|
||||
private static final Method mGuiPatternTerm_reservedSpaceSetter;
|
||||
|
||||
|
||||
static {
|
||||
try {
|
||||
fAEBaseGui_stackSizeRenderer = Ae2Reflect.reflectField(AEBaseGui.class, "aeRenderItem");
|
||||
fGuiCraftingStatus_originalGuiBtn = Ae2Reflect.reflectField(GuiCraftingStatus.class, "originalGuiBtn");
|
||||
fGuiPatternTerm_container = Ae2Reflect.reflectField(GuiBaseFluidPatternTerminal.class, "container");
|
||||
fGuiMEMonitorable_monitorableContainer = Ae2Reflect.reflectField(GuiFCBaseMonitor.class, "monitorableContainer");
|
||||
fGuiMEMonitorable_configSrc = Ae2Reflect.reflectField(GuiFCBaseMonitor.class, "configSrc");
|
||||
fGuiMEMonitorable_craftingStatusBtn = Ae2Reflect.reflectField(GuiFCBaseMonitor.class, "craftingStatusBtn");
|
||||
fGuiCPUStatus_icon = Ae2Reflect.reflectField(GuiCraftingStatus.class, "myIcon");
|
||||
fGuiContainer_guiLeft = Ae2Reflect.reflectField(GuiContainer.class, "guiLeft", "field_147003_i", "i");
|
||||
fGuiContainer_guiTop = Ae2Reflect.reflectField(GuiContainer.class, "guiTop", "field_147009_r", "r");
|
||||
fGui_drag = Ae2Reflect.reflectField(AEBaseGui.class, "drag_click");
|
||||
mGuiPatternTerm_inventorySlots = Ae2Reflect.reflectMethod(AEBaseGui.class, "getInventorySlots");
|
||||
mGuiPatternTerm_reservedSpace = Ae2Reflect.reflectMethod(GuiFCBaseMonitor.class, "getReservedSpace");
|
||||
mGuiPatternTerm_reservedSpaceSetter = Ae2Reflect.reflectMethod(GuiFCBaseMonitor.class, "setReservedSpace", int.class);
|
||||
} catch (NoSuchFieldException | NoSuchMethodException e) {
|
||||
throw new IllegalStateException("Failed to initialize AE2 reflection hacks!", e);
|
||||
}
|
||||
@@ -73,30 +53,6 @@ public class Ae2ReflectClient {
|
||||
return Ae2Reflect.readField(gui, fGui_drag);
|
||||
}
|
||||
|
||||
public static int getGuiLeft(GuiContainer gui) {
|
||||
return Ae2Reflect.readField(gui, fGuiContainer_guiLeft);
|
||||
}
|
||||
|
||||
public static int getGuiTop(GuiContainer gui) {
|
||||
return Ae2Reflect.readField(gui, fGuiContainer_guiTop);
|
||||
}
|
||||
|
||||
public static void setReservedSpace(GuiFCBaseMonitor gui, int size) {
|
||||
try {
|
||||
mGuiPatternTerm_reservedSpaceSetter.invoke(gui, size);
|
||||
} catch (Exception e) {
|
||||
throw new IllegalStateException("Failed to invoke method: " + mGuiPatternTerm_reservedSpaceSetter, e);
|
||||
}
|
||||
}
|
||||
|
||||
public static int getReservedSpace(GuiFCBaseMonitor gui) {
|
||||
try {
|
||||
return (int) mGuiPatternTerm_reservedSpace.invoke(gui);
|
||||
} catch (Exception e) {
|
||||
throw new IllegalStateException("Failed to invoke method: " + mGuiPatternTerm_reservedSpace, e);
|
||||
}
|
||||
}
|
||||
|
||||
public static AppEngRenderItem getStackSizeRenderer(AEBaseGui gui) {
|
||||
return Ae2Reflect.readField(gui, fAEBaseGui_stackSizeRenderer);
|
||||
}
|
||||
@@ -105,14 +61,4 @@ public class Ae2ReflectClient {
|
||||
return Ae2Reflect.readField(gui, fGuiCraftingStatus_originalGuiBtn);
|
||||
}
|
||||
|
||||
public static void setGuiContainer(GuiBaseFluidPatternTerminal instance, ContainerFluidPatternTerminal container) {
|
||||
Ae2Reflect.writeField(instance, fGuiPatternTerm_container, container);
|
||||
Ae2Reflect.writeField(instance, fGuiMEMonitorable_monitorableContainer, container);
|
||||
Ae2Reflect.writeField(instance, fGuiMEMonitorable_configSrc, container.getConfigManager());
|
||||
}
|
||||
|
||||
public static GuiTabButton getCraftingStatusButton(GuiFCBaseMonitor gui) {
|
||||
return Ae2Reflect.readField(gui, fGuiMEMonitorable_craftingStatusBtn);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -18,6 +18,10 @@ public final class ModAndClassUtil {
|
||||
public static boolean EIO = false;
|
||||
public static boolean FTR = false;
|
||||
public static boolean OC = false;
|
||||
public static boolean ThE = false;
|
||||
public static boolean WCT = false;
|
||||
public static boolean IC2 = false;
|
||||
public static boolean NEI = false;
|
||||
public static boolean GTPP = false;
|
||||
|
||||
public static boolean isDoubleButton;
|
||||
@@ -28,6 +32,8 @@ public final class ModAndClassUtil {
|
||||
public static boolean isShiftTooltip;
|
||||
public static boolean isBigInterface;
|
||||
|
||||
public static Class<?> essentiaGas;
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public static void init() {
|
||||
|
||||
@@ -87,6 +93,12 @@ public final class ModAndClassUtil {
|
||||
isCraftStatus = false;
|
||||
}
|
||||
|
||||
try {
|
||||
essentiaGas = Class.forName("thaumicenergistics.common.fluids.GaseousEssentia");
|
||||
} catch (ClassNotFoundException e) {
|
||||
essentiaGas = null;
|
||||
}
|
||||
|
||||
if (Loader.isModLoaded("gregtech") && !Loader.isModLoaded("gregapi"))
|
||||
GT5 = true;
|
||||
if (Loader.isModLoaded("gregapi") && Loader.isModLoaded("gregapi_post"))
|
||||
@@ -99,6 +111,14 @@ public final class ModAndClassUtil {
|
||||
FTR = true;
|
||||
if (Loader.isModLoaded("OpenComputers"))
|
||||
OC = true;
|
||||
if (Loader.isModLoaded("thaumicenergistics"))
|
||||
ThE = true;
|
||||
if (Loader.isModLoaded("ae2wct"))
|
||||
WCT = true;
|
||||
if (Loader.isModLoaded("IC2"))
|
||||
IC2 = true;
|
||||
if (Loader.isModLoaded("NotEnoughItems"))
|
||||
NEI = true;
|
||||
if (Loader.isModLoaded("miscutils"))
|
||||
GTPP = true;
|
||||
}
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
package com.glodblock.github.util;
|
||||
|
||||
import codechicken.nei.PositionedStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class NEIUtil {
|
||||
|
||||
public static List<PositionedStack> compress(List<PositionedStack> list) {
|
||||
List<PositionedStack> comp = new LinkedList<>();
|
||||
for (PositionedStack positionedStack : list) {
|
||||
if (positionedStack == null) continue;
|
||||
ItemStack currentStack = positionedStack.items[0].copy();
|
||||
if (currentStack.stackSize == 0) continue;
|
||||
boolean find = false;
|
||||
for (PositionedStack storedStack : comp) {
|
||||
if (storedStack == null) continue;
|
||||
ItemStack firstStack = storedStack.items[0].copy();
|
||||
boolean areItemStackEqual = firstStack.isItemEqual(currentStack) && ItemStack.areItemStackTagsEqual(firstStack, currentStack);
|
||||
if (areItemStackEqual && (firstStack.stackSize + currentStack.stackSize) <= firstStack.getMaxStackSize()) {
|
||||
find = true;
|
||||
storedStack.items[0].stackSize = firstStack.stackSize + currentStack.stackSize;
|
||||
}
|
||||
}
|
||||
if (!find) {
|
||||
comp.add(positionedStack.copy());
|
||||
}
|
||||
}
|
||||
return comp.stream().filter(Objects::nonNull).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,6 +9,7 @@ public class NameConst {
|
||||
public static final String BLOCK_FLUID_PACKET_DECODER = "fluid_packet_decoder";
|
||||
public static final String BLOCK_FLUID_INTERFACE = "fluid_interface";
|
||||
public static final String BLOCK_INGREDIENT_BUFFER = "ingredient_buffer";
|
||||
public static final String BLOCK_LARGE_INGREDIENT_BUFFER = "large_ingredient_buffer";
|
||||
public static final String BLOCK_OC_PATTERN_EDITOR = "oc_pattern_editor";
|
||||
|
||||
public static final String ITEM_FLUID_DROP = "fluid_drop";
|
||||
@@ -37,6 +38,7 @@ public class NameConst {
|
||||
public static final String GUI_FLUID_PATTERN_ENCODER = GUI_KEY + BLOCK_FLUID_PATTERN_ENCODER;
|
||||
public static final String GUI_FLUID_PACKET_DECODER = GUI_KEY + BLOCK_FLUID_PACKET_DECODER;
|
||||
public static final String GUI_INGREDIENT_BUFFER = GUI_KEY + BLOCK_INGREDIENT_BUFFER;
|
||||
public static final String GUI_LARGE_INGREDIENT_BUFFER = GUI_KEY + BLOCK_LARGE_INGREDIENT_BUFFER;
|
||||
public static final String GUI_FLUID_INTERFACE = GUI_KEY + BLOCK_FLUID_INTERFACE;
|
||||
public static final String GUI_OC_PATTERN_EDITOR = GUI_KEY + BLOCK_OC_PATTERN_EDITOR;
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
public net.minecraft.inventory.InventoryCrafting field_70465_c # eventHandler
|
||||
public net.minecraft.inventory.InventoryCrafting field_70464_b # inventoryWidth
|
||||
|
||||
public net.minecraft.client.gui.inventory.GuiContainer field_147003_i # guiLeft
|
||||
public net.minecraft.client.gui.inventory.GuiContainer field_147009_r # guiTop
|
||||
@@ -26,6 +26,7 @@ tile.fluid_pattern_encoder.name=Fluid Pattern Encoder
|
||||
tile.fluid_packet_decoder.name=ME Fluid Packet Decoder
|
||||
tile.fluid_interface.name=ME Dual Interface
|
||||
tile.ingredient_buffer.name=Ingredient Buffer
|
||||
tile.large_ingredient_buffer.name=Large Ingredient Buffer
|
||||
tile.oc_pattern_editor.name=OC Pattern Editor
|
||||
|
||||
ae2fc.tooltip.invalid_fluid=Invalid fluid!
|
||||
@@ -34,12 +35,17 @@ ae2fc.tooltip.fluid_packet=Use a Fluid Packet Decoder to\nconvert this back into
|
||||
ae2fc.tooltip.empty=Empty
|
||||
ae2fc.tooltip.dump_tank=Dump Tank Contents
|
||||
ae2fc.tooltip.switch_fluid_interface=Switch ME Dual Interface GUI
|
||||
ae2fc.tooltip.not_combine=Merge the same items
|
||||
ae2fc.tooltip.not_combine.hint=Disabled
|
||||
ae2fc.tooltip.combine=Merge the same items
|
||||
ae2fc.tooltip.combine.hint=Enabled
|
||||
|
||||
ae2fc.gui.part_fluid_pattern_terminal=Fluid Pattern Terminal
|
||||
ae2fc.gui.part_fluid_pattern_terminal_ex=Fluid Processing Pattern Terminal
|
||||
ae2fc.gui.fluid_pattern_encoder=Fluid Pattern Encoder
|
||||
ae2fc.gui.fluid_packet_decoder=ME Fluid Packet Decoder
|
||||
ae2fc.gui.ingredient_buffer=Ingredient Buffer
|
||||
ae2fc.gui.large_ingredient_buffer=Large Ingredient Buffer
|
||||
ae2fc.gui.fluid_interface=ME Dual Interface
|
||||
ae2fc.gui.fluid_interface.0=D
|
||||
ae2fc.gui.fluid_interface.1=U
|
||||
@@ -48,3 +54,5 @@ ae2fc.gui.fluid_interface.3=S
|
||||
ae2fc.gui.fluid_interface.4=W
|
||||
ae2fc.gui.fluid_interface.5=E
|
||||
ae2fc.gui.oc_pattern_editor=OC Pattern Editor
|
||||
|
||||
itemGroup.ae2fc=Fluid Craft For AE2
|
||||
@@ -0,0 +1,52 @@
|
||||
item.fluid_drop.name=%s液滴
|
||||
item.fluid_encoded_pattern.name=编写样板
|
||||
item.part_fluid_pattern_terminal.name=ME流体样板终端
|
||||
item.part_fluid_pattern_terminal_ex.name=ME增广流体样板终端
|
||||
item.part_fluid_interface.name=ME二合一接口
|
||||
item.part_fluid_import.name=ME流体输入总线
|
||||
item.part_fluid_export.name=ME流体输出总线
|
||||
item.fluid_packet.name=流体封包
|
||||
item.fluid_storage.1.name=1k-ME流体存储元件
|
||||
item.fluid_storage.4.name=4k-ME流体存储元件
|
||||
item.fluid_storage.16.name=16k-ME流体存储元件
|
||||
item.fluid_storage.64.name=64k-ME流体存储元件
|
||||
item.fluid_storage.256.name=256k-ME流体存储元件
|
||||
item.fluid_storage.1024.name=1024k-ME流体存储元件
|
||||
item.fluid_storage.4096.name=4096k-ME流体存储元件
|
||||
item.fluid_part.0.name=1k-ME流体存储组件
|
||||
item.fluid_part.1.name=4k-ME流体存储组件
|
||||
item.fluid_part.2.name=16k-ME流体存储组件
|
||||
item.fluid_part.3.name=64k-ME流体存储组件
|
||||
item.fluid_part.4.name=256k-ME流体存储组件
|
||||
item.fluid_part.5.name=1024k-ME流体存储组件
|
||||
item.fluid_part.6.name=4096k-ME流体存储组件
|
||||
|
||||
tile.fluid_discretizer.name=ME流体离散器
|
||||
tile.fluid_pattern_encoder.name=流体适配型样板编码台
|
||||
tile.fluid_packet_decoder.name=ME流体封包解码器
|
||||
tile.fluid_interface.name=ME二合一接口
|
||||
tile.ingredient_buffer.name=原材料缓存仓
|
||||
tile.large_ingredient_buffer.name=大型原材料缓存仓
|
||||
tile.oc_pattern_editor.name=OC样板编辑器
|
||||
|
||||
ae2fc.tooltip.invalid_fluid=流体无效!
|
||||
ae2fc.tooltip.encode_pattern=编写样板
|
||||
ae2fc.tooltip.fluid_packet=使用ME流体封包解码器\n来将其转换回流体形式。
|
||||
ae2fc.tooltip.empty=空
|
||||
ae2fc.tooltip.dump_tank=排空该流体槽
|
||||
ae2fc.tooltip.switch_fluid_interface=切换ME二合一接口GUI
|
||||
|
||||
ae2fc.gui.part_fluid_pattern_terminal=ME流体样板终端
|
||||
ae2fc.gui.part_fluid_pattern_terminal_ex=ME增广流体样板终端
|
||||
ae2fc.gui.fluid_pattern_encoder=流体适配型样板编码台
|
||||
ae2fc.gui.fluid_packet_decoder=ME流体封包解码器
|
||||
ae2fc.gui.ingredient_buffer=原材料缓存仓
|
||||
ae2fc.gui.large_ingredient_buffer=大型原材料缓存仓
|
||||
ae2fc.gui.fluid_interface=ME二合一接口
|
||||
ae2fc.gui.fluid_interface.0=下
|
||||
ae2fc.gui.fluid_interface.1=上
|
||||
ae2fc.gui.fluid_interface.2=北
|
||||
ae2fc.gui.fluid_interface.3=南
|
||||
ae2fc.gui.fluid_interface.4=西
|
||||
ae2fc.gui.fluid_interface.5=东
|
||||
ae2fc.gui.oc_pattern_editor=OC样板编辑器
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 383 B |
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 734 B |
Reference in new issue
Block a user