Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public class AssignSubCommand extends SubCommand {
HELP.add(" §a/vrplot assign §8<§7plot§8> §8<§7username§8>");
}

public AssignSubCommand(CommandSender sender, Command command, String label, String[] args, boolean bypass) throws FailedCommandException {
super(sender, command, label, args, bypass, HELP);
public AssignSubCommand(CommandSender sender, Command command, String label, String[] args) throws FailedCommandException {
super(sender, command, label, args, HELP);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,15 @@ public void preview(Location playerPreviewLocation, boolean visualization, boole
default:
throw new IllegalStateException("Unexpected value: " + direction);
}
Location distanceCalculateLoc = previewLocation;
if (playerPreviewLocation != null) {
distanceCalculateLoc = playerPreviewLocation;
}
for (int x = minX - 1; x < maxX; x++) {
for (int z = minZ; z < maxZ; z++) {
if (x == minX - 1 || z == minZ || x == maxX - 1 || z == maxZ - 1) {
Block block = previewLocation.getWorld().getBlockAt(x, previewLocation.getBlockY(), z);
if (previewLocation.distance(block.getLocation()) < maxDistance) {
if (distanceCalculateLoc.distance(block.getLocation()) < maxDistance) {
borderBlocks.add(block);
}
}
Expand Down Expand Up @@ -164,7 +168,7 @@ public void preview(Location playerPreviewLocation, boolean visualization, boole
BlockVector2 secondPillarV = BlockVector2.at(maxX - 1, minZ);
BlockVector2 thirdPillarV = BlockVector2.at(minX - 1, maxZ - 1);
BlockVector2 fourthPillarV = BlockVector2.at(maxX - 1, maxZ - 1);
BlockVector2 previewV = BlockVector2.at(previewLocation.getBlockX(), previewLocation.getBlockZ());
BlockVector2 previewV = BlockVector2.at(distanceCalculateLoc.getBlockX(), distanceCalculateLoc.getBlockZ());
if (VectorUtils.distance(previewV, firstPillarV) < maxDistance) {
for (int y = bottomLeftCorner.getBlockY(); y < bottomLeftCorner.getBlockY() + getHeight() + 10; y++) {
blocks.add(firstPillarV.toLocation(this.world, y).getBlock());
Expand Down