mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-20 17:28:14 +07:00
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:
parent
0d1c56fb60
commit
fa0ce204da
@ -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){
|
||||
|
@ -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};
|
||||
}
|
||||
}
|
||||
|
@ -53,10 +53,4 @@ public class DrawLiquidOutputs extends DrawBlock{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//can't display these properly
|
||||
@Override
|
||||
public TextureRegion[] icons(Block block){
|
||||
return new TextureRegion[]{};
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user