mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-11 15:57:55 +00:00
Button works!
This commit is contained in:
1 parent
6aa1a877e5
commit
9834066b4b
6 files changed
+29
-20
No files matched your search
@@ -74,7 +74,7 @@ public class GuiBaseFluidPatternTerminalEx extends GuiFCBaseMonitor {
|
||||
}
|
||||
else if( this.fluidPrioritizedEnabledBtn == btn || this.fluidPrioritizedDisabledBtn == btn )
|
||||
{
|
||||
FluidCraft.proxy.netHandler.sendToServer( new CPacketFluidPatternTermBtns( "PatternTerminalEx.Prioritize", this.fluidPrioritizedEnabledBtn == btn ? PRIORITY_DISABLE : PRIORITY_ENABLE ) );
|
||||
FluidCraft.proxy.netHandler.sendToServer( new CPacketFluidPatternTermBtns( "PatternTerminalEx.Prioritize", container.prioritize ? PRIORITY_DISABLE : PRIORITY_ENABLE ) );
|
||||
}
|
||||
else if( this.invertBtn == btn )
|
||||
{
|
||||
@@ -160,14 +160,14 @@ public class GuiBaseFluidPatternTerminalEx extends GuiFCBaseMonitor {
|
||||
}
|
||||
if( this.container.prioritize )
|
||||
{
|
||||
this.fluidPrioritizedEnabledBtn.visible = true;
|
||||
this.fluidPrioritizedDisabledBtn.visible = false;
|
||||
this.fluidPrioritizedEnabledBtn.visible = false;
|
||||
this.fluidPrioritizedDisabledBtn.visible = true;
|
||||
// MinecraftServer.getServer().getConfigurationManager().sendChatMsg(new ChatComponentText("ENABLED"));
|
||||
}
|
||||
else
|
||||
{
|
||||
this.fluidPrioritizedEnabledBtn.visible = false;
|
||||
this.fluidPrioritizedDisabledBtn.visible = true;
|
||||
this.fluidPrioritizedEnabledBtn.visible = true;
|
||||
this.fluidPrioritizedDisabledBtn.visible = false;
|
||||
//MinecraftServer.getServer().getConfigurationManager().sendChatMsg(new ChatComponentText("DISABLED"));
|
||||
}
|
||||
|
||||
|
||||
@@ -312,7 +312,8 @@ public class FCBasePartContainerEx extends FCBaseMonitorContain implements IAEAp
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
this.substitute = this.patternTerminal.isSubstitution();
|
||||
this.combine = this.patternTerminal.shouldCombine();
|
||||
this.combine = this.patternTerminal.shouldCombine(); //Check out
|
||||
this.prioritize = this.patternTerminal.isPrioritize();
|
||||
if (inverted != patternTerminal.isInverted() || activePage != patternTerminal.getActivePage()) {
|
||||
inverted = patternTerminal.isInverted();
|
||||
activePage = patternTerminal.getActivePage();
|
||||
|
||||
@@ -38,11 +38,9 @@ public class PartFluidPatternTerminalEx extends FCBasePart {
|
||||
private final AppEngInternalInventory pattern = new AppEngInternalInventory( this, 2 );
|
||||
|
||||
private boolean substitute = false;
|
||||
<<<<<<< HEAD
|
||||
private boolean combine = false;
|
||||
=======
|
||||
private boolean priorization = false;
|
||||
>>>>>>> b51bff6 (Test)
|
||||
private boolean prioritize = false;
|
||||
private boolean inverted = false;
|
||||
private int activePage = 0;
|
||||
|
||||
@@ -84,7 +82,7 @@ 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" );
|
||||
@@ -101,13 +99,13 @@ 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" );
|
||||
data.setBoolean("priorization", this.priorization);
|
||||
data.setBoolean("priorization", this.prioritize);
|
||||
data.setBoolean( "substitute", this.substitute );
|
||||
data.setBoolean( "inverted", this.inverted );
|
||||
data.setInteger( "activePage", this.activePage );
|
||||
@@ -226,13 +224,18 @@ public class PartFluidPatternTerminalEx extends FCBasePart {
|
||||
return this.substitute;
|
||||
}
|
||||
|
||||
public boolean isPrioritize()
|
||||
{
|
||||
return this.prioritize;
|
||||
}
|
||||
|
||||
public void setSubstitution( boolean canSubstitute )
|
||||
{
|
||||
this.substitute = canSubstitute;
|
||||
}
|
||||
public void setPrioritization( boolean canPrioritize )
|
||||
{
|
||||
this.priorization = canPrioritize;
|
||||
this.prioritize = canPrioritize;
|
||||
}
|
||||
|
||||
public void onChangeCrafting(IAEItemStack[] newCrafting, IAEItemStack[] newOutput) {
|
||||
|
||||
+7
-1
@@ -4,8 +4,10 @@ import codechicken.nei.api.IOverlayHandler;
|
||||
import codechicken.nei.recipe.IRecipeHandler;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.client.gui.GuiBaseFluidPatternTerminalEx;
|
||||
import com.glodblock.github.client.gui.GuiFluidPatternTerminal;
|
||||
import com.glodblock.github.client.gui.GuiFluidPatternTerminalEx;
|
||||
import com.glodblock.github.client.gui.container.FluidPrioritization;
|
||||
import com.glodblock.github.nei.object.OrderStack;
|
||||
import com.glodblock.github.nei.recipes.FluidRecipe;
|
||||
import com.glodblock.github.network.CPacketTransferRecipe;
|
||||
@@ -30,7 +32,11 @@ public class FluidPatternTerminalRecipeTransferHandler implements IOverlayHandle
|
||||
@Override
|
||||
public void overlayRecipe(GuiContainer firstGui, IRecipeHandler recipe, int recipeIndex, boolean shift) {
|
||||
if (isCorrectGui(firstGui)) {
|
||||
List<OrderStack<?>> in = FluidRecipe.getPackageInputs(recipe, recipeIndex);
|
||||
boolean priority = false;
|
||||
if (firstGui instanceof GuiBaseFluidPatternTerminalEx) {
|
||||
priority = ((GuiBaseFluidPatternTerminalEx)firstGui).container.prioritize;
|
||||
}
|
||||
List<OrderStack<?>> in = FluidRecipe.getPackageInputs(recipe, recipeIndex, priority);
|
||||
List<OrderStack<?>> out = FluidRecipe.getPackageOutputs(recipe, recipeIndex, !notUseOther(recipe));
|
||||
boolean craft = shouldCraft(recipe);
|
||||
FluidCraft.proxy.netHandler.sendToServer(new CPacketTransferRecipe(in, out, craft));
|
||||
|
||||
@@ -32,18 +32,14 @@ public final class FluidRecipe {
|
||||
}
|
||||
}
|
||||
|
||||
public static List<OrderStack<?>> getPackageInputs(IRecipeHandler recipe, int index) {
|
||||
public static List<OrderStack<?>> getPackageInputs(IRecipeHandler recipe, int index, boolean priority) {
|
||||
TemplateRecipeHandler tRecipe = (TemplateRecipeHandler) recipe;
|
||||
if (tRecipe == null || !IdentifierMap.containsKey(tRecipe.getOverlayIdentifier())) return new ArrayList<>();
|
||||
if (tRecipe.getOverlayIdentifier() == null) return getPackageInputsLegacy(recipe, index);
|
||||
IRecipeExtractor extractor = IdentifierMap.get(tRecipe.getOverlayIdentifier());
|
||||
if (extractor == null) return new ArrayList<>();
|
||||
List<PositionedStack> tmp = new ArrayList<>(tRecipe.getIngredientStacks(index));
|
||||
FluidPrioritization fluid = FluidPrioritization.ENABLED;
|
||||
switch(fluid) {
|
||||
case ENABLED:
|
||||
MinecraftServer.getServer().getConfigurationManager().sendChatMsg(new ChatComponentText("hi"));
|
||||
|
||||
if (priority) {
|
||||
for (int i = 0; i < tmp.size(); i++) {
|
||||
if(tmp.get(i).toString().contains("GregTech_FluidDisplay")) {
|
||||
MinecraftServer.getServer().getConfigurationManager().sendChatMsg(new ChatComponentText(String.valueOf(tmp.size())));
|
||||
|
||||
@@ -112,6 +112,9 @@ public class CPacketFluidPatternTermBtns implements IMessage {
|
||||
case "PatternTerminalEx.ActivePage":
|
||||
cpt.getPatternTerminal().setActivePage(Integer.parseInt(Value));
|
||||
break;
|
||||
case "PatternTerminalEx.Prioritize":
|
||||
cpt.getPatternTerminal().setPrioritization(Value.equals("1"));
|
||||
break;
|
||||
}
|
||||
} else if(Name.equals( "Terminal.Cpu" ) && c instanceof ContainerFluidCraftConfirm) {
|
||||
final ContainerFluidCraftConfirm qk = (ContainerFluidCraftConfirm) c;
|
||||
|
||||
Reference in new issue
Block a user