Add a few more strings

This commit is contained in:
Matthew Miller
2019-10-22 20:14:52 +10:00
parent c01d2f7c24
commit 455a40b3fc
4 changed files with 35 additions and 17 deletions

View File

@ -36,6 +36,8 @@ import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.math.Vector3;
import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.util.TreeGenerator.TreeType;
import com.sk89q.worldedit.util.formatting.text.TextComponent;
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
import com.sk89q.worldedit.world.biome.BiomeType;
import org.enginehub.piston.annotation.Command;
import org.enginehub.piston.annotation.CommandContainer;
@ -49,6 +51,7 @@ import static com.sk89q.worldedit.command.util.Logging.LogMode.ALL;
import static com.sk89q.worldedit.command.util.Logging.LogMode.PLACEMENT;
import static com.sk89q.worldedit.command.util.Logging.LogMode.POSITION;
import static com.sk89q.worldedit.internal.command.CommandUtil.checkCommandArgument;
import static com.sk89q.worldedit.util.translation.LocalisationHelpers.pluraliseI18n;
/**
* Commands for the generation of shapes and other objects.
@ -113,7 +116,7 @@ public class GenerationCommands {
break;
default:
actor.printError("You must either specify 1 or 2 radius values.");
actor.printError(TranslatableComponent.of("worldedit.cyl.invalid-radius"));
return 0;
}
@ -123,7 +126,7 @@ public class GenerationCommands {
BlockVector3 pos = session.getPlacementPosition(actor);
int affected = editSession.makeCylinder(pos, pattern, radiusX, radiusZ, height, !hollow);
actor.print(affected + " block(s) have been created.");
actor.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.cyl.created", affected), TextComponent.of(affected)));
return affected;
}
@ -173,7 +176,7 @@ public class GenerationCommands {
break;
default:
actor.printError("You must either specify 1 or 3 radius values.");
actor.printError(TranslatableComponent.of("worldedit.sphere.invalid-radius"));
return 0;
}
@ -190,7 +193,7 @@ public class GenerationCommands {
if (actor instanceof Player) {
((Player) actor).findFreePosition();
}
actor.print(affected + " block(s) have been created.");
actor.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.sphere.created", affected), TextComponent.of(affected)));
return affected;
}
@ -211,7 +214,7 @@ public class GenerationCommands {
worldEdit.checkMaxRadius(size);
density /= 100;
int affected = editSession.makeForest(session.getPlacementPosition(actor), size, density, type);
actor.print(affected + " trees created.");
actor.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.forestgen.created", affected), TextComponent.of(affected)));
return affected;
}
@ -226,7 +229,7 @@ public class GenerationCommands {
int size) throws WorldEditException {
worldEdit.checkMaxRadius(size);
int affected = editSession.makePumpkinPatches(session.getPlacementPosition(actor), size);
actor.print(affected + " pumpkin patches created.");
actor.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.pumpkins.created", affected), TextComponent.of(affected)));
return affected;
}
@ -263,7 +266,7 @@ public class GenerationCommands {
if (actor instanceof Player) {
((Player) actor).findFreePosition();
}
actor.print(affected + " block(s) have been created.");
actor.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.pyramid.created", affected), TextComponent.of(affected)));
return affected;
}
@ -322,10 +325,10 @@ public class GenerationCommands {
if (actor instanceof Player) {
((Player) actor).findFreePosition();
}
actor.print(affected + " block(s) have been created.");
actor.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.generate.created", affected), TextComponent.of(affected)));
return affected;
} catch (ExpressionException e) {
actor.printError(e.getMessage());
actor.printError(TextComponent.of(e.getMessage()));
return 0;
}
}
@ -381,10 +384,10 @@ public class GenerationCommands {
try {
final int affected = editSession.makeBiomeShape(region, zero, unit, target, String.join(" ", expression), hollow, session.getTimeout());
actor.print("" + affected + " columns affected.");
actor.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.generatebiome.changed", affected), TextComponent.of(affected)));
return affected;
} catch (ExpressionException e) {
actor.printError(e.getMessage());
actor.printError(TextComponent.of(e.getMessage()));
return 0;
}
}