Merge pull request #2 from LordMZTE/rv3-1.7.10
add gui to legacy controller
This commit is contained in:
commit
52624ed3aa
|
@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
|
|||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-3.0-all.zip
|
||||
|
|
|
@ -2,8 +2,13 @@ package appeng.block.legacy;
|
|||
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.sync.GuiBridge;
|
||||
import appeng.tile.legacy.TileLegacyController;
|
||||
import appeng.util.Platform;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
|
@ -15,5 +20,10 @@ public class BlockLegacyController extends AEBaseTileBlock {
|
|||
this.setFeature( EnumSet.of(AEFeature.Legacy) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onActivated(World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
Platform.openGUI(player, w.getTileEntity(x, y, z), ForgeDirection.getOrientation(side), GuiBridge.GUI_NETWORK_STATUS_BLOCK);
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -24,6 +24,7 @@ import appeng.api.config.SortDir;
|
|||
import appeng.api.config.SortOrder;
|
||||
import appeng.api.config.ViewItems;
|
||||
import appeng.api.implementations.guiobjects.INetworkTool;
|
||||
import appeng.api.networking.IGridHost;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.widgets.GuiImgButton;
|
||||
|
@ -53,7 +54,11 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
|
|||
private GuiImgButton units;
|
||||
private int tooltip = -1;
|
||||
|
||||
public GuiNetworkStatus( final InventoryPlayer inventoryPlayer, final INetworkTool te )
|
||||
public GuiNetworkStatus( final InventoryPlayer inventoryPlayer, final INetworkTool te ) {
|
||||
this(inventoryPlayer, te.getGridHost());
|
||||
}
|
||||
|
||||
public GuiNetworkStatus( final InventoryPlayer inventoryPlayer, final IGridHost te )
|
||||
{
|
||||
super( new ContainerNetworkStatus( inventoryPlayer, te ) );
|
||||
final GuiScrollbar scrollbar = new GuiScrollbar();
|
||||
|
|
|
@ -57,10 +57,14 @@ public class ContainerNetworkStatus extends AEBaseContainer
|
|||
private IGrid network;
|
||||
private int delay = 40;
|
||||
|
||||
public ContainerNetworkStatus( final InventoryPlayer ip, final INetworkTool te )
|
||||
public ContainerNetworkStatus( final InventoryPlayer ip, final INetworkTool te ) {
|
||||
this(ip, te.getGridHost());
|
||||
}
|
||||
|
||||
public ContainerNetworkStatus( final InventoryPlayer ip, final IGridHost te )
|
||||
{
|
||||
super( ip, null, null );
|
||||
final IGridHost host = te.getGridHost();
|
||||
final IGridHost host = te;
|
||||
|
||||
if( host != null )
|
||||
{
|
||||
|
|
|
@ -57,6 +57,7 @@ import appeng.parts.reporting.PartPatternTerminal;
|
|||
import appeng.tile.crafting.TileCraftingTile;
|
||||
import appeng.tile.crafting.TileMolecularAssembler;
|
||||
import appeng.tile.grindstone.TileGrinder;
|
||||
import appeng.tile.legacy.TileLegacyController;
|
||||
import appeng.tile.misc.*;
|
||||
import appeng.tile.networking.TileWireless;
|
||||
import appeng.tile.qnb.TileQuantumBridge;
|
||||
|
@ -103,6 +104,8 @@ public enum GuiBridge implements IGuiHandler
|
|||
|
||||
GUI_NETWORK_STATUS( ContainerNetworkStatus.class, INetworkTool.class, GuiHostType.ITEM, null ),
|
||||
|
||||
GUI_NETWORK_STATUS_BLOCK( ContainerNetworkStatus.class, TileLegacyController.class, GuiHostType.WORLD, null ),
|
||||
|
||||
GUI_CRAFTING_CPU( ContainerCraftingCPU.class, TileCraftingTile.class, GuiHostType.WORLD, SecurityPermissions.CRAFT ),
|
||||
|
||||
GUI_NETWORK_TOOL( ContainerNetworkTool.class, INetworkTool.class, GuiHostType.ITEM, null ),
|
||||
|
|
Loading…
Reference in New Issue