mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-12-29 20:19:06 +00:00
RT Sets
This commit is contained in:
@@ -52,6 +52,12 @@ public class IrisAxisRotationClamp
|
||||
@Desc("Iris spins the axis but not freely. For example an interval of 90 would mean 4 possible angles (right angles) degrees. \nSetting this to 0 means totally free rotation.\n\nNote that a lot of structures can have issues with non 90 degree intervals because the minecraft block resolution is so low.")
|
||||
private double interval = 0;
|
||||
|
||||
public void minMax(double fd)
|
||||
{
|
||||
min = fd;
|
||||
max = fd;
|
||||
}
|
||||
|
||||
public boolean isUnlimited()
|
||||
{
|
||||
return min == max && min == 0;
|
||||
|
||||
@@ -31,4 +31,16 @@ public class IrisJigsawPiece extends IrisRegistrant
|
||||
@ArrayType(type = IrisJigsawPieceConnector.class, min = 1)
|
||||
@Desc("The connectors this object contains")
|
||||
private KList<IrisJigsawPieceConnector> connectors = new KList<>();
|
||||
|
||||
public IrisJigsawPieceConnector getConnector(IrisPosition relativePosition) {
|
||||
for(IrisJigsawPieceConnector i : connectors)
|
||||
{
|
||||
if(i.getPosition().equals(relativePosition))
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.volmit.iris.object;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.manager.IrisDataManager;
|
||||
import com.volmit.iris.scaffold.cache.AtomicCache;
|
||||
import com.volmit.iris.util.AxisAlignedBB;
|
||||
import com.volmit.iris.util.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -33,6 +35,25 @@ public class IrisObject extends IrisRegistrant
|
||||
private transient BlockVector center;
|
||||
private transient volatile boolean smartBored = false;
|
||||
private transient IrisLock lock = new IrisLock("Preloadcache");
|
||||
private transient AtomicCache<AxisAlignedBB> aabb;
|
||||
|
||||
public AxisAlignedBB getAABB()
|
||||
{
|
||||
return aabb.aquire(() -> {
|
||||
int[] v = new int[]{0,0,0,0,0,0};
|
||||
for(BlockVector i : blocks.k())
|
||||
{
|
||||
v[0] = Math.min(v[0], i.getBlockX());
|
||||
v[1] = Math.min(v[1], i.getBlockY());
|
||||
v[2] = Math.min(v[2], i.getBlockZ());
|
||||
v[3] = Math.max(v[3], i.getBlockX());
|
||||
v[4] = Math.max(v[4], i.getBlockY());
|
||||
v[5] = Math.max(v[5], i.getBlockZ());
|
||||
}
|
||||
|
||||
return new AxisAlignedBB(new IrisPosition(v[0], v[1], v[2]), new IrisPosition(v[3], v[4], v[5]));
|
||||
});
|
||||
}
|
||||
|
||||
public void ensureSmartBored(boolean debug)
|
||||
{
|
||||
@@ -628,13 +649,14 @@ public class IrisObject extends IrisRegistrant
|
||||
return y;
|
||||
}
|
||||
|
||||
public IrisObject rotateCopy(IrisObjectRotation rt) {
|
||||
IrisObject copy = copy();
|
||||
copy.rotate(rt, 0, 0, 0);
|
||||
return copy;
|
||||
}
|
||||
|
||||
public void rotate(IrisObjectRotation r, int spinx, int spiny, int spinz)
|
||||
{
|
||||
if(shitty)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
KMap<BlockVector, BlockData> v = blocks.copy();
|
||||
blocks.clear();
|
||||
|
||||
@@ -646,11 +668,6 @@ public class IrisObject extends IrisRegistrant
|
||||
|
||||
public void place(Location at)
|
||||
{
|
||||
if(shitty)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for(BlockVector i : blocks.keySet())
|
||||
{
|
||||
at.clone().add(0, getCenter().getY(), 0).add(i).getBlock().setBlockData(blocks.get(i), false);
|
||||
@@ -659,11 +676,6 @@ public class IrisObject extends IrisRegistrant
|
||||
|
||||
public void placeCenterY(Location at)
|
||||
{
|
||||
if(shitty)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for(BlockVector i : blocks.keySet())
|
||||
{
|
||||
at.clone().add(getCenter().getX(), getCenter().getY(), getCenter().getZ()).add(i).getBlock().setBlockData(blocks.get(i), false);
|
||||
@@ -672,11 +684,6 @@ public class IrisObject extends IrisRegistrant
|
||||
|
||||
public void unplaceCenterY(Location at)
|
||||
{
|
||||
if(shitty)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for(BlockVector i : blocks.keySet())
|
||||
{
|
||||
at.clone().add(getCenter().getX(), getCenter().getY(), getCenter().getZ()).add(i).getBlock().setBlockData(Material.AIR.createBlockData(), false);
|
||||
|
||||
@@ -25,4 +25,8 @@ public class IrisPosition
|
||||
@DontObfuscate
|
||||
@Desc("The z position")
|
||||
private int z = 0;
|
||||
|
||||
public IrisPosition add(IrisPosition relativePosition) {
|
||||
return new IrisPosition(relativePosition.x+x, relativePosition.y+y, relativePosition.z + z);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user