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); 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){ public void add(float x, float y, float radius, Color color, float opacity){
if(!enabled()) return; if(!enabled()) return;
@@ -180,13 +184,14 @@ public class LightRenderer{
Draw.color(); Draw.color();
buffer.beginDraw(Color.clear); buffer.beginDraw(Color.clear);
Draw.blend(Blending.normal); Gl.blendEquationSeparate(Gl.funcAdd, Gl.max);
for(Runnable run : lights){ for(Runnable run : lights){
run.run(); run.run();
} }
Draw.reset(); Draw.reset();
Draw.blend();
buffer.endDraw(); buffer.endDraw();
Gl.blendEquationSeparate(Gl.funcAdd, Gl.funcAdd);
Draw.color(); Draw.color();
Shaders.light.ambient.set(state.rules.ambientLight); Shaders.light.ambient.set(state.rules.ambientLight);

View File

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

View File

@@ -1,3 +1,3 @@
org.gradle.daemon=true org.gradle.daemon=true
org.gradle.jvmargs=-Xms256m -Xmx1024m org.gradle.jvmargs=-Xms256m -Xmx1024m
archash=f2bb11a4dbb6febed118a772ce61a253e1d863c5 archash=bff072e2d671c74a32b41353125c2aa6ba8c0314