mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
Settings & Schematic Fixes
This commit is contained in:
parent
11e74ef6cc
commit
4094034aaf
@ -12,7 +12,8 @@ public class Settings
|
||||
public PerformanceMode performanceMode = PerformanceMode.MATCH_CPU;
|
||||
public int threadCount = 1;
|
||||
public int threadPriority = Thread.MIN_PRIORITY;
|
||||
public boolean loadonstart = true;
|
||||
public boolean loadonstart = false;
|
||||
public boolean fastPlacement = false;
|
||||
}
|
||||
|
||||
public static class GeneratorSettings
|
||||
|
@ -217,7 +217,7 @@ public class IrisGenerator extends ParallelChunkGenerator
|
||||
mb = BEDROCK;
|
||||
}
|
||||
|
||||
if(Iris.settings.gen.flatBedrock ? i == 1 : i < glBase.scatterInt(x, i, z, 3))
|
||||
if(!Iris.settings.gen.flatBedrock ? i <= 2 : i < glBase.scatterInt(x, i, z, 3))
|
||||
{
|
||||
mb = BEDROCK;
|
||||
}
|
||||
|
@ -7,11 +7,16 @@ import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.material.Button;
|
||||
import org.bukkit.material.Directional;
|
||||
import org.bukkit.material.MaterialData;
|
||||
import org.bukkit.util.BlockVector;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
@ -230,8 +235,16 @@ public class Schematic
|
||||
{
|
||||
for(Location j : undo.k())
|
||||
{
|
||||
Catalyst12.setBlock(source, j.getBlockX(), j.getBlockY(), j.getBlockZ(), undo.get(j));
|
||||
Iris.refresh.add(j.getChunk());
|
||||
if(Iris.settings.performance.fastPlacement)
|
||||
{
|
||||
Catalyst12.setBlock(source, j.getBlockX(), j.getBlockY(), j.getBlockZ(), undo.get(j));
|
||||
Iris.refresh.add(j.getChunk());
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
source.getBlockAt(j.getBlockX(), j.getBlockY(), j.getBlockZ()).setTypeIdAndData(undo.get(j).material.getId(), undo.get(j).data, false);
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
@ -244,9 +257,17 @@ public class Schematic
|
||||
|
||||
try
|
||||
{
|
||||
Iris.refresh.add(f.getChunk());
|
||||
undo.put(f, MB.of(f.getBlock().getType(), f.getBlock().getData()));
|
||||
Catalyst12.setBlock(source, f.getBlockX(), f.getBlockY(), f.getBlockZ(), b);
|
||||
if(Iris.settings.performance.fastPlacement)
|
||||
{
|
||||
Iris.refresh.add(f.getChunk());
|
||||
Catalyst12.setBlock(source, f.getBlockX(), f.getBlockY(), f.getBlockZ(), b);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
source.getBlockAt(f.getBlockX(), f.getBlockY(), f.getBlockZ()).setTypeIdAndData(b.material.getId(), b.data, false);
|
||||
}
|
||||
}
|
||||
|
||||
catch(Throwable e)
|
||||
@ -288,12 +309,46 @@ public class Schematic
|
||||
|
||||
for(BlockVector i : g.k())
|
||||
{
|
||||
s.put(VectorMath.rotate(from, to, i).toBlockVector(), g.get(i));
|
||||
MB mb = rotate(from, to, g.get(i));
|
||||
s.put(VectorMath.rotate(from, to, i).toBlockVector(), mb);
|
||||
}
|
||||
|
||||
name = name + "-rt" + to.name();
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private MB rotate(Direction from, Direction to, MB mb)
|
||||
{
|
||||
Class<? extends MaterialData> cl = mb.material.getData();
|
||||
|
||||
if(cl.isAssignableFrom(Directional.class))
|
||||
{
|
||||
try
|
||||
{
|
||||
Directional d = (Directional) cl.getConstructor(int.class, byte.class).newInstance(mb.material.getId(), mb.data);
|
||||
BlockFace f = d.getFacing();
|
||||
Vector mod = new Vector(f.getModX(), f.getModY(), f.getModZ());
|
||||
Vector modded = VectorMath.rotate(from, to, mod);
|
||||
|
||||
for(BlockFace i : BlockFace.values())
|
||||
{
|
||||
if(i.getModX() == modded.getBlockX() && i.getModY() == modded.getBlockY() && i.getModZ() == modded.getBlockZ())
|
||||
{
|
||||
d.setFacingDirection(i);
|
||||
return new MB(mb.material, ((MaterialData) d).getData());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
catch(Throwable e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
return mb;
|
||||
}
|
||||
|
||||
public void computeFlag(String j)
|
||||
{
|
||||
try
|
||||
|
@ -143,7 +143,6 @@ public class SchematicGroup
|
||||
|
||||
gg.execute();
|
||||
gg = Iris.buildPool.startWork();
|
||||
|
||||
getSchematics().add(inject);
|
||||
L.v("# Generated " + inject.size() + " Rotated Objects to " + getName());
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user