mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-05 12:36:40 +00:00
Finish up transition to captions
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package com.boydti.fawe.command;
|
||||
|
||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.List;
|
||||
|
@ -9,6 +9,7 @@ import com.sk89q.worldedit.function.visitor.RecursiveVisitor;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.regions.AbstractRegion;
|
||||
import com.sk89q.worldedit.regions.RegionOperationException;
|
||||
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@ -105,12 +106,12 @@ public class FuzzyRegion extends AbstractRegion {
|
||||
|
||||
@Override
|
||||
public void expand(BlockVector3... changes) throws RegionOperationException {
|
||||
throw new RegionOperationException("Selection cannot expand");
|
||||
throw new RegionOperationException(TranslatableComponent.of("fawe.error.selection-expand"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void contract(BlockVector3... changes) throws RegionOperationException {
|
||||
throw new RegionOperationException("Selection cannot contract");
|
||||
throw new RegionOperationException(TranslatableComponent.of("fawe.error.selection-contract"));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -120,7 +121,7 @@ public class FuzzyRegion extends AbstractRegion {
|
||||
|
||||
@Override
|
||||
public void shift(BlockVector3 change) throws RegionOperationException {
|
||||
throw new RegionOperationException("Selection cannot be shifted");
|
||||
throw new RegionOperationException(TranslatableComponent.of("fawe.error.selection-shift"));
|
||||
}
|
||||
|
||||
public void setExtent(EditSession extent) {
|
||||
|
@ -240,11 +240,11 @@ public class EditSessionBuilder {
|
||||
}
|
||||
if (Settings.IMP.EXTENT.DEBUG) {
|
||||
if (event.getActor() != null) {
|
||||
event.getActor().printDebug("Potentially unsafe extent blocked: " + toReturn.getClass().getName());
|
||||
event.getActor().printDebug(" - For area restrictions, it is recommended to use the FaweAPI");
|
||||
event.getActor().printDebug(" - For block logging, it is recommended to use BlocksHub");
|
||||
event.getActor().printDebug(" - To allow this plugin add it to the FAWE `allowed-plugins` list");
|
||||
event.getActor().printDebug(" - To hide this message set `debug` to false in the FAWE config.yml");
|
||||
event.getActor().printDebug(TranslatableComponent.of("Potentially unsafe extent blocked: " + toReturn.getClass().getName()));
|
||||
event.getActor().printDebug(TranslatableComponent.of(" - For area restrictions, it is recommended to use the FaweAPI"));
|
||||
event.getActor().printDebug(TranslatableComponent.of(" - For block logging, it is recommended to use BlocksHub"));
|
||||
event.getActor().printDebug(TranslatableComponent.of(" - To allow this plugin add it to the FAWE `allowed-plugins` list"));
|
||||
event.getActor().printDebug(TranslatableComponent.of(" - To hide this message set `debug` to false in the FAWE config.yml"));
|
||||
} else {
|
||||
LOGGER.debug("Potentially unsafe extent blocked: " + toReturn.getClass().getName());
|
||||
LOGGER.debug(" - For area restrictions, it is recommended to use the FaweAPI");
|
||||
|
@ -6,6 +6,9 @@ import com.boydti.fawe.util.MainUtil;
|
||||
import com.boydti.fawe.util.MathMan;
|
||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||
import com.sk89q.worldedit.extension.platform.binding.ProvideBindings;
|
||||
import com.sk89q.worldedit.util.formatting.text.TextComponent;
|
||||
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
|
||||
import org.w3c.dom.Text;
|
||||
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.RenderingHints;
|
||||
@ -172,7 +175,7 @@ public class ImageUtil {
|
||||
try {
|
||||
return MainUtil.readImage(getInputStream(uri));
|
||||
} catch (IOException e) {
|
||||
throw new InputParseException(e.getMessage());
|
||||
throw new InputParseException(TranslatableComponent.of(e.getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
@ -185,7 +188,7 @@ public class ImageUtil {
|
||||
}
|
||||
return new URL(uriStr).openStream();
|
||||
} catch (IOException e) {
|
||||
throw new InputParseException(e.getMessage());
|
||||
throw new InputParseException(TranslatableComponent.of(e.getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
@ -208,9 +211,9 @@ public class ImageUtil {
|
||||
Settings.IMP.PATHS.HEIGHTMAP), arg);
|
||||
return MainUtil.readImage(file);
|
||||
}
|
||||
throw new InputParseException("Invalid image " + arg);
|
||||
throw new InputParseException(TranslatableComponent.of("fawe.error.invalid-image", TextComponent.of(arg)));
|
||||
} catch (IOException e) {
|
||||
throw new InputParseException(e.getMessage());
|
||||
throw new InputParseException(TranslatableComponent.of(e.getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
@ -227,16 +230,16 @@ public class ImageUtil {
|
||||
File file = MainUtil.getFile(MainUtil.getFile(Fawe.imp().getDirectory(),
|
||||
Settings.IMP.PATHS.HEIGHTMAP), arg);
|
||||
if (!file.exists()) {
|
||||
throw new InputParseException("File not found " + file);
|
||||
throw new InputParseException(TranslatableComponent.of("fawe.error.file-not-found", TextComponent.of(String.valueOf(file))));
|
||||
}
|
||||
if (file.isDirectory()) {
|
||||
throw new InputParseException("File is a directory " + file);
|
||||
throw new InputParseException(TranslatableComponent.of("fawe.error.file-is-invalid-directory", TextComponent.of(String.valueOf(file))));
|
||||
}
|
||||
return file.toURI();
|
||||
}
|
||||
throw new InputParseException("Invalid image " + arg);
|
||||
throw new InputParseException(TranslatableComponent.of("fawe.error.invalid-image", TextComponent.of(arg)));
|
||||
} catch (IOException | URISyntaxException e) {
|
||||
throw new InputParseException(e.getMessage());
|
||||
throw new InputParseException(TranslatableComponent.of(e.getMessage()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user