mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-12 16:27:40 +00:00
clean up
This commit is contained in:
1 parent
5ee263e9de
commit
3e8c507556
7 files changed
+6
-43
No files matched your search
@@ -71,7 +71,7 @@ public class GuiBaseFluidPatternTerminalEx extends GuiFCBaseMonitor {
|
||||
}
|
||||
else if( this.combineDisableBtn == btn || this.combineEnableBtn == btn )
|
||||
{
|
||||
FluidCraft.proxy.netHandler.sendToServer( new CPacketFluidPatternTermBtns( "PatternTerminal.Combine", this.combineDisableBtn == btn ? "1" : "0" ) );
|
||||
FluidCraft.proxy.netHandler.sendToServer( new CPacketFluidPatternTermBtns( "PatternTerminalEx.Combine", this.combineDisableBtn == btn ? "1" : "0" ) );
|
||||
}
|
||||
else if (ModAndClassUtil.isDoubleButton && doubleBtn == btn)
|
||||
{
|
||||
|
||||
@@ -60,14 +60,14 @@ 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 )
|
||||
public boolean inverted;
|
||||
@GuiSync( 96 + (17-9) + 17 )
|
||||
public int activePage = 0;
|
||||
@GuiSync( 95 + (17-9) + 18 )
|
||||
public boolean combine = false;
|
||||
|
||||
public FCBasePartContainerEx(final InventoryPlayer ip, final ITerminalHost monitorable )
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -106,8 +106,9 @@ public class CPacketFluidPatternTermBtns implements IMessage {
|
||||
case "PatternTerminalEx.Double":
|
||||
cpt.doubleStacks(Value.equals("1"));
|
||||
break;
|
||||
case "PatternTerminal.Combine":
|
||||
case "PatternTerminalEx.Combine":
|
||||
cpt.getPatternTerminal().setCombineMode(Value.equals("1"));
|
||||
break;
|
||||
case "PatternTerminalEx.ActivePage":
|
||||
cpt.getPatternTerminal().setActivePage(Integer.parseInt(Value));
|
||||
break;
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user