9
0
mirror of https://github.com/VolmitSoftware/Iris.git synced 2025-12-27 02:59:06 +00:00

Simplify parallax

This commit is contained in:
Daniel Mills
2021-01-04 13:04:00 -05:00
parent 64f27e7d39
commit 53e8c9141c

View File

@@ -74,16 +74,6 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer
default void insertParallax(int x, int z, Hunk<BlockData> data)
{
insertParallax(x, z, data, 5);
}
default void insertParallax(int x, int z, Hunk<BlockData> data, int tries)
{
if(tries <= 0)
{
return;
}
try
{
PrecisionStopwatch p = PrecisionStopwatch.start();
@@ -111,11 +101,6 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer
return;
}
int min = Math.max(meta.getMinObject(), 0);
int max = meta.getMaxObject();
max = max < 0 ? 255 : max;
boolean placed = false;
for(int i = x; i < x+ data.getWidth(); i++)
{
for(int j= z; j < z + data.getDepth(); j++)
@@ -127,24 +112,11 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer
if(d != null)
{
data.set(i - x, k, j - z, d);
placed = true;
}
}
}
}
if(!placed)
{
J.sleep(150);
if(tries < 4)
{
generateParallaxLayer(x, z, true);
}
insertParallax(x, z, data, tries-1);
}
getEngine().getMetrics().getParallaxInsert().put(p.getMilliseconds());
}