Skip to content

Commit

Permalink
a bunch of stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
GlodBlock committed Oct 1, 2022
1 parent 19d5e44 commit e268d96
Show file tree
Hide file tree
Showing 42 changed files with 1,206 additions and 81 deletions.
16 changes: 8 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ buildscript {
apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'idea'

version = "2.3.4-r"
version = "2.4.0-r"
group = "ae2fc"
archivesBaseName = "Fluid Craft for AE2"

Expand All @@ -42,17 +42,17 @@ repositories {
maven { url 'https://dvs1.progwml6.com/files/maven/' }
maven { url 'https://jitpack.io/' }
maven { url 'https://cursemaven.com/' }
maven { url "https://minecraft.curseforge.com/api/maven/" }
maven { url 'https://minecraft.curseforge.com/api/maven/' }
}

dependencies {
compile 'com.github.phantamanta44:jsr305:1.0.1'
deobfCompile 'mezz.jei:jei_1.12.2:4.15.0.293' //jei
deobfCompile "curse.maven:ae2-extended-life-570458:3785381" // pae2
deobfCompile "curse.maven:packagedauto-308380:2977147" // 1.0.3.14
deobfCompile "curse.maven:modular-machinery-270790:2761302" // 1.11.1
deobfCompile "curse.maven:codechicken-lib-1-8-242818:2779848" //ccl
deobfCompile "curse.maven:gregtech-ce-unofficial-557242:3784798" // gt
deobfCompile 'curse.maven:ae2-extended-life-570458:3785381' // pae2
deobfCompile 'curse.maven:packagedauto-308380:2977147' // 1.0.3.14
deobfCompile 'curse.maven:modular-machinery-270790:2761302' // 1.11.1
deobfCompile 'curse.maven:codechicken-lib-1-8-242818:2779848' //ccl
deobfCompile 'curse.maven:gregtech-ce-unofficial-557242:3784798' // gt
compileOnly "curse.maven:dynamistics-383632:3056455" // dy
}

minecraft {
Expand Down
5 changes: 1 addition & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
systemProp.http.proxyHost=127.0.0.1
systemProp.http.proxyPort=7890
systemProp.https.proxyHost=127.0.0.1
systemProp.https.proxyPort=7890

2 changes: 1 addition & 1 deletion src/main/java/com/glodblock/github/FluidCraft.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
public class FluidCraft {

public static final String MODID = "ae2fc";
public static final String VERSION = "2.3.4-r";
public static final String VERSION = "2.4.0-r";

@Mod.Instance(MODID)
public static FluidCraft INSTANCE;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,33 @@
package com.glodblock.github.client;

import appeng.api.storage.ITerminalHost;
import appeng.api.storage.data.IAEItemStack;
import appeng.client.gui.implementations.GuiExpandedProcessingPatternTerm;
import appeng.client.gui.widgets.GuiTabButton;
import appeng.client.render.StackSizeRenderer;
import appeng.container.AEBaseContainer;
import appeng.container.slot.OptionalSlotFake;
import appeng.container.slot.SlotFake;
import appeng.container.slot.SlotFakeCraftingMatrix;
import appeng.util.item.AEItemStack;
import com.glodblock.github.FluidCraft;
import com.glodblock.github.client.button.GuiFCImgButton;
import com.glodblock.github.client.container.ContainerExtendedFluidPatternTerminal;
import com.glodblock.github.client.render.FluidRenderUtils;
import com.glodblock.github.common.item.ItemFluidPacket;
import com.glodblock.github.inventory.GuiType;
import com.glodblock.github.inventory.InventoryHandler;
import com.glodblock.github.inventory.slot.SlotSingleItem;
import com.glodblock.github.network.CPacketFluidPatternTermBtns;
import com.glodblock.github.network.CPacketInventoryAction;
import com.glodblock.github.util.Ae2ReflectClient;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.ClickType;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;

import javax.annotation.Nonnull;

public class GuiExtendedFluidPatternTerminal extends GuiExpandedProcessingPatternTerm {

Expand All @@ -24,6 +36,8 @@ public class GuiExtendedFluidPatternTerminal extends GuiExpandedProcessingPatter
private GuiTabButton craftingStatusBtn;
private GuiFCImgButton combineEnableBtn;
private GuiFCImgButton combineDisableBtn;
private GuiFCImgButton fluidEnableBtn;
private GuiFCImgButton fluidDisableBtn;

public GuiExtendedFluidPatternTerminal(InventoryPlayer inventoryPlayer, ITerminalHost te) {
super(inventoryPlayer, te);
Expand All @@ -44,16 +58,35 @@ public void initGui() {
this.combineDisableBtn = new GuiFCImgButton( this.guiLeft + 74, this.guiTop + this.ySize - 153, "NOT_COMBINE", "DONT_COMBINE" );
this.combineDisableBtn.setHalfSize( true );
this.buttonList.add( this.combineDisableBtn );

this.fluidEnableBtn = new GuiFCImgButton( this.guiLeft + 74, this.guiTop + this.ySize - 143, "FLUID_FIRST", "FLUID" );
this.fluidEnableBtn.setHalfSize( true );
this.buttonList.add( this.fluidEnableBtn );

this.fluidDisableBtn = new GuiFCImgButton( this.guiLeft + 74, this.guiTop + this.ySize - 143, "ORIGIN_ORDER", "ITEM" );
this.fluidDisableBtn.setHalfSize( true );
this.buttonList.add( this.fluidDisableBtn );
}

@Override
public void drawSlot(Slot slot) {
if (!(slot instanceof SlotFake && FluidRenderUtils.renderFluidPacketIntoGuiSlot(
slot, slot.getStack(), stackSizeRenderer, fontRenderer))) {
if (!(slot instanceof SlotFake && (FluidRenderUtils.renderFluidPacketIntoGuiSlot(
slot, slot.getStack(), stackSizeRenderer, fontRenderer) || renderMEStyleSlot(slot, slot.getStack())))) {
super.drawSlot(slot);
}
}

private boolean renderMEStyleSlot(Slot slot, @Nonnull ItemStack stack) {
if (slot instanceof SlotFake && !stack.isEmpty() && !(stack.getItem() instanceof ItemFluidPacket)) {
super.drawSlot(new SlotSingleItem(slot));
if (stack.getCount() > 1) {
this.stackSizeRenderer.renderStackSize(fontRenderer, AEItemStack.fromItemStack(stack), slot.xPos, slot.yPos);
}
return true;
}
return false;
}

@Override
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) {
if ( this.container.combine )
Expand All @@ -66,6 +99,16 @@ public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) {
this.combineEnableBtn.visible = false;
this.combineDisableBtn.visible = true;
}
if (this.container.fluidFirst)
{
this.fluidEnableBtn.visible = true;
this.fluidDisableBtn.visible = false;
}
else
{
this.fluidEnableBtn.visible = false;
this.fluidDisableBtn.visible = true;
}
super.drawFG(offsetX, offsetY, mouseX, mouseY);
}

Expand All @@ -75,9 +118,33 @@ protected void actionPerformed(final GuiButton btn) {
InventoryHandler.switchGui(GuiType.FLUID_PAT_TERM_CRAFTING_STATUS);
} else if (this.combineDisableBtn == btn || this.combineEnableBtn == btn) {
FluidCraft.proxy.netHandler.sendToServer(new CPacketFluidPatternTermBtns( "PatternTerminal.Combine", this.combineDisableBtn == btn ? "1" : "0" ));
} else if (this.fluidDisableBtn == btn || this.fluidEnableBtn == btn) {
FluidCraft.proxy.netHandler.sendToServer(new CPacketFluidPatternTermBtns( "PatternTerminal.Fluid", this.fluidDisableBtn == btn ? "1" : "0" ));
} else {
super.actionPerformed(btn);
}
}

@Override
protected void handleMouseClick(Slot slot, int slotIdx, int mouseButton, ClickType clickType) {
if (mouseButton == 2 ) {
if (slot instanceof OptionalSlotFake || slot instanceof SlotFakeCraftingMatrix) {
if (slot.getHasStack()) {
IAEItemStack stack = AEItemStack.fromItemStack(slot.getStack());
((AEBaseContainer) this.inventorySlots).setTargetStack(stack);
int x = 0;
for (int i = 0; i < this.inventorySlots.inventorySlots.size(); i ++) {
if (this.inventorySlots.inventorySlots.get(i).equals(slot)) {
x = i;
break;
}
}
FluidCraft.proxy.netHandler.sendToServer(new CPacketInventoryAction(1, x, 0, stack));
return;
}
}
}
super.handleMouseClick(slot, slotIdx, mouseButton, clickType);
}

}
Original file line number Diff line number Diff line change
@@ -1,21 +1,33 @@
package com.glodblock.github.client;

import appeng.api.storage.ITerminalHost;
import appeng.api.storage.data.IAEItemStack;
import appeng.client.gui.implementations.GuiPatternTerm;
import appeng.client.gui.widgets.GuiTabButton;
import appeng.client.render.StackSizeRenderer;
import appeng.container.AEBaseContainer;
import appeng.container.slot.OptionalSlotFake;
import appeng.container.slot.SlotFake;
import appeng.container.slot.SlotFakeCraftingMatrix;
import appeng.util.item.AEItemStack;
import com.glodblock.github.FluidCraft;
import com.glodblock.github.client.button.GuiFCImgButton;
import com.glodblock.github.client.container.ContainerFluidPatternTerminal;
import com.glodblock.github.client.render.FluidRenderUtils;
import com.glodblock.github.common.item.ItemFluidPacket;
import com.glodblock.github.inventory.GuiType;
import com.glodblock.github.inventory.InventoryHandler;
import com.glodblock.github.inventory.slot.SlotSingleItem;
import com.glodblock.github.network.CPacketFluidPatternTermBtns;
import com.glodblock.github.network.CPacketInventoryAction;
import com.glodblock.github.util.Ae2ReflectClient;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.ClickType;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;

import javax.annotation.Nonnull;

public class GuiFluidPatternTerminal extends GuiPatternTerm {

Expand All @@ -24,6 +36,8 @@ public class GuiFluidPatternTerminal extends GuiPatternTerm {
private GuiTabButton craftingStatusBtn;
private GuiFCImgButton combineEnableBtn;
private GuiFCImgButton combineDisableBtn;
private GuiFCImgButton fluidEnableBtn;
private GuiFCImgButton fluidDisableBtn;

public GuiFluidPatternTerminal(InventoryPlayer inventoryPlayer, ITerminalHost te) {
super(inventoryPlayer, te);
Expand All @@ -44,6 +58,14 @@ public void initGui() {
this.combineDisableBtn = new GuiFCImgButton( this.guiLeft + 84, this.guiTop + this.ySize - 163, "NOT_COMBINE", "DONT_COMBINE" );
this.combineDisableBtn.setHalfSize( true );
this.buttonList.add( this.combineDisableBtn );

this.fluidEnableBtn = new GuiFCImgButton( this.guiLeft + 74, this.guiTop + this.ySize - 153, "FLUID_FIRST", "FLUID" );
this.fluidEnableBtn.setHalfSize( true );
this.buttonList.add( this.fluidEnableBtn );

this.fluidDisableBtn = new GuiFCImgButton( this.guiLeft + 74, this.guiTop + this.ySize - 153, "ORIGIN_ORDER", "ITEM" );
this.fluidDisableBtn.setHalfSize( true );
this.buttonList.add( this.fluidDisableBtn );
}

@Override
Expand All @@ -66,26 +88,71 @@ public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) {
this.combineEnableBtn.visible = false;
this.combineDisableBtn.visible = false;
}
if (this.container.fluidFirst)
{
this.fluidEnableBtn.visible = true;
this.fluidDisableBtn.visible = false;
}
else
{
this.fluidEnableBtn.visible = false;
this.fluidDisableBtn.visible = true;
}
super.drawFG(offsetX, offsetY, mouseX, mouseY);
}

@Override
public void drawSlot(Slot slot) {
if (!(slot instanceof SlotFake && FluidRenderUtils.renderFluidPacketIntoGuiSlot(
slot, slot.getStack(), stackSizeRenderer, fontRenderer))) {
super.drawSlot(slot);
if (!(slot instanceof SlotFake && (FluidRenderUtils.renderFluidPacketIntoGuiSlot(
slot, slot.getStack(), stackSizeRenderer, fontRenderer) || renderMEStyleSlot(slot, slot.getStack())))) {
super.drawSlot(slot);
}
}

private boolean renderMEStyleSlot(Slot slot, @Nonnull ItemStack stack) {
if (slot instanceof SlotFake && !stack.isEmpty() && !(stack.getItem() instanceof ItemFluidPacket)) {
super.drawSlot(new SlotSingleItem(slot));
if (stack.getCount() > 1) {
this.stackSizeRenderer.renderStackSize(fontRenderer, AEItemStack.fromItemStack(stack), slot.xPos, slot.yPos);
}
return true;
}
return false;
}

@Override
protected void actionPerformed(final GuiButton btn) {
if (btn == craftingStatusBtn) {
InventoryHandler.switchGui(GuiType.FLUID_PAT_TERM_CRAFTING_STATUS);
} else if (this.combineDisableBtn == btn || this.combineEnableBtn == btn) {
FluidCraft.proxy.netHandler.sendToServer(new CPacketFluidPatternTermBtns( "PatternTerminal.Combine", this.combineDisableBtn == btn ? "1" : "0" ));
} else if (this.fluidDisableBtn == btn || this.fluidEnableBtn == btn) {
FluidCraft.proxy.netHandler.sendToServer(new CPacketFluidPatternTermBtns( "PatternTerminal.Fluid", this.fluidDisableBtn == btn ? "1" : "0" ));
} else {
super.actionPerformed(btn);
}
}

@Override
protected void handleMouseClick(Slot slot, int slotIdx, int mouseButton, ClickType clickType) {
if (mouseButton == 2 ) {
if (slot instanceof OptionalSlotFake || slot instanceof SlotFakeCraftingMatrix) {
if (slot.getHasStack()) {
IAEItemStack stack = AEItemStack.fromItemStack(slot.getStack());
((AEBaseContainer) this.inventorySlots).setTargetStack(stack);
int x = 0;
for (int i = 0; i < this.inventorySlots.inventorySlots.size(); i ++) {
if (this.inventorySlots.inventorySlots.get(i).equals(slot)) {
x = i;
break;
}
}
FluidCraft.proxy.netHandler.sendToServer(new CPacketInventoryAction(1, x, 0, stack));
return;
}
}
}
super.handleMouseClick(slot, slotIdx, mouseButton, clickType);
}

}
Loading

0 comments on commit e268d96

Please sign in to comment.