mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-01 02:46:41 +00:00
Further translations
This commit is contained in:
@ -66,6 +66,7 @@ import com.sk89q.worldedit.util.formatting.component.SubtleFormat;
|
||||
import com.sk89q.worldedit.util.formatting.component.TextComponentProducer;
|
||||
import com.sk89q.worldedit.util.formatting.text.Component;
|
||||
import com.sk89q.worldedit.util.formatting.text.TextComponent;
|
||||
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
|
||||
import com.sk89q.worldedit.util.formatting.text.event.ClickEvent;
|
||||
import com.sk89q.worldedit.util.formatting.text.event.HoverEvent;
|
||||
import com.sk89q.worldedit.util.formatting.text.format.TextColor;
|
||||
@ -116,12 +117,12 @@ public class SelectionCommands {
|
||||
} else if (actor instanceof Locatable) {
|
||||
pos = ((Locatable) actor).getBlockLocation();
|
||||
} else {
|
||||
actor.printError("You must provide coordinates as console.");
|
||||
actor.printError(TranslatableComponent.of("worldedit.pos.console-require-coords"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!session.getRegionSelector(world).selectPrimary(pos.toVector().toBlockPoint(), ActorSelectorLimits.forActor(actor))) {
|
||||
actor.printError("Position already set.");
|
||||
actor.printError(TranslatableComponent.of("worldedit.pos.already-set"));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -144,12 +145,12 @@ public class SelectionCommands {
|
||||
} else if (actor instanceof Locatable) {
|
||||
pos = ((Locatable) actor).getBlockLocation();
|
||||
} else {
|
||||
actor.printError("You must provide coordinates as console.");
|
||||
actor.printError(TranslatableComponent.of("worldedit.pos.console-require-coords"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!session.getRegionSelector(world).selectSecondary(pos.toVector().toBlockPoint(), ActorSelectorLimits.forActor(actor))) {
|
||||
actor.printError("Position already set.");
|
||||
actor.printError(TranslatableComponent.of("worldedit.pos.already-set"));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -168,14 +169,14 @@ public class SelectionCommands {
|
||||
|
||||
if (pos != null) {
|
||||
if (!session.getRegionSelector(player.getWorld()).selectPrimary(pos.toVector().toBlockPoint(), ActorSelectorLimits.forActor(player))) {
|
||||
player.printError("Position already set.");
|
||||
player.printError(TranslatableComponent.of("worldedit.hpos.already-set"));
|
||||
return;
|
||||
}
|
||||
|
||||
session.getRegionSelector(player.getWorld())
|
||||
.explainPrimarySelection(player, session, pos.toVector().toBlockPoint());
|
||||
} else {
|
||||
player.printError("No block in sight!");
|
||||
player.printError(TranslatableComponent.of("worldedit.hpos.no-block"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -190,14 +191,14 @@ public class SelectionCommands {
|
||||
|
||||
if (pos != null) {
|
||||
if (!session.getRegionSelector(player.getWorld()).selectSecondary(pos.toVector().toBlockPoint(), ActorSelectorLimits.forActor(player))) {
|
||||
player.printError("Position already set.");
|
||||
player.printError(TranslatableComponent.of("worldedit.hpos.already-set"));
|
||||
return;
|
||||
}
|
||||
|
||||
session.getRegionSelector(player.getWorld())
|
||||
.explainSecondarySelection(player, session, pos.toVector().toBlockPoint());
|
||||
} else {
|
||||
player.printError("No block in sight!");
|
||||
player.printError(TranslatableComponent.of("worldedit.hpos.no-block"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -225,9 +226,13 @@ public class SelectionCommands {
|
||||
min = BlockVector3.at(min2D.getBlockX() * 16, 0, min2D.getBlockZ() * 16);
|
||||
max = BlockVector3.at(max2D.getBlockX() * 16 + 15, world.getMaxY(), max2D.getBlockZ() * 16 + 15);
|
||||
|
||||
actor.print("Chunks selected: ("
|
||||
+ min2D.getBlockX() + ", " + min2D.getBlockZ() + ") - ("
|
||||
+ max2D.getBlockX() + ", " + max2D.getBlockZ() + ")");
|
||||
actor.printInfo(TranslatableComponent.of(
|
||||
"worldedit.chunk.selected-multiple",
|
||||
TextComponent.of(min2D.getBlockX()),
|
||||
TextComponent.of(min2D.getBlockZ()),
|
||||
TextComponent.of(max2D.getBlockX()),
|
||||
TextComponent.of(max2D.getBlockZ())
|
||||
));
|
||||
} else {
|
||||
final BlockVector2 min2D;
|
||||
if (coordinates != null) {
|
||||
@ -247,8 +252,8 @@ public class SelectionCommands {
|
||||
min = BlockVector3.at(min2D.getBlockX() * 16, 0, min2D.getBlockZ() * 16);
|
||||
max = min.add(15, world.getMaxY(), 15);
|
||||
|
||||
actor.print("Chunk selected: "
|
||||
+ min2D.getBlockX() + ", " + min2D.getBlockZ());
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.chunk.selected", TextComponent.of(min2D.getBlockX()),
|
||||
TextComponent.of(min2D.getBlockZ())));
|
||||
}
|
||||
|
||||
final CuboidRegionSelector selector;
|
||||
@ -278,16 +283,16 @@ public class SelectionCommands {
|
||||
}
|
||||
ItemType itemType = ItemTypes.get(wandId);
|
||||
if (itemType == null) {
|
||||
player.printError("Wand item is mis-configured or disabled.");
|
||||
player.printError(TranslatableComponent.of("worldedit.wand.invalid"));
|
||||
return;
|
||||
}
|
||||
player.giveItem(new BaseItemStack(itemType, 1));
|
||||
if (navWand) {
|
||||
session.setTool(itemType, new NavigationWand());
|
||||
player.print("Left click: jump to location; Right click: pass through walls");
|
||||
player.printInfo(TranslatableComponent.of("worldedit.wand.navwand.info"));
|
||||
} else {
|
||||
session.setTool(itemType, new SelectionWand());
|
||||
player.print("Left click: select pos #1; Right click: select pos #2");
|
||||
player.printInfo(TranslatableComponent.of("worldedit.wand.selwand.info"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -339,9 +344,9 @@ public class SelectionCommands {
|
||||
|
||||
session.getRegionSelector(world).explainRegionAdjust(actor, session);
|
||||
|
||||
actor.print("Region contracted " + (oldSize - newSize) + " blocks.");
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.contract.contracted", TextComponent.of(oldSize - newSize)));
|
||||
} catch (RegionOperationException e) {
|
||||
actor.printError(e.getMessage());
|
||||
actor.printError(TextComponent.of(e.getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
@ -368,9 +373,9 @@ public class SelectionCommands {
|
||||
|
||||
session.getRegionSelector(world).explainRegionAdjust(actor, session);
|
||||
|
||||
actor.print("Region shifted.");
|
||||
actor.print(TranslatableComponent.of("worldedit.shift.shifted"));
|
||||
} catch (RegionOperationException e) {
|
||||
actor.printError(e.getMessage());
|
||||
actor.printError(TextComponent.of(e.getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
@ -391,7 +396,7 @@ public class SelectionCommands {
|
||||
region.expand(getChangesForEachDir(amount, onlyHorizontal, onlyVertical));
|
||||
session.getRegionSelector(world).learnChanges();
|
||||
session.getRegionSelector(world).explainRegionAdjust(actor, session);
|
||||
actor.print("Region outset.");
|
||||
actor.print(TranslatableComponent.of("worldedit.outset.outset"));
|
||||
}
|
||||
|
||||
@Command(
|
||||
@ -411,7 +416,7 @@ public class SelectionCommands {
|
||||
region.contract(getChangesForEachDir(amount, onlyHorizontal, onlyVertical));
|
||||
session.getRegionSelector(world).learnChanges();
|
||||
session.getRegionSelector(world).explainRegionAdjust(actor, session);
|
||||
actor.print("Region inset.");
|
||||
actor.print(TranslatableComponent.of("worldedit.inset.inset"));
|
||||
}
|
||||
|
||||
private BlockVector3[] getChangesForEachDir(int amount, boolean onlyHorizontal, boolean onlyVertical) {
|
||||
@ -447,36 +452,36 @@ public class SelectionCommands {
|
||||
region = clipboard.getRegion();
|
||||
|
||||
BlockVector3 origin = clipboard.getOrigin();
|
||||
actor.print("Offset: " + origin);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.size.offset", TextComponent.of(origin.toString())));
|
||||
} else {
|
||||
region = session.getSelection(world);
|
||||
|
||||
actor.print("Type: " + session.getRegionSelector(world).getTypeName());
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.size.type", TextComponent.of(session.getRegionSelector(world).getTypeName())));
|
||||
|
||||
for (String line : session.getRegionSelector(world).getInformationLines()) {
|
||||
actor.print(line);
|
||||
actor.printInfo(TextComponent.of(line));
|
||||
}
|
||||
}
|
||||
BlockVector3 size = region.getMaximumPoint()
|
||||
.subtract(region.getMinimumPoint())
|
||||
.add(1, 1, 1);
|
||||
|
||||
actor.print("Size: " + size);
|
||||
actor.print("Cuboid distance: " + region.getMaximumPoint().distance(region.getMinimumPoint()));
|
||||
actor.print("# of blocks: " + region.getArea());
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.size.size", TextComponent.of(size.toString())));
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.size.distance", TextComponent.of(region.getMaximumPoint().distance(region.getMinimumPoint()))));
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.size.blocks", TextComponent.of(region.getArea())));
|
||||
}
|
||||
|
||||
|
||||
@Command(
|
||||
name = "/count",
|
||||
desc = "Counts the number of blocks matching a mask"
|
||||
)
|
||||
@CommandPermissions("worldedit.analysis.count")
|
||||
public void count(Actor actor, World world, LocalSession session, EditSession editSession,
|
||||
public int count(Actor actor, World world, LocalSession session, EditSession editSession,
|
||||
@Arg(desc = "The mask of blocks to match")
|
||||
Mask mask) throws WorldEditException {
|
||||
int count = editSession.countBlocks(session.getSelection(world), mask);
|
||||
actor.print("Counted: " + count);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.count.counted", TextComponent.of(count)));
|
||||
return count;
|
||||
}
|
||||
|
||||
@Command(
|
||||
@ -510,13 +515,13 @@ public class SelectionCommands {
|
||||
} else {
|
||||
distribution = session.getLastDistribution();
|
||||
if (distribution == null) {
|
||||
actor.printError("No previous distribution.");
|
||||
actor.printError(TranslatableComponent.of("worldedit.distr.no-previous"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (distribution.isEmpty()) { // *Should* always be false
|
||||
actor.printError("No blocks counted.");
|
||||
actor.printError(TranslatableComponent.of("worldedit.distr.no-blocks"));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -542,7 +547,7 @@ public class SelectionCommands {
|
||||
if (selector == null) {
|
||||
session.getRegionSelector(world).clear();
|
||||
session.dispatchCUISelection(actor);
|
||||
actor.print("Selection cleared.");
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.select.cleared"));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -552,38 +557,38 @@ public class SelectionCommands {
|
||||
switch (selector) {
|
||||
case CUBOID:
|
||||
newSelector = new CuboidRegionSelector(oldSelector);
|
||||
actor.print("Cuboid: left click for point 1, right click for point 2");
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.select.cuboid.message"));
|
||||
break;
|
||||
case EXTEND:
|
||||
newSelector = new ExtendingCuboidRegionSelector(oldSelector);
|
||||
actor.print("Cuboid: left click for a starting point, right click to extend");
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.select.extend.message"));
|
||||
break;
|
||||
case POLY: {
|
||||
newSelector = new Polygonal2DRegionSelector(oldSelector);
|
||||
actor.print("2D polygon selector: Left/right click to add a point.");
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.select.poly.message"));
|
||||
Optional<Integer> limit = ActorSelectorLimits.forActor(actor).getPolygonVertexLimit();
|
||||
limit.ifPresent(integer -> actor.print(integer + " points maximum."));
|
||||
limit.ifPresent(integer -> actor.printInfo(TranslatableComponent.of("worldedit.select.poly.limit-message", TextComponent.of(integer))));
|
||||
break;
|
||||
}
|
||||
case ELLIPSOID:
|
||||
newSelector = new EllipsoidRegionSelector(oldSelector);
|
||||
actor.print("Ellipsoid selector: left click=center, right click to extend");
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.select.ellipsoid.message"));
|
||||
break;
|
||||
case SPHERE:
|
||||
newSelector = new SphereRegionSelector(oldSelector);
|
||||
actor.print("Sphere selector: left click=center, right click to set radius");
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.select.sphere.message"));
|
||||
break;
|
||||
case CYL:
|
||||
newSelector = new CylinderRegionSelector(oldSelector);
|
||||
actor.print("Cylindrical selector: Left click=center, right click to extend.");
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.select.cyl.message"));
|
||||
break;
|
||||
case CONVEX:
|
||||
case HULL:
|
||||
case POLYHEDRON: {
|
||||
newSelector = new ConvexPolyhedralRegionSelector(oldSelector);
|
||||
actor.print("Convex polyhedral selector: Left click=First vertex, right click to add more.");
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.select.convex.message"));
|
||||
Optional<Integer> limit = ActorSelectorLimits.forActor(actor).getPolyhedronVertexLimit();
|
||||
limit.ifPresent(integer -> actor.print(integer + " points maximum."));
|
||||
limit.ifPresent(integer -> actor.printInfo(TranslatableComponent.of("worldedit.select.convex.limit-message", TextComponent.of(integer))));
|
||||
break;
|
||||
}
|
||||
case LIST:
|
||||
@ -593,13 +598,13 @@ public class SelectionCommands {
|
||||
TextComponentProducer contents = box.getContents();
|
||||
contents.append(SubtleFormat.wrap("Select one of the modes below:")).newline();
|
||||
|
||||
box.appendCommand("cuboid", "Select two corners of a cuboid", "//sel cuboid");
|
||||
box.appendCommand("extend", "Fast cuboid selection mode", "//sel extend");
|
||||
box.appendCommand("poly", "Select a 2D polygon with height", "//sel poly");
|
||||
box.appendCommand("ellipsoid", "Select an ellipsoid", "//sel ellipsoid");
|
||||
box.appendCommand("sphere", "Select a sphere", "//sel sphere");
|
||||
box.appendCommand("cyl", "Select a cylinder", "//sel cyl");
|
||||
box.appendCommand("convex", "Select a convex polyhedral", "//sel convex");
|
||||
box.appendCommand("cuboid", TranslatableComponent.of("worldedit.select.cuboid.description"), "//sel cuboid");
|
||||
box.appendCommand("extend", TranslatableComponent.of("worldedit.select.extend.description"), "//sel extend");
|
||||
box.appendCommand("poly", TranslatableComponent.of("worldedit.select.poly.description"), "//sel poly");
|
||||
box.appendCommand("ellipsoid", TranslatableComponent.of("worldedit.select.ellipsoid.description"), "//sel ellipsoid");
|
||||
box.appendCommand("sphere", TranslatableComponent.of("worldedit.select.sphere.description"), "//sel sphere");
|
||||
box.appendCommand("cyl", TranslatableComponent.of("worldedit.select.cyl.description"), "//sel cyl");
|
||||
box.appendCommand("convex", TranslatableComponent.of("worldedit.select.convex.description"), "//sel convex");
|
||||
|
||||
actor.print(box.create(1));
|
||||
return;
|
||||
@ -616,7 +621,7 @@ public class SelectionCommands {
|
||||
|
||||
if (found != null) {
|
||||
session.setDefaultRegionSelector(found);
|
||||
actor.print("Your default region selector is now " + found.name() + ".");
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.select.default-set", TextComponent.of(found.name())));
|
||||
} else {
|
||||
throw new RuntimeException("Something unexpected happened. Please report this.");
|
||||
}
|
||||
@ -679,7 +684,7 @@ public class SelectionCommands {
|
||||
|
||||
@Override
|
||||
public Component create(int page) throws InvalidComponentException {
|
||||
super.getContents().append(TextComponent.of("Total Block Count: " + totalBlocks, TextColor.GRAY))
|
||||
super.getContents().append(TranslatableComponent.of("worldedit.distr.total", TextColor.GRAY, TextComponent.of(totalBlocks)))
|
||||
.append(TextComponent.newline());
|
||||
return super.create(page);
|
||||
}
|
||||
|
Reference in New Issue
Block a user