mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-04-24 00:47:31 +00:00
Fixes
This commit is contained in:
14
src/main/java/ninja/bytecode/iris/CommandIris.java
Normal file
14
src/main/java/ninja/bytecode/iris/CommandIris.java
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
package ninja.bytecode.iris;
|
||||||
|
|
||||||
|
import org.bukkit.command.Command;
|
||||||
|
import org.bukkit.command.CommandExecutor;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
|
public class CommandIris implements CommandExecutor
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public boolean onCommand(CommandSender sender, Command command, String label, String[] args)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -317,8 +317,6 @@ public class IrisGenerator extends ParallelChunkGenerator
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
g.generateRotationVariants();
|
|
||||||
|
|
||||||
schematicCache.put(folder, g);
|
schematicCache.put(folder, g);
|
||||||
return g;
|
return g;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,9 +15,7 @@ import org.bukkit.World;
|
|||||||
import org.bukkit.util.BlockVector;
|
import org.bukkit.util.BlockVector;
|
||||||
|
|
||||||
import ninja.bytecode.iris.util.Catalyst12;
|
import ninja.bytecode.iris.util.Catalyst12;
|
||||||
import ninja.bytecode.iris.util.Direction;
|
|
||||||
import ninja.bytecode.iris.util.MB;
|
import ninja.bytecode.iris.util.MB;
|
||||||
import ninja.bytecode.iris.util.VectorMath;
|
|
||||||
import ninja.bytecode.shuriken.collections.GMap;
|
import ninja.bytecode.shuriken.collections.GMap;
|
||||||
import ninja.bytecode.shuriken.io.CustomOutputStream;
|
import ninja.bytecode.shuriken.io.CustomOutputStream;
|
||||||
import ninja.bytecode.shuriken.logging.L;
|
import ninja.bytecode.shuriken.logging.L;
|
||||||
@@ -105,7 +103,6 @@ public class Schematic
|
|||||||
}
|
}
|
||||||
|
|
||||||
din.close();
|
din.close();
|
||||||
center();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
@@ -207,49 +204,4 @@ public class Schematic
|
|||||||
L.i("Loaded Schematic: " + f.getPath() + " Size: " + s.getSchematic().size());
|
L.i("Loaded Schematic: " + f.getPath() + " Size: " + s.getSchematic().size());
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void center()
|
|
||||||
{
|
|
||||||
GMap<BlockVector, MB> sf = getSchematic().copy();
|
|
||||||
BlockVector max = new BlockVector(-w, -h, -d);
|
|
||||||
BlockVector min = new BlockVector(w, h, d);
|
|
||||||
clear();
|
|
||||||
|
|
||||||
for(BlockVector i : sf.k())
|
|
||||||
{
|
|
||||||
if(i.getX() <= min.getX() && i.getZ() <= min.getZ() && i.getY() <= min.getY())
|
|
||||||
{
|
|
||||||
min = i;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(i.getX() >= max.getX() && i.getZ() >= max.getZ() && i.getY() >= max.getY())
|
|
||||||
{
|
|
||||||
max = i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
BlockVector center = min.clone().add(max.clone().multiply(0.5D)).toBlockVector();
|
|
||||||
center.setY(0);
|
|
||||||
|
|
||||||
for(BlockVector i : sf.k())
|
|
||||||
{
|
|
||||||
getSchematic().put(i.clone().subtract(center).toBlockVector(), sf.get(i));
|
|
||||||
}
|
|
||||||
|
|
||||||
x = 0;
|
|
||||||
y = 0;
|
|
||||||
z = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void rotate(Direction from, Direction to)
|
|
||||||
{
|
|
||||||
GMap<BlockVector, MB> sf = getSchematic().copy();
|
|
||||||
clear();
|
|
||||||
|
|
||||||
for(BlockVector i : sf.k())
|
|
||||||
{
|
|
||||||
getSchematic().put(VectorMath.rotate(from, to, i).toBlockVector(), sf.get(i));
|
|
||||||
}
|
|
||||||
center();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package ninja.bytecode.iris.schematic;
|
package ninja.bytecode.iris.schematic;
|
||||||
|
|
||||||
import ninja.bytecode.iris.util.Direction;
|
|
||||||
import ninja.bytecode.shuriken.collections.GList;
|
import ninja.bytecode.shuriken.collections.GList;
|
||||||
|
|
||||||
public class SchematicGroup
|
public class SchematicGroup
|
||||||
@@ -62,28 +61,4 @@ public class SchematicGroup
|
|||||||
{
|
{
|
||||||
return getSchematics().size();
|
return getSchematics().size();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void generateRotationVariants()
|
|
||||||
{
|
|
||||||
if(flags.contains("rotation=none"))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
GList<Schematic> variants = new GList<>();
|
|
||||||
GList<Direction> directions = flags.contains("rotation=all") ? Direction.udnews() : Direction.news();
|
|
||||||
directions.remove(Direction.N);
|
|
||||||
|
|
||||||
for(Schematic i : getSchematics())
|
|
||||||
{
|
|
||||||
for(Direction j : directions)
|
|
||||||
{
|
|
||||||
Schematic rotated = i.copy();
|
|
||||||
rotated.rotate(Direction.N, j);
|
|
||||||
variants.add(rotated);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
getSchematics().add(variants);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user