mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-12-27 19:19:07 +00:00
Support Object scaling
This commit is contained in:
@@ -2,6 +2,7 @@ package com.volmit.iris.util;
|
||||
|
||||
import com.volmit.iris.object.IrisPosition;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.util.BlockVector;
|
||||
|
||||
public class AxisAlignedBB
|
||||
{
|
||||
@@ -62,11 +63,22 @@ public class AxisAlignedBB
|
||||
return new IrisPosition((int)xb, (int)yb, (int)zb);
|
||||
}
|
||||
|
||||
|
||||
public BlockVector maxbv()
|
||||
{
|
||||
return new BlockVector((int)xb, (int)yb, (int)zb);
|
||||
}
|
||||
|
||||
public IrisPosition min()
|
||||
{
|
||||
return new IrisPosition((int)xa, (int)ya, (int)za);
|
||||
}
|
||||
|
||||
public BlockVector minbv()
|
||||
{
|
||||
return new BlockVector((int)xa, (int)ya, (int)za);
|
||||
}
|
||||
|
||||
public Cuboid toCuboid(World world) {
|
||||
return new Cuboid(min().toLocation(world), max().toLocation(world));
|
||||
}
|
||||
|
||||
@@ -703,6 +703,21 @@ public class KList<T> extends ArrayList<T> implements List<T>
|
||||
return get(M.irand(0, last()));
|
||||
}
|
||||
|
||||
public T getRandom(RNG rng)
|
||||
{
|
||||
if(isEmpty())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if(size() == 1)
|
||||
{
|
||||
return get(0);
|
||||
}
|
||||
|
||||
return get(rng.i(0, last()));
|
||||
}
|
||||
|
||||
public KList<T> qdel(T t)
|
||||
{
|
||||
remove(t);
|
||||
|
||||
Reference in New Issue
Block a user