Backport of fixed lighting + overflow crash fix

This commit is contained in:
Anuken
2020-02-28 13:46:16 -05:00
parent bc7671b08d
commit 38ab1473f2
3 changed files with 14 additions and 4 deletions

View File

@@ -24,6 +24,10 @@ public class LightRenderer{
lights.add(run);
}
public void add(Position pos, float radius, Color color, float opacity){
add(pos.getX(), pos.getY(), radius, color, opacity);
}
public void add(float x, float y, float radius, Color color, float opacity){
if(!enabled()) return;
@@ -180,13 +184,14 @@ public class LightRenderer{
Draw.color();
buffer.beginDraw(Color.clear);
Draw.blend(Blending.normal);
Gl.blendEquationSeparate(Gl.funcAdd, Gl.max);
for(Runnable run : lights){
run.run();
}
Draw.reset();
Draw.blend();
buffer.endDraw();
Gl.blendEquationSeparate(Gl.funcAdd, Gl.funcAdd);
Draw.color();
Shaders.light.ambient.set(state.rules.ambientLight);
@@ -196,4 +201,4 @@ public class LightRenderer{
lights.clear();
}
}
}

View File

@@ -54,6 +54,11 @@ public class OverflowGate extends Block{
}
if(entity.lastItem != null){
if(entity.lastInput == null){
entity.lastItem = null;
return;
}
entity.time += 1f / speed * Time.delta();
Tile target = getTileTarget(tile, entity.lastItem, entity.lastInput, false);