mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
Fix goto issues
This commit is contained in:
parent
27be0ad808
commit
7269233134
@ -40,8 +40,6 @@ import java.util.List;
|
|||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
|
|
||||||
public class CommandIrisStudioGoto extends MortarCommand {
|
public class CommandIrisStudioGoto extends MortarCommand {
|
||||||
private static final AtomicBoolean looking = new AtomicBoolean(false);
|
|
||||||
|
|
||||||
public CommandIrisStudioGoto() {
|
public CommandIrisStudioGoto() {
|
||||||
super("goto", "find", "g");
|
super("goto", "find", "g");
|
||||||
setDescription("Find any region or biome");
|
setDescription("Find any region or biome");
|
||||||
@ -74,10 +72,6 @@ public class CommandIrisStudioGoto extends MortarCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (sender.isPlayer()) {
|
if (sender.isPlayer()) {
|
||||||
if (looking.get()) {
|
|
||||||
sender.sendMessage("A Search is already running, please wait!");
|
|
||||||
}
|
|
||||||
|
|
||||||
Player p = sender.player();
|
Player p = sender.player();
|
||||||
World world = p.getWorld();
|
World world = p.getWorld();
|
||||||
|
|
||||||
@ -90,12 +84,10 @@ public class CommandIrisStudioGoto extends MortarCommand {
|
|||||||
IrisBiome b = IrisDataManager.loadAnyBiome(args[0]);
|
IrisBiome b = IrisDataManager.loadAnyBiome(args[0]);
|
||||||
IrisRegion r = IrisDataManager.loadAnyRegion(args[0]);
|
IrisRegion r = IrisDataManager.loadAnyRegion(args[0]);
|
||||||
|
|
||||||
looking.set(true);
|
|
||||||
if (b != null) {
|
if (b != null) {
|
||||||
J.a(() -> {
|
J.a(() -> {
|
||||||
Location l = g.lookForBiome(b, 10000, (v) -> sender.sendMessage("Looking for " + C.BOLD + C.WHITE + b.getName() + C.RESET + C.GRAY + ": Checked " + Form.f(v) + " Places"));
|
Location l = g.lookForBiome(b, 10000, (v) -> sender.sendMessage("Looking for " + C.BOLD + C.WHITE + b.getName() + C.RESET + C.GRAY + ": Checked " + Form.f(v) + " Places"));
|
||||||
|
|
||||||
looking.set(false);
|
|
||||||
if (l == null) {
|
if (l == null) {
|
||||||
sender.sendMessage("Couldn't find " + b.getName() + ".");
|
sender.sendMessage("Couldn't find " + b.getName() + ".");
|
||||||
} else {
|
} else {
|
||||||
@ -107,7 +99,6 @@ public class CommandIrisStudioGoto extends MortarCommand {
|
|||||||
J.a(() -> {
|
J.a(() -> {
|
||||||
Location l = g.lookForRegion(r, 60000, (v) -> sender.sendMessage(C.BOLD + "" + C.WHITE + r.getName() + C.RESET + C.GRAY + ": Checked " + Form.f(v) + " Places"));
|
Location l = g.lookForRegion(r, 60000, (v) -> sender.sendMessage(C.BOLD + "" + C.WHITE + r.getName() + C.RESET + C.GRAY + ": Checked " + Form.f(v) + " Places"));
|
||||||
|
|
||||||
looking.set(false);
|
|
||||||
if (l == null) {
|
if (l == null) {
|
||||||
sender.sendMessage("Couldn't find " + r.getName() + ".");
|
sender.sendMessage("Couldn't find " + r.getName() + ".");
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user