mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-19 10:43:14 +00:00
Experimentals
This commit is contained in:
parent
c4536d789b
commit
1b20d3b6ac
@ -50,6 +50,10 @@ public class IrisSettings
|
|||||||
@Desc("Useful information when creating iris worlds. Shows object loads & more.")
|
@Desc("Useful information when creating iris worlds. Shows object loads & more.")
|
||||||
public boolean verbose = false;
|
public boolean verbose = false;
|
||||||
|
|
||||||
|
@DontObfuscate
|
||||||
|
@Desc("Experiments...")
|
||||||
|
public boolean allowExperimentalV2Generator = false;
|
||||||
|
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@Desc("If true, will not use world edit even if its on the server")
|
@Desc("If true, will not use world edit even if its on the server")
|
||||||
public boolean ignoreWorldEdit = false;
|
public boolean ignoreWorldEdit = false;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.volmit.iris.command;
|
package com.volmit.iris.command;
|
||||||
|
|
||||||
import com.volmit.iris.Iris;
|
import com.volmit.iris.Iris;
|
||||||
|
import com.volmit.iris.IrisSettings;
|
||||||
import com.volmit.iris.gen.v2.TestGen;
|
import com.volmit.iris.gen.v2.TestGen;
|
||||||
import com.volmit.iris.util.Command;
|
import com.volmit.iris.util.Command;
|
||||||
import com.volmit.iris.util.MortarCommand;
|
import com.volmit.iris.util.MortarCommand;
|
||||||
@ -59,7 +60,7 @@ public class CommandIris extends MortarCommand
|
|||||||
@Override
|
@Override
|
||||||
public boolean handle(MortarSender sender, String[] args)
|
public boolean handle(MortarSender sender, String[] args)
|
||||||
{
|
{
|
||||||
if(args.length == 1 && args[0].equalsIgnoreCase("test!"))
|
if(args.length == 1 && args[0].equalsIgnoreCase("test!") && IrisSettings.get().allowExperimentalV2Generator)
|
||||||
{
|
{
|
||||||
TestGen.gen(sender.player());
|
TestGen.gen(sender.player());
|
||||||
return true;
|
return true;
|
||||||
|
@ -226,7 +226,7 @@ public abstract class ContextualTerrainProvider implements TerrainProvider, List
|
|||||||
@EventHandler(priority = EventPriority.MONITOR)
|
@EventHandler(priority = EventPriority.MONITOR)
|
||||||
public void on(EntitySpawnEvent e)
|
public void on(EntitySpawnEvent e)
|
||||||
{
|
{
|
||||||
onSpawn(e);
|
J.a(() -> onSpawn(e));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract void onSpawn(EntitySpawnEvent e);
|
protected abstract void onSpawn(EntitySpawnEvent e);
|
||||||
@ -288,15 +288,14 @@ public abstract class ContextualTerrainProvider implements TerrainProvider, List
|
|||||||
{
|
{
|
||||||
if(getTarget().isWorld(e.getFrom().getWorld()) && !getTarget().isWorld(e.getTo().getWorld()))
|
if(getTarget().isWorld(e.getFrom().getWorld()) && !getTarget().isWorld(e.getTo().getWorld()))
|
||||||
{
|
{
|
||||||
tick();
|
J.a(() -> onPlayerLeft(e.getPlayer()));
|
||||||
onPlayerLeft(e.getPlayer());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!getTarget().isWorld(e.getFrom().getWorld()) && getTarget().isWorld(e.getTo().getWorld()))
|
if(!getTarget().isWorld(e.getFrom().getWorld()) && getTarget().isWorld(e.getTo().getWorld()))
|
||||||
{
|
{
|
||||||
tick();
|
J.a(() -> onPlayerJoin(e.getPlayer()));
|
||||||
onPlayerJoin(e.getPlayer());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR)
|
@EventHandler(priority = EventPriority.MONITOR)
|
||||||
@ -304,8 +303,7 @@ public abstract class ContextualTerrainProvider implements TerrainProvider, List
|
|||||||
{
|
{
|
||||||
if(getTarget().isWorld(e.getPlayer().getWorld()))
|
if(getTarget().isWorld(e.getPlayer().getWorld()))
|
||||||
{
|
{
|
||||||
tick();
|
J.a(() -> onPlayerLeft(e.getPlayer()));
|
||||||
onPlayerLeft(e.getPlayer());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -314,8 +312,7 @@ public abstract class ContextualTerrainProvider implements TerrainProvider, List
|
|||||||
{
|
{
|
||||||
if(getTarget().isWorld(e.getPlayer().getWorld()))
|
if(getTarget().isWorld(e.getPlayer().getWorld()))
|
||||||
{
|
{
|
||||||
tick();
|
J.a(() -> onPlayerJoin(e.getPlayer()));
|
||||||
onPlayerJoin(e.getPlayer());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -324,7 +321,6 @@ public abstract class ContextualTerrainProvider implements TerrainProvider, List
|
|||||||
{
|
{
|
||||||
if(getTarget().isWorld(e.getWorld()))
|
if(getTarget().isWorld(e.getWorld()))
|
||||||
{
|
{
|
||||||
tick();
|
|
||||||
onChunkLoaded(e.getChunk());
|
onChunkLoaded(e.getChunk());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -334,7 +330,6 @@ public abstract class ContextualTerrainProvider implements TerrainProvider, List
|
|||||||
{
|
{
|
||||||
if(getTarget().isWorld(e.getWorld()))
|
if(getTarget().isWorld(e.getWorld()))
|
||||||
{
|
{
|
||||||
tick();
|
|
||||||
onChunkUnloaded(e.getChunk());
|
onChunkUnloaded(e.getChunk());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -506,67 +506,75 @@ public class IrisTerrainProvider extends PostBlockTerrainProvider implements Iri
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if(isSpawnable())
|
if(!IrisSettings.get().isSystemEntitySpawnOverrides())
|
||||||
{
|
{
|
||||||
if(!IrisSettings.get().isSystemEntitySpawnOverrides())
|
return;
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
int x = e.getEntity().getLocation().getBlockX();
|
|
||||||
int y = e.getEntity().getLocation().getBlockY();
|
|
||||||
int z = e.getEntity().getLocation().getBlockZ();
|
|
||||||
IrisDimension dim = getDimension();
|
|
||||||
IrisRegion region = sampleRegion(x, z);
|
|
||||||
IrisBiome above = sampleTrueBiome(x, z);
|
|
||||||
IrisBiome below = sampleTrueBiome(x, y, z);
|
|
||||||
|
|
||||||
if(above.getLoadKey().equals(below.getLoadKey()))
|
|
||||||
{
|
|
||||||
below = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
IrisStructureResult res = getStructure(x, y, z);
|
|
||||||
|
|
||||||
if(res != null && res.getTile() != null)
|
|
||||||
{
|
|
||||||
if(trySpawn(res.getTile().getEntitySpawnOverrides(), e))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(res != null && res.getStructure() != null)
|
|
||||||
{
|
|
||||||
if(trySpawn(res.getStructure().getEntitySpawnOverrides(), e))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(below != null)
|
|
||||||
{
|
|
||||||
if(trySpawn(below.getEntitySpawnOverrides(), e))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(trySpawn(above.getEntitySpawnOverrides(), e))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(trySpawn(region.getEntitySpawnOverrides(), e))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(trySpawn(dim.getEntitySpawnOverrides(), e))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int x = e.getEntity().getLocation().getBlockX();
|
||||||
|
int y = e.getEntity().getLocation().getBlockY();
|
||||||
|
int z = e.getEntity().getLocation().getBlockZ();
|
||||||
|
|
||||||
|
J.a(() ->
|
||||||
|
{
|
||||||
|
if(isSpawnable())
|
||||||
|
{
|
||||||
|
|
||||||
|
IrisDimension dim = getDimension();
|
||||||
|
IrisRegion region = sampleRegion(x, z);
|
||||||
|
IrisBiome above = sampleTrueBiome(x, z);
|
||||||
|
IrisBiome bbelow = sampleTrueBiome(x, y, z);
|
||||||
|
IrisStructureResult res = getStructure(x, y, z);
|
||||||
|
if(above.getLoadKey().equals(bbelow.getLoadKey()))
|
||||||
|
{
|
||||||
|
bbelow = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
IrisBiome below = bbelow;
|
||||||
|
|
||||||
|
J.s(() ->
|
||||||
|
{
|
||||||
|
if(res != null && res.getTile() != null)
|
||||||
|
{
|
||||||
|
if(trySpawn(res.getTile().getEntitySpawnOverrides(), e))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(res != null && res.getStructure() != null)
|
||||||
|
{
|
||||||
|
if(trySpawn(res.getStructure().getEntitySpawnOverrides(), e))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(below != null)
|
||||||
|
{
|
||||||
|
if(trySpawn(below.getEntitySpawnOverrides(), e))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(trySpawn(above.getEntitySpawnOverrides(), e))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(trySpawn(region.getEntitySpawnOverrides(), e))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(trySpawn(dim.getEntitySpawnOverrides(), e))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
catch(Throwable xe)
|
catch(Throwable xe)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user