Skip to content

Commit

Permalink
Merge pull request #5 from GlodBlock/upstream
Browse files Browse the repository at this point in the history
upstream
  • Loading branch information
Dream-Master authored Jul 31, 2022
2 parents 76eeeb1 + c961a5d commit 38accb2
Show file tree
Hide file tree
Showing 68 changed files with 1,276 additions and 276 deletions.
3 changes: 0 additions & 3 deletions CODEOWNERS

This file was deleted.

42 changes: 2 additions & 40 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 7 additions & 2 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/com/glodblock/github/FluidCraft.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
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";
Expand All @@ -43,15 +43,16 @@ public static void preInit(FMLPreInitializationEvent event) {
@Mod.EventHandler
public static void init(FMLInitializationEvent event) {
ModAndClassUtil.init();
AEApi.instance().registries().cell().addCellHandler(new FluidCellHandler());
ItemAndBlockHolder.loadSetting();
proxy.init(event);
}

@Mod.EventHandler
public static void postInit(FMLPostInitializationEvent event) {
NetworkRegistry.INSTANCE.registerGuiHandler(FluidCraft.INSTANCE, new InventoryHandler());

AEApi.instance().registries().cell().addCellHandler(new FluidCellHandler());
ItemAndBlockHolder.loadSetting();

if (!Config.removeRecipe) {
(new RecipeLoader()).run();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand All @@ -68,6 +71,10 @@ else if( this.substitutionsEnabledBtn == btn || this.substitutionsDisabledBtn ==
{
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") );
Expand Down Expand Up @@ -100,11 +107,22 @@ public void initGui()
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
Expand Down Expand Up @@ -136,8 +154,27 @@ public void drawFG( final int offsetX, final int offsetY, final int mouseX, fina
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -67,6 +69,10 @@ else if( this.invertBtn == btn )
{
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") );
Expand Down Expand Up @@ -104,6 +110,14 @@ public void initGui()
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);
}

Expand All @@ -124,8 +138,19 @@ public void drawFG( final int offsetX, final int offsetY, final int mouseX, fina
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);
}

Expand Down Expand Up @@ -167,6 +192,8 @@ public void drawScreen( final int mouseX, final int mouseY, final float btn )
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);

Expand Down
Loading

0 comments on commit 38accb2

Please sign in to comment.