mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-06 04:46:40 +00:00
fix compile
This commit is contained in:
@ -22,6 +22,7 @@ package com.sk89q.worldedit.command;
|
||||
import com.boydti.fawe.Fawe;
|
||||
import com.boydti.fawe.FaweAPI;
|
||||
import com.boydti.fawe.config.BBC;
|
||||
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
|
||||
import com.boydti.fawe.config.Settings;
|
||||
import com.boydti.fawe.database.DBHandler;
|
||||
import com.boydti.fawe.database.RollbackDatabase;
|
||||
@ -88,13 +89,13 @@ public class HistoryCommands {
|
||||
@CommandPermissions("worldedit.history.rollback")
|
||||
public void faweRollback(Player player, LocalSession session, @Arg(desc = "String user") String user, @Arg(def = "0", desc = "radius") @Range(from = 0, to=Integer.MAX_VALUE) int radius, @Arg(name = "time", desc = "String", def = "0") String time, @Switch(name = 'r', desc = "TODO") boolean restore) throws WorldEditException {
|
||||
if (!Settings.IMP.HISTORY.USE_DATABASE) {
|
||||
BBC.SETTING_DISABLE.send(player, "history.use-database (Import with /frb #import )");
|
||||
player.print(TranslatableComponent.of("fawe.error.setting.disable" , "history.use-database (Import with /frb #import )"));
|
||||
return;
|
||||
}
|
||||
if (user.charAt(0) == '#') {
|
||||
if (user.equals("#import")) {
|
||||
if (!player.hasPermission("fawe.rollback.import")) {
|
||||
BBC.NO_PERM.send(player, "fawe.rollback.import");
|
||||
player.print(TranslatableComponent.of("fawe.error.no.perm", "fawe.rollback.import"));
|
||||
return;
|
||||
}
|
||||
File folder = MainUtil.getFile(Fawe.imp().getDirectory(), Settings.IMP.PATHS.HISTORY);
|
||||
@ -147,7 +148,7 @@ public class HistoryCommands {
|
||||
}
|
||||
String toParse = user.substring(1);
|
||||
if (!MathMan.isInteger(toParse)) {
|
||||
BBC.COMMAND_SYNTAX.send(player, "/frb #<index>");
|
||||
player.print(TranslatableComponent.of("fawe.error.command.syntax" , "/frb #<index>"));
|
||||
return;
|
||||
}
|
||||
int index = Integer.parseInt(toParse);
|
||||
@ -157,24 +158,24 @@ public class HistoryCommands {
|
||||
if (file.getBDFile().exists()) {
|
||||
if (restore) file.redo(player);
|
||||
else file.undo(player);
|
||||
BBC.ROLLBACK_ELEMENT.send(player, world.getName() + "/" + user + "-" + index);
|
||||
player.print(TranslatableComponent.of("fawe.worldedit.rollback.rollback.element" , world.getName() + "/" + user + "-" + index));
|
||||
} else {
|
||||
BBC.TOOL_INSPECT_INFO_FOOTER.send(player, 0);
|
||||
player.print(TranslatableComponent.of("fawe.worldedit.tool.tool.inspect.info.footer" , 0));
|
||||
}
|
||||
return;
|
||||
}
|
||||
UUID other = Fawe.imp().getUUID(user);
|
||||
if (other == null) {
|
||||
BBC.PLAYER_NOT_FOUND.send(player, user);
|
||||
player.print(TranslatableComponent.of("fawe.error.player.not.found" , user));
|
||||
return;
|
||||
}
|
||||
if (radius == 0) {
|
||||
BBC.COMMAND_SYNTAX.send(player, "/frb " + user + " <radius> <time>");
|
||||
player.print(TranslatableComponent.of("fawe.error.command.syntax" , "/frb " + user + " <radius> <time>"));
|
||||
return;
|
||||
}
|
||||
long timeDiff = MainUtil.timeToSec(time) * 1000;
|
||||
if (timeDiff == 0) {
|
||||
BBC.COMMAND_SYNTAX.send(player, "/frb " + user + " " + radius + " <time>");
|
||||
player.print(TranslatableComponent.of("fawe.error.command.syntax" , "/frb " + user + " " + radius + " <time>"));
|
||||
return;
|
||||
}
|
||||
radius = Math.max(Math.min(500, radius), 0);
|
||||
@ -189,7 +190,7 @@ public class HistoryCommands {
|
||||
|
||||
Region[] allowedRegions = player.getCurrentRegions(FaweMaskManager.MaskType.OWNER);
|
||||
if (allowedRegions == null) {
|
||||
player.printError(BBC.NO_REGION.s());
|
||||
player.printError(TranslatableComponent.of("fawe.error.no.region"));
|
||||
return;
|
||||
}
|
||||
// TODO mask the regions bot / top to the bottom and top coord in the allowedRegions
|
||||
@ -203,10 +204,10 @@ public class HistoryCommands {
|
||||
@Override
|
||||
public void run(DiskStorageHistory edit) {
|
||||
edit.undo(player, allowedRegions);
|
||||
BBC.ROLLBACK_ELEMENT.send(player, edit.getWorld().getName() + "/" + user + "-" + edit.getIndex());
|
||||
player.print(TranslatableComponent.of("fawe.worldedit.rollback.rollback.element" , edit.getWorld().getName() + "/" + user + "-" + edit.getIndex()));
|
||||
count.incrementAndGet();
|
||||
}
|
||||
}, () -> BBC.TOOL_INSPECT_INFO_FOOTER.send(player, count), true, restore);
|
||||
}, () -> player.print(TranslatableComponent.of("fawe.worldedit.tool.tool.inspect.info.footer" , count)), true, restore);
|
||||
}
|
||||
|
||||
@Command(
|
||||
@ -235,7 +236,7 @@ public class HistoryCommands {
|
||||
times = Math.max(1, times);
|
||||
LocalSession undoSession = session;
|
||||
if (session.hasFastMode()) {
|
||||
player.print(BBC.COMMAND_UNDO_DISABLED.s());
|
||||
player.print(TranslatableComponent.of("fawe.worldedit.history.command.undo.disabled"));
|
||||
return;
|
||||
}
|
||||
if (playerName != null) {
|
||||
|
Reference in New Issue
Block a user