5
5
import com .github .alexthe666 .iceandfire .entity .tile .TileEntityDragonforge ;
6
6
import com .github .alexthe666 .iceandfire .inventory .ContainerDragonForge ;
7
7
import com .mojang .blaze3d .matrix .MatrixStack ;
8
- import com .mojang .blaze3d .platform . GlStateManager ;
8
+ import com .mojang .blaze3d .systems . RenderSystem ;
9
9
10
10
import net .minecraft .client .gui .FontRenderer ;
11
11
import net .minecraft .client .gui .screen .inventory .ContainerScreen ;
14
14
import net .minecraft .tileentity .TileEntity ;
15
15
import net .minecraft .util .ResourceLocation ;
16
16
import net .minecraft .util .text .ITextComponent ;
17
- import net .minecraftforge .api .distmarker .Dist ;
18
- import net .minecraftforge .api .distmarker .OnlyIn ;
19
17
20
- @ OnlyIn (Dist .CLIENT )
21
18
public class GuiDragonForge extends ContainerScreen <ContainerDragonForge > {
22
19
private static final ResourceLocation TEXTURE_FIRE = new ResourceLocation ("iceandfire:textures/gui/dragonforge_fire.png" );
23
20
private static final ResourceLocation TEXTURE_ICE = new ResourceLocation ("iceandfire:textures/gui/dragonforge_ice.png" );
24
21
private static final ResourceLocation TEXTURE_LIGHTNING = new ResourceLocation ("iceandfire:textures/gui/dragonforge_lightning.png" );
25
- private final PlayerInventory playerInventory ;
26
22
private ContainerDragonForge tileFurnace ;
27
23
private int dragonType ;
28
24
29
25
public GuiDragonForge (ContainerDragonForge container , PlayerInventory inv , ITextComponent name ) {
30
26
super (container , inv , name );
31
- this .playerInventory = inv ;
32
27
this .tileFurnace = container ;
33
- if (tileFurnace instanceof ContainerDragonForge ) {
34
- this .dragonType = tileFurnace .isFire ;
35
- }
28
+ this .dragonType = tileFurnace .isFire ;
36
29
}
37
30
31
+ @ Override
38
32
protected void drawGuiContainerForegroundLayer (MatrixStack stack , int mouseX , int mouseY ) {
39
33
FontRenderer font = this .getMinecraft ().fontRenderer ;
40
34
if (tileFurnace != null ) {
@@ -46,7 +40,7 @@ protected void drawGuiContainerForegroundLayer(MatrixStack stack, int mouseX, in
46
40
47
41
@ Override
48
42
protected void drawGuiContainerBackgroundLayer (MatrixStack matrixStack , float partialTicks , int mouseX , int mouseY ) {
49
- GlStateManager .color4f (1.0F , 1.0F , 1.0F , 1.0F );
43
+ RenderSystem .color4f (1.0F , 1.0F , 1.0F , 1.0F );
50
44
if (dragonType == 0 ) {
51
45
this .getMinecraft ().getTextureManager ().bindTexture (TEXTURE_FIRE );
52
46
} else if (dragonType == 1 ) {
@@ -57,11 +51,11 @@ protected void drawGuiContainerBackgroundLayer(MatrixStack matrixStack, float pa
57
51
int k = (this .width - this .xSize ) / 2 ;
58
52
int l = (this .height - this .ySize ) / 2 ;
59
53
this .blit (matrixStack , k , l , 0 , 0 , this .xSize , this .ySize );
60
- int i1 = this .func_175381_h (126 );
54
+ int i1 = this .getCookTime (126 );
61
55
this .blit (matrixStack , k + 12 , l + 23 , 0 , 166 , i1 , 38 );
62
56
}
63
57
64
- private int func_175381_h (int p_175381_1_ ) {
58
+ private int getCookTime (int p_175381_1_ ) {
65
59
TileEntity te = IceAndFire .PROXY .getRefrencedTE ();
66
60
int j = 0 ;
67
61
int maxCookTime = 1000 ;
@@ -72,6 +66,7 @@ private int func_175381_h(int p_175381_1_) {
72
66
return j != 0 ? j * p_175381_1_ / maxCookTime : 0 ;
73
67
}
74
68
69
+ @ Override
75
70
public void render (MatrixStack matrixStack , int mouseX , int mouseY , float partialTicks ) {
76
71
this .renderBackground (matrixStack );
77
72
super .render (matrixStack , mouseX , mouseY , partialTicks );
0 commit comments