Tiny tweaks (style, javadoc, add to a todo a bit)
/*
- * Copyright 2016 MovingBlocks
+ * Copyright 2017 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import java.util.Set;
import java.util.stream.Collectors;
+/**
+ * Contains a series of handy game console commands associated with blocks.
+ */
@RegisterSystem
@Share(BlockCommands.class)
public class BlockCommands extends BaseComponentSystem {
@@ -137,7 +140,6 @@ public String listItems(@CommandParam(value = "startsWith", required = false) S
return items.toString();
}
-
@Command(shortDescription = "List all available blocks\nYou can filter by adding the beginning of words after the" +
"commands, e.g.: \"listBlocks engine: core:\" will list all blocks from the engine and core module",
requiredPermission = PermissionManager.CHEAT_PERMISSION)
@@ -217,7 +219,6 @@ public String listFreeShapeBlocks(@CommandParam(value = "startsWith", required =
return stringBuilder.toString();
}
-
@Command(shortDescription = "Replaces a block in front of user",
helpText = "Replaces a block in front of the user at the specified max distance", runOnServer = true, requiredPermission = PermissionManager.CHEAT_PERMISSION)
public void replaceBlock(
@@ -249,9 +250,7 @@ public void replaceBlock(
}
}
}
-
}
-
}
@Command(shortDescription = "Gives multiple stacks of blocks matching a search",
@@ -349,7 +348,7 @@ private String giveBlock(BlockFamily blockFamily, int quantity, EntityRef client
return "Here, have these zero (0) blocks just like you wanted";
}
//continue giving blocks until there are no more blocks to give
- //TODO reference maxStackSize instead of explicitely subtracting 99
+ //TODO reference maxStackSize instead of explicitly subtracting 99 and introduce an upper bound? 10 million lags ..
for (int quantityLeft = quantity; quantityLeft > 0; quantityLeft -= 99) {
EntityRef item = blockItemFactory.newInstance(blockFamily, quantityLeft > 99 ? 99 : quantityLeft);
if (!item.exists()) {
