Skip to content

Commit

Permalink
Format and release 0.0.23-RC1
Browse files Browse the repository at this point in the history
  • Loading branch information
cjburkey01 committed Dec 6, 2021
1 parent db16245 commit 5589658
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 13 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ plugins {
}

object DepData {
const val LIVE_VERSION = "0.0.22";
const val THIS_VERSION = "0.0.23-prev16permfix";
const val LIVE_VERSION = "0.0.23-RC1";
const val THIS_VERSION = "0.0.23-RC1";
const val PLUGIN_NAME = "ClaimChunk";
const val ARCHIVES_BASE_NAME = "claimchunk";
const val MAIN_CLASS = "com.cjburkey.claimchunk.ClaimChunk";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

import com.cjburkey.claimchunk.ClaimChunk;
import com.cjburkey.claimchunk.smartcommand.CCSubCommand;

import de.goldmensch.commanddispatcher.Executor;

import org.bukkit.Chunk;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
Expand All @@ -26,7 +28,7 @@ public ScanCmd(ClaimChunk claimChunk) {
@Override
public CCArg[] getPermittedArguments() {
return new CCArg[] {
new CCArg("scanDistance", CCAutoComplete.NONE),
new CCArg("scanDistance", CCAutoComplete.NONE),
};
}

Expand All @@ -43,11 +45,17 @@ public boolean onCall(@NotNull String cmdUsed, @NotNull CommandSender executor,
List<Chunk> nearbyChunks = new ArrayList<>();
int near = claimChunk.chConfig().getNearChunkSearch();

if (args.length > 0 && isInteger(args[0], 10))
near = Integer.parseInt(args[0]);
if (args.length > 0 && isInteger(args[0], 10)) near = Integer.parseInt(args[0]);

if (near > claimChunk.chConfig().getMaxScanRange()) {
messagePly(player, claimChunk.getMessages().scanInputTooBig.replace("%%MAXAREA%%", String.valueOf(claimChunk.chConfig().getMaxScanRange())));
messagePly(
player,
claimChunk
.getMessages()
.scanInputTooBig
.replace(
"%%MAXAREA%%",
String.valueOf(claimChunk.chConfig().getMaxScanRange())));
return true;
}

Expand All @@ -59,16 +67,23 @@ public boolean onCall(@NotNull String cmdUsed, @NotNull CommandSender executor,
for (int x1 = -min; x1 < max; x1++) {
for (int z1 = -min; z1 < max; z1++) {

final Chunk chunk = player.getWorld().getChunkAt(x1 + playerChunk.getX(), z1 + playerChunk.getZ());
final Chunk chunk =
player.getWorld()
.getChunkAt(x1 + playerChunk.getX(), z1 + playerChunk.getZ());

if (claimChunk.getChunkHandler().isClaimed(chunk) && !claimChunk.getChunkHandler().isOwner(chunk, player))
if (claimChunk.getChunkHandler().isClaimed(chunk)
&& !claimChunk.getChunkHandler().isOwner(chunk, player))
nearbyChunks.add(chunk);
}
}

messagePly(player, claimChunk.getMessages().claimsFound
.replace("%%NEARBY%%", String.valueOf(nearbyChunks.size()))
.replace("%%RADIUS%%", String.valueOf(near)));
messagePly(
player,
claimChunk
.getMessages()
.claimsFound
.replace("%%NEARBY%%", String.valueOf(nearbyChunks.size()))
.replace("%%RADIUS%%", String.valueOf(near)));
return true;
}

Expand All @@ -79,8 +94,8 @@ public boolean isInteger(String s, int radix) {
if (s.length() == 1) return false;
else continue;
}
if (Character.digit(s.charAt(i),radix) < 0) return false;
if (Character.digit(s.charAt(i), radix) < 0) return false;
}
return true;
}
}
}

0 comments on commit 5589658

Please sign in to comment.