mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-07-04 14:44:43 +02:00
Compare commits
32 Commits
Author | SHA1 | Date | |
---|---|---|---|
5653d0f175 | |||
b022a97196 | |||
cb596ee6ea | |||
4e391136c0 | |||
a6a0e1d12f | |||
d2776eed5a | |||
6528c60f4d | |||
7ee46be2ac | |||
13bc231091 | |||
55d1a40394 | |||
d70f99b489 | |||
fde9735da2 | |||
20f0aa3656 | |||
0b7bf2d26d | |||
f10e38af63 | |||
21727ebfc7 | |||
e322ee85fd | |||
541255fe7e | |||
20c2f36f6c | |||
744f7a18ae | |||
18eece0b71 | |||
4f12dcf966 | |||
ee832528db | |||
bb5d6c91da | |||
6d4adecb32 | |||
c37b13dcb3 | |||
086dac2ea4 | |||
b2b8598b5b | |||
61e5d9f1b6 | |||
c8989b3332 | |||
9f54472dd6 | |||
115932c65a |
@ -1008,6 +1008,6 @@ ij_html_uniform_ident = false
|
||||
indent_size = 2
|
||||
ij_yaml_keep_indents_on_empty_lines = false
|
||||
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_brackets = true
|
||||
|
12
.github/FUNDING.yml
vendored
12
.github/FUNDING.yml
vendored
@ -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']
|
17
.github/PULL_REQUEST_TEMPLATE.md
vendored
17
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -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
1
.github/release-drafter.yml
vendored
Normal file
@ -0,0 +1 @@
|
||||
_extends: .github
|
32
.github/workflows/build.yml
vendored
32
.github/workflows/build.yml
vendored
@ -1,6 +1,6 @@
|
||||
name: "build"
|
||||
|
||||
on: ["pull_request", "push"]
|
||||
on: [ "pull_request", "push" ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@ -8,10 +8,34 @@ jobs:
|
||||
steps:
|
||||
- name: "Checkout Repository"
|
||||
uses: "actions/checkout@v2.3.4"
|
||||
- name: "Setup JDK 16"
|
||||
uses: "actions/setup-java@v2.2.0"
|
||||
- name: "Validate Gradle Wrapper"
|
||||
uses: "gradle/wrapper-validation-action@v1.0.4"
|
||||
- name: "Setup Java"
|
||||
uses: "actions/setup-java@v2.3.1"
|
||||
with:
|
||||
distribution: "temurin"
|
||||
java-version: "16"
|
||||
java-version: "17"
|
||||
- name: "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
14
.github/workflows/release-drafter.yml
vendored
Normal 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 }}
|
12
.github/workflows/validate-gradle-wrapper.yml
vendored
12
.github/workflows/validate-gradle-wrapper.yml
vendored
@ -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"
|
@ -32,8 +32,8 @@ dependencies {
|
||||
exclude(group = "org.bukkit")
|
||||
exclude(group = "org.spigotmc")
|
||||
}
|
||||
compileOnlyApi(libs.fastasyncworldeditBukkit)
|
||||
testImplementation(libs.fastasyncworldeditBukkit)
|
||||
compileOnlyApi(libs.fastasyncworldeditBukkit) { isTransitive = false }
|
||||
testImplementation(libs.fastasyncworldeditBukkit) { isTransitive = false }
|
||||
compileOnly(libs.vault) {
|
||||
exclude(group = "org.bukkit")
|
||||
}
|
||||
@ -80,6 +80,10 @@ tasks.named<ShadowJar>("shadowJar") {
|
||||
relocate("com.intellectualsites.http", "com.plotsquared.core.http")
|
||||
relocate("com.intellectualsites.paster", "com.plotsquared.core.paster")
|
||||
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.
|
||||
minimize()
|
||||
|
@ -27,6 +27,7 @@ package com.plotsquared.bukkit;
|
||||
|
||||
import com.plotsquared.bukkit.util.BukkitUtil;
|
||||
import com.plotsquared.core.command.MainCommand;
|
||||
import com.plotsquared.core.configuration.Settings;
|
||||
import com.plotsquared.core.player.ConsolePlayer;
|
||||
import com.plotsquared.core.player.PlotPlayer;
|
||||
import org.bukkit.command.Command;
|
||||
@ -42,6 +43,7 @@ import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
public class BukkitCommand implements CommandExecutor, TabCompleter {
|
||||
|
||||
@ -63,7 +65,7 @@ public class BukkitCommand implements CommandExecutor, TabCompleter {
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(
|
||||
CommandSender commandSender, Command command, String s,
|
||||
CommandSender commandSender, Command command, String label,
|
||||
String[] args
|
||||
) {
|
||||
if (!(commandSender instanceof Player)) {
|
||||
@ -73,8 +75,11 @@ public class BukkitCommand implements CommandExecutor, TabCompleter {
|
||||
if (args.length == 0) {
|
||||
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 =
|
||||
MainCommand.getInstance().tab(player, args, s.endsWith(" "));
|
||||
MainCommand.getInstance().tab(player, args, label.endsWith(" "));
|
||||
if (objects == null) {
|
||||
return null;
|
||||
}
|
||||
|
@ -176,7 +176,7 @@ public class BukkitRegionManager extends RegionManager {
|
||||
final boolean ignoreAugment,
|
||||
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 p1z = pos1.getZ();
|
||||
|
@ -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.
|
@ -31,8 +31,8 @@ dependencies {
|
||||
exclude(group = "dummypermscompat")
|
||||
}
|
||||
testImplementation(libs.worldeditCore)
|
||||
compileOnlyApi(libs.fastasyncworldeditCore)
|
||||
testImplementation(libs.fastasyncworldeditCore)
|
||||
compileOnlyApi(libs.fastasyncworldeditCore) { isTransitive = false }
|
||||
testImplementation(libs.fastasyncworldeditCore) { isTransitive = false }
|
||||
|
||||
// Logging
|
||||
compileOnlyApi(libs.log4j)
|
||||
|
@ -132,7 +132,7 @@ public class Add extends Command {
|
||||
checkTrue(!uuids.isEmpty(), null);
|
||||
int localAddSize = plot.getMembers().size();
|
||||
int maxAddSize = Permissions.hasPermissionRange(player, Permission.PERMISSION_ADD, Settings.Limit.MAX_PLOTS);
|
||||
if (localAddSize > maxAddSize) {
|
||||
if (localAddSize >= maxAddSize) {
|
||||
player.sendMessage(
|
||||
TranslatableCaption.of("members.plot_max_members_added"),
|
||||
Template.of("amount", String.valueOf(localAddSize))
|
||||
@ -166,7 +166,7 @@ public class Add extends Command {
|
||||
|
||||
@Override
|
||||
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());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -856,11 +856,11 @@ public class Area extends SubCommand {
|
||||
) {
|
||||
}).collect(Collectors.toCollection(LinkedList::new));
|
||||
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 TabCompletions.completePlayers(String.join(",", args).trim(), Collections.emptyList());
|
||||
return TabCompletions.completePlayers(player, String.join(",", args).trim(), Collections.emptyList());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -916,11 +916,11 @@ public class Cluster extends SubCommand {
|
||||
) {
|
||||
}).collect(Collectors.toCollection(LinkedList::new));
|
||||
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 TabCompletions.completePlayers(String.join(",", args).trim(), Collections.emptyList());
|
||||
return TabCompletions.completePlayers(player, String.join(",", args).trim(), Collections.emptyList());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ public class Deny extends SubCommand {
|
||||
|
||||
int maxDenySize = Permissions.hasPermissionRange(player, Permission.PERMISSION_DENY, Settings.Limit.MAX_PLOTS);
|
||||
int size = plot.getDenied().size();
|
||||
if (size > (maxDenySize - 1)) {
|
||||
if (size >= maxDenySize) {
|
||||
player.sendMessage(
|
||||
TranslatableCaption.of("members.plot_max_members_denied"),
|
||||
Template.of("amount", String.valueOf(size))
|
||||
@ -157,7 +157,7 @@ public class Deny extends SubCommand {
|
||||
|
||||
@Override
|
||||
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) {
|
||||
|
@ -70,11 +70,11 @@ public class Dislike extends SubCommand {
|
||||
.map(completion -> new Command(null, true, completion, "", RequiredType.PLAYER, CommandCategory.INFO) {
|
||||
}).collect(Collectors.toCollection(LinkedList::new));
|
||||
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 TabCompletions.completePlayers(String.join(",", args).trim(), Collections.emptyList());
|
||||
return TabCompletions.completePlayers(player, String.join(",", args).trim(), Collections.emptyList());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -173,11 +173,11 @@ public class Download extends SubCommand {
|
||||
) {
|
||||
}).collect(Collectors.toCollection(LinkedList::new));
|
||||
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 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) {
|
||||
|
@ -176,11 +176,11 @@ public class Grant extends Command {
|
||||
) {
|
||||
}).collect(Collectors.toCollection(LinkedList::new));
|
||||
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 TabCompletions.completePlayers(String.join(",", args).trim(), Collections.emptyList());
|
||||
return TabCompletions.completePlayers(player, String.join(",", args).trim(), Collections.emptyList());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -307,11 +307,11 @@ public class Inbox extends SubCommand {
|
||||
.map(completion -> new Command(null, true, completion, "", RequiredType.PLAYER, CommandCategory.CHAT) {
|
||||
}).collect(Collectors.toCollection(LinkedList::new));
|
||||
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 TabCompletions.completePlayers(String.join(",", args).trim(), Collections.emptyList());
|
||||
return TabCompletions.completePlayers(player, String.join(",", args).trim(), Collections.emptyList());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -161,7 +161,7 @@ public class Info extends SubCommand {
|
||||
}).collect(Collectors.toCollection(LinkedList::new));
|
||||
|
||||
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;
|
||||
|
@ -220,11 +220,11 @@ public class Like extends SubCommand {
|
||||
.map(completion -> new Command(null, true, completion, "", RequiredType.PLAYER, CommandCategory.INFO) {
|
||||
}).collect(Collectors.toCollection(LinkedList::new));
|
||||
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 TabCompletions.completePlayers(String.join(",", args).trim(), Collections.emptyList());
|
||||
return TabCompletions.completePlayers(player, String.join(",", args).trim(), Collections.emptyList());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -532,7 +532,7 @@ public class ListCmd extends SubCommand {
|
||||
}).collect(Collectors.toCollection(LinkedList::new));
|
||||
|
||||
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;
|
||||
|
@ -209,7 +209,7 @@ public class Owner extends SetCommand {
|
||||
|
||||
@Override
|
||||
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());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -292,11 +292,11 @@ public class Rate extends SubCommand {
|
||||
.map(completion -> new Command(null, true, completion, "", RequiredType.PLAYER, CommandCategory.INFO) {
|
||||
}).collect(Collectors.toCollection(LinkedList::new));
|
||||
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 TabCompletions.completePlayers(String.join(",", args).trim(), Collections.emptyList());
|
||||
return TabCompletions.completePlayers(player, String.join(",", args).trim(), Collections.emptyList());
|
||||
}
|
||||
|
||||
private static class MutableInt {
|
||||
|
@ -142,7 +142,7 @@ public class Remove extends SubCommand {
|
||||
if (plot == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return TabCompletions.completeAddedPlayers(plot, String.join(",", args).trim(),
|
||||
return TabCompletions.completeAddedPlayers(player, plot, String.join(",", args).trim(),
|
||||
Collections.singletonList(player.getName())
|
||||
);
|
||||
}
|
||||
|
@ -317,11 +317,11 @@ public class SchematicCmd extends SubCommand {
|
||||
) {
|
||||
}).collect(Collectors.toCollection(LinkedList::new));
|
||||
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 TabCompletions.completePlayers(String.join(",", args).trim(), Collections.emptyList());
|
||||
return TabCompletions.completePlayers(player, String.join(",", args).trim(), Collections.emptyList());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -288,7 +288,7 @@ public class Set extends SubCommand {
|
||||
}).collect(Collectors.toCollection(LinkedList::new));
|
||||
|
||||
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;
|
||||
} else if (args.length > 1) {
|
||||
|
@ -305,11 +305,11 @@ public class Template extends SubCommand {
|
||||
) {
|
||||
}).collect(Collectors.toCollection(LinkedList::new));
|
||||
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 TabCompletions.completePlayers(String.join(",", args).trim(), Collections.emptyList());
|
||||
return TabCompletions.completePlayers(player, String.join(",", args).trim(), Collections.emptyList());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -138,7 +138,7 @@ public class Trust extends Command {
|
||||
checkTrue(!uuids.isEmpty(), null);
|
||||
int localTrustSize = currentPlot.getTrusted().size();
|
||||
int maxTrustSize = Permissions.hasPermissionRange(player, Permission.PERMISSION_TRUST, Settings.Limit.MAX_PLOTS);
|
||||
if (localTrustSize > maxTrustSize) {
|
||||
if (localTrustSize >= maxTrustSize) {
|
||||
player.sendMessage(
|
||||
TranslatableCaption.of("members.plot_max_members_trusted"),
|
||||
Template.of("amount", String.valueOf(localTrustSize))
|
||||
@ -168,7 +168,7 @@ public class Trust extends Command {
|
||||
|
||||
@Override
|
||||
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());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -73,6 +73,7 @@ public class Unlink extends SubCommand {
|
||||
}
|
||||
if (!plot.isMerged()) {
|
||||
player.sendMessage(TranslatableCaption.of("merge.unlink_impossible"));
|
||||
return false;
|
||||
}
|
||||
final boolean createRoad;
|
||||
if (args.length != 0) {
|
||||
@ -100,6 +101,7 @@ public class Unlink extends SubCommand {
|
||||
if (!force && !plot.isOwner(player.getUUID()) && !Permissions
|
||||
.hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_UNLINK)) {
|
||||
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
|
||||
return true;
|
||||
}
|
||||
Runnable runnable = () -> {
|
||||
if (!plot.getPlotModificationManager().unlinkPlot(createRoad, createRoad)) {
|
||||
|
@ -334,7 +334,7 @@ public class Visit extends Command {
|
||||
public Collection<Command> tab(PlotPlayer<?> player, String[] args, boolean space) {
|
||||
final List<Command> completions = new ArrayList<>();
|
||||
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 -> {
|
||||
completions.addAll(
|
||||
TabCompletions.completeAreas(args[1]));
|
||||
|
@ -71,7 +71,6 @@ public class ComponentPresetManager {
|
||||
private static final Logger LOGGER = LogManager.getLogger("PlotSquared/" + ComponentPresetManager.class.getSimpleName());
|
||||
|
||||
private final List<ComponentPreset> presets;
|
||||
private final String guiName;
|
||||
private final EconHandler econHandler;
|
||||
private final InventoryUtil inventoryUtil;
|
||||
private File componentsFile;
|
||||
@ -104,15 +103,14 @@ public class ComponentPresetManager {
|
||||
|
||||
final YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(this.componentsFile);
|
||||
|
||||
if (!yamlConfiguration.contains("title")) {
|
||||
yamlConfiguration.set("title", "&6Plot Components");
|
||||
if (yamlConfiguration.contains("title")) {
|
||||
yamlConfiguration.set("title", "#Now in /lang/messages_%.json, preset.title");
|
||||
try {
|
||||
yamlConfiguration.save(this.componentsFile);
|
||||
} catch (IOException e) {
|
||||
LOGGER.error("Failed to save default values to components.yml", e);
|
||||
}
|
||||
}
|
||||
this.guiName = yamlConfiguration.getString("title", "&6Plot Components");
|
||||
|
||||
if (yamlConfiguration.contains("presets")) {
|
||||
this.presets = yamlConfiguration
|
||||
@ -183,7 +181,8 @@ public class ComponentPresetManager {
|
||||
allowedPresets.add(componentPreset);
|
||||
}
|
||||
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
|
||||
public boolean onClick(final int index) {
|
||||
if (!getPlayer().getCurrentPlot().equals(plot)) {
|
||||
|
@ -173,9 +173,21 @@ public class PlotListener {
|
||||
String greeting = plot.getFlag(GreetingFlag.class);
|
||||
if (!greeting.isEmpty()) {
|
||||
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 {
|
||||
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 worldTemplate = Template.of("world", player.getLocation().getWorldName());
|
||||
Template ownerTemplate = Template.of("owner", owner);
|
||||
Template aliasTemplate = Template.of("alias", plot.getAlias());
|
||||
|
||||
final Consumer<String> userConsumer = user -> {
|
||||
if (Settings.Titles.TITLES_AS_ACTIONBAR) {
|
||||
player.sendActionBar(header, plotTemplate, worldTemplate, ownerTemplate);
|
||||
player.sendActionBar(header, aliasTemplate, plotTemplate, worldTemplate, ownerTemplate);
|
||||
} 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);
|
||||
if (!farewell.isEmpty()) {
|
||||
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 {
|
||||
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)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -368,7 +368,7 @@ public class Plot {
|
||||
for (Plot p : plots) {
|
||||
String name = p.getAlias();
|
||||
if (!name.isEmpty() && name.equalsIgnoreCase(arg)) {
|
||||
return p;
|
||||
return p.getBasePlot(false);
|
||||
}
|
||||
}
|
||||
if (message && player != null) {
|
||||
|
@ -408,13 +408,9 @@ public abstract class PlotArea {
|
||||
}
|
||||
}
|
||||
this.getFlagContainer().addAll(parseFlags(flags));
|
||||
|
||||
Component flagsComponent = null;
|
||||
Collection<PlotFlag<?, ?>> flagCollection = this.getFlagContainer().getFlagMap().values();
|
||||
flagsComponent = getFlagsComponent(flagsComponent, flagCollection);
|
||||
ConsolePlayer.getConsole().sendMessage(
|
||||
TranslatableCaption.of("flags.area_flags"),
|
||||
Template.of("flags", flagsComponent)
|
||||
Template.of("flags", flags.toString())
|
||||
);
|
||||
|
||||
this.spawnEggs = config.getBoolean("event.spawn.egg");
|
||||
@ -433,13 +429,9 @@ public abstract class PlotArea {
|
||||
}
|
||||
}
|
||||
this.getRoadFlagContainer().addAll(parseFlags(roadflags));
|
||||
|
||||
Component roadFlagsComponent = null;
|
||||
Collection<PlotFlag<?, ?>> roadFlagCollection = this.getRoadFlagContainer().getFlagMap().values();
|
||||
roadFlagsComponent = getFlagsComponent(roadFlagsComponent, roadFlagCollection);
|
||||
ConsolePlayer.getConsole().sendMessage(
|
||||
TranslatableCaption.of("flags.road_flags"),
|
||||
Template.of("flags", roadFlagsComponent)
|
||||
Template.of("flags", roadflags.toString())
|
||||
);
|
||||
|
||||
loadConfiguration(config);
|
||||
|
@ -43,8 +43,18 @@ public abstract class ListFlag<V, F extends PlotFlag<List<V>, F>> extends PlotFl
|
||||
@Override
|
||||
public F merge(@NonNull List<V> newValue) {
|
||||
final List<V> mergedList = new ArrayList<>();
|
||||
mergedList.addAll(getValue());
|
||||
mergedList.addAll(newValue);
|
||||
// If a server already used PS before this fix, we remove all present duplicates on an eventual merge
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -89,7 +89,7 @@ public class LocationOffsetDelegateQueueCoordinator extends DelegateQueueCoordin
|
||||
public boolean setBiome(int x, int z, @NonNull BiomeType biome) {
|
||||
boolean result = true;
|
||||
for (int y = 0; y < 256; y++) {
|
||||
result &= this.setBiome(x, z, biome);
|
||||
result &= this.setBiome(x, y, z, biome);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ public abstract class RegionManager {
|
||||
private static final Logger LOGGER = LogManager.getLogger("PlotSquared/" + RegionManager.class.getSimpleName());
|
||||
|
||||
public static RegionManager manager = null;
|
||||
private final WorldUtil worldUtil;
|
||||
protected final WorldUtil worldUtil;
|
||||
private final GlobalBlockQueue blockQueue;
|
||||
private final ProgressSubscriberFactory subscriberFactory;
|
||||
|
||||
|
@ -32,11 +32,13 @@ import com.plotsquared.core.command.Command;
|
||||
import com.plotsquared.core.command.CommandCategory;
|
||||
import com.plotsquared.core.command.RequiredType;
|
||||
import com.plotsquared.core.configuration.Settings;
|
||||
import com.plotsquared.core.player.ConsolePlayer;
|
||||
import com.plotsquared.core.player.PlotPlayer;
|
||||
import com.plotsquared.core.plot.Plot;
|
||||
import com.plotsquared.core.plot.PlotArea;
|
||||
import com.plotsquared.core.uuid.UUIDMapping;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@ -80,12 +82,31 @@ public final class TabCompletions {
|
||||
* @param input Command input
|
||||
* @param existing Players that should not be included in completions
|
||||
* @return List of completions
|
||||
* @deprecated In favor {@link #completePlayers(PlotPlayer, String, List)}
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
public static @NonNull List<Command> completePlayers(
|
||||
final @NonNull String input,
|
||||
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 existing Players that should not be included in completions
|
||||
* @return List of completions
|
||||
*
|
||||
* @deprecated In favor {@link #completeAddedPlayers(PlotPlayer, Plot, String, List)}
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
public static @NonNull List<Command> completeAddedPlayers(
|
||||
final @NonNull Plot plot,
|
||||
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)
|
||||
|| plot.getTrusted().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 uuidFilter Filter applied before caching values
|
||||
* @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(
|
||||
final @NonNull String cacheIdentifier,
|
||||
final @NonNull PlotPlayer<?> issuer,
|
||||
final @NonNull String input, final @NonNull List<String> existing,
|
||||
final @NonNull Predicate<UUID> uuidFilter
|
||||
) {
|
||||
@ -246,9 +306,13 @@ public final class TabCompletions {
|
||||
final Collection<? extends PlotPlayer<?>> onlinePlayers = PlotSquared.platform().playerManager().getPlayers();
|
||||
players = new ArrayList<>(onlinePlayers.size());
|
||||
for (final PlotPlayer<?> player : onlinePlayers) {
|
||||
if (uuidFilter.test(player.getUUID())) {
|
||||
players.add(player.getName());
|
||||
if (!uuidFilter.test(player.getUUID())) {
|
||||
continue;
|
||||
}
|
||||
if (issuer != null && !issuer.canSee(player)) {
|
||||
continue;
|
||||
}
|
||||
players.add(player.getName());
|
||||
}
|
||||
}
|
||||
return filterCached(players, input, existing);
|
||||
|
@ -183,8 +183,6 @@
|
||||
"error.task_in_process": "<prefix><gold>Task is already running.</gold>",
|
||||
"titles.title_entered_plot": "<gold>Plot: <world>;<plot></gold>",
|
||||
"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.enabled": "<prefix><gold><value> is now enabled.</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_lore_cost": "<prefix><gray>Cost: </gray><gold><cost></gold>",
|
||||
"preset.preset_lore_component": "<gray>Component: </gray><gold><component></gold>",
|
||||
"preset.title": "Plot Components",
|
||||
"generic.generic_other": "<gray>other</gray>",
|
||||
"generic.generic_merged": "<gray>merged</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.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.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.alias": "<gray>Set the plot alias.</gray>",
|
||||
"commands.description.area": "<gray>Create a new plot area.</gray>",
|
||||
|
10
README.md
10
README.md
@ -30,21 +30,13 @@ is to provide a lag-free and smooth experience.
|
||||
* [Wiki](https://github.com/IntellectualSites/PlotSquared-Documentation/wiki)
|
||||
* [Issues](https://github.com/IntellectualSites/PlotSquared/issues)
|
||||
* [Translations](https://intellectualsites.crowdin.com/plotsquared/)
|
||||
* [Contributing](https://github.com/IntellectualSites/.github/blob/main/CONTRIBUTING.md)
|
||||
|
||||
### Developer Resources
|
||||
* [API Documentation](https://github.com/IntellectualSites/PlotSquared-Documentation/wiki/API-Documentation)
|
||||
* [Event API](https://github.com/IntellectualSites/PlotSquared-Documentation/wiki/Events)
|
||||
* [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
|
||||
* [Plot2Dynmap](http://www.spigotmc.org/resources/plot2dynmap.1292/)
|
||||
* [HoloPlots](https://www.spigotmc.org/resources/holoplots.4880/)
|
||||
|
@ -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.
|
@ -1,6 +1,7 @@
|
||||
import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin
|
||||
import org.cadixdev.gradle.licenser.LicenseExtension
|
||||
import org.cadixdev.gradle.licenser.Licenser
|
||||
import java.net.URI
|
||||
|
||||
plugins {
|
||||
java
|
||||
@ -11,22 +12,13 @@ plugins {
|
||||
alias(libs.plugins.shadow)
|
||||
alias(libs.plugins.licenser)
|
||||
alias(libs.plugins.grgit)
|
||||
alias(libs.plugins.nexus)
|
||||
|
||||
eclipse
|
||||
idea
|
||||
}
|
||||
|
||||
var ver by extra("6.1.1")
|
||||
var versuffix by extra("-SNAPSHOT")
|
||||
val versionsuffix: String? by project
|
||||
if (versionsuffix != null) {
|
||||
versuffix = "-$versionsuffix"
|
||||
}
|
||||
version = if (!project.hasProperty("release")) {
|
||||
ver + versuffix
|
||||
} else {
|
||||
ver
|
||||
}
|
||||
version = "6.1.3"
|
||||
|
||||
allprojects {
|
||||
group = "com.plotsquared"
|
||||
@ -76,7 +68,7 @@ allprojects {
|
||||
dependencies {
|
||||
// Tests
|
||||
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") {
|
||||
@ -103,6 +95,9 @@ allprojects {
|
||||
|
||||
signing {
|
||||
if (!version.toString().endsWith("-SNAPSHOT")) {
|
||||
val signingKey: String? by project
|
||||
val signingPassword: String? by project
|
||||
useInMemoryPgpKeys(signingKey, signingPassword)
|
||||
signing.isRequired
|
||||
sign(publishing.publications)
|
||||
}
|
||||
@ -111,8 +106,6 @@ allprojects {
|
||||
publishing {
|
||||
publications {
|
||||
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"])
|
||||
|
||||
pom {
|
||||
@ -133,18 +126,23 @@ allprojects {
|
||||
developer {
|
||||
id.set("Sauilitired")
|
||||
name.set("Alexander Söderberg")
|
||||
organization.set("IntellectualSites")
|
||||
}
|
||||
developer {
|
||||
id.set("NotMyFault")
|
||||
name.set("NotMyFault")
|
||||
organization.set("IntellectualSites")
|
||||
email.set("contact@notmyfault.dev")
|
||||
}
|
||||
developer {
|
||||
id.set("SirYwell")
|
||||
name.set("Hannes Greule")
|
||||
organization.set("IntellectualSites")
|
||||
}
|
||||
developer {
|
||||
id.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 {
|
||||
@ -217,10 +187,6 @@ allprojects {
|
||||
)
|
||||
}
|
||||
|
||||
jar {
|
||||
this.archiveClassifier.set("jar")
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
this.archiveClassifier.set(null as String?)
|
||||
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 {
|
||||
val aggregatedJavadocs = create<Javadoc>("aggregatedJavadocs") {
|
||||
title = "${project.name} ${project.version} API"
|
||||
|
@ -6,19 +6,19 @@ log4j-api = "2.14.1" # Version set by Minecraft
|
||||
|
||||
# Platform expectations
|
||||
paper = "1.17.1-R0.1-SNAPSHOT"
|
||||
checker-qual = "3.18.0"
|
||||
checker-qual = "3.18.1"
|
||||
guice = "5.0.1"
|
||||
findbugs = "3.0.1"
|
||||
snakeyaml = "1.28" # Version set by Bukkit
|
||||
|
||||
# Adventure & MiniMessage
|
||||
adventure-api = "4.9.1"
|
||||
adventure-api = "4.9.2"
|
||||
adventure-text-minimessage = "4.1.0-SNAPSHOT"
|
||||
adventure-platform-bukkit = "4.0.0-SNAPSHOT"
|
||||
adventure-platform-bukkit = "4.0.0"
|
||||
|
||||
# Plugins
|
||||
worldedit = "7.2.6"
|
||||
fawe = "1.17-201"
|
||||
fawe = "1.17-343"
|
||||
vault = "1.7.1"
|
||||
placeholderapi = "2.10.10"
|
||||
luckperms = "5.3"
|
||||
@ -35,13 +35,14 @@ paster = "1.1.1"
|
||||
bstats = "2.2.1"
|
||||
paperlib = "1.0.6"
|
||||
squirrelid = "0.3.0"
|
||||
serverlib = "2.3.0"
|
||||
serverlib = "2.3.1"
|
||||
http4j = "1.3"
|
||||
|
||||
# Gradle plugins
|
||||
shadow = "7.0.0"
|
||||
shadow = "7.1.0"
|
||||
grgit = "4.1.0"
|
||||
licenser = "0.6.1"
|
||||
nexus = "1.1.0"
|
||||
|
||||
[libraries]
|
||||
# Platform expectations
|
||||
@ -67,8 +68,8 @@ adventurePlatformBukkit = { group = "net.kyori", name = "adventure-platform-bukk
|
||||
# Plugins
|
||||
worldeditCore = { group = "com.sk89q.worldedit", name = "worldedit-core", version.ref = "worldedit" }
|
||||
worldeditBukkit = { group = "com.sk89q.worldedit", name = "worldedit-bukkit", version.ref = "worldedit" }
|
||||
fastasyncworldeditBukkit = { group = "com.fastasyncworldedit", name = "FAWE-Bukkit", version.ref = "fawe" }
|
||||
fastasyncworldeditCore = { group = "com.fastasyncworldedit", name = "FAWE-Core", version.ref = "fawe" }
|
||||
fastasyncworldeditBukkit = { group = "com.fastasyncworldedit", name = "FastAsyncWorldEdit-Bukkit", version.ref = "fawe" }
|
||||
fastasyncworldeditCore = { group = "com.fastasyncworldedit", name = "FastAsyncWorldEdit-Core", version.ref = "fawe" }
|
||||
vault = { group = "com.github.MilkBowl", name = "VaultAPI", version.ref = "vault" }
|
||||
placeholderapi = { group = "me.clip", name = "placeholderapi", version.ref = "placeholderapi" }
|
||||
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" }
|
||||
grgit = { id = "org.ajoberstar.grgit", version.ref = "grgit" }
|
||||
licenser = { id = "org.cadixdev.licenser", version.ref = "licenser" }
|
||||
nexus = { id = "io.github.gradle-nexus.publish-plugin", version.ref = "nexus" }
|
||||
|
@ -5,7 +5,14 @@
|
||||
],
|
||||
"ignoreDeps": [
|
||||
"guava",
|
||||
"com.google.guava:guava",
|
||||
"gson",
|
||||
"snakeyaml"
|
||||
]
|
||||
],
|
||||
"timezone": "Europe/Berlin",
|
||||
"schedule": [
|
||||
"on monday after 9am"
|
||||
],
|
||||
"labels": ["Renovate"],
|
||||
"commitMessagePrefix": "chore: "
|
||||
}
|
||||
|
Reference in New Issue
Block a user