mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
fff
This commit is contained in:
parent
0dbff85bd8
commit
657f581a3d
@ -97,10 +97,10 @@ public class IrisEngine extends BlockPopulator implements Engine
|
||||
MultiBurst.burst.burst(
|
||||
() -> getFramework().getDecorantActuator().actuate(x, z, blocks),
|
||||
() -> getFramework().getDepositModifier().modify(x, z, blocks),
|
||||
() -> getFramework().getPostModifier().modify(x, z, blocks),
|
||||
() -> getFramework().getEngineParallax().insertParallax(x, z, blocks)
|
||||
() -> getFramework().getPostModifier().modify(x, z, blocks)
|
||||
);
|
||||
|
||||
getFramework().getEngineParallax().insertParallax(x, z, blocks);
|
||||
getFramework().recycle();
|
||||
}
|
||||
catch(Throwable e)
|
||||
|
@ -44,9 +44,6 @@ public class CommandIris extends MortarCommand
|
||||
@Command
|
||||
private CommandIrisIDM idm;
|
||||
|
||||
@Command
|
||||
private CommandIrisRegen regen;
|
||||
|
||||
@Command
|
||||
private CommandIrisPregen pregen;
|
||||
|
||||
|
@ -1,84 +0,0 @@
|
||||
package com.volmit.iris.manager.command;
|
||||
|
||||
import com.volmit.iris.util.KList;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.scaffold.IrisWorlds;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
import com.volmit.iris.util.Spiraler;
|
||||
|
||||
public class CommandIrisRegen extends MortarCommand
|
||||
{
|
||||
public CommandIrisRegen()
|
||||
{
|
||||
super("regenerate", "regen", "rg");
|
||||
setDescription("Regenerate chunks");
|
||||
requiresPermission(Iris.perm.studio);
|
||||
setCategory("Regen");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
list.add("3");
|
||||
list.add("7");
|
||||
list.add("9");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
if(sender.isPlayer())
|
||||
{
|
||||
Player p = sender.player();
|
||||
World world = p.getWorld();
|
||||
if(!IrisWorlds.isIrisWorld(world))
|
||||
{
|
||||
sender.sendMessage("You must be in an iris world.");
|
||||
return true;
|
||||
}
|
||||
|
||||
if(IrisWorlds.access(world).isFailing())
|
||||
{
|
||||
sender.sendMessage("This world is in a failed state! Cannot Regenerate!");
|
||||
return true;
|
||||
}
|
||||
|
||||
if(args.length == 0)
|
||||
{
|
||||
sender.sendMessage("Regenerating your chunk");
|
||||
IrisWorlds.access(world).clearRegeneratedLists(p.getLocation().getChunk().getX(), p.getLocation().getChunk().getZ());
|
||||
IrisWorlds.access(world).regenerate(p.getLocation().getChunk().getX(), p.getLocation().getChunk().getZ());
|
||||
return true;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
int m = Integer.valueOf(args[0]);
|
||||
sender.sendMessage("Regenerating " + (m * m) + " Chunks Surrounding you");
|
||||
new Spiraler(m, m, (a, b) -> IrisWorlds.access(world).clearRegeneratedLists(a + p.getLocation().getChunk().getX(), b + p.getLocation().getChunk().getZ())).drain();
|
||||
new Spiraler(m, m, (a, b) -> IrisWorlds.access(world).regenerate(a + p.getLocation().getChunk().getX(), b + p.getLocation().getChunk().getZ())).drain();
|
||||
}
|
||||
catch(Throwable e)
|
||||
{
|
||||
sender.sendMessage("/iris regen [SIZE]");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
sender.sendMessage("Players only.");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getArgsUsage()
|
||||
{
|
||||
return "/iris regen [size]";
|
||||
}
|
||||
}
|
@ -1,24 +1,19 @@
|
||||
package com.volmit.iris.object;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Axis;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.block.data.Directional;
|
||||
import org.bukkit.block.data.MultipleFacing;
|
||||
import org.bukkit.block.data.Orientable;
|
||||
import org.bukkit.block.data.Rotatable;
|
||||
import org.bukkit.util.BlockVector;
|
||||
|
||||
import com.volmit.iris.util.Desc;
|
||||
import com.volmit.iris.util.DontObfuscate;
|
||||
import com.volmit.iris.util.KList;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.bukkit.Axis;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.block.data.*;
|
||||
import org.bukkit.util.BlockVector;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
@ -143,7 +138,7 @@ public class IrisObjectRotation
|
||||
return Axis.Y;
|
||||
}
|
||||
|
||||
return Axis.X;
|
||||
return Axis.Y;
|
||||
}
|
||||
|
||||
public Axis axisFor2D(BlockFace f)
|
||||
@ -160,7 +155,7 @@ public class IrisObjectRotation
|
||||
return Axis.X;
|
||||
}
|
||||
|
||||
return Axis.X;
|
||||
return Axis.Z;
|
||||
}
|
||||
|
||||
public BlockData rotate(BlockData dd, int spinxx, int spinyy, int spinzz)
|
||||
@ -194,17 +189,6 @@ public class IrisObjectRotation
|
||||
}
|
||||
}
|
||||
|
||||
else if(d instanceof Orientable)
|
||||
{
|
||||
Orientable g = ((Orientable) d);
|
||||
BlockFace f = faceForAxis(g.getAxis());
|
||||
BlockVector bv = new BlockVector(f.getModX(), f.getModY(), f.getModZ());
|
||||
bv = rotate(bv.clone(), spinx, spiny, spinz);
|
||||
BlockFace t = getFace(bv);
|
||||
Axis a = !((Orientable) d).getAxes().contains(Axis.Y) ? axisFor(t) : axisFor2D(t);
|
||||
((Orientable) d).setAxis(a);
|
||||
}
|
||||
|
||||
else if(d instanceof Rotatable)
|
||||
{
|
||||
Rotatable g = ((Rotatable) d);
|
||||
@ -243,6 +227,18 @@ public class IrisObjectRotation
|
||||
}
|
||||
}
|
||||
|
||||
else if(d.getMaterial().equals(Material.NETHER_PORTAL) && d instanceof Orientable)
|
||||
{
|
||||
//TODO: Fucks up logs
|
||||
Orientable g = ((Orientable) d);
|
||||
BlockFace f = faceForAxis(g.getAxis());
|
||||
BlockVector bv = new BlockVector(f.getModX(), f.getModY(), f.getModZ());
|
||||
bv = rotate(bv.clone(), spinx, spiny, spinz);
|
||||
BlockFace t = getFace(bv);
|
||||
Axis a = !g.getAxes().contains(Axis.Y) ? axisFor(t) : axisFor2D(t);
|
||||
((Orientable) d).setAxis(a);
|
||||
}
|
||||
|
||||
return d;
|
||||
}
|
||||
|
||||
|
@ -396,7 +396,8 @@ public class B
|
||||
}
|
||||
}
|
||||
|
||||
if(onto.equals(Material.ACACIA_LEAVES) || onto.equals(Material.BIRCH_LEAVES)
|
||||
if(onto.equals(Material.ACACIA_LEAVES)
|
||||
|| onto.equals(Material.BIRCH_LEAVES)
|
||||
|| onto.equals(Material.DARK_OAK_LEAVES)
|
||||
|| onto.equals(Material.JUNGLE_LEAVES)
|
||||
|| onto.equals(Material.OAK_LEAVES)
|
||||
@ -491,7 +492,10 @@ public class B
|
||||
|
||||
public static boolean isFoliagePlantable(BlockData d)
|
||||
{
|
||||
return d.getMaterial().equals(Material.GRASS_BLOCK) || d.getMaterial().equals(Material.DIRT) || d.getMaterial().equals(Material.COARSE_DIRT) || d.getMaterial().equals(Material.PODZOL);
|
||||
return d.getMaterial().equals(Material.GRASS_BLOCK)
|
||||
|| d.getMaterial().equals(Material.DIRT)
|
||||
|| d.getMaterial().equals(Material.COARSE_DIRT)
|
||||
|| d.getMaterial().equals(Material.PODZOL);
|
||||
}
|
||||
|
||||
public static boolean isFluid(BlockData d)
|
||||
|
Loading…
x
Reference in New Issue
Block a user