Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-12-26 02:50:06 +01:00
Added the remaining translation nodes
Dieser Commit ist enthalten in:
Ursprung
fc0fee39cb
Commit
87fb9f6d0e
@ -458,8 +458,8 @@ public class SelectionCommands {
|
|||||||
|
|
||||||
actor.printInfo(TranslatableComponent.of("worldedit.size.type", TextComponent.of(session.getRegionSelector(world).getTypeName())));
|
actor.printInfo(TranslatableComponent.of("worldedit.size.type", TextComponent.of(session.getRegionSelector(world).getTypeName())));
|
||||||
|
|
||||||
for (String line : session.getRegionSelector(world).getInformationLines()) {
|
for (Component line : session.getRegionSelector(world).getSelectionInfoLines()) {
|
||||||
actor.printInfo(TextComponent.of(line));
|
actor.print(line);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BlockVector3 size = region.getMaximumPoint()
|
BlockVector3 size = region.getMaximumPoint()
|
||||||
@ -531,7 +531,7 @@ public class SelectionCommands {
|
|||||||
BlockDistributionResult res = new BlockDistributionResult(distribution, separateStates);
|
BlockDistributionResult res = new BlockDistributionResult(distribution, separateStates);
|
||||||
if (!actor.isPlayer()) res.formatForConsole();
|
if (!actor.isPlayer()) res.formatForConsole();
|
||||||
return res.create(finalPage);
|
return res.create(finalPage);
|
||||||
}, null);
|
}, (Component) null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Command(
|
@Command(
|
||||||
|
@ -24,9 +24,12 @@ import com.sk89q.worldedit.LocalSession;
|
|||||||
import com.sk89q.worldedit.extension.platform.Actor;
|
import com.sk89q.worldedit.extension.platform.Actor;
|
||||||
import com.sk89q.worldedit.math.BlockVector3;
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
import com.sk89q.worldedit.regions.selector.limit.SelectorLimits;
|
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 com.sk89q.worldedit.world.World;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
@ -154,6 +157,17 @@ public interface RegionSelector {
|
|||||||
*
|
*
|
||||||
* @return a list of lines describing the region
|
* @return a list of lines describing the region
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
List<String> getInformationLines();
|
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());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,6 +34,9 @@ import com.sk89q.worldedit.regions.Region;
|
|||||||
import com.sk89q.worldedit.regions.RegionSelector;
|
import com.sk89q.worldedit.regions.RegionSelector;
|
||||||
import com.sk89q.worldedit.regions.polyhedron.Triangle;
|
import com.sk89q.worldedit.regions.polyhedron.Triangle;
|
||||||
import com.sk89q.worldedit.regions.selector.limit.SelectorLimits;
|
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 com.sk89q.worldedit.world.World;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -182,16 +185,15 @@ public class ConvexPolyhedralRegionSelector implements RegionSelector, CUIRegion
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getInformationLines() {
|
public List<Component> getSelectionInfoLines() {
|
||||||
List<String> ret = new ArrayList<>();
|
List<Component> ret = new ArrayList<>();
|
||||||
|
|
||||||
ret.add("Vertices: "+region.getVertices().size());
|
ret.add(TranslatableComponent.of("worldedit.selection.convex.info.vertices", TextComponent.of(region.getVertices().size())));
|
||||||
ret.add("Triangles: "+region.getTriangles().size());
|
ret.add(TranslatableComponent.of("worldedit.selection.convex.info.triangles", TextComponent.of(region.getTriangles().size())));
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void explainPrimarySelection(Actor player, LocalSession session, BlockVector3 pos) {
|
public void explainPrimarySelection(Actor player, LocalSession session, BlockVector3 pos) {
|
||||||
checkNotNull(player);
|
checkNotNull(player);
|
||||||
@ -200,7 +202,7 @@ public class ConvexPolyhedralRegionSelector implements RegionSelector, CUIRegion
|
|||||||
|
|
||||||
session.describeCUI(player);
|
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
|
@Override
|
||||||
@ -211,7 +213,7 @@ public class ConvexPolyhedralRegionSelector implements RegionSelector, CUIRegion
|
|||||||
|
|
||||||
session.describeCUI(player);
|
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
|
@Override
|
||||||
|
@ -32,6 +32,9 @@ import com.sk89q.worldedit.regions.CuboidRegion;
|
|||||||
import com.sk89q.worldedit.regions.Region;
|
import com.sk89q.worldedit.regions.Region;
|
||||||
import com.sk89q.worldedit.regions.RegionSelector;
|
import com.sk89q.worldedit.regions.RegionSelector;
|
||||||
import com.sk89q.worldedit.regions.selector.limit.SelectorLimits;
|
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 com.sk89q.worldedit.world.World;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -154,9 +157,13 @@ public class CuboidRegionSelector implements RegionSelector, CUIRegion {
|
|||||||
checkNotNull(pos);
|
checkNotNull(pos);
|
||||||
|
|
||||||
if (position1 != null && position2 != null) {
|
if (position1 != null && position2 != null) {
|
||||||
player.print("First position set to " + position1 + " (" + region.getArea() + ").");
|
player.printInfo(TranslatableComponent.of(
|
||||||
} else {
|
"worldedit.selection.cuboid.explain.primary-area",
|
||||||
player.print("First position set to " + position1 + ".");
|
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()));
|
session.dispatchCUIEvent(player, new SelectionPointEvent(0, pos, getArea()));
|
||||||
@ -169,9 +176,13 @@ public class CuboidRegionSelector implements RegionSelector, CUIRegion {
|
|||||||
checkNotNull(pos);
|
checkNotNull(pos);
|
||||||
|
|
||||||
if (position1 != null && position2 != null) {
|
if (position1 != null && position2 != null) {
|
||||||
player.print("Second position set to " + position2 + " (" + region.getArea() + ").");
|
player.printInfo(TranslatableComponent.of(
|
||||||
} else {
|
"worldedit.selection.cuboid.explain.secondary-area",
|
||||||
player.print("Second position set to " + position2 + ".");
|
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()));
|
session.dispatchCUIEvent(player, new SelectionPointEvent(1, pos, getArea()));
|
||||||
@ -241,15 +252,15 @@ public class CuboidRegionSelector implements RegionSelector, CUIRegion {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getInformationLines() {
|
public List<Component> getSelectionInfoLines() {
|
||||||
final List<String> lines = new ArrayList<>();
|
final List<Component> lines = new ArrayList<>();
|
||||||
|
|
||||||
if (position1 != null) {
|
if (position1 != null) {
|
||||||
lines.add("Position 1: " + position1);
|
lines.add(TranslatableComponent.of("worldedit.selection.cuboid.info.pos1", TextComponent.of(position1.toString())));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (position2 != null) {
|
if (position2 != null) {
|
||||||
lines.add("Position 2: " + position2);
|
lines.add(TranslatableComponent.of("worldedit.selection.cuboid.info.pos2", TextComponent.of(position2.toString())));
|
||||||
}
|
}
|
||||||
|
|
||||||
return lines;
|
return lines;
|
||||||
|
@ -36,6 +36,9 @@ import com.sk89q.worldedit.regions.CylinderRegion;
|
|||||||
import com.sk89q.worldedit.regions.Region;
|
import com.sk89q.worldedit.regions.Region;
|
||||||
import com.sk89q.worldedit.regions.RegionSelector;
|
import com.sk89q.worldedit.regions.RegionSelector;
|
||||||
import com.sk89q.worldedit.regions.selector.limit.SelectorLimits;
|
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 com.sk89q.worldedit.world.World;
|
||||||
|
|
||||||
import java.text.NumberFormat;
|
import java.text.NumberFormat;
|
||||||
@ -166,7 +169,7 @@ public class CylinderRegionSelector implements RegionSelector, CUIRegion {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void explainPrimarySelection(Actor player, LocalSession session, BlockVector3 pos) {
|
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);
|
session.describeCUI(player);
|
||||||
}
|
}
|
||||||
@ -176,9 +179,14 @@ public class CylinderRegionSelector implements RegionSelector, CUIRegion {
|
|||||||
Vector3 center = region.getCenter();
|
Vector3 center = region.getCenter();
|
||||||
|
|
||||||
if (!center.equals(Vector3.ZERO)) {
|
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 {
|
} else {
|
||||||
player.printError("You must select the center point before setting the radius.");
|
player.printError(TranslatableComponent.of("worldedit.selection.cylinder.explain.secondary-missing"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -233,14 +241,14 @@ public class CylinderRegionSelector implements RegionSelector, CUIRegion {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getInformationLines() {
|
public List<Component> getSelectionInfoLines() {
|
||||||
final List<String> lines = new ArrayList<>();
|
final List<Component> lines = new ArrayList<>();
|
||||||
|
|
||||||
if (!region.getCenter().equals(Vector3.ZERO)) {
|
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)) {
|
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;
|
return lines;
|
||||||
|
@ -33,6 +33,9 @@ import com.sk89q.worldedit.regions.EllipsoidRegion;
|
|||||||
import com.sk89q.worldedit.regions.Region;
|
import com.sk89q.worldedit.regions.Region;
|
||||||
import com.sk89q.worldedit.regions.RegionSelector;
|
import com.sk89q.worldedit.regions.RegionSelector;
|
||||||
import com.sk89q.worldedit.regions.selector.limit.SelectorLimits;
|
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 com.sk89q.worldedit.world.World;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -145,9 +148,16 @@ public class EllipsoidRegionSelector implements RegionSelector, CUIRegion {
|
|||||||
@Override
|
@Override
|
||||||
public void explainPrimarySelection(Actor player, LocalSession session, BlockVector3 pos) {
|
public void explainPrimarySelection(Actor player, LocalSession session, BlockVector3 pos) {
|
||||||
if (isDefined()) {
|
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 {
|
} 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);
|
session.describeCUI(player);
|
||||||
@ -156,9 +166,16 @@ public class EllipsoidRegionSelector implements RegionSelector, CUIRegion {
|
|||||||
@Override
|
@Override
|
||||||
public void explainSecondarySelection(Actor player, LocalSession session, BlockVector3 pos) {
|
public void explainSecondarySelection(Actor player, LocalSession session, BlockVector3 pos) {
|
||||||
if (isDefined()) {
|
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 {
|
} 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);
|
session.describeCUI(player);
|
||||||
@ -204,17 +221,17 @@ public class EllipsoidRegionSelector implements RegionSelector, CUIRegion {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getInformationLines() {
|
public List<Component> getSelectionInfoLines() {
|
||||||
final List<String> lines = new ArrayList<>();
|
final List<Component> lines = new ArrayList<>();
|
||||||
|
|
||||||
final Vector3 center = region.getCenter();
|
final Vector3 center = region.getCenter();
|
||||||
if (center.lengthSq() > 0) {
|
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();
|
final Vector3 radius = region.getRadius();
|
||||||
if (radius.lengthSq() > 0) {
|
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;
|
return lines;
|
||||||
|
@ -24,6 +24,8 @@ import com.sk89q.worldedit.extension.platform.Actor;
|
|||||||
import com.sk89q.worldedit.math.BlockVector3;
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
import com.sk89q.worldedit.regions.RegionSelector;
|
import com.sk89q.worldedit.regions.RegionSelector;
|
||||||
import com.sk89q.worldedit.regions.selector.limit.SelectorLimits;
|
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 com.sk89q.worldedit.world.World;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
@ -129,14 +131,22 @@ public class ExtendingCuboidRegionSelector extends CuboidRegionSelector {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void explainPrimarySelection(Actor player, LocalSession session, BlockVector3 pos) {
|
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);
|
explainRegionAdjust(player, session);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void explainSecondarySelection(Actor player, LocalSession session, BlockVector3 pos) {
|
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);
|
explainRegionAdjust(player, session);
|
||||||
}
|
}
|
||||||
|
@ -34,6 +34,9 @@ import com.sk89q.worldedit.regions.Polygonal2DRegion;
|
|||||||
import com.sk89q.worldedit.regions.Region;
|
import com.sk89q.worldedit.regions.Region;
|
||||||
import com.sk89q.worldedit.regions.RegionSelector;
|
import com.sk89q.worldedit.regions.RegionSelector;
|
||||||
import com.sk89q.worldedit.regions.selector.limit.SelectorLimits;
|
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 com.sk89q.worldedit.world.World;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@ -163,7 +166,7 @@ public class Polygonal2DRegionSelector implements RegionSelector, CUIRegion {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void explainPrimarySelection(Actor player, LocalSession session, BlockVector3 pos) {
|
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 SelectionShapeEvent(getTypeID()));
|
||||||
session.dispatchCUIEvent(player, new SelectionPoint2DEvent(0, pos, getArea()));
|
session.dispatchCUIEvent(player, new SelectionPoint2DEvent(0, pos, getArea()));
|
||||||
@ -172,7 +175,11 @@ public class Polygonal2DRegionSelector implements RegionSelector, CUIRegion {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void explainSecondarySelection(Actor player, LocalSession session, BlockVector3 pos) {
|
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 SelectionPoint2DEvent(region.size() - 1, pos, getArea()));
|
||||||
session.dispatchCUIEvent(player, new SelectionMinMaxEvent(region.getMinimumY(), region.getMaximumY()));
|
session.dispatchCUIEvent(player, new SelectionMinMaxEvent(region.getMinimumY(), region.getMaximumY()));
|
||||||
@ -230,8 +237,8 @@ public class Polygonal2DRegionSelector implements RegionSelector, CUIRegion {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getInformationLines() {
|
public List<Component> getSelectionInfoLines() {
|
||||||
return Collections.singletonList("# points: " + region.size());
|
return Collections.singletonList(TranslatableComponent.of("worldedit.selection.polygon2d.info", TextComponent.of(region.size())));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -25,6 +25,8 @@ import com.sk89q.worldedit.math.BlockVector3;
|
|||||||
import com.sk89q.worldedit.math.Vector3;
|
import com.sk89q.worldedit.math.Vector3;
|
||||||
import com.sk89q.worldedit.regions.RegionSelector;
|
import com.sk89q.worldedit.regions.RegionSelector;
|
||||||
import com.sk89q.worldedit.regions.selector.limit.SelectorLimits;
|
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 com.sk89q.worldedit.world.World;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
@ -88,9 +90,13 @@ public class SphereRegionSelector extends EllipsoidRegionSelector {
|
|||||||
@Override
|
@Override
|
||||||
public void explainSecondarySelection(Actor player, LocalSession session, BlockVector3 pos) {
|
public void explainSecondarySelection(Actor player, LocalSession session, BlockVector3 pos) {
|
||||||
if (isDefined()) {
|
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 {
|
} 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);
|
session.describeCUI(player);
|
||||||
|
@ -292,6 +292,35 @@
|
|||||||
"worldedit.operation.affected.entity": "{0} entities affected",
|
"worldedit.operation.affected.entity": "{0} entities affected",
|
||||||
"worldedit.operation.deform.expression": "deformed using {0}",
|
"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.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.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."
|
"worldedit.help.subcommand-not-found": "The sub-command '{0}' under '{1}' could not be found."
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren