GUI Registration
This commit is contained in:
@@ -54,7 +54,7 @@ import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
||||
public class GuiCraftingCPU extends AEBaseGui<ContainerCraftingCPU> implements ISortSource
|
||||
public class GuiCraftingCPU<T extends ContainerCraftingCPU> extends AEBaseGui<T> implements ISortSource
|
||||
{
|
||||
private static final int GUI_HEIGHT = 184;
|
||||
private static final int GUI_WIDTH = 238;
|
||||
@@ -89,7 +89,7 @@ public class GuiCraftingCPU extends AEBaseGui<ContainerCraftingCPU> implements I
|
||||
private Button cancel;
|
||||
private int tooltip = -1;
|
||||
|
||||
public GuiCraftingCPU(ContainerCraftingCPU container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public GuiCraftingCPU(T container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = GUI_HEIGHT;
|
||||
this.xSize = GUI_WIDTH;
|
||||
|
||||
@@ -35,18 +35,15 @@ import net.minecraft.util.text.ITextComponent;
|
||||
import java.io.IOException;
|
||||
|
||||
|
||||
public class GuiCraftingStatus extends GuiCraftingCPU
|
||||
public class GuiCraftingStatus extends GuiCraftingCPU<ContainerCraftingStatus>
|
||||
{
|
||||
|
||||
private final ContainerCraftingStatus craftingStatus;
|
||||
|
||||
private final AESubGui subGui;
|
||||
|
||||
private Button selectCPU;
|
||||
|
||||
public GuiCraftingStatus(ContainerCraftingStatus container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.craftingStatus = container;
|
||||
this.subGui = new AESubGui(this, container.getTarget());
|
||||
}
|
||||
|
||||
@@ -76,20 +73,20 @@ public class GuiCraftingStatus extends GuiCraftingCPU
|
||||
{
|
||||
String btnTextText = GuiText.NoCraftingJobs.getLocal();
|
||||
|
||||
if( this.craftingStatus.selectedCpu >= 0 )// && status.selectedCpu < status.cpus.size() )
|
||||
if( this.container.selectedCpu >= 0 )// && status.selectedCpu < status.cpus.size() )
|
||||
{
|
||||
if( this.craftingStatus.myName.length() > 0 )
|
||||
if( this.container.myName.length() > 0 )
|
||||
{
|
||||
final String name = this.craftingStatus.myName.substring( 0, Math.min( 20, this.craftingStatus.myName.length() ) );
|
||||
final String name = this.container.myName.substring( 0, Math.min( 20, this.container.myName.length() ) );
|
||||
btnTextText = GuiText.CPUs.getLocal() + ": " + name;
|
||||
}
|
||||
else
|
||||
{
|
||||
btnTextText = GuiText.CPUs.getLocal() + ": #" + this.craftingStatus.selectedCpu;
|
||||
btnTextText = GuiText.CPUs.getLocal() + ": #" + this.container.selectedCpu;
|
||||
}
|
||||
}
|
||||
|
||||
if( this.craftingStatus.noCPU )
|
||||
if( this.container.noCPU )
|
||||
{
|
||||
btnTextText = GuiText.NoCraftingJobs.getLocal();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user