Added the remaining translation nodes

Dieser Commit ist enthalten in:
Matthew Miller 2019-11-09 18:35:45 +10:00
Ursprung fc0fee39cb
Commit 87fb9f6d0e
10 geänderte Dateien mit 147 neuen und 43 gelöschten Zeilen

Datei anzeigen

@ -458,8 +458,8 @@ public class SelectionCommands {
actor.printInfo(TranslatableComponent.of("worldedit.size.type", TextComponent.of(session.getRegionSelector(world).getTypeName())));
for (String line : session.getRegionSelector(world).getInformationLines()) {
actor.printInfo(TextComponent.of(line));
for (Component line : session.getRegionSelector(world).getSelectionInfoLines()) {
actor.print(line);
}
}
BlockVector3 size = region.getMaximumPoint()
@ -531,7 +531,7 @@ public class SelectionCommands {
BlockDistributionResult res = new BlockDistributionResult(distribution, separateStates);
if (!actor.isPlayer()) res.formatForConsole();
return res.create(finalPage);
}, null);
}, (Component) null);
}
@Command(

Datei anzeigen

@ -24,9 +24,12 @@ import com.sk89q.worldedit.LocalSession;
import com.sk89q.worldedit.extension.platform.Actor;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.regions.selector.limit.SelectorLimits;
import com.sk89q.worldedit.util.formatting.text.Component;
import com.sk89q.worldedit.util.formatting.text.TextComponent;
import com.sk89q.worldedit.world.World;
import java.util.List;
import java.util.stream.Collectors;
import javax.annotation.Nullable;
@ -154,6 +157,17 @@ public interface RegionSelector {
*
* @return a list of lines describing the region
*/
@Deprecated
List<String> getInformationLines();
/**
* Get lines of information about the selection.
*
* @return a list of lines describing the region.
*/
default List<Component> getSelectionInfoLines() {
return getInformationLines().stream()
.map(TextComponent::of)
.collect(Collectors.toList());
}
}

Datei anzeigen

@ -34,6 +34,9 @@ import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.regions.RegionSelector;
import com.sk89q.worldedit.regions.polyhedron.Triangle;
import com.sk89q.worldedit.regions.selector.limit.SelectorLimits;
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.world.World;
import java.util.ArrayList;
@ -182,16 +185,15 @@ public class ConvexPolyhedralRegionSelector implements RegionSelector, CUIRegion
}
@Override
public List<String> getInformationLines() {
List<String> ret = new ArrayList<>();
public List<Component> getSelectionInfoLines() {
List<Component> ret = new ArrayList<>();
ret.add("Vertices: "+region.getVertices().size());
ret.add("Triangles: "+region.getTriangles().size());
ret.add(TranslatableComponent.of("worldedit.selection.convex.info.vertices", TextComponent.of(region.getVertices().size())));
ret.add(TranslatableComponent.of("worldedit.selection.convex.info.triangles", TextComponent.of(region.getTriangles().size())));
return ret;
}
@Override
public void explainPrimarySelection(Actor player, LocalSession session, BlockVector3 pos) {
checkNotNull(player);
@ -200,7 +202,7 @@ public class ConvexPolyhedralRegionSelector implements RegionSelector, CUIRegion
session.describeCUI(player);
player.print("Started new selection with vertex "+pos+".");
player.printInfo(TranslatableComponent.of("worldedit.selection.convex.explain.primary", TextComponent.of(pos.toString())));
}
@Override
@ -211,7 +213,7 @@ public class ConvexPolyhedralRegionSelector implements RegionSelector, CUIRegion
session.describeCUI(player);
player.print("Added vertex " + pos + " to the selection.");
player.printInfo(TranslatableComponent.of("worldedit.selection.convex.explain.secondary", TextComponent.of(pos.toString())));
}
@Override

Datei anzeigen

@ -32,6 +32,9 @@ import com.sk89q.worldedit.regions.CuboidRegion;
import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.regions.RegionSelector;
import com.sk89q.worldedit.regions.selector.limit.SelectorLimits;
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.world.World;
import java.util.ArrayList;
@ -154,9 +157,13 @@ public class CuboidRegionSelector implements RegionSelector, CUIRegion {
checkNotNull(pos);
if (position1 != null && position2 != null) {
player.print("First position set to " + position1 + " (" + region.getArea() + ").");
} else {
player.print("First position set to " + position1 + ".");
player.printInfo(TranslatableComponent.of(
"worldedit.selection.cuboid.explain.primary-area",
TextComponent.of(position1.toString()),
TextComponent.of(region.getArea())
));
} else if (position1 != null) {
player.printInfo(TranslatableComponent.of("worldedit.selection.cuboid.explain.primary", TextComponent.of(position1.toString())));
}
session.dispatchCUIEvent(player, new SelectionPointEvent(0, pos, getArea()));
@ -169,9 +176,13 @@ public class CuboidRegionSelector implements RegionSelector, CUIRegion {
checkNotNull(pos);
if (position1 != null && position2 != null) {
player.print("Second position set to " + position2 + " (" + region.getArea() + ").");
} else {
player.print("Second position set to " + position2 + ".");
player.printInfo(TranslatableComponent.of(
"worldedit.selection.cuboid.explain.secondary-area",
TextComponent.of(position2.toString()),
TextComponent.of(region.getArea())
));
} else if (position2 != null) {
player.printInfo(TranslatableComponent.of("worldedit.selection.cuboid.explain.secondary", TextComponent.of(position2.toString())));
}
session.dispatchCUIEvent(player, new SelectionPointEvent(1, pos, getArea()));
@ -241,15 +252,15 @@ public class CuboidRegionSelector implements RegionSelector, CUIRegion {
}
@Override
public List<String> getInformationLines() {
final List<String> lines = new ArrayList<>();
public List<Component> getSelectionInfoLines() {
final List<Component> lines = new ArrayList<>();
if (position1 != null) {
lines.add("Position 1: " + position1);
lines.add(TranslatableComponent.of("worldedit.selection.cuboid.info.pos1", TextComponent.of(position1.toString())));
}
if (position2 != null) {
lines.add("Position 2: " + position2);
lines.add(TranslatableComponent.of("worldedit.selection.cuboid.info.pos2", TextComponent.of(position2.toString())));
}
return lines;

Datei anzeigen

@ -36,6 +36,9 @@ import com.sk89q.worldedit.regions.CylinderRegion;
import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.regions.RegionSelector;
import com.sk89q.worldedit.regions.selector.limit.SelectorLimits;
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.world.World;
import java.text.NumberFormat;
@ -166,7 +169,7 @@ public class CylinderRegionSelector implements RegionSelector, CUIRegion {
@Override
public void explainPrimarySelection(Actor player, LocalSession session, BlockVector3 pos) {
player.print("Starting a new cylindrical selection at " + pos + ".");
player.printInfo(TranslatableComponent.of("worldedit.selection.cylinder.explain.primary", TextComponent.of(pos.toString())));
session.describeCUI(player);
}
@ -176,9 +179,14 @@ public class CylinderRegionSelector implements RegionSelector, CUIRegion {
Vector3 center = region.getCenter();
if (!center.equals(Vector3.ZERO)) {
player.print("Radius set to " + NUMBER_FORMAT.format(region.getRadius().getX()) + "/" + NUMBER_FORMAT.format(region.getRadius().getZ()) + " blocks. (" + region.getArea() + ").");
player.printInfo(TranslatableComponent.of(
"worldedit.selection.cylinder.explain.secondary",
TextComponent.of(NUMBER_FORMAT.format(region.getRadius().getX())),
TextComponent.of(NUMBER_FORMAT.format(region.getRadius().getZ())),
TextComponent.of(region.getArea())
));
} else {
player.printError("You must select the center point before setting the radius.");
player.printError(TranslatableComponent.of("worldedit.selection.cylinder.explain.secondary-missing"));
return;
}
@ -233,14 +241,14 @@ public class CylinderRegionSelector implements RegionSelector, CUIRegion {
}
@Override
public List<String> getInformationLines() {
final List<String> lines = new ArrayList<>();
public List<Component> getSelectionInfoLines() {
final List<Component> lines = new ArrayList<>();
if (!region.getCenter().equals(Vector3.ZERO)) {
lines.add("Center: " + region.getCenter());
lines.add(TranslatableComponent.of("worldedit.selection.cylinder.info.center", TextComponent.of(region.getCenter().toString())));
}
if (!region.getRadius().equals(Vector2.ZERO)) {
lines.add("Radius: " + region.getRadius());
lines.add(TranslatableComponent.of("worldedit.selection.cylinder.info.radius", TextComponent.of(region.getRadius().toString())));
}
return lines;

Datei anzeigen

@ -33,6 +33,9 @@ import com.sk89q.worldedit.regions.EllipsoidRegion;
import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.regions.RegionSelector;
import com.sk89q.worldedit.regions.selector.limit.SelectorLimits;
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.world.World;
import java.util.ArrayList;
@ -145,9 +148,16 @@ public class EllipsoidRegionSelector implements RegionSelector, CUIRegion {
@Override
public void explainPrimarySelection(Actor player, LocalSession session, BlockVector3 pos) {
if (isDefined()) {
player.print("Center position set to " + region.getCenter() + " (" + region.getArea() + ").");
player.printInfo(TranslatableComponent.of(
"worldedit.selection.ellipsoid.explain.primary-area",
TextComponent.of(region.getCenter().toString()),
TextComponent.of(region.getArea())
));
} else {
player.print("Center position set to " + region.getCenter() + ".");
player.printInfo(TranslatableComponent.of(
"worldedit.selection.ellipsoid.explain.primary",
TextComponent.of(region.getCenter().toString())
));
}
session.describeCUI(player);
@ -156,9 +166,16 @@ public class EllipsoidRegionSelector implements RegionSelector, CUIRegion {
@Override
public void explainSecondarySelection(Actor player, LocalSession session, BlockVector3 pos) {
if (isDefined()) {
player.print("Radius set to " + region.getRadius() + " (" + region.getArea() + ").");
player.printInfo(TranslatableComponent.of(
"worldedit.selection.ellipsoid.explain.secondary-area",
TextComponent.of(region.getRadius().toString()),
TextComponent.of(region.getArea())
));
} else {
player.print("Radius set to " + region.getRadius() + ".");
player.printInfo(TranslatableComponent.of(
"worldedit.selection.ellipsoid.explain.secondary",
TextComponent.of(region.getRadius().toString())
));
}
session.describeCUI(player);
@ -204,17 +221,17 @@ public class EllipsoidRegionSelector implements RegionSelector, CUIRegion {
}
@Override
public List<String> getInformationLines() {
final List<String> lines = new ArrayList<>();
public List<Component> getSelectionInfoLines() {
final List<Component> lines = new ArrayList<>();
final Vector3 center = region.getCenter();
if (center.lengthSq() > 0) {
lines.add("Center: " + center);
lines.add(TranslatableComponent.of("worldedit.selection.ellipsoid.info.center", TextComponent.of(center.toString())));
}
final Vector3 radius = region.getRadius();
if (radius.lengthSq() > 0) {
lines.add("X/Y/Z radius: " + radius);
lines.add(TranslatableComponent.of("worldedit.selection.ellipsoid.info.radius", TextComponent.of(radius.toString())));
}
return lines;

Datei anzeigen

@ -24,6 +24,8 @@ import com.sk89q.worldedit.extension.platform.Actor;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.regions.RegionSelector;
import com.sk89q.worldedit.regions.selector.limit.SelectorLimits;
import com.sk89q.worldedit.util.formatting.text.TextComponent;
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
import com.sk89q.worldedit.world.World;
import javax.annotation.Nullable;
@ -129,14 +131,22 @@ public class ExtendingCuboidRegionSelector extends CuboidRegionSelector {
@Override
public void explainPrimarySelection(Actor player, LocalSession session, BlockVector3 pos) {
player.print("Started selection at " + pos + " (" + region.getArea() + ").");
player.printInfo(TranslatableComponent.of(
"worldedit.selection.extend.explain.primary",
TextComponent.of(pos.toString()),
TextComponent.of(region.getArea())
));
explainRegionAdjust(player, session);
}
@Override
public void explainSecondarySelection(Actor player, LocalSession session, BlockVector3 pos) {
player.print("Extended selection to encompass " + pos + " (" + region.getArea() + ").");
player.printInfo(TranslatableComponent.of(
"worldedit.selection.extend.explain.secondary",
TextComponent.of(pos.toString()),
TextComponent.of(region.getArea())
));
explainRegionAdjust(player, session);
}

Datei anzeigen

@ -34,6 +34,9 @@ import com.sk89q.worldedit.regions.Polygonal2DRegion;
import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.regions.RegionSelector;
import com.sk89q.worldedit.regions.selector.limit.SelectorLimits;
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.world.World;
import java.util.Collections;
@ -163,7 +166,7 @@ public class Polygonal2DRegionSelector implements RegionSelector, CUIRegion {
@Override
public void explainPrimarySelection(Actor player, LocalSession session, BlockVector3 pos) {
player.print("Starting a new polygon at " + pos + ".");
player.printInfo(TranslatableComponent.of("worldedit.selection.polygon2d.explain.primary", TextComponent.of(pos.toString())));
session.dispatchCUIEvent(player, new SelectionShapeEvent(getTypeID()));
session.dispatchCUIEvent(player, new SelectionPoint2DEvent(0, pos, getArea()));
@ -172,7 +175,11 @@ public class Polygonal2DRegionSelector implements RegionSelector, CUIRegion {
@Override
public void explainSecondarySelection(Actor player, LocalSession session, BlockVector3 pos) {
player.print("Added point #" + region.size() + " at " + pos + ".");
player.printInfo(TranslatableComponent.of(
"worldedit.selection.polygon2d.explain.secondary",
TextComponent.of(region.size()),
TextComponent.of(pos.toString())
));
session.dispatchCUIEvent(player, new SelectionPoint2DEvent(region.size() - 1, pos, getArea()));
session.dispatchCUIEvent(player, new SelectionMinMaxEvent(region.getMinimumY(), region.getMaximumY()));
@ -230,8 +237,8 @@ public class Polygonal2DRegionSelector implements RegionSelector, CUIRegion {
}
@Override
public List<String> getInformationLines() {
return Collections.singletonList("# points: " + region.size());
public List<Component> getSelectionInfoLines() {
return Collections.singletonList(TranslatableComponent.of("worldedit.selection.polygon2d.info", TextComponent.of(region.size())));
}
@Override

Datei anzeigen

@ -25,6 +25,8 @@ import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.math.Vector3;
import com.sk89q.worldedit.regions.RegionSelector;
import com.sk89q.worldedit.regions.selector.limit.SelectorLimits;
import com.sk89q.worldedit.util.formatting.text.TextComponent;
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
import com.sk89q.worldedit.world.World;
import javax.annotation.Nullable;
@ -88,9 +90,13 @@ public class SphereRegionSelector extends EllipsoidRegionSelector {
@Override
public void explainSecondarySelection(Actor player, LocalSession session, BlockVector3 pos) {
if (isDefined()) {
player.print("Radius set to " + region.getRadius().getX() + " (" + region.getArea() + ").");
player.printInfo(TranslatableComponent.of(
"worldedit.selection.sphere.explain.secondary-defined",
TextComponent.of(region.getRadius().getX()),
TextComponent.of(region.getArea())
));
} else {
player.print("Radius set to " + region.getRadius().getX() + ".");
player.printInfo(TranslatableComponent.of("worldedit.selection.sphere.explain.secondary", TextComponent.of(region.getRadius().getX())));
}
session.describeCUI(player);

Datei anzeigen

@ -292,6 +292,35 @@
"worldedit.operation.affected.entity": "{0} entities affected",
"worldedit.operation.deform.expression": "deformed using {0}",
"worldedit.selection.convex.info.vertices": "Vertices: {0}",
"worldedit.selection.convex.info.triangles": "Triangles: {0}",
"worldedit.selection.convex.explain.primary": "Started new selection with vertex {0}.",
"worldedit.selection.convex.explain.secondary": "Added vertex {0} to the selection.",
"worldedit.selection.cuboid.info.pos1": "Position 1: {0}",
"worldedit.selection.cuboid.info.pos2": "Position 2: {0}",
"worldedit.selection.cuboid.explain.primary": "First position set to {0}.",
"worldedit.selection.cuboid.explain.primary-area": "First position set to {0} ({1}).",
"worldedit.selection.cuboid.explain.secondary": "Second position set to {0}.",
"worldedit.selection.cuboid.explain.secondary-area": "Second position set to {0} ({1}).",
"worldedit.selection.extend.explain.primary": "Started selection at {0} ({1}).",
"worldedit.selection.extend.explain.secondary": "Extended selection to encompass {0} ({1}).",
"worldedit.selection.ellipsoid.info.center": "Center: {0}",
"worldedit.selection.ellipsoid.info.radius": "X/Y/Z Radius: {0}",
"worldedit.selection.ellipsoid.explain.primary": "Center position set to {0}.",
"worldedit.selection.ellipsoid.explain.primary-area": "Center position set to {0} ({1}).",
"worldedit.selection.ellipsoid.explain.secondary": "Radius set to {0}.",
"worldedit.selection.ellipsoid.explain.secondary-area": "Radius set to {0} ({1}).",
"worldedit.selection.cylinder.info.center": "Center: {0}",
"worldedit.selection.cylinder.info.radius": "Radius: {0}",
"worldedit.selection.cylinder.explain.primary": "Starting a new cylindrical selection at {0}.",
"worldedit.selection.cylinder.explain.secondary": "Radius set to {0}/{1} blocks. ({2})",
"worldedit.selection.cylinder.explain.secondary-missing": "You must select the center point before setting the radius.",
"worldedit.selection.polygon2d.info": "# points: {0}",
"worldedit.selection.polygon2d.explain.primary": "Starting a new polygon at {0}.",
"worldedit.selection.polygon2d.explain.secondary": "Added point #{0} at {1}.",
"worldedit.selection.sphere.explain.secondary": "Radius set to {0}.",
"worldedit.selection.sphere.explain.secondary-defined": "Radius set to {0} ({1}).",
"worldedit.help.command-not-found": "The command '{0}' could not be found.",
"worldedit.help.no-subcommands": "'{0}' has no sub-commands. (Maybe '{1}' is for a parameter?)",
"worldedit.help.subcommand-not-found": "The sub-command '{0}' under '{1}' could not be found."