Unnecessary Drawer Icon Adding (#9078)

* DrawBlock icons shouldn't have icons by default

It doesn't make sense for drawers like DrawLiquidTile to return icons. Overriding in every such class doesn't make as much sense as simply changing the superclass.

* Ensure that finalIcons is never empty
This commit is contained in:
MEEPofFaith 2023-09-20 18:20:22 -07:00 committed by GitHub
parent 0d1c56fb60
commit fa0ce204da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 8 deletions

View File

@ -44,7 +44,7 @@ public abstract class DrawBlock{
/** @return the generated icons to be used for this block. */
public TextureRegion[] icons(Block block){
return new TextureRegion[]{block.region};
return new TextureRegion[]{};
}
public final TextureRegion[] finalIcons(Block block){
@ -55,7 +55,8 @@ public abstract class DrawBlock{
}
return out;
}
return icons(block);
TextureRegion[] icons = icons(block);
return icons.length == 0 ? new TextureRegion[]{Core.atlas.find("error")} : icons;
}
public GenericCrafter expectCrafter(Block block){

View File

@ -17,4 +17,9 @@ public class DrawDefault extends DrawBlock{
public void drawPlan(Block block, BuildPlan plan, Eachable<BuildPlan> list){
block.drawDefaultPlanRegion(plan, list);
}
@Override
public TextureRegion[] icons(Block block){
return new TextureRegion[]{block.region};
}
}

View File

@ -53,10 +53,4 @@ public class DrawLiquidOutputs extends DrawBlock{
}
}
}
//can't display these properly
@Override
public TextureRegion[] icons(Block block){
return new TextureRegion[]{};
}
}