mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-16 18:44:42 +00:00
Test
Test
This commit is contained in:
1 parent
1998750489
commit
6aa1a877e5
6 files changed
+100
-1
No files matched your search
@@ -10,12 +10,15 @@ import appeng.client.gui.widgets.GuiScrollbar;
|
||||
import appeng.container.slot.AppEngSlot;
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.client.gui.container.FCBasePartContainerEx;
|
||||
import com.glodblock.github.client.gui.container.FluidPrioritization;
|
||||
import com.glodblock.github.network.CPacketFluidPatternTermBtns;
|
||||
import com.glodblock.github.util.Ae2ReflectClient;
|
||||
import com.glodblock.github.util.ModAndClassUtil;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.input.Mouse;
|
||||
@@ -24,11 +27,15 @@ public class GuiBaseFluidPatternTerminalEx extends GuiFCBaseMonitor {
|
||||
|
||||
private static final String SUBSITUTION_DISABLE = "0";
|
||||
private static final String SUBSITUTION_ENABLE = "1";
|
||||
private static final String PRIORITY_DISABLE = "0";
|
||||
private static final String PRIORITY_ENABLE = "1";
|
||||
|
||||
public FCBasePartContainerEx container;
|
||||
|
||||
private GuiImgButton substitutionsEnabledBtn;
|
||||
private GuiImgButton substitutionsDisabledBtn;
|
||||
private GuiImgButton fluidPrioritizedEnabledBtn;
|
||||
private GuiImgButton fluidPrioritizedDisabledBtn;
|
||||
private GuiImgButton encodeBtn;
|
||||
private GuiImgButton invertBtn;
|
||||
private GuiImgButton clearBtn;
|
||||
@@ -65,6 +72,10 @@ public class GuiBaseFluidPatternTerminalEx extends GuiFCBaseMonitor {
|
||||
{
|
||||
FluidCraft.proxy.netHandler.sendToServer( new CPacketFluidPatternTermBtns( "PatternTerminalEx.Substitute", this.substitutionsEnabledBtn == btn ? SUBSITUTION_DISABLE : SUBSITUTION_ENABLE ) );
|
||||
}
|
||||
else if( this.fluidPrioritizedEnabledBtn == btn || this.fluidPrioritizedDisabledBtn == btn )
|
||||
{
|
||||
FluidCraft.proxy.netHandler.sendToServer( new CPacketFluidPatternTermBtns( "PatternTerminalEx.Prioritize", this.fluidPrioritizedEnabledBtn == btn ? PRIORITY_DISABLE : PRIORITY_ENABLE ) );
|
||||
}
|
||||
else if( this.invertBtn == btn )
|
||||
{
|
||||
FluidCraft.proxy.netHandler.sendToServer( new CPacketFluidPatternTermBtns( "PatternTerminalEx.Invert", container.inverted ? "0" : "1" ) );
|
||||
@@ -93,6 +104,16 @@ public class GuiBaseFluidPatternTerminalEx extends GuiFCBaseMonitor {
|
||||
this.substitutionsDisabledBtn.setHalfSize( true );
|
||||
this.buttonList.add( this.substitutionsDisabledBtn );
|
||||
|
||||
this.fluidPrioritizedEnabledBtn = new GuiImgButton( this.guiLeft + 87, this.guiTop + this.ySize - 143, Settings.ACTIONS, FluidPrioritization.ENABLED );
|
||||
this.fluidPrioritizedEnabledBtn.setHalfSize( true );
|
||||
this.buttonList.add( this.fluidPrioritizedEnabledBtn );
|
||||
MinecraftServer.getServer().getConfigurationManager().sendChatMsg(new ChatComponentText("ENABLED IMMER"));
|
||||
|
||||
this.fluidPrioritizedDisabledBtn = new GuiImgButton( this.guiLeft + 87, this.guiTop + this.ySize - 143, Settings.ACTIONS, FluidPrioritization.DISABLED );
|
||||
this.fluidPrioritizedDisabledBtn.setHalfSize( true );
|
||||
this.buttonList.add( this.fluidPrioritizedDisabledBtn );
|
||||
MinecraftServer.getServer().getConfigurationManager().sendChatMsg(new ChatComponentText("DISABLED IMMER"));
|
||||
|
||||
invertBtn = new GuiImgButton( this.guiLeft + 87, this.guiTop + this.ySize - 153, Settings.ACTIONS, container.inverted ? PatternSlotConfig.C_4_16 : PatternSlotConfig.C_16_4);
|
||||
invertBtn.setHalfSize( true );
|
||||
this.buttonList.add( this.invertBtn );
|
||||
@@ -137,6 +158,18 @@ public class GuiBaseFluidPatternTerminalEx extends GuiFCBaseMonitor {
|
||||
this.substitutionsEnabledBtn.visible = false;
|
||||
this.substitutionsDisabledBtn.visible = true;
|
||||
}
|
||||
if( this.container.prioritize )
|
||||
{
|
||||
this.fluidPrioritizedEnabledBtn.visible = true;
|
||||
this.fluidPrioritizedDisabledBtn.visible = false;
|
||||
// MinecraftServer.getServer().getConfigurationManager().sendChatMsg(new ChatComponentText("ENABLED"));
|
||||
}
|
||||
else
|
||||
{
|
||||
this.fluidPrioritizedEnabledBtn.visible = false;
|
||||
this.fluidPrioritizedDisabledBtn.visible = true;
|
||||
//MinecraftServer.getServer().getConfigurationManager().sendChatMsg(new ChatComponentText("DISABLED"));
|
||||
}
|
||||
|
||||
if ( this.container.combine )
|
||||
{
|
||||
@@ -184,11 +217,20 @@ public class GuiBaseFluidPatternTerminalEx extends GuiFCBaseMonitor {
|
||||
substitutionsEnabledBtn.visible = false;
|
||||
substitutionsDisabledBtn.visible = true;
|
||||
}
|
||||
if (container.prioritize) {
|
||||
fluidPrioritizedEnabledBtn.visible = true;
|
||||
fluidPrioritizedDisabledBtn.visible = false;
|
||||
} else {
|
||||
fluidPrioritizedEnabledBtn.visible = false;
|
||||
fluidPrioritizedDisabledBtn.visible = true;
|
||||
}
|
||||
|
||||
final int offset = container.inverted? 18 * -3: 0;
|
||||
|
||||
substitutionsEnabledBtn.xPosition = this.guiLeft + 97 + offset;
|
||||
substitutionsDisabledBtn.xPosition = this.guiLeft + 97 + offset;
|
||||
fluidPrioritizedEnabledBtn.xPosition = this.guiLeft + 87 + offset;
|
||||
fluidPrioritizedDisabledBtn.xPosition = this.guiLeft + 87 + offset;
|
||||
doubleBtn.xPosition = this.guiLeft + 97 + offset;
|
||||
clearBtn.xPosition = this.guiLeft + 87 + offset;
|
||||
invertBtn.xPosition = this.guiLeft + 87 + offset;
|
||||
|
||||
@@ -34,6 +34,7 @@ public class GuiFCPriority extends AEBaseGui
|
||||
private GuiButton plus10;
|
||||
private GuiButton plus100;
|
||||
private GuiButton plus1000;
|
||||
private GuiButton plus10000;
|
||||
private GuiButton minus1;
|
||||
private GuiButton minus10;
|
||||
private GuiButton minus100;
|
||||
@@ -56,16 +57,20 @@ public class GuiFCPriority extends AEBaseGui
|
||||
final int b = AEConfig.instance.priorityByStacksAmounts( 1 );
|
||||
final int c = AEConfig.instance.priorityByStacksAmounts( 2 );
|
||||
final int d = AEConfig.instance.priorityByStacksAmounts( 3 );
|
||||
final int e = AEConfig.instance.priorityByStacksAmounts( 4 );
|
||||
|
||||
this.buttonList.add( this.plus1 = new GuiButton( 0, this.guiLeft + 20, this.guiTop + 32, 22, 20, "+" + a ) );
|
||||
this.buttonList.add( this.plus10 = new GuiButton( 0, this.guiLeft + 48, this.guiTop + 32, 28, 20, "+" + b ) );
|
||||
this.buttonList.add( this.plus100 = new GuiButton( 0, this.guiLeft + 82, this.guiTop + 32, 32, 20, "+" + c ) );
|
||||
this.buttonList.add( this.plus1000 = new GuiButton( 0, this.guiLeft + 120, this.guiTop + 32, 38, 20, "+" + d ) );
|
||||
this.buttonList.add( this.plus10000 = new GuiButton( 0, this.guiLeft + 140, this.guiTop + 32, 42, 20, "+" + e ) );
|
||||
|
||||
|
||||
this.buttonList.add( this.minus1 = new GuiButton( 0, this.guiLeft + 20, this.guiTop + 69, 22, 20, "-" + a ) );
|
||||
this.buttonList.add( this.minus10 = new GuiButton( 0, this.guiLeft + 48, this.guiTop + 69, 28, 20, "-" + b ) );
|
||||
this.buttonList.add( this.minus100 = new GuiButton( 0, this.guiLeft + 82, this.guiTop + 69, 32, 20, "-" + c ) );
|
||||
this.buttonList.add( this.minus1000 = new GuiButton( 0, this.guiLeft + 120, this.guiTop + 69, 38, 20, "-" + d ) );
|
||||
this.buttonList.add( this.plus10000 = new GuiButton( 0, this.guiLeft + 140, this.guiTop + 32, 42, 20, "+" + e ) );
|
||||
|
||||
ItemStack myIcon = null;
|
||||
final Object target = ( (AEBaseContainer) this.inventorySlots ).getTarget();
|
||||
|
||||
@@ -68,6 +68,8 @@ public class FCBasePartContainerEx extends FCBaseMonitorContain implements IAEAp
|
||||
public boolean inverted;
|
||||
@GuiSync( 96 + (17-9) + 17 )
|
||||
public int activePage = 0;
|
||||
@GuiSync( 96 + (17-9) + 13 )
|
||||
public boolean prioritize = false;
|
||||
|
||||
public FCBasePartContainerEx(final InventoryPlayer ip, final ITerminalHost monitorable )
|
||||
{
|
||||
@@ -207,6 +209,11 @@ public class FCBasePartContainerEx extends FCBaseMonitorContain implements IAEAp
|
||||
encodedValue.setTag( "out", tagOut );
|
||||
encodedValue.setBoolean( "substitute", this.isSubstitute() );
|
||||
|
||||
encodedValue.setTag( "in", tagIn );
|
||||
encodedValue.setTag( "out", tagOut );
|
||||
encodedValue.setBoolean( "piroritize", this.isPrioritize() );
|
||||
|
||||
|
||||
output.setTagCompound( encodedValue );
|
||||
}
|
||||
|
||||
@@ -386,6 +393,8 @@ public class FCBasePartContainerEx extends FCBaseMonitorContain implements IAEAp
|
||||
return this.substitute;
|
||||
}
|
||||
|
||||
private boolean isPrioritize() { return this.prioritize; }
|
||||
|
||||
static boolean canDoubleStacks(SlotFake[] slots)
|
||||
{
|
||||
List<SlotFake> enabledSlots = Arrays.stream(slots).filter(SlotFake::isEnabled).collect(Collectors.toList());
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.glodblock.github.client.gui.container;
|
||||
|
||||
|
||||
import akka.actor.Status;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
|
||||
public enum FluidPrioritization {
|
||||
ENABLED,
|
||||
DISABLED;
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user