mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-08 14:57:18 +07:00
Better impl of #8451
This commit is contained in:
@ -11,8 +11,6 @@ import mindustry.gen.*;
|
|||||||
import mindustry.world.draw.*;
|
import mindustry.world.draw.*;
|
||||||
import mindustry.world.meta.*;
|
import mindustry.world.meta.*;
|
||||||
|
|
||||||
import static mindustry.Vars.*;
|
|
||||||
|
|
||||||
public class Battery extends PowerDistributor{
|
public class Battery extends PowerDistributor{
|
||||||
public DrawBlock drawer;
|
public DrawBlock drawer;
|
||||||
|
|
||||||
@ -39,6 +37,10 @@ public class Battery extends PowerDistributor{
|
|||||||
public void init(){
|
public void init(){
|
||||||
super.init();
|
super.init();
|
||||||
|
|
||||||
|
checkDrawDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
void checkDrawDefault(){
|
||||||
if(drawer == null){
|
if(drawer == null){
|
||||||
drawer = new DrawMulti(new DrawDefault(), new DrawPower(){{
|
drawer = new DrawMulti(new DrawDefault(), new DrawPower(){{
|
||||||
emptyLightColor = Battery.this.emptyLightColor;
|
emptyLightColor = Battery.this.emptyLightColor;
|
||||||
@ -49,6 +51,8 @@ public class Battery extends PowerDistributor{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void load(){
|
public void load(){
|
||||||
|
checkDrawDefault();
|
||||||
|
|
||||||
super.load();
|
super.load();
|
||||||
drawer.load(this);
|
drawer.load(this);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user