File tree Expand file tree Collapse file tree 1 file changed +17
-7
lines changed
src/main/java/gregtech/api/gui/widgets Expand file tree Collapse file tree 1 file changed +17
-7
lines changed Original file line number Diff line number Diff line change 44import gregtech .api .gui .IRenderContext ;
55import gregtech .api .gui .Widget ;
66import gregtech .api .gui .resources .TextureArea ;
7+ import gregtech .api .situation .SituationTypes ;
78import gregtech .api .util .Position ;
89import gregtech .api .util .Size ;
910import net .minecraft .client .resources .I18n ;
@@ -36,13 +37,22 @@ public void setTooltipHoverString() {
3637 }
3738
3839 public SituationWidget setImage () {
39- Enum iconTextureEnum = getSituationFromId (currentError ).situationTypes ;
40- if (iconTextureEnum .equals (ERROR )) this .area = GuiTextures .STATUS_ERROR ;
41- else if (iconTextureEnum .equals (WARNING )) this .area = GuiTextures .STATUS_WARNING ;
42- else if (iconTextureEnum .equals (WORKING )) this .area = GuiTextures .STATUS_WORKING ;
43- else if (iconTextureEnum .equals (IDLE )) this .area = GuiTextures .STATUS_IDLING ;
44- else {
45- this .area = null ;
40+ SituationTypes iconTextures = getSituationFromId (currentError ).situationTypes ;
41+ switch (iconTextures ) {
42+ case IDLE :
43+ this .area = GuiTextures .STATUS_IDLING ;
44+ return this ;
45+ case WORKING :
46+ this .area = GuiTextures .STATUS_WORKING ;
47+ return this ;
48+ case WARNING :
49+ this .area = GuiTextures .STATUS_WARNING ;
50+ return this ;
51+ case ERROR :
52+ this .area = GuiTextures .STATUS_ERROR ;
53+ return this ;
54+ default :
55+ this .area = null ;
4656 }
4757 return this ;
4858 }
You can’t perform that action at this time.
0 commit comments