I hope this works
I copy pasted above code and edited a bit to see if it works (Btw, that is basically how I did #224)
This commit is contained in:
1 parent
08e42523ba
commit
fe9ad4b297
1 file changed
+23
-17
@@ -45,21 +45,28 @@ public class DrawCommand {
|
|||||||
BlockStateArgumentType.getBlockState(c, "block"),
|
BlockStateArgumentType.getBlockState(c, "block"),
|
||||||
BlockPredicateArgumentType.getBlockPredicate(c,
|
BlockPredicateArgumentType.getBlockPredicate(c,
|
||||||
"filter")))))))))
|
"filter")))))))))
|
||||||
.then(literal("diamond").then(argument("centre", BlockPosArgumentType.blockPos())
|
.then(literal("diamond").then(argument("center", BlockPosArgumentType.blockPos())
|
||||||
.then(argument("radius", IntegerArgumentType.integer(1)).then(
|
.then(argument("radius", IntegerArgumentType.integer(1))
|
||||||
argument("block", BlockStateArgumentType.blockState()).executes((c) -> drawDiamond(
|
.then(argument("block", BlockStateArgumentType.blockState())
|
||||||
c.getSource(), BlockPosArgumentType.getBlockPos(c, "centre"),
|
.executes((c) -> drawDiamond(c.getSource(),
|
||||||
IntegerArgumentType.getInteger(c, "radius"),
|
BlockPosArgumentType.getBlockPos(c, "center"),
|
||||||
BlockStateArgumentType.getBlockState(c, "block"), null)
|
IntegerArgumentType.getInteger(c, "radius"),
|
||||||
.then(literal("replace").then(
|
BlockStateArgumentType.getBlockState(c, "block"), null))
|
||||||
argument("filter", BlockPredicateArgumentType.blockPredicate())
|
.then(literal("replace")
|
||||||
.executes((c) -> drawDiamond(c.getSource(),
|
.then(argument("filter", BlockPredicateArgumentType.blockPredicate())
|
||||||
BlockPosArgumentType.getBlockPos(c, "centre"),
|
.executes((c) -> drawDiamond(c.getSource(),
|
||||||
IntegerArgumentType.getInteger(c, "radius"),
|
BlockPosArgumentType.getBlockPos(c, "center"),
|
||||||
BlockStateArgumentType.getBlockState(c,
|
IntegerArgumentType.getInteger(c, "radius"),
|
||||||
"block"),
|
BlockStateArgumentType.getBlockState(c, "block"),
|
||||||
BlockPredicateArgumentType.getBlockPredicate(c,
|
BlockPredicateArgumentType.getBlockPredicate(c,"filter")
|
||||||
"filter"))))))))));
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
dispatcher.register(command);
|
dispatcher.register(command);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,8 +176,7 @@ public class DrawCommand {
|
|||||||
return (int) drawDiamond(source, pos, radius, block, replacement, false);
|
return (int) drawDiamond(source, pos, radius, block, replacement, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static double drawDiamond(ServerCommandSource source, BlockPos pos, int radius,
|
private static int drawDiamond(ServerCommandSource source, BlockPos pos, int radius,BlockStateArgument block,
|
||||||
BlockStateArgument block,
|
|
||||||
Predicate<CachedBlockPosition> replacement, boolean solid) {
|
Predicate<CachedBlockPosition> replacement, boolean solid) {
|
||||||
int affected = 0;
|
int affected = 0;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user