Better MultiEffect

This commit is contained in:
Anuken
2022-04-13 21:35:26 -04:00
parent 2f6ff1d22c
commit ea4600beb3
2 changed files with 12 additions and 22 deletions

View File

@@ -138,8 +138,12 @@ public class Effect{
create(x, y, rotation, Color.white, data);
}
protected void create(float x, float y, float rotation, Color color, Object data){
if(headless || this == Fx.none || !Vars.renderer.enableEffects) return;
public boolean shouldCreate(){
return !headless && this != Fx.none && Vars.renderer.enableEffects;
}
public void create(float x, float y, float rotation, Color color, Object data){
if(!shouldCreate()) return;
if(Core.camera.bounds(Tmp.r1).overlaps(Tmp.r2.setCentered(x, y, clip))){
if(!initialized){
@@ -150,7 +154,7 @@ public class Effect{
if(startDelay <= 0f){
add(x, y, rotation, color, data);
}else{
Time.runTask(startDelay, () -> add(x, y, rotation, color, data));
Time.run(startDelay, () -> add(x, y, rotation, color, data));
}
}
}