Compare commits

..

32 Commits
6.1.1 ... 6.1.3

Author SHA1 Message Date
5653d0f175 Release 6.1.3 2021-10-18 20:22:13 +02:00
b022a97196 fix: Flag list parsing for console players (#3277)
Instead of recreating the logic, we can simply reuse what we created above and string-ify that for parsing.
2021-10-18 20:20:52 +02:00
cb596ee6ea Fix StackOverFlow 2021-10-18 17:27:51 +01:00
4e391136c0 Add and Trust permission now count correctly (#3290) 2021-10-15 11:28:23 +01:00
a6a0e1d12f chore: Update dependency org.checkerframework:checker-qual to v3.18.1 (#3283)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-10-10 00:23:32 +02:00
d2776eed5a [ci skip] Move to work level templates 2021-10-08 18:09:58 +02:00
6528c60f4d fix: Fix greeting & farewell captions not being used (#3272)
* fix: Fix greeting & farewell captions not being used

Fixes #3250

* feat: Allow alias in greeting & farewell flag
2021-10-07 08:10:00 +00:00
7ee46be2ac feat: Allow plot alias in title (#3273)
Fixes #3171
2021-10-07 08:07:13 +00:00
13bc231091 chore: Update com.fastasyncworldedit to v1.17-343 (#3282)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-10-05 10:26:42 +02:00
55d1a40394 chore: Update plugin shadow to v7.1.0 (#3284)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-10-04 20:18:56 +02:00
d70f99b489 fix: Respect tab-complete aliases (Fixes #3266) (#3268)
* Fixes #3250

* ListFlag#merge should not allow duplicates (Fixes #3157) (#3265)

* feat: Respect non-visible players in tab completion (Closes #3263) (#3264)

* Respect non-visible players in tab completion (Closes #3263)

* Deprecate old Tab-Complete methods instead of hard-replacing them

* wtf git

* Mark for removal, useless new-lines

* Pass ConsolePlayer.getConsole() instead of Nullable param

* Respect tab-complete aliases (Fixes #3266)

* Useless import

Co-authored-by: NotMyFault <mc.cache@web.de>
Co-authored-by: dordsor21 <dordsor21@gmail.com>
2021-10-04 17:10:36 +02:00
fde9735da2 chore: Update dependency net.kyori:adventure-api to v4.9.2 (#3278)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-10-04 17:05:52 +02:00
20f0aa3656 chore: Update com.fastasyncworldedit to v1.17-341 (#3275)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-10-04 17:05:38 +02:00
0b7bf2d26d chore: Update dependency dev.notmyfault.serverlib:ServerLib to v2.3.1 (#3276)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-10-04 17:05:24 +02:00
f10e38af63 [ci skip] chore: Improve pr template fields 2021-10-04 15:43:44 +02:00
21727ebfc7 build: Overhaul build & deployment workflow (#3267)
* Fixes #3250

* build: Overhaul build & deployment workflow

- Move to release drafter
- Replace publishing with gradle nexus
- Conventional commits are handy
- Determine build status in gh actions before deploying
2021-10-04 15:28:47 +02:00
e322ee85fd feat: Respect non-visible players in tab completion (Closes #3263) (#3264)
* Respect non-visible players in tab completion (Closes #3263)

* Deprecate old Tab-Complete methods instead of hard-replacing them

* wtf git

* Mark for removal, useless new-lines

* Pass ConsolePlayer.getConsole() instead of Nullable param
2021-10-03 14:32:02 +02:00
541255fe7e ListFlag#merge should not allow duplicates (Fixes #3157) (#3265) 2021-10-03 14:31:57 +02:00
20c2f36f6c Update com.fastasyncworldedit to v1.17-336 (#3258)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-09-29 18:09:46 +02:00
744f7a18ae Update dependency org.junit.jupiter:junit-jupiter to v5.8.1 (#3259)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-09-29 18:09:35 +02:00
18eece0b71 [ci skip] chore: Renovate
Closes #3260
2021-09-29 18:09:12 +02:00
4f12dcf966 Return base plot when using alias (#3253) 2021-09-25 15:58:31 +02:00
ee832528db [ci skip] Adjust renovate config
Closes #3252
2021-09-21 00:52:25 +02:00
bb5d6c91da Update Fawe version 2021-09-20 16:21:18 +02:00
6d4adecb32 6.1.3 2021-09-18 23:07:10 +01:00
c37b13dcb3 Fix bad move to adventure 2021-09-18 21:54:22 +01:00
086dac2ea4 Update dependency net.kyori:adventure-platform-bukkit to v4.0.0 (#3245)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-09-16 15:29:17 +02:00
b2b8598b5b Fix #3246 2021-09-15 13:19:25 +01:00
61e5d9f1b6 Move /p components title to translations file matching other parts of components
- Also component-ify title, this must not be limited to a String.
2021-09-15 11:13:03 +02:00
c8989b3332 Update dependency org.junit.jupiter:junit-jupiter to v5.8.0 (#3244)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-09-13 10:23:38 +02:00
9f54472dd6 Relocate annotations properly 2021-09-12 13:56:08 +02:00
115932c65a 6.1.2 2021-09-11 14:28:08 +02:00
46 changed files with 257 additions and 192 deletions

View File

@ -1008,6 +1008,6 @@ ij_html_uniform_ident = false
indent_size = 2 indent_size = 2
ij_yaml_keep_indents_on_empty_lines = false ij_yaml_keep_indents_on_empty_lines = false
ij_yaml_keep_line_breaks = true ij_yaml_keep_line_breaks = true
ij_yaml_space_before_colon = true ij_yaml_space_before_colon = false
ij_yaml_spaces_within_braces = true ij_yaml_spaces_within_braces = true
ij_yaml_spaces_within_brackets = true ij_yaml_spaces_within_brackets = true

12
.github/FUNDING.yml vendored
View File

@ -1,12 +0,0 @@
# These are supported funding model platforms
github: [NotMyFault, dordsor21, SirYwell]
patreon: IntellectualSites # Replace with a single Patreon username
open_collective: IntellectualSites
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: https://www.paypal.me/AlexanderBrandes # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

View File

@ -1,17 +0,0 @@
## Overview
<!-- Please describe which issue this Pull Request targets
If there is no issue, please create one so we can look into it before approving your PR.
You can do so here: https://github.com/IntellectualSites/PlotSquared/issues
-->
**Fixes {Link to issue}**
## Description
## Checklist
<!-- Make sure you have completed the following steps (put an "X" between of brackets): -->
- [] I included all information required in the sections above
- [] I tested my changes and approved their functionality
- [] I ensured my changes do not break other parts of the code
- [] I read and followed the [contribution guidelines](https://github.com/IntellectualSites/PlotSquared/blob/v6/CONTRIBUTING.md)

1
.github/release-drafter.yml vendored Normal file
View File

@ -0,0 +1 @@
_extends: .github

View File

@ -1,6 +1,6 @@
name: "build" name: "build"
on: ["pull_request", "push"] on: [ "pull_request", "push" ]
jobs: jobs:
build: build:
@ -8,10 +8,34 @@ jobs:
steps: steps:
- name: "Checkout Repository" - name: "Checkout Repository"
uses: "actions/checkout@v2.3.4" uses: "actions/checkout@v2.3.4"
- name: "Setup JDK 16" - name: "Validate Gradle Wrapper"
uses: "actions/setup-java@v2.2.0" uses: "gradle/wrapper-validation-action@v1.0.4"
- name: "Setup Java"
uses: "actions/setup-java@v2.3.1"
with: with:
distribution: "temurin" distribution: "temurin"
java-version: "16" java-version: "17"
- name: "Clean Build" - name: "Clean Build"
run: "./gradlew clean build" run: "./gradlew clean build"
- name: "Determine release status"
if: "${{ runner.os == 'Linux' }}"
run: |
if [ "$(./gradlew properties | awk '/^version:/ { print $2; }' | grep '\-SNAPSHOT')" ]; then
echo "STATUS=snapshot" >> $GITHUB_ENV
else
echo "STATUS=release" >> $GITHUB_ENV
fi
- name: "Publish Release"
if: "${{ runner.os == 'Linux' && env.STATUS == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/v6'}}"
run: "./gradlew publishToSonatype closeSonatypeStagingRepository"
env:
ORG_GRADLE_PROJECT_sonatypeUsername: "${{ secrets.SONATYPE_USERNAME }}"
ORG_GRADLE_PROJECT_sonatypePassword: "${{ secrets.SONATYPE_PASSWORD }}"
ORG_GRADLE_PROJECT_signingKey: "${{ secrets.SIGNING_KEY }}"
ORG_GRADLE_PROJECT_signingPassword: "${{ secrets.SIGNING_PASSWORD }}"
- name: "Publish Snapshot"
if: "${{ runner.os == 'Linux' && env.STATUS != 'release' && github.event_name == 'push' && github.ref == 'refs/heads/v6' }}"
run: "./gradlew publishToSonatype"
env:
ORG_GRADLE_PROJECT_sonatypeUsername: "${{ secrets.SONATYPE_USERNAME }}"
ORG_GRADLE_PROJECT_sonatypePassword: "${{ secrets.SONATYPE_PASSWORD }}"

14
.github/workflows/release-drafter.yml vendored Normal file
View File

@ -0,0 +1,14 @@
name: "draft release"
on:
push:
branches:
- v6
jobs:
update_release_draft:
runs-on: "ubuntu-latest"
steps:
- uses: "release-drafter/release-drafter@v5.15.0"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -1,12 +0,0 @@
name: "validate gradle wrapper"
on: ["pull_request", "push"]
jobs:
build:
runs-on: "ubuntu-20.04"
steps:
- name: "Checkout Repository"
uses: "actions/checkout@v2.3.4"
- name: "Validate Gradle Wrapper"
uses: "gradle/wrapper-validation-action@v1.0.4"

View File

@ -32,8 +32,8 @@ dependencies {
exclude(group = "org.bukkit") exclude(group = "org.bukkit")
exclude(group = "org.spigotmc") exclude(group = "org.spigotmc")
} }
compileOnlyApi(libs.fastasyncworldeditBukkit) compileOnlyApi(libs.fastasyncworldeditBukkit) { isTransitive = false }
testImplementation(libs.fastasyncworldeditBukkit) testImplementation(libs.fastasyncworldeditBukkit) { isTransitive = false }
compileOnly(libs.vault) { compileOnly(libs.vault) {
exclude(group = "org.bukkit") exclude(group = "org.bukkit")
} }
@ -80,6 +80,10 @@ tasks.named<ShadowJar>("shadowJar") {
relocate("com.intellectualsites.http", "com.plotsquared.core.http") relocate("com.intellectualsites.http", "com.plotsquared.core.http")
relocate("com.intellectualsites.paster", "com.plotsquared.core.paster") relocate("com.intellectualsites.paster", "com.plotsquared.core.paster")
relocate("org.incendo.serverlib", "com.plotsquared.bukkit.serverlib") relocate("org.incendo.serverlib", "com.plotsquared.bukkit.serverlib")
relocate("org.jetbrains", "com.plotsquared.core.annotations")
relocate("org.intellij.lang", "com.plotsquared.core.intellij.annotations")
relocate("javax.annotation", "com.plotsquared.core.annotation")
relocate("javax.inject", "com.plotsquared.core.annotation.inject")
// Get rid of all the libs which are 100% unused. // Get rid of all the libs which are 100% unused.
minimize() minimize()

View File

@ -27,6 +27,7 @@ package com.plotsquared.bukkit;
import com.plotsquared.bukkit.util.BukkitUtil; import com.plotsquared.bukkit.util.BukkitUtil;
import com.plotsquared.core.command.MainCommand; import com.plotsquared.core.command.MainCommand;
import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.player.ConsolePlayer; import com.plotsquared.core.player.ConsolePlayer;
import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.player.PlotPlayer;
import org.bukkit.command.Command; import org.bukkit.command.Command;
@ -42,6 +43,7 @@ import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Locale;
public class BukkitCommand implements CommandExecutor, TabCompleter { public class BukkitCommand implements CommandExecutor, TabCompleter {
@ -63,7 +65,7 @@ public class BukkitCommand implements CommandExecutor, TabCompleter {
@Override @Override
public List<String> onTabComplete( public List<String> onTabComplete(
CommandSender commandSender, Command command, String s, CommandSender commandSender, Command command, String label,
String[] args String[] args
) { ) {
if (!(commandSender instanceof Player)) { if (!(commandSender instanceof Player)) {
@ -73,8 +75,11 @@ public class BukkitCommand implements CommandExecutor, TabCompleter {
if (args.length == 0) { if (args.length == 0) {
return Collections.singletonList("plots"); return Collections.singletonList("plots");
} }
if (!Settings.Enabled_Components.TAB_COMPLETED_ALIASES.contains(label.toLowerCase(Locale.ENGLISH))) {
return List.of();
}
Collection<com.plotsquared.core.command.Command> objects = Collection<com.plotsquared.core.command.Command> objects =
MainCommand.getInstance().tab(player, args, s.endsWith(" ")); MainCommand.getInstance().tab(player, args, label.endsWith(" "));
if (objects == null) { if (objects == null) {
return null; return null;
} }

View File

@ -176,7 +176,7 @@ public class BukkitRegionManager extends RegionManager {
final boolean ignoreAugment, final boolean ignoreAugment,
final @Nullable Runnable whenDone final @Nullable Runnable whenDone
) { ) {
final BukkitWorld world = new BukkitWorld((World) pos1.getWorld()); final BukkitWorld world = (BukkitWorld) worldUtil.getWeWorld(pos1.getWorldName());
final int p1x = pos1.getX(); final int p1x = pos1.getX();
final int p1z = pos1.getZ(); final int p1z = pos1.getZ();

View File

@ -1,8 +0,0 @@
# Contributing
If you feel like you can improve the plugin any way, then you are more than welcome to contribute to PlotSquared. It would be highly appreciated if you made sure to test your code before committing it, as it will save us a lot of time and effort.
### Code Style
If you are planning to commit any changes to the project, it would be highly appreciated if you were to follow the project
code style conventions. To make this easier we have provided settings that can be picked up by your IDE.
IntelliJ: Install the `EditorConfig` plugin. Now IntelliJ is able to pick up the provided `.editorconfig` file automatically.

View File

@ -31,8 +31,8 @@ dependencies {
exclude(group = "dummypermscompat") exclude(group = "dummypermscompat")
} }
testImplementation(libs.worldeditCore) testImplementation(libs.worldeditCore)
compileOnlyApi(libs.fastasyncworldeditCore) compileOnlyApi(libs.fastasyncworldeditCore) { isTransitive = false }
testImplementation(libs.fastasyncworldeditCore) testImplementation(libs.fastasyncworldeditCore) { isTransitive = false }
// Logging // Logging
compileOnlyApi(libs.log4j) compileOnlyApi(libs.log4j)

View File

@ -132,7 +132,7 @@ public class Add extends Command {
checkTrue(!uuids.isEmpty(), null); checkTrue(!uuids.isEmpty(), null);
int localAddSize = plot.getMembers().size(); int localAddSize = plot.getMembers().size();
int maxAddSize = Permissions.hasPermissionRange(player, Permission.PERMISSION_ADD, Settings.Limit.MAX_PLOTS); int maxAddSize = Permissions.hasPermissionRange(player, Permission.PERMISSION_ADD, Settings.Limit.MAX_PLOTS);
if (localAddSize > maxAddSize) { if (localAddSize >= maxAddSize) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("members.plot_max_members_added"), TranslatableCaption.of("members.plot_max_members_added"),
Template.of("amount", String.valueOf(localAddSize)) Template.of("amount", String.valueOf(localAddSize))
@ -166,7 +166,7 @@ public class Add extends Command {
@Override @Override
public Collection<Command> tab(final PlotPlayer<?> player, final String[] args, final boolean space) { public Collection<Command> tab(final PlotPlayer<?> player, final String[] args, final boolean space) {
return TabCompletions.completePlayers(String.join(",", args).trim(), Collections.emptyList()); return TabCompletions.completePlayers(player, String.join(",", args).trim(), Collections.emptyList());
} }
} }

View File

@ -856,11 +856,11 @@ public class Area extends SubCommand {
) { ) {
}).collect(Collectors.toCollection(LinkedList::new)); }).collect(Collectors.toCollection(LinkedList::new));
if (Permissions.hasPermission(player, Permission.PERMISSION_AREA) && args[0].length() > 0) { if (Permissions.hasPermission(player, Permission.PERMISSION_AREA) && args[0].length() > 0) {
commands.addAll(TabCompletions.completePlayers(args[0], Collections.emptyList())); commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList()));
} }
return commands; return commands;
} }
return TabCompletions.completePlayers(String.join(",", args).trim(), Collections.emptyList()); return TabCompletions.completePlayers(player, String.join(",", args).trim(), Collections.emptyList());
} }
} }

View File

@ -916,11 +916,11 @@ public class Cluster extends SubCommand {
) { ) {
}).collect(Collectors.toCollection(LinkedList::new)); }).collect(Collectors.toCollection(LinkedList::new));
if (Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER) && args[0].length() > 0) { if (Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER) && args[0].length() > 0) {
commands.addAll(TabCompletions.completePlayers(args[0], Collections.emptyList())); commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList()));
} }
return commands; return commands;
} }
return TabCompletions.completePlayers(String.join(",", args).trim(), Collections.emptyList()); return TabCompletions.completePlayers(player, String.join(",", args).trim(), Collections.emptyList());
} }
} }

View File

@ -94,7 +94,7 @@ public class Deny extends SubCommand {
int maxDenySize = Permissions.hasPermissionRange(player, Permission.PERMISSION_DENY, Settings.Limit.MAX_PLOTS); int maxDenySize = Permissions.hasPermissionRange(player, Permission.PERMISSION_DENY, Settings.Limit.MAX_PLOTS);
int size = plot.getDenied().size(); int size = plot.getDenied().size();
if (size > (maxDenySize - 1)) { if (size >= maxDenySize) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("members.plot_max_members_denied"), TranslatableCaption.of("members.plot_max_members_denied"),
Template.of("amount", String.valueOf(size)) Template.of("amount", String.valueOf(size))
@ -157,7 +157,7 @@ public class Deny extends SubCommand {
@Override @Override
public Collection<Command> tab(final PlotPlayer<?> player, final String[] args, final boolean space) { public Collection<Command> tab(final PlotPlayer<?> player, final String[] args, final boolean space) {
return TabCompletions.completePlayers(String.join(",", args).trim(), Collections.emptyList()); return TabCompletions.completePlayers(player, String.join(",", args).trim(), Collections.emptyList());
} }
private void handleKick(PlotPlayer<?> player, Plot plot) { private void handleKick(PlotPlayer<?> player, Plot plot) {

View File

@ -70,11 +70,11 @@ public class Dislike extends SubCommand {
.map(completion -> new Command(null, true, completion, "", RequiredType.PLAYER, CommandCategory.INFO) { .map(completion -> new Command(null, true, completion, "", RequiredType.PLAYER, CommandCategory.INFO) {
}).collect(Collectors.toCollection(LinkedList::new)); }).collect(Collectors.toCollection(LinkedList::new));
if (Permissions.hasPermission(player, Permission.PERMISSION_RATE) && args[0].length() > 0) { if (Permissions.hasPermission(player, Permission.PERMISSION_RATE) && args[0].length() > 0) {
commands.addAll(TabCompletions.completePlayers(args[0], Collections.emptyList())); commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList()));
} }
return commands; return commands;
} }
return TabCompletions.completePlayers(String.join(",", args).trim(), Collections.emptyList()); return TabCompletions.completePlayers(player, String.join(",", args).trim(), Collections.emptyList());
} }
} }

View File

@ -173,11 +173,11 @@ public class Download extends SubCommand {
) { ) {
}).collect(Collectors.toCollection(LinkedList::new)); }).collect(Collectors.toCollection(LinkedList::new));
if (Permissions.hasPermission(player, Permission.PERMISSION_DOWNLOAD) && args[0].length() > 0) { if (Permissions.hasPermission(player, Permission.PERMISSION_DOWNLOAD) && args[0].length() > 0) {
commands.addAll(TabCompletions.completePlayers(args[0], Collections.emptyList())); commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList()));
} }
return commands; return commands;
} }
return TabCompletions.completePlayers(String.join(",", args).trim(), Collections.emptyList()); return TabCompletions.completePlayers(player, String.join(",", args).trim(), Collections.emptyList());
} }
private void upload(PlotPlayer<?> player, Plot plot) { private void upload(PlotPlayer<?> player, Plot plot) {

View File

@ -176,11 +176,11 @@ public class Grant extends Command {
) { ) {
}).collect(Collectors.toCollection(LinkedList::new)); }).collect(Collectors.toCollection(LinkedList::new));
if (Permissions.hasPermission(player, Permission.PERMISSION_GRANT_SINGLE) && args[0].length() > 0) { if (Permissions.hasPermission(player, Permission.PERMISSION_GRANT_SINGLE) && args[0].length() > 0) {
commands.addAll(TabCompletions.completePlayers(args[0], Collections.emptyList())); commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList()));
} }
return commands; return commands;
} }
return TabCompletions.completePlayers(String.join(",", args).trim(), Collections.emptyList()); return TabCompletions.completePlayers(player, String.join(",", args).trim(), Collections.emptyList());
} }
} }

View File

@ -307,11 +307,11 @@ public class Inbox extends SubCommand {
.map(completion -> new Command(null, true, completion, "", RequiredType.PLAYER, CommandCategory.CHAT) { .map(completion -> new Command(null, true, completion, "", RequiredType.PLAYER, CommandCategory.CHAT) {
}).collect(Collectors.toCollection(LinkedList::new)); }).collect(Collectors.toCollection(LinkedList::new));
if (Permissions.hasPermission(player, Permission.PERMISSION_INBOX) && args[0].length() > 0) { if (Permissions.hasPermission(player, Permission.PERMISSION_INBOX) && args[0].length() > 0) {
commands.addAll(TabCompletions.completePlayers(args[0], Collections.emptyList())); commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList()));
} }
return commands; return commands;
} }
return TabCompletions.completePlayers(String.join(",", args).trim(), Collections.emptyList()); return TabCompletions.completePlayers(player, String.join(",", args).trim(), Collections.emptyList());
} }
} }

View File

@ -161,7 +161,7 @@ public class Info extends SubCommand {
}).collect(Collectors.toCollection(LinkedList::new)); }).collect(Collectors.toCollection(LinkedList::new));
if (Permissions.hasPermission(player, Permission.PERMISSION_AREA_INFO_FORCE) && args[0].length() > 0) { if (Permissions.hasPermission(player, Permission.PERMISSION_AREA_INFO_FORCE) && args[0].length() > 0) {
commands.addAll(TabCompletions.completePlayers(args[0], Collections.emptyList())); commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList()));
} }
return commands; return commands;

View File

@ -220,11 +220,11 @@ public class Like extends SubCommand {
.map(completion -> new Command(null, true, completion, "", RequiredType.PLAYER, CommandCategory.INFO) { .map(completion -> new Command(null, true, completion, "", RequiredType.PLAYER, CommandCategory.INFO) {
}).collect(Collectors.toCollection(LinkedList::new)); }).collect(Collectors.toCollection(LinkedList::new));
if (Permissions.hasPermission(player, Permission.PERMISSION_RATE) && args[0].length() > 0) { if (Permissions.hasPermission(player, Permission.PERMISSION_RATE) && args[0].length() > 0) {
commands.addAll(TabCompletions.completePlayers(args[0], Collections.emptyList())); commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList()));
} }
return commands; return commands;
} }
return TabCompletions.completePlayers(String.join(",", args).trim(), Collections.emptyList()); return TabCompletions.completePlayers(player, String.join(",", args).trim(), Collections.emptyList());
} }
} }

View File

@ -532,7 +532,7 @@ public class ListCmd extends SubCommand {
}).collect(Collectors.toCollection(LinkedList::new)); }).collect(Collectors.toCollection(LinkedList::new));
if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_PLAYER) && args[0].length() > 0) { if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_PLAYER) && args[0].length() > 0) {
commands.addAll(TabCompletions.completePlayers(args[0], Collections.emptyList())); commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList()));
} }
return commands; return commands;

View File

@ -209,7 +209,7 @@ public class Owner extends SetCommand {
@Override @Override
public Collection<Command> tab(final PlotPlayer<?> player, final String[] args, final boolean space) { public Collection<Command> tab(final PlotPlayer<?> player, final String[] args, final boolean space) {
return TabCompletions.completePlayers(String.join(",", args).trim(), Collections.emptyList()); return TabCompletions.completePlayers(player, String.join(",", args).trim(), Collections.emptyList());
} }
} }

View File

@ -292,11 +292,11 @@ public class Rate extends SubCommand {
.map(completion -> new Command(null, true, completion, "", RequiredType.PLAYER, CommandCategory.INFO) { .map(completion -> new Command(null, true, completion, "", RequiredType.PLAYER, CommandCategory.INFO) {
}).collect(Collectors.toCollection(LinkedList::new)); }).collect(Collectors.toCollection(LinkedList::new));
if (Permissions.hasPermission(player, Permission.PERMISSION_RATE) && args[0].length() > 0) { if (Permissions.hasPermission(player, Permission.PERMISSION_RATE) && args[0].length() > 0) {
commands.addAll(TabCompletions.completePlayers(args[0], Collections.emptyList())); commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList()));
} }
return commands; return commands;
} }
return TabCompletions.completePlayers(String.join(",", args).trim(), Collections.emptyList()); return TabCompletions.completePlayers(player, String.join(",", args).trim(), Collections.emptyList());
} }
private static class MutableInt { private static class MutableInt {

View File

@ -142,7 +142,7 @@ public class Remove extends SubCommand {
if (plot == null) { if (plot == null) {
return Collections.emptyList(); return Collections.emptyList();
} }
return TabCompletions.completeAddedPlayers(plot, String.join(",", args).trim(), return TabCompletions.completeAddedPlayers(player, plot, String.join(",", args).trim(),
Collections.singletonList(player.getName()) Collections.singletonList(player.getName())
); );
} }

View File

@ -317,11 +317,11 @@ public class SchematicCmd extends SubCommand {
) { ) {
}).collect(Collectors.toCollection(LinkedList::new)); }).collect(Collectors.toCollection(LinkedList::new));
if (Permissions.hasPermission(player, Permission.PERMISSION_SCHEMATIC) && args[0].length() > 0) { if (Permissions.hasPermission(player, Permission.PERMISSION_SCHEMATIC) && args[0].length() > 0) {
commands.addAll(TabCompletions.completePlayers(args[0], Collections.emptyList())); commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList()));
} }
return commands; return commands;
} }
return TabCompletions.completePlayers(String.join(",", args).trim(), Collections.emptyList()); return TabCompletions.completePlayers(player, String.join(",", args).trim(), Collections.emptyList());
} }
} }

View File

@ -288,7 +288,7 @@ public class Set extends SubCommand {
}).collect(Collectors.toCollection(LinkedList::new)); }).collect(Collectors.toCollection(LinkedList::new));
if (Permissions.hasPermission(player, Permission.PERMISSION_SET) && args[0].length() > 0) { if (Permissions.hasPermission(player, Permission.PERMISSION_SET) && args[0].length() > 0) {
commands.addAll(TabCompletions.completePlayers(args[0], Collections.emptyList())); commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList()));
} }
return commands; return commands;
} else if (args.length > 1) { } else if (args.length > 1) {

View File

@ -305,11 +305,11 @@ public class Template extends SubCommand {
) { ) {
}).collect(Collectors.toCollection(LinkedList::new)); }).collect(Collectors.toCollection(LinkedList::new));
if (Permissions.hasPermission(player, Permission.PERMISSION_TEMPLATE) && args[0].length() > 0) { if (Permissions.hasPermission(player, Permission.PERMISSION_TEMPLATE) && args[0].length() > 0) {
commands.addAll(TabCompletions.completePlayers(args[0], Collections.emptyList())); commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList()));
} }
return commands; return commands;
} }
return TabCompletions.completePlayers(String.join(",", args).trim(), Collections.emptyList()); return TabCompletions.completePlayers(player, String.join(",", args).trim(), Collections.emptyList());
} }
} }

View File

@ -138,7 +138,7 @@ public class Trust extends Command {
checkTrue(!uuids.isEmpty(), null); checkTrue(!uuids.isEmpty(), null);
int localTrustSize = currentPlot.getTrusted().size(); int localTrustSize = currentPlot.getTrusted().size();
int maxTrustSize = Permissions.hasPermissionRange(player, Permission.PERMISSION_TRUST, Settings.Limit.MAX_PLOTS); int maxTrustSize = Permissions.hasPermissionRange(player, Permission.PERMISSION_TRUST, Settings.Limit.MAX_PLOTS);
if (localTrustSize > maxTrustSize) { if (localTrustSize >= maxTrustSize) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("members.plot_max_members_trusted"), TranslatableCaption.of("members.plot_max_members_trusted"),
Template.of("amount", String.valueOf(localTrustSize)) Template.of("amount", String.valueOf(localTrustSize))
@ -168,7 +168,7 @@ public class Trust extends Command {
@Override @Override
public Collection<Command> tab(final PlotPlayer<?> player, final String[] args, final boolean space) { public Collection<Command> tab(final PlotPlayer<?> player, final String[] args, final boolean space) {
return TabCompletions.completePlayers(String.join(",", args).trim(), Collections.emptyList()); return TabCompletions.completePlayers(player, String.join(",", args).trim(), Collections.emptyList());
} }
} }

View File

@ -73,6 +73,7 @@ public class Unlink extends SubCommand {
} }
if (!plot.isMerged()) { if (!plot.isMerged()) {
player.sendMessage(TranslatableCaption.of("merge.unlink_impossible")); player.sendMessage(TranslatableCaption.of("merge.unlink_impossible"));
return false;
} }
final boolean createRoad; final boolean createRoad;
if (args.length != 0) { if (args.length != 0) {
@ -100,6 +101,7 @@ public class Unlink extends SubCommand {
if (!force && !plot.isOwner(player.getUUID()) && !Permissions if (!force && !plot.isOwner(player.getUUID()) && !Permissions
.hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_UNLINK)) { .hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_UNLINK)) {
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms")); player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
return true;
} }
Runnable runnable = () -> { Runnable runnable = () -> {
if (!plot.getPlotModificationManager().unlinkPlot(createRoad, createRoad)) { if (!plot.getPlotModificationManager().unlinkPlot(createRoad, createRoad)) {

View File

@ -334,7 +334,7 @@ public class Visit extends Command {
public Collection<Command> tab(PlotPlayer<?> player, String[] args, boolean space) { public Collection<Command> tab(PlotPlayer<?> player, String[] args, boolean space) {
final List<Command> completions = new ArrayList<>(); final List<Command> completions = new ArrayList<>();
switch (args.length - 1) { switch (args.length - 1) {
case 0 -> completions.addAll(TabCompletions.completePlayers(args[0], Collections.emptyList())); case 0 -> completions.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList()));
case 1 -> { case 1 -> {
completions.addAll( completions.addAll(
TabCompletions.completeAreas(args[1])); TabCompletions.completeAreas(args[1]));

View File

@ -71,7 +71,6 @@ public class ComponentPresetManager {
private static final Logger LOGGER = LogManager.getLogger("PlotSquared/" + ComponentPresetManager.class.getSimpleName()); private static final Logger LOGGER = LogManager.getLogger("PlotSquared/" + ComponentPresetManager.class.getSimpleName());
private final List<ComponentPreset> presets; private final List<ComponentPreset> presets;
private final String guiName;
private final EconHandler econHandler; private final EconHandler econHandler;
private final InventoryUtil inventoryUtil; private final InventoryUtil inventoryUtil;
private File componentsFile; private File componentsFile;
@ -104,15 +103,14 @@ public class ComponentPresetManager {
final YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(this.componentsFile); final YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(this.componentsFile);
if (!yamlConfiguration.contains("title")) { if (yamlConfiguration.contains("title")) {
yamlConfiguration.set("title", "&6Plot Components"); yamlConfiguration.set("title", "#Now in /lang/messages_%.json, preset.title");
try { try {
yamlConfiguration.save(this.componentsFile); yamlConfiguration.save(this.componentsFile);
} catch (IOException e) { } catch (IOException e) {
LOGGER.error("Failed to save default values to components.yml", e); LOGGER.error("Failed to save default values to components.yml", e);
} }
} }
this.guiName = yamlConfiguration.getString("title", "&6Plot Components");
if (yamlConfiguration.contains("presets")) { if (yamlConfiguration.contains("presets")) {
this.presets = yamlConfiguration this.presets = yamlConfiguration
@ -183,7 +181,8 @@ public class ComponentPresetManager {
allowedPresets.add(componentPreset); allowedPresets.add(componentPreset);
} }
final int size = (int) Math.ceil((double) allowedPresets.size() / 9.0D); final int size = (int) Math.ceil((double) allowedPresets.size() / 9.0D);
final PlotInventory plotInventory = new PlotInventory(this.inventoryUtil, player, size, this.guiName) { final PlotInventory plotInventory = new PlotInventory(this.inventoryUtil, player, size,
TranslatableCaption.of("preset.title").getComponent(player)) {
@Override @Override
public boolean onClick(final int index) { public boolean onClick(final int index) {
if (!getPlayer().getCurrentPlot().equals(plot)) { if (!getPlayer().getCurrentPlot().equals(plot)) {

View File

@ -173,9 +173,21 @@ public class PlotListener {
String greeting = plot.getFlag(GreetingFlag.class); String greeting = plot.getFlag(GreetingFlag.class);
if (!greeting.isEmpty()) { if (!greeting.isEmpty()) {
if (!Settings.Chat.NOTIFICATION_AS_ACTIONBAR) { if (!Settings.Chat.NOTIFICATION_AS_ACTIONBAR) {
plot.format(StaticCaption.of(greeting), player, false).thenAcceptAsync(player::sendMessage); player.sendMessage(
TranslatableCaption.of("flags.greeting_flag_format"),
Template.of("world", plot.getWorldName()),
Template.of("plot_id", plot.getId().toString()),
Template.of("alias", plot.getAlias()),
Template.of("greeting", greeting)
);
} else { } else {
plot.format(StaticCaption.of(greeting), player, false).thenAcceptAsync(player::sendActionBar); player.sendActionBar(
TranslatableCaption.of("flags.greeting_flag_format"),
Template.of("world", plot.getWorldName()),
Template.of("plot_id", plot.getId().toString()),
Template.of("alias", plot.getAlias()),
Template.of("greeting", greeting)
);
} }
} }
@ -322,12 +334,13 @@ public class PlotListener {
Template plotTemplate = Template.of("plot", lastPlot.getId().toString()); Template plotTemplate = Template.of("plot", lastPlot.getId().toString());
Template worldTemplate = Template.of("world", player.getLocation().getWorldName()); Template worldTemplate = Template.of("world", player.getLocation().getWorldName());
Template ownerTemplate = Template.of("owner", owner); Template ownerTemplate = Template.of("owner", owner);
Template aliasTemplate = Template.of("alias", plot.getAlias());
final Consumer<String> userConsumer = user -> { final Consumer<String> userConsumer = user -> {
if (Settings.Titles.TITLES_AS_ACTIONBAR) { if (Settings.Titles.TITLES_AS_ACTIONBAR) {
player.sendActionBar(header, plotTemplate, worldTemplate, ownerTemplate); player.sendActionBar(header, aliasTemplate, plotTemplate, worldTemplate, ownerTemplate);
} else { } else {
player.sendTitle(header, subHeader, plotTemplate, worldTemplate, ownerTemplate); player.sendTitle(header, subHeader, aliasTemplate, plotTemplate, worldTemplate, ownerTemplate);
} }
}; };
@ -404,9 +417,21 @@ public class PlotListener {
String farewell = plot.getFlag(FarewellFlag.class); String farewell = plot.getFlag(FarewellFlag.class);
if (!farewell.isEmpty()) { if (!farewell.isEmpty()) {
if (!Settings.Chat.NOTIFICATION_AS_ACTIONBAR) { if (!Settings.Chat.NOTIFICATION_AS_ACTIONBAR) {
plot.format(StaticCaption.of(farewell), player, false).thenAcceptAsync(player::sendMessage); player.sendMessage(
TranslatableCaption.of("flags.farewell_flag_format"),
Template.of("world", plot.getWorldName()),
Template.of("plot_id", plot.getId().toString()),
Template.of("alias", plot.getAlias()),
Template.of("farewell", farewell)
);
} else { } else {
plot.format(StaticCaption.of(farewell), player, false).thenAcceptAsync(player::sendActionBar); player.sendActionBar(
TranslatableCaption.of("flags.farewell_flag_format"),
Template.of("world", plot.getWorldName()),
Template.of("plot_id", plot.getId().toString()),
Template.of("alias", plot.getAlias()),
Template.of("farewell", farewell)
);
} }
} }

View File

@ -368,7 +368,7 @@ public class Plot {
for (Plot p : plots) { for (Plot p : plots) {
String name = p.getAlias(); String name = p.getAlias();
if (!name.isEmpty() && name.equalsIgnoreCase(arg)) { if (!name.isEmpty() && name.equalsIgnoreCase(arg)) {
return p; return p.getBasePlot(false);
} }
} }
if (message && player != null) { if (message && player != null) {

View File

@ -408,13 +408,9 @@ public abstract class PlotArea {
} }
} }
this.getFlagContainer().addAll(parseFlags(flags)); this.getFlagContainer().addAll(parseFlags(flags));
Component flagsComponent = null;
Collection<PlotFlag<?, ?>> flagCollection = this.getFlagContainer().getFlagMap().values();
flagsComponent = getFlagsComponent(flagsComponent, flagCollection);
ConsolePlayer.getConsole().sendMessage( ConsolePlayer.getConsole().sendMessage(
TranslatableCaption.of("flags.area_flags"), TranslatableCaption.of("flags.area_flags"),
Template.of("flags", flagsComponent) Template.of("flags", flags.toString())
); );
this.spawnEggs = config.getBoolean("event.spawn.egg"); this.spawnEggs = config.getBoolean("event.spawn.egg");
@ -433,13 +429,9 @@ public abstract class PlotArea {
} }
} }
this.getRoadFlagContainer().addAll(parseFlags(roadflags)); this.getRoadFlagContainer().addAll(parseFlags(roadflags));
Component roadFlagsComponent = null;
Collection<PlotFlag<?, ?>> roadFlagCollection = this.getRoadFlagContainer().getFlagMap().values();
roadFlagsComponent = getFlagsComponent(roadFlagsComponent, roadFlagCollection);
ConsolePlayer.getConsole().sendMessage( ConsolePlayer.getConsole().sendMessage(
TranslatableCaption.of("flags.road_flags"), TranslatableCaption.of("flags.road_flags"),
Template.of("flags", roadFlagsComponent) Template.of("flags", roadflags.toString())
); );
loadConfiguration(config); loadConfiguration(config);

View File

@ -43,8 +43,18 @@ public abstract class ListFlag<V, F extends PlotFlag<List<V>, F>> extends PlotFl
@Override @Override
public F merge(@NonNull List<V> newValue) { public F merge(@NonNull List<V> newValue) {
final List<V> mergedList = new ArrayList<>(); final List<V> mergedList = new ArrayList<>();
mergedList.addAll(getValue()); // If a server already used PS before this fix, we remove all present duplicates on an eventual merge
mergedList.addAll(newValue); for (final V v : getValue()) {
if (!mergedList.contains(v)) {
mergedList.add(v);
}
}
// Only add new values if not already present from #getValue()
for (final V v : newValue) {
if (!mergedList.contains(v)) {
mergedList.add(v);
}
}
return this.flagOf(mergedList); return this.flagOf(mergedList);
} }

View File

@ -89,7 +89,7 @@ public class LocationOffsetDelegateQueueCoordinator extends DelegateQueueCoordin
public boolean setBiome(int x, int z, @NonNull BiomeType biome) { public boolean setBiome(int x, int z, @NonNull BiomeType biome) {
boolean result = true; boolean result = true;
for (int y = 0; y < 256; y++) { for (int y = 0; y < 256; y++) {
result &= this.setBiome(x, z, biome); result &= this.setBiome(x, y, z, biome);
} }
return result; return result;
} }

View File

@ -61,7 +61,7 @@ public abstract class RegionManager {
private static final Logger LOGGER = LogManager.getLogger("PlotSquared/" + RegionManager.class.getSimpleName()); private static final Logger LOGGER = LogManager.getLogger("PlotSquared/" + RegionManager.class.getSimpleName());
public static RegionManager manager = null; public static RegionManager manager = null;
private final WorldUtil worldUtil; protected final WorldUtil worldUtil;
private final GlobalBlockQueue blockQueue; private final GlobalBlockQueue blockQueue;
private final ProgressSubscriberFactory subscriberFactory; private final ProgressSubscriberFactory subscriberFactory;

View File

@ -32,11 +32,13 @@ import com.plotsquared.core.command.Command;
import com.plotsquared.core.command.CommandCategory; import com.plotsquared.core.command.CommandCategory;
import com.plotsquared.core.command.RequiredType; import com.plotsquared.core.command.RequiredType;
import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.player.ConsolePlayer;
import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.player.PlotPlayer;
import com.plotsquared.core.plot.Plot; import com.plotsquared.core.plot.Plot;
import com.plotsquared.core.plot.PlotArea; import com.plotsquared.core.plot.PlotArea;
import com.plotsquared.core.uuid.UUIDMapping; import com.plotsquared.core.uuid.UUIDMapping;
import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
@ -80,12 +82,31 @@ public final class TabCompletions {
* @param input Command input * @param input Command input
* @param existing Players that should not be included in completions * @param existing Players that should not be included in completions
* @return List of completions * @return List of completions
* @deprecated In favor {@link #completePlayers(PlotPlayer, String, List)}
*/ */
@Deprecated(forRemoval = true)
public static @NonNull List<Command> completePlayers( public static @NonNull List<Command> completePlayers(
final @NonNull String input, final @NonNull String input,
final @NonNull List<String> existing final @NonNull List<String> existing
) { ) {
return completePlayers("players", input, existing, uuid -> true); return completePlayers(ConsolePlayer.getConsole(), input, existing);
}
/**
* Get a list of tab completions corresponding to player names. This uses the UUID pipeline
* cache, so it will complete will all names known to PlotSquared
*
* @param input Command input
* @param issuer The player who issued the tab completion
* @param existing Players that should not be included in completions
* @return List of completions
*/
public static @NonNull List<Command> completePlayers(
final @NonNull PlotPlayer<?> issuer,
final @NonNull String input,
final @NonNull List<String> existing
) {
return completePlayers("players", issuer, input, existing, uuid -> true);
} }
/** /**
@ -95,12 +116,32 @@ public final class TabCompletions {
* @param input Command input * @param input Command input
* @param existing Players that should not be included in completions * @param existing Players that should not be included in completions
* @return List of completions * @return List of completions
*
* @deprecated In favor {@link #completeAddedPlayers(PlotPlayer, Plot, String, List)}
*/ */
@Deprecated(forRemoval = true)
public static @NonNull List<Command> completeAddedPlayers( public static @NonNull List<Command> completeAddedPlayers(
final @NonNull Plot plot, final @NonNull Plot plot,
final @NonNull String input, final @NonNull List<String> existing final @NonNull String input, final @NonNull List<String> existing
) { ) {
return completePlayers("added" + plot, input, existing, return completeAddedPlayers(ConsolePlayer.getConsole(), plot, input, existing);
}
/**
* Get a list of tab completions corresponding to player names added to the given plot.
*
* @param issuer The player who issued the tab completion
* @param plot Plot to complete added players for
* @param input Command input
* @param existing Players that should not be included in completions
* @return List of completions
*/
public static @NonNull List<Command> completeAddedPlayers(
final @NonNull PlotPlayer<?> issuer,
final @NonNull Plot plot,
final @NonNull String input, final @NonNull List<String> existing
) {
return completePlayers("added" + plot, issuer, input, existing,
uuid -> plot.getMembers().contains(uuid) uuid -> plot.getMembers().contains(uuid)
|| plot.getTrusted().contains(uuid) || plot.getTrusted().contains(uuid)
|| plot.getDenied().contains(uuid) || plot.getDenied().contains(uuid)
@ -222,9 +263,28 @@ public final class TabCompletions {
* @param existing Players that should not be included in completions * @param existing Players that should not be included in completions
* @param uuidFilter Filter applied before caching values * @param uuidFilter Filter applied before caching values
* @return List of completions * @return List of completions
* @deprecated In favor {@link #completePlayers(String, PlotPlayer, String, List, Predicate)}
*/
@Deprecated(forRemoval = true)
private static List<Command> completePlayers(
final @NonNull String cacheIdentifier,
final @NonNull String input, final @NonNull List<String> existing,
final @NonNull Predicate<UUID> uuidFilter
) {
return completePlayers(cacheIdentifier, ConsolePlayer.getConsole(), input, existing, uuidFilter);
}
/**
* @param cacheIdentifier Cache key
* @param issuer The player who issued the tab completion
* @param input Command input
* @param existing Players that should not be included in completions
* @param uuidFilter Filter applied before caching values
* @return List of completions
*/ */
private static List<Command> completePlayers( private static List<Command> completePlayers(
final @NonNull String cacheIdentifier, final @NonNull String cacheIdentifier,
final @NonNull PlotPlayer<?> issuer,
final @NonNull String input, final @NonNull List<String> existing, final @NonNull String input, final @NonNull List<String> existing,
final @NonNull Predicate<UUID> uuidFilter final @NonNull Predicate<UUID> uuidFilter
) { ) {
@ -246,9 +306,13 @@ public final class TabCompletions {
final Collection<? extends PlotPlayer<?>> onlinePlayers = PlotSquared.platform().playerManager().getPlayers(); final Collection<? extends PlotPlayer<?>> onlinePlayers = PlotSquared.platform().playerManager().getPlayers();
players = new ArrayList<>(onlinePlayers.size()); players = new ArrayList<>(onlinePlayers.size());
for (final PlotPlayer<?> player : onlinePlayers) { for (final PlotPlayer<?> player : onlinePlayers) {
if (uuidFilter.test(player.getUUID())) { if (!uuidFilter.test(player.getUUID())) {
players.add(player.getName()); continue;
} }
if (issuer != null && !issuer.canSee(player)) {
continue;
}
players.add(player.getName());
} }
} }
return filterCached(players, input, existing); return filterCached(players, input, existing);

View File

@ -183,8 +183,6 @@
"error.task_in_process": "<prefix><gold>Task is already running.</gold>", "error.task_in_process": "<prefix><gold>Task is already running.</gold>",
"titles.title_entered_plot": "<gold>Plot: <world>;<plot></gold>", "titles.title_entered_plot": "<gold>Plot: <world>;<plot></gold>",
"titles.title_entered_plot_sub": "<dark_aqua>Owned by <owner></dark_aqua>", "titles.title_entered_plot_sub": "<dark_aqua>Owned by <owner></dark_aqua>",
"titles.prefix_greeting": "<gold><id></gold><gray>></gray>",
"titles.prefix_farewell": "<gold><id></gold><gray>></gray>",
"core.prefix": "<dark_gray>[</dark_gray><gold>P2</gold><dark_gray>] </dark_gray>", "core.prefix": "<dark_gray>[</dark_gray><gold>P2</gold><dark_gray>] </dark_gray>",
"core.enabled": "<prefix><gold><value> is now enabled.</gold>", "core.enabled": "<prefix><gold><value> is now enabled.</gold>",
"placeholder.hooked": "<prefix><gold>PlotSquared hooked into MVdWPlaceholderAPI</gold>", "placeholder.hooked": "<prefix><gold>PlotSquared hooked into MVdWPlaceholderAPI</gold>",
@ -459,6 +457,7 @@
"preset.preset_invalid": "<prefix><red>Could not generate a pattern from that preset.</red>", "preset.preset_invalid": "<prefix><red>Could not generate a pattern from that preset.</red>",
"preset.preset_lore_cost": "<prefix><gray>Cost: </gray><gold><cost></gold>", "preset.preset_lore_cost": "<prefix><gray>Cost: </gray><gold><cost></gold>",
"preset.preset_lore_component": "<gray>Component: </gray><gold><component></gold>", "preset.preset_lore_component": "<gray>Component: </gray><gold><component></gold>",
"preset.title": "Plot Components",
"generic.generic_other": "<gray>other</gray>", "generic.generic_other": "<gray>other</gray>",
"generic.generic_merged": "<gray>merged</gray>", "generic.generic_merged": "<gray>merged</gray>",
"generic.generic_unowned": "<gray>unowned</gray>", "generic.generic_unowned": "<gray>unowned</gray>",
@ -616,6 +615,8 @@
"flags.flag_error_title": "Flag value must be in the format </red><grey>\"A title\" \"The subtitle\"</grey><red>.", "flags.flag_error_title": "Flag value must be in the format </red><grey>\"A title\" \"The subtitle\"</grey><red>.",
"flags.area_flags": "<prefix><gray>Area flags: </gray><dark_aqua><flags></dark_aqua>", "flags.area_flags": "<prefix><gray>Area flags: </gray><dark_aqua><flags></dark_aqua>",
"flags.road_flags": "<prefix><gray>Road flags: </gray><dark_aqua><flags></dark_aqua>", "flags.road_flags": "<prefix><gray>Road flags: </gray><dark_aqua><flags></dark_aqua>",
"flags.greeting_flag_format": "<prefix><gold>[<world>;<plot_id>]:</gold> <greeting>",
"flags.farewell_flag_format": "<prefix><gold>[<world>;<plot_id>]:</gold> <farewell>",
"commands.description.add": "<gray>Allow a user to build in a plot while the plot owner is online.</gray>", "commands.description.add": "<gray>Allow a user to build in a plot while the plot owner is online.</gray>",
"commands.description.alias": "<gray>Set the plot alias.</gray>", "commands.description.alias": "<gray>Set the plot alias.</gray>",
"commands.description.area": "<gray>Create a new plot area.</gray>", "commands.description.area": "<gray>Create a new plot area.</gray>",

View File

@ -30,21 +30,13 @@ is to provide a lag-free and smooth experience.
* [Wiki](https://github.com/IntellectualSites/PlotSquared-Documentation/wiki) * [Wiki](https://github.com/IntellectualSites/PlotSquared-Documentation/wiki)
* [Issues](https://github.com/IntellectualSites/PlotSquared/issues) * [Issues](https://github.com/IntellectualSites/PlotSquared/issues)
* [Translations](https://intellectualsites.crowdin.com/plotsquared/) * [Translations](https://intellectualsites.crowdin.com/plotsquared/)
* [Contributing](https://github.com/IntellectualSites/.github/blob/main/CONTRIBUTING.md)
### Developer Resources ### Developer Resources
* [API Documentation](https://github.com/IntellectualSites/PlotSquared-Documentation/wiki/API-Documentation) * [API Documentation](https://github.com/IntellectualSites/PlotSquared-Documentation/wiki/API-Documentation)
* [Event API](https://github.com/IntellectualSites/PlotSquared-Documentation/wiki/Events) * [Event API](https://github.com/IntellectualSites/PlotSquared-Documentation/wiki/Events)
* [Flag API](https://github.com/IntellectualSites/PlotSquared-Documentation/wiki/API-Flag) * [Flag API](https://github.com/IntellectualSites/PlotSquared-Documentation/wiki/API-Flag)
# Building
Gradle is the **recommended** way to build the project. Use `./gradlew build` in the main project directory to build the project. Gradle is required if you intend to build or develop the Sponge module.
# Contributing
See [here](https://github.com/IntellectualSites/PlotSquared/blob/v6/CONTRIBUTING.md)
## Suggestions
Suggestions are welcome! We have a separate issue tracker for suggestions, that can be found in [this](https://github.com/IntellectualSites/PlotSquaredSuggestions) repository.
# Official Addons # Official Addons
* [Plot2Dynmap](http://www.spigotmc.org/resources/plot2dynmap.1292/) * [Plot2Dynmap](http://www.spigotmc.org/resources/plot2dynmap.1292/)
* [HoloPlots](https://www.spigotmc.org/resources/holoplots.4880/) * [HoloPlots](https://www.spigotmc.org/resources/holoplots.4880/)

View File

@ -1,3 +0,0 @@
If you discover a security vulnerability in PlotSquared, please submit it through the [Security Vulnerability Form](https://forms.gle/btgdRn9yhGtzEiGW8).
Thanks for helping make PlotSquared safe for everyone.

View File

@ -1,6 +1,7 @@
import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin
import org.cadixdev.gradle.licenser.LicenseExtension import org.cadixdev.gradle.licenser.LicenseExtension
import org.cadixdev.gradle.licenser.Licenser import org.cadixdev.gradle.licenser.Licenser
import java.net.URI
plugins { plugins {
java java
@ -11,22 +12,13 @@ plugins {
alias(libs.plugins.shadow) alias(libs.plugins.shadow)
alias(libs.plugins.licenser) alias(libs.plugins.licenser)
alias(libs.plugins.grgit) alias(libs.plugins.grgit)
alias(libs.plugins.nexus)
eclipse eclipse
idea idea
} }
var ver by extra("6.1.1") version = "6.1.3"
var versuffix by extra("-SNAPSHOT")
val versionsuffix: String? by project
if (versionsuffix != null) {
versuffix = "-$versionsuffix"
}
version = if (!project.hasProperty("release")) {
ver + versuffix
} else {
ver
}
allprojects { allprojects {
group = "com.plotsquared" group = "com.plotsquared"
@ -76,7 +68,7 @@ allprojects {
dependencies { dependencies {
// Tests // Tests
testImplementation("junit:junit:4.13.2") testImplementation("junit:junit:4.13.2")
testImplementation("org.junit.jupiter:junit-jupiter:5.7.2") testImplementation("org.junit.jupiter:junit-jupiter:5.8.1")
} }
plugins.withId("java") { plugins.withId("java") {
@ -103,6 +95,9 @@ allprojects {
signing { signing {
if (!version.toString().endsWith("-SNAPSHOT")) { if (!version.toString().endsWith("-SNAPSHOT")) {
val signingKey: String? by project
val signingPassword: String? by project
useInMemoryPgpKeys(signingKey, signingPassword)
signing.isRequired signing.isRequired
sign(publishing.publications) sign(publishing.publications)
} }
@ -111,8 +106,6 @@ allprojects {
publishing { publishing {
publications { publications {
create<MavenPublication>("maven") { create<MavenPublication>("maven") {
// This includes not only the original jar (i.e. not shadowJar),
// but also sources & javadocs due to the above java block.
from(components["java"]) from(components["java"])
pom { pom {
@ -133,18 +126,23 @@ allprojects {
developer { developer {
id.set("Sauilitired") id.set("Sauilitired")
name.set("Alexander Söderberg") name.set("Alexander Söderberg")
organization.set("IntellectualSites")
} }
developer { developer {
id.set("NotMyFault") id.set("NotMyFault")
name.set("NotMyFault") name.set("NotMyFault")
organization.set("IntellectualSites")
email.set("contact@notmyfault.dev")
} }
developer { developer {
id.set("SirYwell") id.set("SirYwell")
name.set("Hannes Greule") name.set("Hannes Greule")
organization.set("IntellectualSites")
} }
developer { developer {
id.set("dordsor21") id.set("dordsor21")
name.set("dordsor21") name.set("dordsor21")
organization.set("IntellectualSites")
} }
} }
@ -161,34 +159,6 @@ allprojects {
} }
} }
} }
repositories {
mavenLocal() // Install to own local repository
// Accept String? to not err if they're not present.
// Check that they both exist before adding the repo, such that
// `credentials` doesn't err if one is null.
// It's not pretty, but this way it can compile.
val nexusUsername: String? by project
val nexusPassword: String? by project
if (nexusUsername != null && nexusPassword != null) {
maven {
val releasesRepositoryUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
val snapshotRepositoryUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
url = uri(
if (version.toString().endsWith("-SNAPSHOT")) snapshotRepositoryUrl
else releasesRepositoryUrl
)
credentials {
username = nexusUsername
password = nexusPassword
}
}
} else {
logger.warn("No nexus repository is added; nexusUsername or nexusPassword is null.")
}
}
} }
tasks { tasks {
@ -217,10 +187,6 @@ allprojects {
) )
} }
jar {
this.archiveClassifier.set("jar")
}
shadowJar { shadowJar {
this.archiveClassifier.set(null as String?) this.archiveClassifier.set(null as String?)
this.archiveFileName.set("${project.name}-${project.version}.${this.archiveExtension.getOrElse("jar")}") this.archiveFileName.set("${project.name}-${project.version}.${this.archiveExtension.getOrElse("jar")}")
@ -237,6 +203,15 @@ allprojects {
} }
nexusPublishing {
repositories {
sonatype {
nexusUrl.set(URI.create("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(URI.create("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
}
}
}
tasks { tasks {
val aggregatedJavadocs = create<Javadoc>("aggregatedJavadocs") { val aggregatedJavadocs = create<Javadoc>("aggregatedJavadocs") {
title = "${project.name} ${project.version} API" title = "${project.name} ${project.version} API"

View File

@ -6,19 +6,19 @@ log4j-api = "2.14.1" # Version set by Minecraft
# Platform expectations # Platform expectations
paper = "1.17.1-R0.1-SNAPSHOT" paper = "1.17.1-R0.1-SNAPSHOT"
checker-qual = "3.18.0" checker-qual = "3.18.1"
guice = "5.0.1" guice = "5.0.1"
findbugs = "3.0.1" findbugs = "3.0.1"
snakeyaml = "1.28" # Version set by Bukkit snakeyaml = "1.28" # Version set by Bukkit
# Adventure & MiniMessage # Adventure & MiniMessage
adventure-api = "4.9.1" adventure-api = "4.9.2"
adventure-text-minimessage = "4.1.0-SNAPSHOT" adventure-text-minimessage = "4.1.0-SNAPSHOT"
adventure-platform-bukkit = "4.0.0-SNAPSHOT" adventure-platform-bukkit = "4.0.0"
# Plugins # Plugins
worldedit = "7.2.6" worldedit = "7.2.6"
fawe = "1.17-201" fawe = "1.17-343"
vault = "1.7.1" vault = "1.7.1"
placeholderapi = "2.10.10" placeholderapi = "2.10.10"
luckperms = "5.3" luckperms = "5.3"
@ -35,13 +35,14 @@ paster = "1.1.1"
bstats = "2.2.1" bstats = "2.2.1"
paperlib = "1.0.6" paperlib = "1.0.6"
squirrelid = "0.3.0" squirrelid = "0.3.0"
serverlib = "2.3.0" serverlib = "2.3.1"
http4j = "1.3" http4j = "1.3"
# Gradle plugins # Gradle plugins
shadow = "7.0.0" shadow = "7.1.0"
grgit = "4.1.0" grgit = "4.1.0"
licenser = "0.6.1" licenser = "0.6.1"
nexus = "1.1.0"
[libraries] [libraries]
# Platform expectations # Platform expectations
@ -67,8 +68,8 @@ adventurePlatformBukkit = { group = "net.kyori", name = "adventure-platform-bukk
# Plugins # Plugins
worldeditCore = { group = "com.sk89q.worldedit", name = "worldedit-core", version.ref = "worldedit" } worldeditCore = { group = "com.sk89q.worldedit", name = "worldedit-core", version.ref = "worldedit" }
worldeditBukkit = { group = "com.sk89q.worldedit", name = "worldedit-bukkit", version.ref = "worldedit" } worldeditBukkit = { group = "com.sk89q.worldedit", name = "worldedit-bukkit", version.ref = "worldedit" }
fastasyncworldeditBukkit = { group = "com.fastasyncworldedit", name = "FAWE-Bukkit", version.ref = "fawe" } fastasyncworldeditBukkit = { group = "com.fastasyncworldedit", name = "FastAsyncWorldEdit-Bukkit", version.ref = "fawe" }
fastasyncworldeditCore = { group = "com.fastasyncworldedit", name = "FAWE-Core", version.ref = "fawe" } fastasyncworldeditCore = { group = "com.fastasyncworldedit", name = "FastAsyncWorldEdit-Core", version.ref = "fawe" }
vault = { group = "com.github.MilkBowl", name = "VaultAPI", version.ref = "vault" } vault = { group = "com.github.MilkBowl", name = "VaultAPI", version.ref = "vault" }
placeholderapi = { group = "me.clip", name = "placeholderapi", version.ref = "placeholderapi" } placeholderapi = { group = "me.clip", name = "placeholderapi", version.ref = "placeholderapi" }
luckperms = { group = "net.luckperms", name = "api", version.ref = "luckperms" } luckperms = { group = "net.luckperms", name = "api", version.ref = "luckperms" }
@ -92,3 +93,4 @@ paster = { group = "com.intellectualsites.paster", name = "Paster", version.ref
shadow = { id = "com.github.johnrengelman.shadow", version.ref = "shadow" } shadow = { id = "com.github.johnrengelman.shadow", version.ref = "shadow" }
grgit = { id = "org.ajoberstar.grgit", version.ref = "grgit" } grgit = { id = "org.ajoberstar.grgit", version.ref = "grgit" }
licenser = { id = "org.cadixdev.licenser", version.ref = "licenser" } licenser = { id = "org.cadixdev.licenser", version.ref = "licenser" }
nexus = { id = "io.github.gradle-nexus.publish-plugin", version.ref = "nexus" }

View File

@ -5,7 +5,14 @@
], ],
"ignoreDeps": [ "ignoreDeps": [
"guava", "guava",
"com.google.guava:guava",
"gson", "gson",
"snakeyaml" "snakeyaml"
] ],
"timezone": "Europe/Berlin",
"schedule": [
"on monday after 9am"
],
"labels": ["Renovate"],
"commitMessagePrefix": "chore: "
} }