mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-07-18 13:24:43 +02:00
Compare commits
1 Commits
feature/v6
...
feature/v6
Author | SHA1 | Date | |
---|---|---|---|
9ee3e9a3a4 |
@ -142,14 +142,6 @@ public class Auto extends SubCommand {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int maxMerge = Permissions.hasPermissionRange(player, Permission.PERMISSION_MERGE, Settings.Limit.MAX_PLOTS);
|
|
||||||
if (sizeX * sizeZ > maxMerge) {
|
|
||||||
player.sendMessage(
|
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
|
||||||
Template.of("node", Permission.PERMISSION_MERGE + "." + (sizeX * sizeZ))
|
|
||||||
);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ public class Merge extends SubCommand {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final int size = plot.getConnectedPlots().size();
|
final int size = plot.getConnectedPlots().size();
|
||||||
int max = Permissions.hasPermissionRange(player, Permission.PERMISSION_MERGE, Settings.Limit.MAX_PLOTS);
|
int max = Permissions.hasPermissionRange(player, "plots.merge", Settings.Limit.MAX_PLOTS);
|
||||||
PlotMergeEvent event =
|
PlotMergeEvent event =
|
||||||
this.eventDispatcher.callMerge(plot, direction, max, player);
|
this.eventDispatcher.callMerge(plot, direction, max, player);
|
||||||
if (event.getEventResult() == Result.DENY) {
|
if (event.getEventResult() == Result.DENY) {
|
||||||
|
@ -234,8 +234,19 @@ public class HybridUtils {
|
|||||||
Set<BlockType> types = new HashSet<>();
|
Set<BlockType> types = new HashSet<>();
|
||||||
for (int yIndex = 0; yIndex < height; yIndex++) {
|
for (int yIndex = 0; yIndex < height; yIndex++) {
|
||||||
BlockState old = oldBlocks[yIndex][x][z]; // Nullable
|
BlockState old = oldBlocks[yIndex][x][z]; // Nullable
|
||||||
try {
|
|
||||||
BlockState now = newBlocks[yIndex][x][z]; // Not null
|
BlockState now = newBlocks[yIndex][x][z]; // Not null
|
||||||
|
if (now == null) {
|
||||||
|
throw new NullPointerException(String.format(
|
||||||
|
"\"now\" block null attempting to perform plot analysis. Indexes: x=%d of %d, yIndex=%d" +
|
||||||
|
" of %d, z=%d of %d",
|
||||||
|
x,
|
||||||
|
width,
|
||||||
|
yIndex,
|
||||||
|
height,
|
||||||
|
z,
|
||||||
|
length
|
||||||
|
));
|
||||||
|
}
|
||||||
if (!now.equals(old) && !(old == null && now.getBlockType().equals(BlockTypes.AIR))) {
|
if (!now.equals(old) && !(old == null && now.getBlockType().equals(BlockTypes.AIR))) {
|
||||||
changes[i]++;
|
changes[i]++;
|
||||||
}
|
}
|
||||||
@ -270,9 +281,6 @@ public class HybridUtils {
|
|||||||
}
|
}
|
||||||
types.add(now.getBlockType());
|
types.add(now.getBlockType());
|
||||||
}
|
}
|
||||||
} catch (NullPointerException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
variety[i] = types.size();
|
variety[i] = types.size();
|
||||||
i++;
|
i++;
|
||||||
|
Reference in New Issue
Block a user