mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-11 10:16:15 +00:00
Finalize commands, add to GUI
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
package com.dfsek.terra.command.image.gui;
|
||||
|
||||
import com.dfsek.terra.command.WorldCommand;
|
||||
import com.dfsek.terra.config.ConfigUtil;
|
||||
import com.dfsek.terra.config.WorldConfig;
|
||||
import com.dfsek.terra.image.ImageLoader;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -13,7 +15,13 @@ import java.util.List;
|
||||
public class RawGUICommand extends WorldCommand {
|
||||
@Override
|
||||
public boolean onCommand(@NotNull Player sender, @NotNull Command command, @NotNull String label, @NotNull String[] args, World world) {
|
||||
WorldConfig.fromWorld(world).imageLoader.debug(false, sender.getWorld());
|
||||
if(! ConfigUtil.debug) {
|
||||
sender.sendMessage("Debug mode must be enabled to use the debug GUI! The debug GUI is NOT PRODUCTION SAFE!");
|
||||
return true;
|
||||
}
|
||||
ImageLoader loader = WorldConfig.fromWorld(world).imageLoader;
|
||||
if(loader != null) loader.debug(false, sender.getWorld());
|
||||
else ImageLoader.debugWorld(false, world);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.dfsek.terra.command.image.gui;
|
||||
|
||||
import com.dfsek.terra.command.WorldCommand;
|
||||
import com.dfsek.terra.config.ConfigUtil;
|
||||
import com.dfsek.terra.config.WorldConfig;
|
||||
import com.dfsek.terra.image.ImageLoader;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -13,7 +15,13 @@ import java.util.List;
|
||||
public class StepGUICommand extends WorldCommand {
|
||||
@Override
|
||||
public boolean onCommand(@NotNull Player sender, @NotNull Command command, @NotNull String label, @NotNull String[] args, World world) {
|
||||
WorldConfig.fromWorld(world).imageLoader.debug(true, sender.getWorld());
|
||||
if(! ConfigUtil.debug) {
|
||||
sender.sendMessage("Debug mode must be enabled to use the debug GUI! The debug GUI is NOT PRODUCTION SAFE!");
|
||||
return true;
|
||||
}
|
||||
ImageLoader loader = WorldConfig.fromWorld(world).imageLoader;
|
||||
if(loader != null) loader.debug(true, sender.getWorld());
|
||||
else ImageLoader.debugWorld(true, world);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user