mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-01 02:46:41 +00:00
Javadoc and Formatting fixes. (#619)
Javadoc and Formatting fixes. Also, extremely minor code changes which have been tested. This commit is only part one of two commits that aim to fix problems with formatting in our project. In part two I will modify the Google Java Style Guide (since it closely matches our code style) for our project so there is guidance on how to format and document. * Updated PlotSquared URL * Removed plugin acronyms * Fixed a typo * Fixed grammar * Use modern block id's * Update YouTube video URL
This commit is contained in:
@ -108,26 +108,26 @@ public class GenerationCommands {
|
||||
@Arg(name = "pocketMax", desc = "TODO", def = "3") int pocketMaxOpt) throws WorldEditException {
|
||||
CavesGen gen = new CavesGen(sizeOpt, frequencyOpt, rarityOpt, minYOpt, maxYOpt, systemFrequencyOpt, individualRarityOpt, pocketChanceOpt, pocketMinOpt, pocketMaxOpt);
|
||||
editSession.generate(region, gen);
|
||||
actor.print(Caption.of("fawe.worldedit.visitor.visitor.block" , editSession.getBlockChangeCount()));
|
||||
actor.print(Caption.of("fawe.worldedit.visitor.visitor.block", editSession.getBlockChangeCount()));
|
||||
}
|
||||
|
||||
|
||||
@Command(
|
||||
name = "/ores",
|
||||
desc = "Generates ores"
|
||||
name = "/ores",
|
||||
desc = "Generates ores"
|
||||
)
|
||||
@CommandPermissions("worldedit.generation.ore")
|
||||
@Logging(PLACEMENT)
|
||||
@Confirm(Confirm.Processor.REGION)
|
||||
public void ores(Actor actor, LocalSession session, EditSession editSession, @Selection Region region, @Arg(desc = "Mask") Mask mask) throws WorldEditException {
|
||||
editSession.addOres(region, mask);
|
||||
actor.print(Caption.of("fawe.worldedit.visitor.visitor.block" , editSession.getBlockChangeCount()));
|
||||
actor.print(Caption.of("fawe.worldedit.visitor.visitor.block", editSession.getBlockChangeCount()));
|
||||
}
|
||||
|
||||
@Command(
|
||||
name = "/img",
|
||||
aliases = { "/image", "image" },
|
||||
desc = "Generate an image"
|
||||
name = "/img",
|
||||
aliases = { "/image", "image" },
|
||||
desc = "Generate an image"
|
||||
)
|
||||
@CommandPermissions("worldedit.generation.image")
|
||||
@Logging(PLACEMENT)
|
||||
@ -155,7 +155,9 @@ public class GenerationCommands {
|
||||
int color = finalImage.getRGB(x, z);
|
||||
BlockType block = tu.getNearestBlock(color);
|
||||
count[0]++;
|
||||
if (block != null) return editSession.setBlock(pos, block.getDefaultState());
|
||||
if (block != null) {
|
||||
return editSession.setBlock(pos, block.getDefaultState());
|
||||
}
|
||||
return false;
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
@ -163,19 +165,19 @@ public class GenerationCommands {
|
||||
return false;
|
||||
});
|
||||
Operations.completeBlindly(visitor);
|
||||
actor.print(Caption.of("fawe.worldedit.visitor.visitor.block" , editSession.getBlockChangeCount()));
|
||||
actor.print(Caption.of("fawe.worldedit.visitor.visitor.block", editSession.getBlockChangeCount()));
|
||||
}
|
||||
|
||||
@Command(
|
||||
name = "/ore",
|
||||
desc = "Generates ores"
|
||||
name = "/ore",
|
||||
desc = "Generates ores"
|
||||
)
|
||||
@CommandPermissions("worldedit.generation.ore")
|
||||
@Logging(PLACEMENT)
|
||||
@Confirm(Confirm.Processor.REGION)
|
||||
public void ore(Actor actor, LocalSession session, EditSession editSession, @Selection Region region, @Arg(desc = "Mask") Mask mask, @Arg(desc = "Pattern") Pattern material, @Arg(desc="Ore vein size") @Range(from = 0, to=Integer.MAX_VALUE) int size, int freq, @Range(from=0, to=100) int rarity, @Range(from=0, to=255) int minY, @Range(from=0, to=255) int maxY) throws WorldEditException {
|
||||
editSession.addOre(region, mask, material, size, freq, rarity, minY, maxY);
|
||||
actor.print(Caption.of("fawe.worldedit.visitor.visitor.block" , editSession.getBlockChangeCount()));
|
||||
actor.print(Caption.of("fawe.worldedit.visitor.visitor.block", editSession.getBlockChangeCount()));
|
||||
}
|
||||
|
||||
@Command(
|
||||
@ -211,7 +213,8 @@ public class GenerationCommands {
|
||||
int height,
|
||||
@Switch(name = 'h', desc = "Make a hollow cylinder")
|
||||
boolean hollow) throws WorldEditException {
|
||||
final double radiusX, radiusZ;
|
||||
final double radiusX;
|
||||
final double radiusZ;
|
||||
switch (radii.size()) {
|
||||
case 1:
|
||||
radiusX = radiusZ = Math.max(1, radii.get(0));
|
||||
@ -270,7 +273,9 @@ public class GenerationCommands {
|
||||
boolean raised,
|
||||
@Switch(name = 'h', desc = "Make a hollow sphere")
|
||||
boolean hollow) throws WorldEditException {
|
||||
final double radiusX, radiusY, radiusZ;
|
||||
final double radiusX;
|
||||
final double radiusY;
|
||||
final double radiusZ;
|
||||
switch (radii.size()) {
|
||||
case 1:
|
||||
radiusX = radiusY = radiusZ = Math.max(0, radii.get(0));
|
||||
@ -427,9 +432,15 @@ public class GenerationCommands {
|
||||
zero = max.add(min).multiply(0.5);
|
||||
unit = max.subtract(zero);
|
||||
|
||||
if (unit.getX() == 0) unit = unit.withX(1.0);
|
||||
if (unit.getY() == 0) unit = unit.withY(1.0);
|
||||
if (unit.getZ() == 0) unit = unit.withZ(1.0);
|
||||
if (unit.getX() == 0) {
|
||||
unit = unit.withX(1.0);
|
||||
}
|
||||
if (unit.getY() == 0) {
|
||||
unit = unit.withY(1.0);
|
||||
}
|
||||
if (unit.getZ() == 0) {
|
||||
unit = unit.withZ(1.0);
|
||||
}
|
||||
}
|
||||
|
||||
final Vector3 unit1 = unit;
|
||||
@ -451,9 +462,9 @@ public class GenerationCommands {
|
||||
name = "/generatebiome",
|
||||
aliases = { "/genbiome", "/gb" },
|
||||
desc = "Sets biome according to a formula.",
|
||||
descFooter = "Formula must return positive numbers (true) if the point is inside the shape\n" +
|
||||
"Sets the biome of blocks in that shape.\n"
|
||||
+"See also https://tinyurl.com/weexpr."
|
||||
descFooter = "Formula must return positive numbers (true) if the point is inside the shape\n"
|
||||
+ "Sets the biome of blocks in that shape.\n"
|
||||
+ "See also https://tinyurl.com/weexpr."
|
||||
)
|
||||
@CommandPermissions("worldedit.generation.shape.biome")
|
||||
@Logging(ALL)
|
||||
@ -494,9 +505,15 @@ public class GenerationCommands {
|
||||
zero = max.add(min).multiply(0.5);
|
||||
unit = max.subtract(zero);
|
||||
|
||||
if (unit.getX() == 0) unit = unit.withX(1.0);
|
||||
if (unit.getY() == 0) unit = unit.withY(1.0);
|
||||
if (unit.getZ() == 0) unit = unit.withZ(1.0);
|
||||
if (unit.getX() == 0) {
|
||||
unit = unit.withX(1.0);
|
||||
}
|
||||
if (unit.getY() == 0) {
|
||||
unit = unit.withY(1.0);
|
||||
}
|
||||
if (unit.getZ() == 0) {
|
||||
unit = unit.withZ(1.0);
|
||||
}
|
||||
}
|
||||
|
||||
final Vector3 unit1 = unit;
|
||||
|
Reference in New Issue
Block a user