mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-19 02:36:59 +00:00
Support pregen listeners in iris comp gen
This commit is contained in:
parent
def4e19359
commit
6d79d3d1f8
@ -16,7 +16,22 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.core.gui;
|
||||
package com.volmit.iris.core.pregenerator;
|
||||
|
||||
public class PregeneratorGUI {
|
||||
public interface PregenListener {
|
||||
void onTick(double chunksPerSecond, double chunksPerMinute, double regionsPerMinute, double percent, int generated, int totalChunks, int chunksRemaining, long eta, long elapsed, String method);
|
||||
|
||||
void onChunkGenerating(int x, int z);
|
||||
|
||||
void onChunkGenerated(int x, int z);
|
||||
|
||||
void onRegionGenerated(int x, int z);
|
||||
|
||||
void onRegionGenerating(int x, int z);
|
||||
|
||||
void onRegionSkipped(int x, int z);
|
||||
|
||||
void onClose();
|
||||
|
||||
void onSaving();
|
||||
}
|
@ -23,6 +23,7 @@ import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.core.IrisSettings;
|
||||
import com.volmit.iris.core.nms.BiomeBaseInjector;
|
||||
import com.volmit.iris.core.nms.INMS;
|
||||
import com.volmit.iris.core.pregenerator.PregenListener;
|
||||
import com.volmit.iris.engine.IrisEngineCompound;
|
||||
import com.volmit.iris.engine.IrisWorlds;
|
||||
import com.volmit.iris.engine.cache.Cache;
|
||||
@ -460,6 +461,11 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce
|
||||
|
||||
@Override
|
||||
public void directWriteMCA(IrisWorld w, int x, int z, NBTWorld writer, MultiBurst burst) {
|
||||
directWriteMCA(w, x, z, writer, burst, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void directWriteMCA(IrisWorld w, int x, int z, NBTWorld writer, MultiBurst burst, PregenListener l) {
|
||||
BurstExecutor e = burst.burst(1024);
|
||||
int mcaox = x << 5;
|
||||
int mcaoz = z << 5;
|
||||
@ -468,7 +474,17 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce
|
||||
int ii = i;
|
||||
for (int j = 0; j < 32; j++) {
|
||||
int jj = j;
|
||||
e.queue(() -> directWriteChunk(w, ii + mcaox, jj + mcaoz, writer));
|
||||
e.queue(() -> {
|
||||
if(l != null)
|
||||
{
|
||||
l.onChunkGenerating(ii + mcaox, jj + mcaoz);
|
||||
}
|
||||
directWriteChunk(w, ii + mcaox, jj + mcaoz, writer);
|
||||
if(l != null)
|
||||
{
|
||||
l.onChunkGenerated(ii + mcaox, jj + mcaoz);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -20,6 +20,7 @@ package com.volmit.iris.engine.framework;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.core.pregenerator.PregenListener;
|
||||
import com.volmit.iris.engine.IrisComplex;
|
||||
import com.volmit.iris.engine.data.DataProvider;
|
||||
import com.volmit.iris.engine.data.mca.NBTWorld;
|
||||
@ -47,6 +48,8 @@ public interface IrisAccess extends Hotloadable, DataProvider {
|
||||
|
||||
void directWriteMCA(IrisWorld w, int x, int z, NBTWorld writer, MultiBurst burst);
|
||||
|
||||
void directWriteMCA(IrisWorld w, int x, int z, NBTWorld writer, MultiBurst burst, PregenListener listener);
|
||||
|
||||
void directWriteChunk(IrisWorld w, int x, int z, NBTWorld writer);
|
||||
|
||||
int getGenerated();
|
||||
|
Loading…
x
Reference in New Issue
Block a user