mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-19 10:43:14 +00:00
Fixes
This commit is contained in:
parent
1a7aa1218a
commit
c7f612dac0
2
pom.xml
2
pom.xml
@ -4,7 +4,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>bytecode.ninja</groupId>
|
<groupId>bytecode.ninja</groupId>
|
||||||
<artifactId>Iris</artifactId>
|
<artifactId>Iris</artifactId>
|
||||||
<version>1.0.12</version>
|
<version>1.0.13</version>
|
||||||
<name>Iris</name>
|
<name>Iris</name>
|
||||||
<properties>
|
<properties>
|
||||||
<skip.copy>false</skip.copy>
|
<skip.copy>false</skip.copy>
|
||||||
|
@ -81,6 +81,20 @@ public class Iris extends MortarPlugin
|
|||||||
lowMemoryMode = Runtime.getRuntime().maxMemory() < 4000000000L; // 4 * 1000 * 1000 * 1000 // 4gb
|
lowMemoryMode = Runtime.getRuntime().maxMemory() < 4000000000L; // 4 * 1000 * 1000 * 1000 // 4gb
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static int getThreadCount()
|
||||||
|
{
|
||||||
|
int tc = IrisSettings.get().forceThreadCount;
|
||||||
|
|
||||||
|
if(tc <= 0)
|
||||||
|
{
|
||||||
|
int p = Runtime.getRuntime().availableProcessors();
|
||||||
|
|
||||||
|
return p > 16 ? 16 : p < 4 ? 4 : p;
|
||||||
|
}
|
||||||
|
|
||||||
|
return tc;
|
||||||
|
}
|
||||||
|
|
||||||
private static String findNMSTag()
|
private static String findNMSTag()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@ -253,7 +267,7 @@ public class Iris extends MortarPlugin
|
|||||||
public ChunkGenerator getDefaultWorldGenerator(String worldName, String id)
|
public ChunkGenerator getDefaultWorldGenerator(String worldName, String id)
|
||||||
{
|
{
|
||||||
// @NoArgsConstructor
|
// @NoArgsConstructor
|
||||||
return createProvisionBukkit(IrisGenConfiguration.builder().threads(IrisSettings.get().threads).target(TerrainTarget.builder().environment(Environment.NORMAL).folder(new File(worldName)).name(worldName).seed(worldName.hashCode()).build()).build());
|
return createProvisionBukkit(IrisGenConfiguration.builder().threads(getThreadCount()).target(TerrainTarget.builder().environment(Environment.NORMAL).folder(new File(worldName)).name(worldName).seed(worldName.hashCode()).build()).build());
|
||||||
//@done
|
//@done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ public class IrisSettings
|
|||||||
|
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@Desc("Iris generator threads (must be 2 or higher). Threads in iris are not a perfect scale for performance as a lot of data has to be shared. 16 Threads is a good rule of thumb. Use 8 threads on a quad core processor.")
|
@Desc("Iris generator threads (must be 2 or higher). Threads in iris are not a perfect scale for performance as a lot of data has to be shared. 16 Threads is a good rule of thumb. Use 8 threads on a quad core processor.")
|
||||||
public int threads = 16;
|
public int forceThreadCount = -1;
|
||||||
|
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@Desc("The default world type incase iris doesnt have a dimension to use.")
|
@Desc("The default world type incase iris doesnt have a dimension to use.")
|
||||||
|
@ -8,7 +8,6 @@ import org.bukkit.WorldCreator;
|
|||||||
import org.bukkit.WorldType;
|
import org.bukkit.WorldType;
|
||||||
|
|
||||||
import com.volmit.iris.Iris;
|
import com.volmit.iris.Iris;
|
||||||
import com.volmit.iris.IrisSettings;
|
|
||||||
import com.volmit.iris.gen.IrisTerrainProvider;
|
import com.volmit.iris.gen.IrisTerrainProvider;
|
||||||
import com.volmit.iris.gen.nms.NMSCreator;
|
import com.volmit.iris.gen.nms.NMSCreator;
|
||||||
import com.volmit.iris.gen.provisions.ProvisionBukkit;
|
import com.volmit.iris.gen.provisions.ProvisionBukkit;
|
||||||
@ -62,7 +61,7 @@ public class CommandIrisCreate extends MortarCommand
|
|||||||
//@builder
|
//@builder
|
||||||
ProvisionBukkit gen = Iris.instance.createProvisionBukkit(
|
ProvisionBukkit gen = Iris.instance.createProvisionBukkit(
|
||||||
IrisGenConfiguration.builder()
|
IrisGenConfiguration.builder()
|
||||||
.threads(IrisSettings.get().threads)
|
.threads(Iris.getThreadCount())
|
||||||
.dimension(dim.getLoadKey())
|
.dimension(dim.getLoadKey())
|
||||||
.target(TerrainTarget
|
.target(TerrainTarget
|
||||||
.builder()
|
.builder()
|
||||||
@ -74,7 +73,7 @@ public class CommandIrisCreate extends MortarCommand
|
|||||||
).build());
|
).build());
|
||||||
//@done
|
//@done
|
||||||
|
|
||||||
sender.sendMessage("Generating with " + IrisSettings.get().threads + " threads per chunk");
|
sender.sendMessage("Generating with " + Iris.getThreadCount() + " threads per chunk");
|
||||||
O<Boolean> done = new O<Boolean>();
|
O<Boolean> done = new O<Boolean>();
|
||||||
done.set(false);
|
done.set(false);
|
||||||
|
|
||||||
|
@ -126,11 +126,6 @@ public abstract class DimensionalTerrainProvider extends ContextualTerrainProvid
|
|||||||
{
|
{
|
||||||
IrisDimension d = loadDimension(getDimensionName());
|
IrisDimension d = loadDimension(getDimensionName());
|
||||||
|
|
||||||
if(d == null)
|
|
||||||
{
|
|
||||||
Iris.error("Can't find dimension: " + getDimensionName());
|
|
||||||
}
|
|
||||||
|
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@ import org.bukkit.block.data.BlockData;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.generator.BlockPopulator;
|
import org.bukkit.generator.BlockPopulator;
|
||||||
|
|
||||||
|
import com.volmit.iris.Iris;
|
||||||
import com.volmit.iris.IrisSettings;
|
import com.volmit.iris.IrisSettings;
|
||||||
import com.volmit.iris.gen.atomics.AtomicSliver;
|
import com.volmit.iris.gen.atomics.AtomicSliver;
|
||||||
import com.volmit.iris.gen.atomics.AtomicSliverMap;
|
import com.volmit.iris.gen.atomics.AtomicSliverMap;
|
||||||
@ -353,6 +354,16 @@ public abstract class ParallaxTerrainProvider extends TopographicTerrainProvider
|
|||||||
placeObject(k, i, j, random.nextParallelRNG((34 * ((i * 30) + (j * 30) + g++) * i * j) + i - j + 3566522));
|
placeObject(k, i, j, random.nextParallelRNG((34 * ((i * 30) + (j * 30) + g++) * i * j) + i - j + 3566522));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(r == null)
|
||||||
|
{
|
||||||
|
Iris.error("R Null");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(r.getSurfaceObjects() == null)
|
||||||
|
{
|
||||||
|
Iris.error("Surface objects null");
|
||||||
|
}
|
||||||
|
|
||||||
if(r != null)
|
if(r != null)
|
||||||
{
|
{
|
||||||
for(IrisObjectPlacement k : r.getSurfaceObjects())
|
for(IrisObjectPlacement k : r.getSurfaceObjects())
|
||||||
|
@ -15,7 +15,6 @@ import org.bukkit.generator.BlockPopulator;
|
|||||||
import org.bukkit.generator.ChunkGenerator;
|
import org.bukkit.generator.ChunkGenerator;
|
||||||
|
|
||||||
import com.volmit.iris.Iris;
|
import com.volmit.iris.Iris;
|
||||||
import com.volmit.iris.IrisSettings;
|
|
||||||
import com.volmit.iris.gen.IrisTerrainProvider;
|
import com.volmit.iris.gen.IrisTerrainProvider;
|
||||||
import com.volmit.iris.gen.scaffold.HeightedFakeWorld;
|
import com.volmit.iris.gen.scaffold.HeightedFakeWorld;
|
||||||
import com.volmit.iris.gen.scaffold.Provisioned;
|
import com.volmit.iris.gen.scaffold.Provisioned;
|
||||||
@ -38,7 +37,7 @@ public class ProvisionBukkit extends ChunkGenerator implements Provisioned
|
|||||||
private final TerrainProvider provider;
|
private final TerrainProvider provider;
|
||||||
private final KMap<ChunkPosition, TerrainChunk> precache;
|
private final KMap<ChunkPosition, TerrainChunk> precache;
|
||||||
private KList<ChunkPosition> regenerated = new KList<ChunkPosition>();
|
private KList<ChunkPosition> regenerated = new KList<ChunkPosition>();
|
||||||
private Executor e = Executors.newFixedThreadPool(IrisSettings.get().getThreads());
|
private Executor e = Executors.newFixedThreadPool(Iris.getThreadCount());
|
||||||
private World cachedWorld;
|
private World cachedWorld;
|
||||||
|
|
||||||
public ProvisionBukkit(TerrainProvider provider)
|
public ProvisionBukkit(TerrainProvider provider)
|
||||||
|
@ -131,7 +131,7 @@ public class IrisProject
|
|||||||
//@builder
|
//@builder
|
||||||
ProvisionBukkit gen = Iris.instance
|
ProvisionBukkit gen = Iris.instance
|
||||||
.createProvisionBukkit(IrisGenConfiguration.builder()
|
.createProvisionBukkit(IrisGenConfiguration.builder()
|
||||||
.threads(IrisSettings.get().threads)
|
.threads(Iris.getThreadCount())
|
||||||
.dimension(getName())
|
.dimension(getName())
|
||||||
.target(TerrainTarget.builder()
|
.target(TerrainTarget.builder()
|
||||||
.environment(d.getEnvironment())
|
.environment(d.getEnvironment())
|
||||||
@ -144,7 +144,7 @@ public class IrisProject
|
|||||||
|
|
||||||
IrisTerrainProvider gx = (IrisTerrainProvider) gen.getProvider();
|
IrisTerrainProvider gx = (IrisTerrainProvider) gen.getProvider();
|
||||||
gx.setDev(true);
|
gx.setDev(true);
|
||||||
sender.sendMessage("Generating with " + IrisSettings.get().threads + " threads per chunk");
|
sender.sendMessage("Generating with " + Iris.getThreadCount() + " threads per chunk");
|
||||||
O<Boolean> done = new O<Boolean>();
|
O<Boolean> done = new O<Boolean>();
|
||||||
done.set(false);
|
done.set(false);
|
||||||
activeProvider = gx;
|
activeProvider = gx;
|
||||||
|
@ -229,8 +229,8 @@ public class IrisRegion extends IrisRegistrant implements IRare
|
|||||||
@Desc("Generate rivers in this region")
|
@Desc("Generate rivers in this region")
|
||||||
private double riverThickness = 0.1;
|
private double riverThickness = 0.1;
|
||||||
|
|
||||||
private final transient AtomicCache<KList<IrisObjectPlacement>> surfaceObjectsCache = new AtomicCache<>(true);
|
private final transient AtomicCache<KList<IrisObjectPlacement>> surfaceObjectsCache = new AtomicCache<>();
|
||||||
private final transient AtomicCache<KList<IrisObjectPlacement>> carveObjectsCache = new AtomicCache<>(true);
|
private final transient AtomicCache<KList<IrisObjectPlacement>> carveObjectsCache = new AtomicCache<>();
|
||||||
private final transient AtomicCache<KList<String>> cacheRidge = new AtomicCache<>();
|
private final transient AtomicCache<KList<String>> cacheRidge = new AtomicCache<>();
|
||||||
private final transient AtomicCache<KList<String>> cacheSpot = new AtomicCache<>();
|
private final transient AtomicCache<KList<String>> cacheSpot = new AtomicCache<>();
|
||||||
private final transient AtomicCache<CNG> shoreHeightGenerator = new AtomicCache<>();
|
private final transient AtomicCache<CNG> shoreHeightGenerator = new AtomicCache<>();
|
||||||
|
@ -185,7 +185,7 @@ public class ResourceLoader<T extends IrisRegistrant>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(warn)
|
if(warn && !resourceTypeName.equals("Dimension"))
|
||||||
{
|
{
|
||||||
J.a(() -> Iris.warn("Couldn't find " + resourceTypeName + ": " + name));
|
J.a(() -> Iris.warn("Couldn't find " + resourceTypeName + ": " + name));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user