Add thread count getter

This commit is contained in:
BuildTools 2020-10-23 13:59:38 +02:00
parent 527a0f5c70
commit 23136be280
2 changed files with 11 additions and 7 deletions

View File

@ -22,12 +22,6 @@ public class CommandIrisCTC extends MortarCommand
@Override
public boolean handle(MortarSender sender, String[] args)
{
if(args.length == 0)
{
sender.sendMessage("/iris ctc " + getArgsUsage());
return true;
}
if(sender.isPlayer())
{
Player p = sender.player();
@ -38,8 +32,14 @@ public class CommandIrisCTC extends MortarCommand
sender.sendMessage("You must be in an iris world.");
return true;
}
IrisTerrainProvider g = IrisWorlds.getProvider(world);
if(args.length == 0){
sender.sendMessage("Current threads: " + g.getThreadCount());
return true;
}
int m = Math.min(Math.max(Integer.valueOf(args[0]), 2), 256);
g.changeThreadCount(m);
sender.sendMessage("Thread count changed to " + m);

View File

@ -45,6 +45,10 @@ public abstract class ParallelTerrainProvider extends DimensionalTerrainProvider
Iris.info("Thread Count changed to " + getThreads());
}
public int getThreadCount(){
return getThreads();
}
protected abstract int onGenerateColumn(int cx, int cz, int wx, int wz, int x, int z, AtomicSliver sliver, BiomeMap biomeMap, boolean sampled);
protected void onGenerateColumn(int cx, int cz, int wx, int wz, int x, int z, AtomicSliver sliver, BiomeMap biomeMap)