All GUI compile errors fixed, switched to excludes over includes in gradle build and lots, LOTS of more fixes.
This commit is contained in:
@@ -21,6 +21,9 @@ package appeng.fluids.block;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import appeng.container.ContainerLocator;
|
||||
import appeng.container.ContainerOpener;
|
||||
import appeng.fluids.container.ContainerFluidInterface;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -57,7 +60,7 @@ public class BlockFluidInterface extends AEBaseTileBlock<TileFluidInterface>
|
||||
{
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
// FIXME Platform.openGUI( p, tg, AEPartLocation.fromFacing(hit), GuiBridge.GUI_FLUID_INTERFACE );
|
||||
ContainerOpener.openContainer(ContainerFluidInterface.TYPE, p, ContainerLocator.forTileEntitySide(tg, hit.getFace()));
|
||||
}
|
||||
return ActionResultType.SUCCESS;
|
||||
}
|
||||
|
||||
@@ -2,34 +2,26 @@
|
||||
package appeng.fluids.client.gui;
|
||||
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
|
||||
import appeng.client.gui.implementations.GuiUpgradeable;
|
||||
import appeng.client.gui.widgets.GuiTabButton;
|
||||
import appeng.container.implementations.ContainerPriority;
|
||||
import appeng.core.localization.GuiText;
|
||||
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketSwitchGuis;
|
||||
import appeng.fluids.client.gui.widgets.GuiFluidSlot;
|
||||
import appeng.fluids.client.gui.widgets.GuiOptionalFluidSlot;
|
||||
import appeng.fluids.container.ContainerFluidFormationPlane;
|
||||
import appeng.fluids.parts.PartFluidFormationPlane;
|
||||
import appeng.fluids.util.IAEFluidTank;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
|
||||
|
||||
public class GuiFluidFormationPlane extends GuiUpgradeable
|
||||
public class GuiFluidFormationPlane extends GuiUpgradeable<ContainerFluidFormationPlane>
|
||||
{
|
||||
private final PartFluidFormationPlane plane;
|
||||
private GuiTabButton priority;
|
||||
|
||||
public GuiFluidFormationPlane( PlayerInventory PlayerInventory, PartFluidFormationPlane te )
|
||||
public GuiFluidFormationPlane(ContainerFluidFormationPlane container, PlayerInventory playerInventory, ITextComponent title)
|
||||
{
|
||||
super( new ContainerFluidFormationPlane( PlayerInventory, te ) );
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 251;
|
||||
this.plane = te;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -40,8 +32,7 @@ public class GuiFluidFormationPlane extends GuiUpgradeable
|
||||
final int xo = 8;
|
||||
final int yo = 23 + 6;
|
||||
|
||||
final IAEFluidTank config = this.plane.getConfig();
|
||||
final ContainerFluidFormationPlane container = (ContainerFluidFormationPlane) this.container;
|
||||
final IAEFluidTank config = container.getFluidConfigInventory();
|
||||
|
||||
for( int y = 0; y < 7; y++ )
|
||||
{
|
||||
@@ -63,7 +54,11 @@ public class GuiFluidFormationPlane extends GuiUpgradeable
|
||||
@Override
|
||||
protected void addButtons()
|
||||
{
|
||||
this.addButton( this.priority = new GuiTabButton( this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(), this.itemRenderer ) );
|
||||
this.addButton( new GuiTabButton( this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(), this.itemRenderer, btn -> openPriorityGui() ) );
|
||||
}
|
||||
|
||||
private void openPriorityGui() {
|
||||
NetworkHandler.instance().sendToServer( new PacketSwitchGuis( ContainerPriority.TYPE ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -72,16 +67,6 @@ public class GuiFluidFormationPlane extends GuiUpgradeable
|
||||
return "guis/storagebus.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed( final GuiButton btn ) throws IOException
|
||||
{
|
||||
super.actionPerformed( btn );
|
||||
if( btn == this.priority )
|
||||
{
|
||||
NetworkHandler.instance().sendToServer( new PacketSwitchGuis( GuiBridge.GUI_PRIORITY ) );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected GuiText getName()
|
||||
{
|
||||
|
||||
@@ -19,16 +19,15 @@
|
||||
package appeng.fluids.client.gui;
|
||||
|
||||
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
|
||||
import appeng.client.gui.implementations.GuiUpgradeable;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.fluids.client.gui.widgets.GuiFluidSlot;
|
||||
import appeng.fluids.client.gui.widgets.GuiOptionalFluidSlot;
|
||||
import appeng.fluids.container.ContainerFluidIO;
|
||||
import appeng.fluids.parts.PartFluidImportBus;
|
||||
import appeng.fluids.parts.PartSharedFluidBus;
|
||||
import appeng.fluids.util.IAEFluidTank;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
|
||||
|
||||
/**
|
||||
@@ -36,14 +35,12 @@ import appeng.fluids.util.IAEFluidTank;
|
||||
* @version rv5 - 1/05/2018
|
||||
* @since rv5 1/05/2018
|
||||
*/
|
||||
public class GuiFluidIO extends GuiUpgradeable
|
||||
public class GuiFluidIO extends GuiUpgradeable<ContainerFluidIO>
|
||||
{
|
||||
private final PartSharedFluidBus bus;
|
||||
|
||||
public GuiFluidIO( PlayerInventory PlayerInventory, PartSharedFluidBus te )
|
||||
public GuiFluidIO(ContainerFluidIO container, PlayerInventory playerInventory, ITextComponent title)
|
||||
{
|
||||
super( new ContainerFluidIO( PlayerInventory, te ) );
|
||||
this.bus = te;
|
||||
super(container, playerInventory, title);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -51,8 +48,7 @@ public class GuiFluidIO extends GuiUpgradeable
|
||||
{
|
||||
super.init();
|
||||
|
||||
final ContainerFluidIO container = (ContainerFluidIO) this.container;
|
||||
final IAEFluidTank inv = this.bus.getConfig();
|
||||
final IAEFluidTank inv = this.container.getFluidConfigInventory();
|
||||
final int y = 40;
|
||||
final int x = 80;
|
||||
|
||||
|
||||
@@ -19,37 +19,27 @@
|
||||
package appeng.fluids.client.gui;
|
||||
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
|
||||
import appeng.client.gui.implementations.GuiUpgradeable;
|
||||
import appeng.client.gui.widgets.GuiTabButton;
|
||||
import appeng.container.implementations.ContainerPriority;
|
||||
import appeng.core.localization.GuiText;
|
||||
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketSwitchGuis;
|
||||
import appeng.fluids.client.gui.widgets.GuiFluidSlot;
|
||||
import appeng.fluids.client.gui.widgets.GuiFluidTank;
|
||||
import appeng.fluids.container.ContainerFluidInterface;
|
||||
import appeng.fluids.helper.DualityFluidInterface;
|
||||
import appeng.fluids.helper.IFluidInterfaceHost;
|
||||
import appeng.fluids.util.IAEFluidTank;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
|
||||
public class GuiFluidInterface extends GuiUpgradeable
|
||||
public class GuiFluidInterface extends GuiUpgradeable<ContainerFluidInterface>
|
||||
{
|
||||
public final static int ID_BUTTON_TANK = 222;
|
||||
|
||||
private final IFluidInterfaceHost host;
|
||||
private GuiTabButton priority;
|
||||
|
||||
public GuiFluidInterface( final PlayerInventory ip, final IFluidInterfaceHost te )
|
||||
public GuiFluidInterface(ContainerFluidInterface container, PlayerInventory playerInventory, ITextComponent title)
|
||||
{
|
||||
super( new ContainerFluidInterface( ip, te ) );
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 231;
|
||||
this.host = te;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -57,19 +47,18 @@ public class GuiFluidInterface extends GuiUpgradeable
|
||||
{
|
||||
super.init();
|
||||
|
||||
final IAEFluidTank configFluids = this.host.getDualityFluidInterface().getConfig();
|
||||
final IAEFluidTank fluidTank = this.host.getDualityFluidInterface().getTanks();
|
||||
final IAEFluidTank configFluids = this.container.getFluidConfigInventory();
|
||||
final IAEFluidTank fluidTank = this.container.getTanks();
|
||||
|
||||
for( int i = 0; i < DualityFluidInterface.NUMBER_OF_TANKS; ++i )
|
||||
{
|
||||
final GuiFluidTank guiTank = new GuiFluidTank( fluidTank, i, DualityFluidInterface.NUMBER_OF_TANKS + i, this.getGuiLeft() + 35 + 18 * i, this
|
||||
final GuiFluidTank guiTank = new GuiFluidTank( fluidTank, i, this.getGuiLeft() + 35 + 18 * i, this
|
||||
.getGuiTop() + 53, 16, 68 );
|
||||
this.addButton( guiTank );
|
||||
this.guiSlots.add( new GuiFluidSlot( configFluids, i, i, 35 + 18 * i, 35 ) );
|
||||
}
|
||||
|
||||
this.priority = new GuiTabButton( this.getGuiLeft() + 154, this.getGuiTop(), 2 + 4 * 16, GuiText.Priority.getLocal(), this.itemRenderer );
|
||||
this.addButton( this.priority );
|
||||
this.addButton( new GuiTabButton( this.getGuiLeft() + 154, this.getGuiTop(), 2 + 4 * 16, GuiText.Priority.getLocal(), this.itemRenderer, btn -> openPriorityGui() ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -87,21 +76,14 @@ public class GuiFluidInterface extends GuiUpgradeable
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY )
|
||||
public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY, float partialTicks)
|
||||
{
|
||||
this.bindTexture( "guis/interfacefluid.png" );
|
||||
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
|
||||
GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, 0 /* FIXME ZINDEX */ );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed( final GuiButton btn ) throws IOException
|
||||
{
|
||||
super.actionPerformed( btn );
|
||||
|
||||
if( btn == this.priority )
|
||||
{
|
||||
NetworkHandler.instance().sendToServer( new PacketSwitchGuis( GuiBridge.GUI_PRIORITY ) );
|
||||
}
|
||||
private void openPriorityGui() {
|
||||
NetworkHandler.instance().sendToServer( new PacketSwitchGuis( ContainerPriority.TYPE ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
package appeng.fluids.client.gui;
|
||||
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.widget.button.Button;
|
||||
import net.minecraft.client.util.InputMappings;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
|
||||
import appeng.api.config.RedstoneMode;
|
||||
@@ -13,33 +13,20 @@ import appeng.client.gui.implementations.GuiUpgradeable;
|
||||
import appeng.client.gui.widgets.GuiImgButton;
|
||||
import appeng.client.gui.widgets.GuiNumberBox;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
import appeng.fluids.client.gui.widgets.GuiFluidSlot;
|
||||
import appeng.fluids.container.ContainerFluidLevelEmitter;
|
||||
import appeng.fluids.parts.PartFluidLevelEmitter;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
|
||||
|
||||
public class GuiFluidLevelEmitter extends GuiUpgradeable
|
||||
public class GuiFluidLevelEmitter extends GuiUpgradeable<ContainerFluidLevelEmitter>
|
||||
{
|
||||
private final PartFluidLevelEmitter levelEmitter;
|
||||
private GuiNumberBox level;
|
||||
|
||||
private GuiButton plus1;
|
||||
private GuiButton plus10;
|
||||
private GuiButton plus100;
|
||||
private GuiButton plus1000;
|
||||
private GuiButton minus1;
|
||||
private GuiButton minus10;
|
||||
private GuiButton minus100;
|
||||
private GuiButton minus1000;
|
||||
|
||||
public GuiFluidLevelEmitter( final PlayerInventory PlayerInventory, final PartFluidLevelEmitter te )
|
||||
{
|
||||
super( new ContainerFluidLevelEmitter( PlayerInventory, te ) );
|
||||
this.levelEmitter = te;
|
||||
public GuiFluidLevelEmitter(ContainerFluidLevelEmitter container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -53,41 +40,41 @@ public class GuiFluidLevelEmitter extends GuiUpgradeable
|
||||
this.level.setTextColor( 0xFFFFFF );
|
||||
this.level.setVisible( true );
|
||||
this.level.changeFocus( true );
|
||||
( (ContainerFluidLevelEmitter) this.inventorySlots ).setTextField( this.level );
|
||||
container.setTextField( this.level );
|
||||
|
||||
final int y = 40;
|
||||
final int x = 80 + 44;
|
||||
this.guiSlots.add( new GuiFluidSlot( this.levelEmitter.getConfig(), 0, 0, x, y ) );
|
||||
this.guiSlots.add( new GuiFluidSlot( this.container.getFluidConfigInventory(), 0, 0, x, y ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addButtons()
|
||||
{
|
||||
this.redstoneMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 28, Settings.REDSTONE_EMITTER, RedstoneMode.LOW_SIGNAL );
|
||||
this.redstoneMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 28, Settings.REDSTONE_EMITTER, RedstoneMode.LOW_SIGNAL, this::actionPerformed );
|
||||
|
||||
final int a = AEConfig.instance().levelByMillyBuckets( 0 );
|
||||
final int b = AEConfig.instance().levelByMillyBuckets( 1 );
|
||||
final int c = AEConfig.instance().levelByMillyBuckets( 2 );
|
||||
final int d = AEConfig.instance().levelByMillyBuckets( 3 );
|
||||
|
||||
this.addButton( this.plus1 = new GuiButton( 0, this.guiLeft + 20, this.guiTop + 17, 22, 20, "+" + a ) );
|
||||
this.addButton( this.plus10 = new GuiButton( 0, this.guiLeft + 48, this.guiTop + 17, 28, 20, "+" + b ) );
|
||||
this.addButton( this.plus100 = new GuiButton( 0, this.guiLeft + 82, this.guiTop + 17, 32, 20, "+" + c ) );
|
||||
this.addButton( this.plus1000 = new GuiButton( 0, this.guiLeft + 120, this.guiTop + 17, 38, 20, "+" + d ) );
|
||||
this.addButton( new Button(this.guiLeft + 20, this.guiTop + 17, 22, 20, "+" + a, btn -> addQty(a) ) );
|
||||
this.addButton( new Button(this.guiLeft + 48, this.guiTop + 17, 28, 20, "+" + b, btn -> addQty(b) ) );
|
||||
this.addButton( new Button(this.guiLeft + 82, this.guiTop + 17, 32, 20, "+" + c, btn -> addQty(c) ) );
|
||||
this.addButton( new Button(this.guiLeft + 120, this.guiTop + 17, 38, 20, "+" + d, btn -> addQty(d) ) );
|
||||
|
||||
this.addButton( this.minus1 = new GuiButton( 0, this.guiLeft + 20, this.guiTop + 59, 22, 20, "-" + a ) );
|
||||
this.addButton( this.minus10 = new GuiButton( 0, this.guiLeft + 48, this.guiTop + 59, 28, 20, "-" + b ) );
|
||||
this.addButton( this.minus100 = new GuiButton( 0, this.guiLeft + 82, this.guiTop + 59, 32, 20, "-" + c ) );
|
||||
this.addButton( this.minus1000 = new GuiButton( 0, this.guiLeft + 120, this.guiTop + 59, 38, 20, "-" + d ) );
|
||||
this.addButton( new Button(this.guiLeft + 20, this.guiTop + 59, 22, 20, "-" + a, btn -> addQty(-a) ) );
|
||||
this.addButton( new Button(this.guiLeft + 48, this.guiTop + 59, 28, 20, "-" + b, btn -> addQty(-b) ) );
|
||||
this.addButton( new Button(this.guiLeft + 82, this.guiTop + 59, 32, 20, "-" + c, btn -> addQty(-c) ) );
|
||||
this.addButton( new Button(this.guiLeft + 120, this.guiTop + 59, 38, 20, "-" + d, btn -> addQty(-d) ) );
|
||||
|
||||
this.addButton( this.redstoneMode );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
||||
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks)
|
||||
{
|
||||
super.drawBG( offsetX, offsetY, mouseX, mouseY );
|
||||
this.level.drawTextBox();
|
||||
super.drawBG( offsetX, offsetY, mouseX, mouseY, partialTicks);
|
||||
this.level.render(mouseX, mouseY, partialTicks);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -113,20 +100,6 @@ public class GuiFluidLevelEmitter extends GuiUpgradeable
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed( final GuiButton btn ) throws IOException
|
||||
{
|
||||
super.actionPerformed( btn );
|
||||
|
||||
final boolean isPlus = btn == this.plus1 || btn == this.plus10 || btn == this.plus100 || btn == this.plus1000;
|
||||
final boolean isMinus = btn == this.minus1 || btn == this.minus10 || btn == this.minus100 || btn == this.minus1000;
|
||||
|
||||
if( isPlus || isMinus )
|
||||
{
|
||||
this.addQty( this.getQty( btn ) );
|
||||
}
|
||||
}
|
||||
|
||||
private void addQty( final long i )
|
||||
{
|
||||
try
|
||||
@@ -166,51 +139,66 @@ public class GuiFluidLevelEmitter extends GuiUpgradeable
|
||||
// nope..
|
||||
this.level.setText( "0" );
|
||||
}
|
||||
catch( final IOException e )
|
||||
{
|
||||
AELog.debug( e );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void keyTyped( final char character, final int key ) throws IOException
|
||||
{
|
||||
if( !this.checkHotbarKeys( key ) )
|
||||
{
|
||||
if( ( key == 211 || key == 205 || key == 203 || key == 14 || Character.isDigit( character ) ) && this.level.textboxKeyTyped( character, key ) )
|
||||
public boolean charTyped(char character, int keyCode) {
|
||||
if (level.charTyped(character, keyCode)) {
|
||||
String Out = this.level.getText();
|
||||
|
||||
boolean Fixed = false;
|
||||
while( Out.startsWith( "0" ) && Out.length() > 1 )
|
||||
{
|
||||
try
|
||||
{
|
||||
String Out = this.level.getText();
|
||||
|
||||
boolean Fixed = false;
|
||||
while( Out.startsWith( "0" ) && Out.length() > 1 )
|
||||
{
|
||||
Out = Out.substring( 1 );
|
||||
Fixed = true;
|
||||
}
|
||||
|
||||
if( Fixed )
|
||||
{
|
||||
this.level.setText( Out );
|
||||
}
|
||||
|
||||
if( Out.isEmpty() )
|
||||
{
|
||||
Out = "0";
|
||||
}
|
||||
|
||||
NetworkHandler.instance().sendToServer( new PacketValueConfig( "FluidLevelEmitter.Value", Out ) );
|
||||
}
|
||||
catch( final IOException e )
|
||||
{
|
||||
AELog.debug( e );
|
||||
}
|
||||
Out = Out.substring( 1 );
|
||||
Fixed = true;
|
||||
}
|
||||
else
|
||||
|
||||
if( Fixed )
|
||||
{
|
||||
super.keyTyped( character, key );
|
||||
this.level.setText( Out );
|
||||
}
|
||||
|
||||
if( Out.isEmpty() )
|
||||
{
|
||||
Out = "0";
|
||||
}
|
||||
|
||||
NetworkHandler.instance().sendToServer( new PacketValueConfig( "FluidLevelEmitter.Value", Out ) );
|
||||
return true;
|
||||
}
|
||||
return super.charTyped(character, keyCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean keyPressed(int keyCode, int scanCode, int p_keyPressed_3_)
|
||||
{
|
||||
if( !this.checkHotbarKeys( InputMappings.getInputByCode(keyCode, scanCode) ) )
|
||||
{
|
||||
if( ( keyCode == 211 || keyCode == 205 || keyCode == 203 || keyCode == 14 ) && this.level.keyPressed( keyCode, scanCode, p_keyPressed_3_ ) )
|
||||
{
|
||||
String Out = this.level.getText();
|
||||
|
||||
boolean Fixed = false;
|
||||
while( Out.startsWith( "0" ) && Out.length() > 1 )
|
||||
{
|
||||
Out = Out.substring( 1 );
|
||||
Fixed = true;
|
||||
}
|
||||
|
||||
if( Fixed )
|
||||
{
|
||||
this.level.setText( Out );
|
||||
}
|
||||
|
||||
if( Out.isEmpty() )
|
||||
{
|
||||
Out = "0";
|
||||
}
|
||||
|
||||
NetworkHandler.instance().sendToServer( new PacketValueConfig( "FluidLevelEmitter.Value", Out ) );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return super.keyPressed(keyCode, scanCode, p_keyPressed_3_);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,9 +21,7 @@ package appeng.fluids.client.gui;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import appeng.container.implementations.ContainerPriority;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
|
||||
import appeng.api.config.AccessRestriction;
|
||||
@@ -46,6 +44,7 @@ import appeng.fluids.client.gui.widgets.GuiOptionalFluidSlot;
|
||||
import appeng.fluids.container.ContainerFluidStorageBus;
|
||||
import appeng.fluids.parts.PartFluidStorageBus;
|
||||
import appeng.fluids.util.IAEFluidTank;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
|
||||
|
||||
/**
|
||||
@@ -53,20 +52,14 @@ import appeng.fluids.util.IAEFluidTank;
|
||||
* @version rv6 - 22/05/2018
|
||||
* @since rv6 22/05/2018
|
||||
*/
|
||||
public class GuiFluidStorageBus extends GuiUpgradeable
|
||||
public class GuiFluidStorageBus extends GuiUpgradeable<ContainerFluidStorageBus>
|
||||
{
|
||||
private GuiImgButton rwMode;
|
||||
private GuiImgButton storageFilter;
|
||||
private GuiTabButton priority;
|
||||
private GuiImgButton partition;
|
||||
private GuiImgButton clear;
|
||||
private final PartFluidStorageBus bus;
|
||||
|
||||
public GuiFluidStorageBus( PlayerInventory PlayerInventory, PartFluidStorageBus te )
|
||||
{
|
||||
super( new ContainerFluidStorageBus( PlayerInventory, te ) );
|
||||
public GuiFluidStorageBus(ContainerFluidStorageBus container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 251;
|
||||
this.bus = te;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -77,8 +70,7 @@ public class GuiFluidStorageBus extends GuiUpgradeable
|
||||
final int xo = 8;
|
||||
final int yo = 23 + 6;
|
||||
|
||||
final IAEFluidTank config = this.bus.getConfig();
|
||||
final ContainerFluidStorageBus container = (ContainerFluidStorageBus) this.inventorySlots;
|
||||
final IAEFluidTank config = this.container.getFluidConfigInventory();
|
||||
|
||||
for( int y = 0; y < 7; y++ )
|
||||
{
|
||||
@@ -100,19 +92,17 @@ public class GuiFluidStorageBus extends GuiUpgradeable
|
||||
@Override
|
||||
protected void addButtons()
|
||||
{
|
||||
this.clear = new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.ACTIONS, ActionItems.CLOSE );
|
||||
this.partition = new GuiImgButton( this.guiLeft - 18, this.guiTop + 28, Settings.ACTIONS, ActionItems.WRENCH );
|
||||
this.rwMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 48, Settings.ACCESS, AccessRestriction.READ_WRITE );
|
||||
this.storageFilter = new GuiImgButton( this.guiLeft - 18, this.guiTop + 68, Settings.STORAGE_FILTER, StorageFilter.EXTRACTABLE_ONLY );
|
||||
this.fuzzyMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 88, Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL );
|
||||
addButton( new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.ACTIONS, ActionItems.CLOSE, btn -> clear() ) );
|
||||
addButton( new GuiImgButton( this.guiLeft - 18, this.guiTop + 28, Settings.ACTIONS, ActionItems.WRENCH, btn -> partition() ) );
|
||||
this.rwMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 48, Settings.ACCESS, AccessRestriction.READ_WRITE, btn -> toggleReadWriteMode() );
|
||||
this.storageFilter = new GuiImgButton( this.guiLeft - 18, this.guiTop + 68, Settings.STORAGE_FILTER, StorageFilter.EXTRACTABLE_ONLY, btn -> toggleStorageFilter() );
|
||||
this.fuzzyMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 88, Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL, this::actionPerformed );
|
||||
|
||||
this.addButton( this.priority = new GuiTabButton( this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(), this.itemRender ) );
|
||||
addButton( this.addButton( new GuiTabButton( this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(), this.itemRenderer, btn -> openPriorityGui() ) ) );
|
||||
|
||||
this.addButton( this.storageFilter );
|
||||
this.addButton( this.fuzzyMode );
|
||||
this.addButton( this.rwMode );
|
||||
this.addButton( this.partition );
|
||||
this.addButton( this.clear );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -143,40 +133,26 @@ public class GuiFluidStorageBus extends GuiUpgradeable
|
||||
return "guis/storagebus.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed( final GuiButton btn ) throws IOException
|
||||
{
|
||||
super.actionPerformed( btn );
|
||||
private void partition() {
|
||||
NetworkHandler.instance().sendToServer( new PacketValueConfig( "StorageBus.Action", "Partition" ) );
|
||||
}
|
||||
|
||||
final boolean backwards = Mouse.isButtonDown( 1 );
|
||||
private void clear() {
|
||||
NetworkHandler.instance().sendToServer( new PacketValueConfig( "StorageBus.Action", "Clear" ) );
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if( btn == this.partition )
|
||||
{
|
||||
NetworkHandler.instance().sendToServer( new PacketValueConfig( "StorageBus.Action", "Partition" ) );
|
||||
}
|
||||
else if( btn == this.clear )
|
||||
{
|
||||
NetworkHandler.instance().sendToServer( new PacketValueConfig( "StorageBus.Action", "Clear" ) );
|
||||
}
|
||||
else if( btn == this.priority )
|
||||
{
|
||||
NetworkHandler.instance().sendToServer( new PacketSwitchGuis( GuiBridge.GUI_PRIORITY ) );
|
||||
}
|
||||
else if( btn == this.rwMode )
|
||||
{
|
||||
NetworkHandler.instance().sendToServer( new PacketConfigButton( this.rwMode.getSetting(), backwards ) );
|
||||
}
|
||||
else if( btn == this.storageFilter )
|
||||
{
|
||||
NetworkHandler.instance().sendToServer( new PacketConfigButton( this.storageFilter.getSetting(), backwards ) );
|
||||
}
|
||||
}
|
||||
catch( final IOException e )
|
||||
{
|
||||
AELog.debug( e );
|
||||
}
|
||||
private void openPriorityGui() {
|
||||
NetworkHandler.instance().sendToServer( new PacketSwitchGuis( ContainerPriority.TYPE ) );
|
||||
}
|
||||
|
||||
private void toggleReadWriteMode() {
|
||||
final boolean backwards = minecraft.mouseHelper.isRightDown();
|
||||
NetworkHandler.instance().sendToServer( new PacketConfigButton( this.rwMode.getSetting(), backwards ) );
|
||||
}
|
||||
|
||||
private void toggleStorageFilter() {
|
||||
final boolean backwards = minecraft.mouseHelper.isRightDown();
|
||||
NetworkHandler.instance().sendToServer( new PacketConfigButton( this.storageFilter.getSetting(), backwards ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,27 +19,9 @@
|
||||
package appeng.fluids.client.gui;
|
||||
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.NumberFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.ClickType;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.util.IConfigManager;
|
||||
import appeng.api.util.IConfigurableObject;
|
||||
import appeng.client.gui.AEBaseMEGui;
|
||||
import appeng.client.gui.widgets.GuiImgButton;
|
||||
import appeng.client.gui.widgets.GuiScrollbar;
|
||||
@@ -58,6 +40,21 @@ import appeng.fluids.container.slots.IMEFluidSlot;
|
||||
import appeng.helpers.InventoryAction;
|
||||
import appeng.util.IConfigManagerHost;
|
||||
import appeng.util.Platform;
|
||||
import net.minecraft.client.gui.widget.button.Button;
|
||||
import net.minecraft.client.util.InputMappings;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.container.ClickType;
|
||||
import net.minecraft.inventory.container.Slot;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraftforge.fml.ModList;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
import java.text.NumberFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
|
||||
/**
|
||||
@@ -65,44 +62,33 @@ import appeng.util.Platform;
|
||||
* @version rv6 - 12/05/2018
|
||||
* @since rv6 12/05/2018
|
||||
*/
|
||||
public class GuiFluidTerminal extends AEBaseMEGui implements ISortSource, IConfigManagerHost
|
||||
public class GuiFluidTerminal extends AEBaseMEGui<ContainerFluidTerminal> implements ISortSource, IConfigManagerHost
|
||||
{
|
||||
private final List<SlotFluidME> meFluidSlots = new LinkedList<>();
|
||||
private final FluidRepo repo;
|
||||
private final IConfigManager configSrc;
|
||||
private final ContainerFluidTerminal container;
|
||||
private final int offsetX = 9;
|
||||
private int rows = 6;
|
||||
private int perRow = 9;
|
||||
|
||||
protected ITerminalHost terminal;
|
||||
|
||||
private MEGuiTextField searchField;
|
||||
private GuiImgButton sortByBox;
|
||||
private GuiImgButton sortDirBox;
|
||||
|
||||
public GuiFluidTerminal( final PlayerInventory PlayerInventory, final ITerminalHost te )
|
||||
{
|
||||
this( PlayerInventory, te, new ContainerFluidTerminal( PlayerInventory, te ) );
|
||||
}
|
||||
|
||||
public GuiFluidTerminal( PlayerInventory PlayerInventory, final ITerminalHost te, final ContainerFluidTerminal c )
|
||||
{
|
||||
super( c );
|
||||
this.terminal = te;
|
||||
public GuiFluidTerminal(ContainerFluidTerminal container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.xSize = 185;
|
||||
this.ySize = 222;
|
||||
final GuiScrollbar scrollbar = new GuiScrollbar();
|
||||
this.setScrollBar( scrollbar );
|
||||
this.repo = new FluidRepo( scrollbar, this );
|
||||
this.configSrc = ( (IConfigurableObject) this.inventorySlots ).getConfigManager();
|
||||
( this.container = (ContainerFluidTerminal) this.inventorySlots ).setGui( this );
|
||||
this.configSrc = container.getConfigManager();
|
||||
this.container.setGui( this );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init()
|
||||
{
|
||||
this.minecraft.player.openContainer = this.inventorySlots;
|
||||
this.guiLeft = ( this.width - this.xSize ) / 2;
|
||||
this.guiTop = ( this.height - this.ySize ) / 2;
|
||||
|
||||
@@ -115,11 +101,11 @@ public class GuiFluidTerminal extends AEBaseMEGui implements ISortSource, IConfi
|
||||
|
||||
int offset = this.guiTop;
|
||||
|
||||
this.addButton( this.sortByBox = new GuiImgButton( this.guiLeft - 18, offset, Settings.SORT_BY, this.configSrc.getSetting( Settings.SORT_BY ) ) );
|
||||
this.sortByBox = this.addButton( new GuiImgButton( this.guiLeft - 18, offset, Settings.SORT_BY, this.configSrc.getSetting( Settings.SORT_BY ), this::actionPerformed ) );
|
||||
offset += 20;
|
||||
|
||||
this.addButton( this.sortDirBox = new GuiImgButton( this.guiLeft - 18, offset, Settings.SORT_DIRECTION, this.configSrc
|
||||
.getSetting( Settings.SORT_DIRECTION ) ) );
|
||||
this.sortDirBox = this.addButton( new GuiImgButton( this.guiLeft - 18, offset, Settings.SORT_DIRECTION, this.configSrc
|
||||
.getSetting( Settings.SORT_DIRECTION ), this::actionPerformed ) );
|
||||
|
||||
for( int y = 0; y < this.rows; y++ )
|
||||
{
|
||||
@@ -127,7 +113,7 @@ public class GuiFluidTerminal extends AEBaseMEGui implements ISortSource, IConfi
|
||||
{
|
||||
SlotFluidME slot = new SlotFluidME( new InternalFluidSlotME( this.repo, x + y * this.perRow, this.offsetX + x * 18, 18 + y * 18 ) );
|
||||
this.getMeFluidSlots().add( slot );
|
||||
this.inventorySlots.inventorySlots.add( slot );
|
||||
this.container.inventorySlots.add( slot );
|
||||
}
|
||||
}
|
||||
this.setScrollBar();
|
||||
@@ -141,30 +127,30 @@ public class GuiFluidTerminal extends AEBaseMEGui implements ISortSource, IConfi
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY )
|
||||
public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY, float partialTicks)
|
||||
{
|
||||
this.bindTexture( this.getBackground() );
|
||||
final int x_width = 197;
|
||||
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, x_width, 18 );
|
||||
GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, x_width, 18, 0 /* FIXME ZINDEX */ );
|
||||
|
||||
for( int x = 0; x < 6; x++ )
|
||||
{
|
||||
this.drawTexturedModalRect( offsetX, offsetY + 18 + x * 18, 0, 18, x_width, 18 );
|
||||
GuiUtils.drawTexturedModalRect( offsetX, offsetY + 18 + x * 18, 0, 18, x_width, 18, 0 /* FIXME ZINDEX */ );
|
||||
}
|
||||
|
||||
this.drawTexturedModalRect( offsetX, offsetY + 16 + 6 * 18, 0, 106 - 18 - 18, x_width, 99 + 77 );
|
||||
GuiUtils.drawTexturedModalRect( offsetX, offsetY + 16 + 6 * 18, 0, 106 - 18 - 18, x_width, 99 + 77, 0 /* FIXME ZINDEX */ );
|
||||
|
||||
if( this.searchField != null )
|
||||
{
|
||||
this.searchField.drawTextBox();
|
||||
this.searchField.render(mouseX, mouseY, partialTicks);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateScreen()
|
||||
public void tick()
|
||||
{
|
||||
this.repo.setPower( this.container.isPowered() );
|
||||
super.updateScreen();
|
||||
super.tick();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -172,7 +158,7 @@ public class GuiFluidTerminal extends AEBaseMEGui implements ISortSource, IConfi
|
||||
{
|
||||
final Slot slot = this.getSlot( mouseX, mouseY );
|
||||
|
||||
if( slot != null && slot instanceof IMEFluidSlot && slot.isEnabled() )
|
||||
if( slot instanceof IMEFluidSlot && slot.isEnabled() )
|
||||
{
|
||||
final IMEFluidSlot fluidSlot = (IMEFluidSlot) slot;
|
||||
|
||||
@@ -181,18 +167,19 @@ public class GuiFluidTerminal extends AEBaseMEGui implements ISortSource, IConfi
|
||||
final IAEFluidStack fluidStack = fluidSlot.getAEFluidStack();
|
||||
final String formattedAmount = NumberFormat.getNumberInstance( Locale.US ).format( fluidStack.getStackSize() / 1000.0 ) + " B";
|
||||
|
||||
final String modName = "" + TextFormatting.BLUE + TextFormatting.ITALIC + Loader.instance()
|
||||
.getIndexedModList()
|
||||
.get( Platform.getModId( fluidStack ) )
|
||||
.getName();
|
||||
// FIXME: Move getting the mod name to platform
|
||||
final String modName = "" + TextFormatting.BLUE + TextFormatting.ITALIC + ModList.get()
|
||||
.getModContainerById( Platform.getModId( fluidStack ) )
|
||||
.map(mc -> mc.getModInfo().getDisplayName())
|
||||
.orElse(null);
|
||||
|
||||
final List<String> list = new ArrayList<>();
|
||||
|
||||
list.add( fluidStack.getFluidStack().getLocalizedName() );
|
||||
list.add( fluidStack.getFluidStack().getDisplayName().getFormattedText() );
|
||||
list.add( formattedAmount );
|
||||
list.add( modName );
|
||||
|
||||
this.drawHoveringText( list, mouseX, mouseY );
|
||||
this.renderTooltip( list, mouseX, mouseY );
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -200,12 +187,11 @@ public class GuiFluidTerminal extends AEBaseMEGui implements ISortSource, IConfi
|
||||
super.renderHoveredToolTip( mouseX, mouseY );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed( GuiButton btn ) throws IOException
|
||||
protected void actionPerformed( Button btn )
|
||||
{
|
||||
if( btn instanceof GuiImgButton )
|
||||
{
|
||||
final boolean backwards = Mouse.isButtonDown( 1 );
|
||||
final boolean backwards = minecraft.mouseHelper.isRightDown();
|
||||
final GuiImgButton iBtn = (GuiImgButton) btn;
|
||||
|
||||
if( iBtn.getSetting() != Settings.ACTIONS )
|
||||
@@ -213,14 +199,7 @@ public class GuiFluidTerminal extends AEBaseMEGui implements ISortSource, IConfi
|
||||
final Enum cv = iBtn.getCurrentValue();
|
||||
final Enum next = Platform.rotateEnum( cv, backwards, iBtn.getSetting().getPossibleValues() );
|
||||
|
||||
try
|
||||
{
|
||||
NetworkHandler.instance().sendToServer( new PacketValueConfig( iBtn.getSetting().name(), next.name() ) );
|
||||
}
|
||||
catch( final IOException e )
|
||||
{
|
||||
AELog.debug( e );
|
||||
}
|
||||
NetworkHandler.instance().sendToServer( new PacketValueConfig( iBtn.getSetting().name(), next.name() ) );
|
||||
|
||||
iBtn.set( next );
|
||||
}
|
||||
@@ -259,42 +238,55 @@ public class GuiFluidTerminal extends AEBaseMEGui implements ISortSource, IConfi
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void keyTyped( final char character, final int key ) throws IOException
|
||||
{
|
||||
if( !this.checkHotbarKeys( key ) )
|
||||
public boolean charTyped(char character, int keyCode) {
|
||||
if (character == ' ' && this.searchField.getText().isEmpty())
|
||||
{
|
||||
if( character == ' ' && this.searchField.getText().isEmpty() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
// Swallow spaces if the text field is still empty
|
||||
return true;
|
||||
}
|
||||
|
||||
if( this.searchField.textboxKeyTyped( character, key ) )
|
||||
if (this.searchField.charTyped(character, keyCode)) {
|
||||
this.repo.setSearchString( this.searchField.getText() );
|
||||
this.repo.updateView();
|
||||
this.setScrollBar();
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.charTyped(character, keyCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean keyPressed(int keyCode, int scanCode, int p_keyPressed_3_)
|
||||
{
|
||||
InputMappings.Input input = InputMappings.getInputByCode(keyCode, scanCode);
|
||||
if( !this.checkHotbarKeys(input) )
|
||||
{
|
||||
if( this.searchField.keyPressed( keyCode, scanCode, p_keyPressed_3_ ) )
|
||||
{
|
||||
this.repo.setSearchString( this.searchField.getText() );
|
||||
this.repo.updateView();
|
||||
this.setScrollBar();
|
||||
}
|
||||
else
|
||||
{
|
||||
super.keyTyped( character, key );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return super.keyPressed(keyCode, scanCode, p_keyPressed_3_);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mouseClicked( final int xCoord, final int yCoord, final int btn ) throws IOException
|
||||
public boolean mouseClicked( final double xCoord, final double yCoord, final int btn )
|
||||
{
|
||||
this.searchField.mouseClicked( xCoord, yCoord, btn );
|
||||
|
||||
if( btn == 1 && this.searchField.isMouseIn( xCoord, yCoord ) )
|
||||
{
|
||||
this.searchField.setText( "" );
|
||||
this.repo.setSearchString( "" );
|
||||
this.repo.updateView();
|
||||
this.setScrollBar();
|
||||
if (this.searchField.mouseClicked( xCoord, yCoord, btn )) {
|
||||
if (btn == 1 && this.searchField.isMouseOver(xCoord, yCoord)) {
|
||||
this.searchField.setText("");
|
||||
this.repo.setSearchString("");
|
||||
this.repo.updateView();
|
||||
this.setScrollBar();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
super.mouseClicked( xCoord, yCoord, btn );
|
||||
return super.mouseClicked( xCoord, yCoord, btn );
|
||||
}
|
||||
|
||||
public void postUpdate( final List<IAEFluidStack> list )
|
||||
|
||||
@@ -24,6 +24,7 @@ import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketFluidSlot;
|
||||
import appeng.fluids.util.AEFluidStack;
|
||||
import appeng.fluids.util.IAEFluidTank;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
|
||||
public class GuiFluidSlot extends GuiCustomSlot
|
||||
@@ -49,7 +50,7 @@ public class GuiFluidSlot extends GuiCustomSlot
|
||||
final Fluid fluid = fs.getFluid();
|
||||
final FluidAttributes attributes = fluid.getAttributes();
|
||||
mc.getTextureManager().bindTexture( AtlasTexture.LOCATION_BLOCKS_TEXTURE );
|
||||
final TextureAtlasSprite sprite = mc.getAtlasSpriteGetter( AtlasTexture.LOCATION_BLOCKS_TEXTURE ).apply( attributes.getStillTexture() );
|
||||
final TextureAtlasSprite sprite = mc.getAtlasSpriteGetter( AtlasTexture.LOCATION_BLOCKS_TEXTURE ).apply( attributes.getStillTexture(fs.getFluidStack()) );
|
||||
|
||||
// Set color for dynamic fluids
|
||||
// Convert int color to RGB
|
||||
@@ -58,7 +59,7 @@ public class GuiFluidSlot extends GuiCustomSlot
|
||||
final float blue = ( attributes.getColor() & 255 ) / 255.0F;
|
||||
RenderSystem.color3f( red, green, blue );
|
||||
|
||||
this.drawTexturedModalRect( this.xPos(), this.yPos(), sprite, this.getWidth(), this.getHeight() );
|
||||
blit(xPos(), yPos(), this.getBlitOffset(), getWidth(), getHeight(), sprite);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,36 +19,36 @@
|
||||
package appeng.fluids.client.gui.widgets;
|
||||
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.util.AEColor;
|
||||
import appeng.client.gui.widgets.ITooltip;
|
||||
import appeng.fluids.util.IAEFluidTank;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.widget.Widget;
|
||||
import net.minecraft.client.renderer.texture.AtlasTexture;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.fluids.FluidAttributes;
|
||||
|
||||
|
||||
@OnlyIn( Dist.CLIENT )
|
||||
public class GuiFluidTank extends GuiButton implements ITooltip
|
||||
public class GuiFluidTank extends Widget implements ITooltip
|
||||
{
|
||||
private final IAEFluidTank tank;
|
||||
private final int slot;
|
||||
|
||||
public GuiFluidTank( IAEFluidTank tank, int slot, int id, int x, int y, int w, int h )
|
||||
public GuiFluidTank(IAEFluidTank tank, int slot, int x, int y, int w, int h)
|
||||
{
|
||||
super( id, x, y, w, h, "" );
|
||||
super( x, y, w, h, "" );
|
||||
this.tank = tank;
|
||||
this.slot = slot;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawButton( final Minecraft mc, final int mouseX, final int mouseY, final float partialTicks )
|
||||
{
|
||||
public void renderButton(int mouseX, int mouseY, float partialTicks) {
|
||||
if( this.visible )
|
||||
{
|
||||
RenderSystem.disableBlend();
|
||||
@@ -56,27 +56,31 @@ public class GuiFluidTank extends GuiButton implements ITooltip
|
||||
|
||||
fill( this.x, this.y, this.x + this.width, this.y + this.height, AEColor.GRAY.blackVariant | 0xFF000000 );
|
||||
|
||||
final IAEFluidStack fluid = this.tank.getFluidInSlot( this.slot );
|
||||
if( fluid != null && fluid.getStackSize() > 0 )
|
||||
final IAEFluidStack fluidStack = this.tank.getFluidInSlot( this.slot );
|
||||
if( fluidStack != null && fluidStack.getStackSize() > 0 )
|
||||
{
|
||||
Fluid fluid = fluidStack.getFluid();
|
||||
FluidAttributes attributes = fluid.getAttributes();
|
||||
|
||||
float red = ( attributes.getColor() >> 16 & 255 ) / 255.0F;
|
||||
float green = ( attributes.getColor() >> 8 & 255 ) / 255.0F;
|
||||
float blue = ( attributes.getColor() & 255 ) / 255.0F;
|
||||
RenderSystem.color3f( red, green, blue );
|
||||
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
mc.getTextureManager().bindTexture( AtlasTexture.LOCATION_BLOCKS_TEXTURE );
|
||||
final TextureAtlasSprite sprite = mc.getAtlasSpriteGetter( AtlasTexture.LOCATION_BLOCKS_TEXTURE ).apply( attributes.getStillTexture(fluidStack.getFluidStack()) );
|
||||
|
||||
float red = ( fluid.getFluid().getColor() >> 16 & 255 ) / 255.0F;
|
||||
float green = ( fluid.getFluid().getColor() >> 8 & 255 ) / 255.0F;
|
||||
float blue = ( fluid.getFluid().getColor() & 255 ) / 255.0F;
|
||||
RenderSystem.color4f( red, green, blue );
|
||||
|
||||
TextureAtlasSprite sprite = mc.getTextureMapBlocks().getAtlasSprite( fluid.getFluid().getStill().toString() );
|
||||
final int scaledHeight = (int) ( this.height * ( (float) fluid.getStackSize() / this.tank.getTankProperties()[this.slot].getCapacity() ) );
|
||||
final int scaledHeight = (int) ( this.height * ( (float) fluidStack.getStackSize() / this.tank.getTankCapacity(this.slot) ) );
|
||||
|
||||
int iconHeightRemainder = scaledHeight % 16;
|
||||
if( iconHeightRemainder > 0 )
|
||||
{
|
||||
this.drawTexturedModalRect( this.x, this.y + this.height - iconHeightRemainder, sprite, 16, iconHeightRemainder );
|
||||
blit(this.x, this.y + this.height - iconHeightRemainder, getBlitOffset(), 16, iconHeightRemainder, sprite );
|
||||
}
|
||||
for( int i = 0; i < scaledHeight / 16; i++ )
|
||||
{
|
||||
this.drawTexturedModalRect( this.x, this.y + this.height - iconHeightRemainder - ( i + 1 ) * 16, sprite, 16, 16 );
|
||||
blit( this.x, this.y + this.height - iconHeightRemainder - ( i + 1 ) * 16, getBlitOffset(), 16, 16, sprite );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,7 +93,7 @@ public class GuiFluidTank extends GuiButton implements ITooltip
|
||||
final IAEFluidStack fluid = this.tank.getFluidInSlot( this.slot );
|
||||
if( fluid != null && fluid.getStackSize() > 0 )
|
||||
{
|
||||
String desc = fluid.getFluid().getLocalizedName( fluid.getFluidStack() );
|
||||
String desc = fluid.getFluid().getAttributes().getDisplayName( fluid.getFluidStack() ).getFormattedText();
|
||||
String amountToText = fluid.getStackSize() + "mB";
|
||||
|
||||
return desc + "\n" + amountToText;
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
package appeng.fluids.client.gui.widgets;
|
||||
|
||||
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.container.slot.IOptionalSlotHost;
|
||||
import appeng.fluids.util.IAEFluidTank;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
|
||||
public class GuiOptionalFluidSlot extends GuiFluidSlot
|
||||
@@ -57,7 +57,7 @@ public class GuiOptionalFluidSlot extends GuiFluidSlot
|
||||
{
|
||||
RenderSystem.color4f( 1.0F, 1.0F, 1.0F, 0.4F );
|
||||
}
|
||||
this.drawTexturedModalRect( guileft + this.xPos() - 1, guitop + this.yPos() - 1, this.srcX - 1, this.srcY - 1, this.getWidth() + 2,
|
||||
this.getHeight() + 2 );
|
||||
GuiUtils.drawTexturedModalRect( guileft + this.xPos() - 1, guitop + this.yPos() - 1, this.srcX - 1, this.srcY - 1, this.getWidth() + 2,
|
||||
this.getHeight() + 2, 0 /* FIXME ZINDEX */ );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,12 @@
|
||||
package appeng.fluids.container;
|
||||
|
||||
|
||||
import appeng.container.ContainerLocator;
|
||||
import appeng.container.helper.PartContainerHelper;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
@@ -16,11 +20,25 @@ import appeng.fluids.util.IAEFluidTank;
|
||||
|
||||
public class ContainerFluidFormationPlane extends ContainerFluidConfigurable
|
||||
{
|
||||
|
||||
public static ContainerType<ContainerFluidFormationPlane> TYPE;
|
||||
|
||||
private static final PartContainerHelper<ContainerFluidFormationPlane, PartFluidFormationPlane> helper
|
||||
= new PartContainerHelper<>(ContainerFluidFormationPlane::new, PartFluidFormationPlane.class, SecurityPermissions.BUILD);
|
||||
|
||||
public static ContainerFluidFormationPlane fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
|
||||
return helper.fromNetwork(windowId, inv, buf);
|
||||
}
|
||||
|
||||
public static boolean open(PlayerEntity player, ContainerLocator locator) {
|
||||
return helper.open(player, locator);
|
||||
}
|
||||
|
||||
private final PartFluidFormationPlane plane;
|
||||
|
||||
public ContainerFluidFormationPlane(ContainerType<?> containerType, int id, final PlayerInventory ip, final PartFluidFormationPlane te )
|
||||
public ContainerFluidFormationPlane(int id, final PlayerInventory ip, final PartFluidFormationPlane te )
|
||||
{
|
||||
super( containerType, id,ip, te );
|
||||
super( TYPE, id,ip, te );
|
||||
this.plane = te;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,11 +19,16 @@
|
||||
package appeng.fluids.container;
|
||||
|
||||
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
import appeng.container.ContainerLocator;
|
||||
import appeng.container.helper.PartContainerHelper;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
|
||||
import appeng.fluids.parts.PartSharedFluidBus;
|
||||
import appeng.fluids.util.IAEFluidTank;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
|
||||
|
||||
/**
|
||||
@@ -33,11 +38,25 @@ import net.minecraft.inventory.container.ContainerType;
|
||||
*/
|
||||
public class ContainerFluidIO extends ContainerFluidConfigurable
|
||||
{
|
||||
|
||||
public static ContainerType<ContainerFluidIO> TYPE;
|
||||
|
||||
private static final PartContainerHelper<ContainerFluidIO, PartSharedFluidBus> helper
|
||||
= new PartContainerHelper<>(ContainerFluidIO::new, PartSharedFluidBus.class, SecurityPermissions.BUILD);
|
||||
|
||||
public static ContainerFluidIO fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
|
||||
return helper.fromNetwork(windowId, inv, buf);
|
||||
}
|
||||
|
||||
public static boolean open(PlayerEntity player, ContainerLocator locator) {
|
||||
return helper.open(player, locator);
|
||||
}
|
||||
|
||||
private final PartSharedFluidBus bus;
|
||||
|
||||
public ContainerFluidIO(ContainerType<?> containerType, int id, PlayerInventory ip, PartSharedFluidBus te )
|
||||
public ContainerFluidIO(int id, PlayerInventory ip, PartSharedFluidBus te )
|
||||
{
|
||||
super( containerType, id,ip, te );
|
||||
super( TYPE, id,ip, te );
|
||||
this.bus = te;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,31 +19,48 @@
|
||||
package appeng.fluids.container;
|
||||
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.inventory.container.IContainerListener;
|
||||
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.util.IConfigManager;
|
||||
import appeng.container.ContainerLocator;
|
||||
import appeng.container.helper.PartOrTileContainerHelper;
|
||||
import appeng.fluids.helper.DualityFluidInterface;
|
||||
import appeng.fluids.helper.FluidSyncHelper;
|
||||
import appeng.fluids.helper.IFluidInterfaceHost;
|
||||
import appeng.fluids.util.IAEFluidTank;
|
||||
import appeng.util.Platform;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.inventory.container.IContainerListener;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
public class ContainerFluidInterface extends ContainerFluidConfigurable
|
||||
{
|
||||
|
||||
public static ContainerType<ContainerFluidInterface> TYPE;
|
||||
|
||||
private static final PartOrTileContainerHelper<ContainerFluidInterface, IFluidInterfaceHost> helper
|
||||
= new PartOrTileContainerHelper<>(ContainerFluidInterface::new, IFluidInterfaceHost.class, SecurityPermissions.BUILD);
|
||||
|
||||
public static ContainerFluidInterface fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
|
||||
return helper.fromNetwork(windowId, inv, buf);
|
||||
}
|
||||
|
||||
public static boolean open(PlayerEntity player, ContainerLocator locator) {
|
||||
return helper.open(player, locator);
|
||||
}
|
||||
|
||||
private final DualityFluidInterface myDuality;
|
||||
private final FluidSyncHelper tankSync;
|
||||
|
||||
public ContainerFluidInterface(ContainerType<?> containerType, int id, final PlayerInventory ip, final IFluidInterfaceHost te )
|
||||
public ContainerFluidInterface(int id, final PlayerInventory ip, final IFluidInterfaceHost te )
|
||||
{
|
||||
super( containerType, id,ip, te.getDualityFluidInterface().getHost() );
|
||||
super( TYPE, id,ip, te.getDualityFluidInterface().getHost() );
|
||||
|
||||
this.myDuality = te.getDualityFluidInterface();
|
||||
this.tankSync = new FluidSyncHelper( this.myDuality.getTanks(), DualityFluidInterface.NUMBER_OF_TANKS );
|
||||
@@ -55,6 +72,10 @@ public class ContainerFluidInterface extends ContainerFluidConfigurable
|
||||
return 231;
|
||||
}
|
||||
|
||||
public IAEFluidTank getTanks() {
|
||||
return myDuality.getTanks();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAEFluidTank getFluidConfigInventory()
|
||||
{
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
package appeng.fluids.container;
|
||||
|
||||
|
||||
import appeng.container.ContainerLocator;
|
||||
import appeng.container.helper.PartContainerHelper;
|
||||
import net.minecraft.client.gui.widget.TextFieldWidget;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
@@ -19,6 +22,19 @@ import appeng.util.Platform;
|
||||
|
||||
public class ContainerFluidLevelEmitter extends ContainerFluidConfigurable
|
||||
{
|
||||
public static ContainerType<ContainerFluidLevelEmitter> TYPE;
|
||||
|
||||
private static final PartContainerHelper<ContainerFluidLevelEmitter, PartFluidLevelEmitter> helper
|
||||
= new PartContainerHelper<>(ContainerFluidLevelEmitter::new, PartFluidLevelEmitter.class, SecurityPermissions.BUILD);
|
||||
|
||||
public static ContainerFluidLevelEmitter fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
|
||||
return helper.fromNetwork(windowId, inv, buf);
|
||||
}
|
||||
|
||||
public static boolean open(PlayerEntity player, ContainerLocator locator) {
|
||||
return helper.open(player, locator);
|
||||
}
|
||||
|
||||
private final PartFluidLevelEmitter lvlEmitter;
|
||||
|
||||
@OnlyIn( Dist.CLIENT )
|
||||
@@ -26,9 +42,9 @@ public class ContainerFluidLevelEmitter extends ContainerFluidConfigurable
|
||||
@GuiSync( 3 )
|
||||
public long EmitterValue = -1;
|
||||
|
||||
public ContainerFluidLevelEmitter(ContainerType<?> containerType, int id, final PlayerInventory ip, final PartFluidLevelEmitter te )
|
||||
public ContainerFluidLevelEmitter(int id, final PlayerInventory ip, final PartFluidLevelEmitter te )
|
||||
{
|
||||
super( containerType, id,ip, te );
|
||||
super( TYPE, id,ip, te );
|
||||
this.lvlEmitter = te;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,8 +21,12 @@ package appeng.fluids.container;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import appeng.container.ContainerLocator;
|
||||
import appeng.container.helper.PartContainerHelper;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
import appeng.api.config.AccessRestriction;
|
||||
@@ -52,6 +56,19 @@ import appeng.util.iterators.NullIterator;
|
||||
public class ContainerFluidStorageBus extends ContainerFluidConfigurable
|
||||
{
|
||||
|
||||
public static ContainerType<ContainerFluidStorageBus> TYPE;
|
||||
|
||||
private static final PartContainerHelper<ContainerFluidStorageBus, PartFluidStorageBus> helper
|
||||
= new PartContainerHelper<>(ContainerFluidStorageBus::new, PartFluidStorageBus.class);
|
||||
|
||||
public static ContainerFluidStorageBus fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
|
||||
return helper.fromNetwork(windowId, inv, buf);
|
||||
}
|
||||
|
||||
public static boolean open(PlayerEntity player, ContainerLocator locator) {
|
||||
return helper.open(player, locator);
|
||||
}
|
||||
|
||||
private final PartFluidStorageBus storageBus;
|
||||
|
||||
@GuiSync( 3 )
|
||||
@@ -60,9 +77,9 @@ public class ContainerFluidStorageBus extends ContainerFluidConfigurable
|
||||
@GuiSync( 4 )
|
||||
public StorageFilter storageFilter = StorageFilter.EXTRACTABLE_ONLY;
|
||||
|
||||
public ContainerFluidStorageBus(ContainerType<?> containerType, int id, PlayerInventory ip, PartFluidStorageBus te )
|
||||
public ContainerFluidStorageBus(int id, PlayerInventory ip, PartFluidStorageBus te )
|
||||
{
|
||||
super( containerType, id,ip, te );
|
||||
super( TYPE, id,ip, te );
|
||||
this.storageBus = te;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,24 +23,23 @@ import java.io.IOException;
|
||||
import java.nio.BufferOverflowException;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import appeng.api.config.*;
|
||||
import appeng.container.ContainerLocator;
|
||||
import appeng.container.helper.PartContainerHelper;
|
||||
import appeng.fluids.parts.PartFluidFormationPlane;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.inventory.container.IContainerListener;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraftforge.common.util.LazyOptional;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidUtil;
|
||||
import net.minecraftforge.fluids.capability.IFluidHandler.FluidAction;
|
||||
import net.minecraftforge.fluids.capability.IFluidHandlerItem;
|
||||
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.PowerMultiplier;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.SortDir;
|
||||
import appeng.api.config.SortOrder;
|
||||
import appeng.api.config.ViewItems;
|
||||
import appeng.api.networking.IGrid;
|
||||
import appeng.api.networking.IGridHost;
|
||||
import appeng.api.networking.IGridNode;
|
||||
@@ -81,6 +80,20 @@ import appeng.util.Platform;
|
||||
*/
|
||||
public class ContainerFluidTerminal extends AEBaseContainer implements IConfigManagerHost, IConfigurableObject, IMEMonitorHandlerReceiver<IAEFluidStack>
|
||||
{
|
||||
|
||||
public static ContainerType<ContainerFluidFormationPlane> TYPE;
|
||||
|
||||
private static final PartContainerHelper<ContainerFluidFormationPlane, PartFluidFormationPlane> helper
|
||||
= new PartContainerHelper<>(ContainerFluidFormationPlane::new, PartFluidFormationPlane.class, SecurityPermissions.BUILD);
|
||||
|
||||
public static ContainerFluidFormationPlane fromNetwork(int windowId, PlayerInventory inv, PacketBuffer buf) {
|
||||
return helper.fromNetwork(windowId, inv, buf);
|
||||
}
|
||||
|
||||
public static boolean open(PlayerEntity player, ContainerLocator locator) {
|
||||
return helper.open(player, locator);
|
||||
}
|
||||
|
||||
private final IConfigManager clientCM;
|
||||
private final IMEMonitor<IAEFluidStack> monitor;
|
||||
private final IItemList<IAEFluidStack> fluids = Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class ).createList();
|
||||
@@ -284,14 +297,7 @@ public class ContainerFluidTerminal extends AEBaseContainer implements IConfigMa
|
||||
{
|
||||
if( crafter instanceof ServerPlayerEntity )
|
||||
{
|
||||
try
|
||||
{
|
||||
NetworkHandler.instance().sendTo( new PacketValueConfig( set.name(), sideLocal.name() ), (ServerPlayerEntity) crafter );
|
||||
}
|
||||
catch( final IOException e )
|
||||
{
|
||||
AELog.debug( e );
|
||||
}
|
||||
NetworkHandler.instance().sendTo( new PacketValueConfig( set.name(), sideLocal.name() ), (ServerPlayerEntity) crafter );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,9 +6,14 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import appeng.container.ContainerLocator;
|
||||
import appeng.container.ContainerOpener;
|
||||
import appeng.container.implementations.ContainerFormationPlane;
|
||||
import appeng.fluids.container.ContainerFluidFormationPlane;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -188,7 +193,7 @@ public class PartFluidFormationPlane extends PartAbstractFormationPlane<IAEFluid
|
||||
{
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
// FIXME Platform.openGUI( player, this.getHost().getTile(), this.getSide(), GuiBridge.GUI_FLUID_FORMATION_PLANE );
|
||||
ContainerOpener.openContainer(ContainerFluidFormationPlane.TYPE, player, ContainerLocator.forPart(this));
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -229,9 +234,9 @@ public class PartFluidFormationPlane extends PartAbstractFormationPlane<IAEFluid
|
||||
return Api.INSTANCE.definitions().parts().fluidFormationnPlane().maybeStack( 1 ).orElse( ItemStack.EMPTY );
|
||||
}
|
||||
|
||||
// FIXME @Override
|
||||
// FIXME public GuiBridge getGuiBridge()
|
||||
// FIXME {
|
||||
// FIXME return GuiBridge.GUI_FLUID_FORMATION_PLANE;
|
||||
// FIXME }
|
||||
@Override
|
||||
public ContainerType<?> getContainerType()
|
||||
{
|
||||
return ContainerFluidFormationPlane.TYPE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,11 @@ package appeng.fluids.parts;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import appeng.container.ContainerLocator;
|
||||
import appeng.container.ContainerOpener;
|
||||
import appeng.fluids.container.ContainerFluidInterface;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -139,7 +143,7 @@ public class PartFluidInterface extends PartBasicState implements IGridTickable,
|
||||
{
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
// FIXME Platform.openGUI( p, this.getTileEntity(), this.getSide(), GuiBridge.GUI_FLUID_INTERFACE );
|
||||
ContainerOpener.openContainer(ContainerFluidInterface.TYPE, p, ContainerLocator.forPart(this));
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -234,9 +238,9 @@ public class PartFluidInterface extends PartBasicState implements IGridTickable,
|
||||
return Api.INSTANCE.definitions().parts().fluidIface().maybeStack( 1 ).orElse( ItemStack.EMPTY );
|
||||
}
|
||||
|
||||
// FIXME @Override
|
||||
// FIXME public GuiBridge getGuiBridge()
|
||||
// FIXME {
|
||||
// FIXME return GuiBridge.GUI_FLUID_INTERFACE;
|
||||
// FIXME }
|
||||
@Override
|
||||
public ContainerType<?> getContainerType()
|
||||
{
|
||||
return ContainerFluidInterface.TYPE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,10 @@ package appeng.fluids.parts;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import appeng.container.ContainerLocator;
|
||||
import appeng.container.ContainerOpener;
|
||||
import appeng.container.implementations.ContainerLevelEmitter;
|
||||
import appeng.fluids.container.ContainerFluidLevelEmitter;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
@@ -327,7 +331,7 @@ public class PartFluidLevelEmitter extends PartUpgradeable implements IStackWatc
|
||||
{
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
// FIXME Platform.openGUI( player, this.getHost().getTile(), this.getSide(), GuiBridge.GUI_FLUID_LEVEL_EMITTER );
|
||||
ContainerOpener.openContainer(ContainerFluidLevelEmitter.TYPE, player, ContainerLocator.forPart(this));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,12 @@ import java.util.List;
|
||||
import java.util.Objects;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import appeng.container.ContainerLocator;
|
||||
import appeng.container.ContainerOpener;
|
||||
import appeng.fluids.container.ContainerFluidInterface;
|
||||
import appeng.fluids.container.ContainerFluidStorageBus;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -224,7 +229,7 @@ public class PartFluidStorageBus extends PartSharedStorageBus implements IMEMoni
|
||||
{
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
// FIXME Platform.openGUI( player, this.getHost().getTile(), this.getSide(), GuiBridge.GUI_STORAGEBUS_FLUID );
|
||||
ContainerOpener.openContainer(ContainerFluidStorageBus.TYPE, player, ContainerLocator.forPart(this));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -489,9 +494,9 @@ public class PartFluidStorageBus extends PartSharedStorageBus implements IMEMoni
|
||||
return Api.INSTANCE.definitions().parts().fluidStorageBus().maybeStack( 1 ).orElse( ItemStack.EMPTY );
|
||||
}
|
||||
|
||||
// FIXME @Override
|
||||
// FIXME public GuiBridge getGuiBridge()
|
||||
// FIXME {
|
||||
// FIXME return GuiBridge.GUI_STORAGEBUS_FLUID;
|
||||
// FIXME }
|
||||
@Override
|
||||
public ContainerType<?> getContainerType()
|
||||
{
|
||||
return ContainerFluidStorageBus.TYPE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,10 @@
|
||||
package appeng.fluids.parts;
|
||||
|
||||
|
||||
import appeng.container.ContainerLocator;
|
||||
import appeng.container.ContainerOpener;
|
||||
import appeng.fluids.container.ContainerFluidIO;
|
||||
import appeng.fluids.container.ContainerFluidInterface;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
@@ -107,7 +111,7 @@ public abstract class PartSharedFluidBus extends PartUpgradeable implements IGri
|
||||
{
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
// FIXME Platform.openGUI( player, this.getHost().getTile(), this.getSide(), GuiBridge.GUI_BUS_FLUID );
|
||||
ContainerOpener.openContainer(ContainerFluidIO.TYPE, player, ContainerLocator.forPart(this));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -19,6 +19,10 @@
|
||||
package appeng.fluids.registries;
|
||||
|
||||
|
||||
import appeng.container.ContainerLocator;
|
||||
import appeng.container.ContainerOpener;
|
||||
import appeng.container.implementations.ContainerFormationPlane;
|
||||
import appeng.fluids.container.ContainerFluidTerminal;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -48,6 +52,6 @@ public class BasicFluidCellGuiHandler implements ICellGuiHandler
|
||||
@Override
|
||||
public void openChestGui( final PlayerEntity player, final IChestOrDrive chest, final ICellHandler cellHandler, final IMEInventoryHandler inv, final ItemStack is, final IStorageChannel chan )
|
||||
{
|
||||
// FIXME Platform.openGUI( player, (TileEntity) chest, AEPartLocation.fromFacing( chest.getUp() ), GuiBridge.GUI_FLUID_TERMINAL );
|
||||
ContainerOpener.openContainer(ContainerFluidTerminal.TYPE, player, ContainerLocator.forTileEntitySide((TileEntity) chest, chest.getUp()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@ import java.util.EnumSet;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import appeng.fluids.container.ContainerFluidInterface;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -182,9 +184,9 @@ public class TileFluidInterface extends AENetworkTile implements IGridTickable,
|
||||
return Api.INSTANCE.definitions().blocks().fluidIface().maybeStack( 1 ).orElse( ItemStack.EMPTY );
|
||||
}
|
||||
|
||||
// FIXME @Override
|
||||
// FIXME public GuiBridge getGuiBridge()
|
||||
// FIXME {
|
||||
// FIXME return GuiBridge.GUI_FLUID_INTERFACE;
|
||||
// FIXME }
|
||||
@Override
|
||||
public ContainerType<?> getContainerType()
|
||||
{
|
||||
return ContainerFluidInterface.TYPE;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user