mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-12-30 04:29:05 +00:00
NV
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
package com.volmit.iris.command;
|
||||
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.gen.IrisChunkGenerator;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
|
||||
public class CommandIrisHotload extends MortarCommand {
|
||||
public CommandIrisHotload() {
|
||||
super("hotload", "hot", "h", "reload");
|
||||
setDescription("Force a hotload");
|
||||
requiresPermission(Iris.perm.studio);
|
||||
setCategory("World");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args) {
|
||||
if (sender.isPlayer()) {
|
||||
Player p = sender.player();
|
||||
World world = p.getWorld();
|
||||
|
||||
if (!(world.getGenerator() instanceof IrisChunkGenerator)) {
|
||||
sender.sendMessage("You must be in an iris world.");
|
||||
return true;
|
||||
}
|
||||
|
||||
IrisChunkGenerator g = (IrisChunkGenerator) world.getGenerator();
|
||||
g.onHotload();
|
||||
sender.sendMessage("Hotloaded!");
|
||||
return true;
|
||||
}
|
||||
|
||||
else {
|
||||
sender.sendMessage("Players only.");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getArgsUsage() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
55
src/main/java/com/volmit/iris/command/CommandIrisRetry.java
Normal file
55
src/main/java/com/volmit/iris/command/CommandIrisRetry.java
Normal file
@@ -0,0 +1,55 @@
|
||||
package com.volmit.iris.command;
|
||||
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.gen.IrisChunkGenerator;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
|
||||
public class CommandIrisRetry extends MortarCommand {
|
||||
public CommandIrisRetry() {
|
||||
super("retry", "again", "rt");
|
||||
setDescription("Retry generating in a failed state");
|
||||
requiresPermission(Iris.perm.studio);
|
||||
setCategory("World");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args) {
|
||||
if (sender.isPlayer()) {
|
||||
Player p = sender.player();
|
||||
World world = p.getWorld();
|
||||
|
||||
if (!(world.getGenerator() instanceof IrisChunkGenerator)) {
|
||||
sender.sendMessage("You must be in an iris world.");
|
||||
return true;
|
||||
}
|
||||
|
||||
IrisChunkGenerator g = (IrisChunkGenerator) world.getGenerator();
|
||||
|
||||
if (g.isFailing()) {
|
||||
sender.sendMessage("Retrying. If the server is unresponsive, you may need to restart the server.");
|
||||
g.retry();
|
||||
}
|
||||
|
||||
else {
|
||||
sender.sendMessage("This generator is not failing.");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
else {
|
||||
sender.sendMessage("Players only.");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getArgsUsage() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -16,9 +16,15 @@ public class CommandIrisWorld extends MortarCommand
|
||||
@Command
|
||||
private CommandIrisPregen pregen;
|
||||
|
||||
@Command
|
||||
private CommandIrisPregen world;
|
||||
|
||||
@Command
|
||||
private CommandIrisHotload hotload;
|
||||
|
||||
public CommandIrisWorld()
|
||||
{
|
||||
super("world", "wrld");
|
||||
super("world", "wrld", "w");
|
||||
setDescription("Commands while in an iris world.");
|
||||
requiresPermission(Iris.perm.studio);
|
||||
setCategory("World");
|
||||
|
||||
Reference in New Issue
Block a user