mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-12-29 12:09:07 +00:00
Goto Object
This commit is contained in:
@@ -121,6 +121,7 @@ public class IrisBoardManager implements BoardProvider, Listener
|
||||
v.add(C.AQUA + "Region" + C.GRAY + ": " + engine.getRegion(x, z).getName());
|
||||
v.add(C.AQUA + "Biome" + C.GRAY + ": " + engine.getBiome(x, y, z).getName());
|
||||
v.add(C.AQUA + "Height" + C.GRAY + ": " + Math.round(engine.getHeight(x, z)));
|
||||
v.add(C.AQUA + "Slope" + C.GRAY + ": " + Form.f(engine.getFramework().getComplex().getSlopeStream().get(x, z), 2));
|
||||
}
|
||||
|
||||
if(Iris.jobCount() > 0)
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
package com.volmit.iris.manager;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.Iterator;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.manager.edit.DustRevealer;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.Sound;
|
||||
import com.volmit.iris.object.IrisObject;
|
||||
import com.volmit.iris.util.*;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -23,12 +19,8 @@ import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.bukkit.util.BlockVector;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.object.IrisObject;
|
||||
import com.volmit.iris.util.C;
|
||||
import com.volmit.iris.util.Cuboid;
|
||||
import com.volmit.iris.util.KList;
|
||||
import com.volmit.iris.util.M;
|
||||
import java.awt.Color;
|
||||
import java.util.Iterator;
|
||||
|
||||
public class WandManager implements Listener
|
||||
{
|
||||
@@ -182,7 +174,8 @@ public class WandManager implements Listener
|
||||
{
|
||||
e.setCancelled(true);
|
||||
e.getPlayer().playSound(e.getClickedBlock().getLocation(), Sound.ENTITY_ENDER_EYE_DEATH, 2f, 1.97f);
|
||||
DustRevealer.spawn(e.getClickedBlock());
|
||||
DustRevealer.spawn(e.getClickedBlock(), new MortarSender(e.getPlayer(), Iris.instance.getTag()));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.volmit.iris.manager.command;
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.manager.IrisDataManager;
|
||||
import com.volmit.iris.object.IrisBiome;
|
||||
import com.volmit.iris.object.IrisObject;
|
||||
import com.volmit.iris.object.IrisRegion;
|
||||
import com.volmit.iris.scaffold.IrisWorlds;
|
||||
import com.volmit.iris.scaffold.engine.IrisAccess;
|
||||
@@ -16,7 +17,7 @@ public class CommandIrisStudioGoto extends MortarCommand
|
||||
public CommandIrisStudioGoto()
|
||||
{
|
||||
super("goto", "find", "g", "tp");
|
||||
setDescription("Find any biome or a biome border");
|
||||
setDescription("Find any region, biome or placed object");
|
||||
requiresPermission(Iris.perm.studio);
|
||||
setCategory("World");
|
||||
}
|
||||
@@ -26,6 +27,8 @@ public class CommandIrisStudioGoto extends MortarCommand
|
||||
if(args.length == 0 && sender.isPlayer() && IrisWorlds.isIrisWorld(sender.player().getWorld()))
|
||||
{
|
||||
list.add(IrisWorlds.access(sender.player().getWorld()).getData().getBiomeLoader().getPossibleKeys());
|
||||
list.add(IrisWorlds.access(sender.player().getWorld()).getData().getRegionLoader().getPossibleKeys());
|
||||
list.add(IrisWorlds.access(sender.player().getWorld()).getData().getObjectLoader().getPossibleKeys());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,6 +57,7 @@ public class CommandIrisStudioGoto extends MortarCommand
|
||||
IrisAccess g = IrisWorlds.access(world);
|
||||
IrisBiome b = IrisDataManager.loadAnyBiome(args[0]);
|
||||
IrisRegion r = IrisDataManager.loadAnyRegion(args[0]);
|
||||
IrisObject o = IrisDataManager.loadAnyObject(args[0]);
|
||||
|
||||
if(b != null)
|
||||
{
|
||||
@@ -91,9 +95,27 @@ public class CommandIrisStudioGoto extends MortarCommand
|
||||
});
|
||||
}
|
||||
|
||||
else if(o != null)
|
||||
{
|
||||
J.a(() -> {
|
||||
Location l = g.lookForObject(o, 60000, (v) -> sender.sendMessage(C.BOLD +""+ C.WHITE + o.getLoadKey() + C.RESET + C.GRAY + ": Checked " + Form.f(v) + " Objects"));
|
||||
|
||||
if(l == null)
|
||||
{
|
||||
sender.sendMessage("Couldn't find " + o.getLoadKey() + ".");
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
sender.sendMessage("Found " + o.getLoadKey() + "!");
|
||||
J.s(() -> sender.player().teleport(l));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
sender.sendMessage(args[0] + " is not a biome or region in this dimension.");
|
||||
sender.sendMessage(args[0] + " is not a biome,region or object in this dimension.");
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
package com.volmit.iris.manager.edit;
|
||||
|
||||
import com.volmit.iris.util.BlockPosition;
|
||||
import com.volmit.iris.util.J;
|
||||
import com.volmit.iris.util.KList;
|
||||
import com.volmit.iris.util.RNG;
|
||||
import com.volmit.iris.util.*;
|
||||
import com.volmit.iris.scaffold.engine.EngineCompositeGenerator;
|
||||
import com.volmit.iris.scaffold.parallax.ParallaxAccess;
|
||||
import lombok.Data;
|
||||
@@ -18,7 +15,7 @@ public class DustRevealer {
|
||||
private final String key;
|
||||
private final KList<BlockPosition> hits;
|
||||
|
||||
public static void spawn(Block block)
|
||||
public static void spawn(Block block, MortarSender sender)
|
||||
{
|
||||
World world = block.getWorld();
|
||||
|
||||
@@ -28,6 +25,7 @@ public class DustRevealer {
|
||||
|
||||
if(a.getObject(block.getX(), block.getY(), block.getZ()) != null)
|
||||
{
|
||||
sender.sendMessage("Found object " + a.getObject(block.getX(), block.getY(), block.getZ()));
|
||||
J.a(() -> {
|
||||
new DustRevealer(a, world, new BlockPosition(block.getX(), block.getY(), block.getZ()), a.getObject(block.getX(), block.getY(), block.getZ()), new KList<>());
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user