mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-12 08:28:35 +00:00
Remove TranslatableComponent override
use Caption class
This commit is contained in:
@ -21,7 +21,7 @@ package com.sk89q.worldedit.extent.clipboard.io;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.boydti.fawe.config.Settings;
|
||||
import com.boydti.fawe.object.clipboard.LazyClipboardHolder;
|
||||
import com.boydti.fawe.object.clipboard.MultiClipboardHolder;
|
||||
@ -170,7 +170,7 @@ public class ClipboardFormats {
|
||||
LocalConfiguration config = worldEdit.getConfiguration();
|
||||
if (input.startsWith("url:")) {
|
||||
if (!player.hasPermission("worldedit.schematic.load.web")) {
|
||||
if (message) player.print(TranslatableComponent.of("fawe.error.no.perm", "worldedit.schematic.load.web"));
|
||||
if (message) player.print(Caption.of("fawe.error.no.perm", "worldedit.schematic.load.web"));
|
||||
return null;
|
||||
}
|
||||
URL base = new URL(Settings.IMP.WEB.URL);
|
||||
@ -178,19 +178,19 @@ public class ClipboardFormats {
|
||||
}
|
||||
if (input.startsWith("http")) {
|
||||
if (!player.hasPermission("worldedit.schematic.load.asset")) {
|
||||
if (message) player.print(TranslatableComponent.of("fawe.error.no.perm", "worldedit.schematic.load.asset"));
|
||||
if (message) player.print(Caption.of("fawe.error.no.perm", "worldedit.schematic.load.asset"));
|
||||
return null;
|
||||
}
|
||||
URL url = new URL(input);
|
||||
URL webInterface = new URL(Settings.IMP.WEB.ASSETS);
|
||||
if (!url.getHost().equalsIgnoreCase(webInterface.getHost())) {
|
||||
if (message) player.print(TranslatableComponent.of("fawe.error.web.unauthorized", url));
|
||||
if (message) player.print(Caption.of("fawe.error.web.unauthorized", url));
|
||||
return null;
|
||||
}
|
||||
return loadAllFromUrl(url);
|
||||
} else {
|
||||
if (Settings.IMP.PATHS.PER_PLAYER_SCHEMATICS && Pattern.compile("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}").matcher(input).find() && !player.hasPermission("worldedit.schematic.load.other")) {
|
||||
player.print(TranslatableComponent.of("fawe.error.no.perm", "worldedit.schematic.load.other"));
|
||||
player.print(Caption.of("fawe.error.no.perm", "worldedit.schematic.load.other"));
|
||||
return null;
|
||||
}
|
||||
File working = worldEdit.getWorkingDirectoryFile(config.saveDir);
|
||||
@ -210,7 +210,7 @@ public class ClipboardFormats {
|
||||
}
|
||||
} else {
|
||||
if (Settings.IMP.PATHS.PER_PLAYER_SCHEMATICS && Pattern.compile("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}").matcher(input).find() && !player.hasPermission("worldedit.schematic.load.other")) {
|
||||
if (message) player.print(TranslatableComponent.of("fawe.error.no.perm", "worldedit.schematic.load.other"));
|
||||
if (message) player.print(Caption.of("fawe.error.no.perm", "worldedit.schematic.load.other"));
|
||||
return null;
|
||||
}
|
||||
if (format == null && input.matches(".*\\.[\\w].*")) {
|
||||
@ -232,12 +232,12 @@ public class ClipboardFormats {
|
||||
if (format == null && f.isFile()) {
|
||||
format = findByFile(f);
|
||||
if (format == null) {
|
||||
player.print(TranslatableComponent.of("fawe.worldedit.clipboard.clipboard.invalid.format" , f.getName()));
|
||||
player.print(Caption.of("fawe.worldedit.clipboard.clipboard.invalid.format" , f.getName()));
|
||||
return null;
|
||||
}
|
||||
}
|
||||
if (!f.exists()) {
|
||||
if (message) player.print(TranslatableComponent.of("fawe.error.schematic.not.found" , input));
|
||||
if (message) player.print(Caption.of("fawe.error.schematic.not.found" , input));
|
||||
return null;
|
||||
}
|
||||
if (!f.isDirectory()) {
|
||||
@ -247,7 +247,7 @@ public class ClipboardFormats {
|
||||
}
|
||||
URIClipboardHolder[] clipboards = loadAllFromDirectory(f);
|
||||
if (clipboards.length < 1) {
|
||||
if (message) player.print(TranslatableComponent.of("fawe.error.schematic.not.found" , input));
|
||||
if (message) player.print(Caption.of("fawe.error.schematic.not.found" , input));
|
||||
return null;
|
||||
}
|
||||
return new MultiClipboardHolder(f.toURI(), clipboards);
|
||||
|
Reference in New Issue
Block a user