mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-07-03 06:04:43 +02:00
Compare commits
119 Commits
Author | SHA1 | Date | |
---|---|---|---|
8b6e7b2f2b | |||
06f0b42a97 | |||
9a85080bf6 | |||
d14d2caa2d | |||
bcfe7c58dd | |||
289f0f3bfd | |||
6fc4005c72 | |||
8f7c2e4c02 | |||
b43d08f4aa | |||
2c55c6a92e | |||
31f48cc7d1 | |||
4b77f1ab28 | |||
7cc38b5fa8 | |||
0c76d08b10 | |||
9c474570c8 | |||
7e1d56c849 | |||
07d0f124b4 | |||
8d6c621763 | |||
cef7098014 | |||
e1efa7266e | |||
f363941719 | |||
25095f4546 | |||
fd0c2050d8 | |||
07fdc94dd8 | |||
b501a81e21 | |||
eb334b3aac | |||
a77a51b6f2 | |||
7d981bc610 | |||
3eb485e900 | |||
9f4af889f7 | |||
2559c889e2 | |||
2cf268b99c | |||
e6fad8309c | |||
7551450cf9 | |||
e042566bb7 | |||
1f26808c7b | |||
a7026047d0 | |||
af2613202d | |||
3da1e9255a | |||
9394906a79 | |||
d881cb6084 | |||
b9d43897af | |||
76b58485a9 | |||
7002df0bc7 | |||
958aac3cb1 | |||
a93402e27b | |||
92f41f43c5 | |||
392ee9fa07 | |||
8859871e89 | |||
93d99630a9 | |||
47ae79e123 | |||
f9ad00c2c8 | |||
566af259db | |||
d9a6431078 | |||
e9c9375e78 | |||
7c99c8aabf | |||
88eb8f88a7 | |||
fd118c2c37 | |||
858b6b5471 | |||
f086826942 | |||
9c84dc2bc0 | |||
cba0f3ac1f | |||
b9a130ab00 | |||
688056352b | |||
2a40f52dea | |||
3ed369de19 | |||
bec51401a3 | |||
109f884b5f | |||
8f3fa419c4 | |||
a9f08bc885 | |||
a8923ec729 | |||
4eafd043a3 | |||
826cc8c835 | |||
d1dbf777a4 | |||
823e78377b | |||
87a2e81ec3 | |||
88775334b7 | |||
e126547e97 | |||
c1163cdb2e | |||
30d06b7801 | |||
a5cf7bf2c2 | |||
3d4d413de8 | |||
b97e843849 | |||
48c7a3e94e | |||
7263290bbe | |||
e99c4e3289 | |||
87cb26189f | |||
2dae336a5f | |||
258ed1469b | |||
6f3eabba0e | |||
804228fa6c | |||
be85708e5a | |||
f2368f97df | |||
df87bcb743 | |||
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 |
@ -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']
|
4
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
4
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@ -18,8 +18,6 @@ body:
|
||||
options:
|
||||
- Paper
|
||||
- Spigot
|
||||
- Tuinity
|
||||
- Purpur
|
||||
validations:
|
||||
required: true
|
||||
|
||||
@ -29,6 +27,8 @@ body:
|
||||
description: Which server version version you using? If your server version is not listed, it is not supported. Update to a supported version first.
|
||||
multiple: false
|
||||
options:
|
||||
- '1.18.1'
|
||||
- '1.18'
|
||||
- '1.17.1'
|
||||
- '1.16.5'
|
||||
- '1.15.2'
|
||||
|
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
|
2
.github/stale.yml
vendored
2
.github/stale.yml
vendored
@ -1,4 +1,4 @@
|
||||
daysUntilStale: 60
|
||||
daysUntilStale: 30
|
||||
daysUntilClose: 7
|
||||
only: issues
|
||||
exemptLabels:
|
||||
|
46
.github/workflows/build.yml
vendored
46
.github/workflows/build.yml
vendored
@ -1,17 +1,41 @@
|
||||
name: "build"
|
||||
name: build
|
||||
|
||||
on: ["pull_request", "push"]
|
||||
on: [ pull_request, push ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: "ubuntu-20.04"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: "Checkout Repository"
|
||||
uses: "actions/checkout@v2.3.4"
|
||||
- name: "Setup JDK 16"
|
||||
uses: "actions/setup-java@v2.2.0"
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v2.4.0
|
||||
- name: Validate Gradle Wrapper"
|
||||
uses: gradle/wrapper-validation-action@v1.0.4
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v2.5.0
|
||||
with:
|
||||
distribution: "temurin"
|
||||
java-version: "16"
|
||||
- name: "Clean Build"
|
||||
run: "./gradlew clean build"
|
||||
distribution: temurin
|
||||
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 closeAndReleaseSonatypeStagingRepository
|
||||
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 }}
|
||||
|
20
.github/workflows/rebase.yml
vendored
Normal file
20
.github/workflows/rebase.yml
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
name: Rebase Pull Request
|
||||
on:
|
||||
issue_comment:
|
||||
types: [created]
|
||||
|
||||
jobs:
|
||||
rebase:
|
||||
name: Rebase
|
||||
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase') && github.event.comment.author_association == 'MEMBER'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v2.4.0
|
||||
with:
|
||||
token: ${{ secrets.REBASE_TOKEN }}
|
||||
fetch-depth: 0
|
||||
- name: Automatic Rebase
|
||||
uses: cirrus-actions/rebase@1.5
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.REBASE_TOKEN }}
|
18
.github/workflows/release-drafter.yml
vendored
Normal file
18
.github/workflows/release-drafter.yml
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
name: draft release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- v6
|
||||
pull_request:
|
||||
types: [ opened, reopened, synchronize ]
|
||||
pull_request_target:
|
||||
types: [ opened, reopened, synchronize ]
|
||||
|
||||
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"
|
13
.whitesource
Normal file
13
.whitesource
Normal file
@ -0,0 +1,13 @@
|
||||
{
|
||||
"scanSettings": {
|
||||
"baseBranches": ["v6"]
|
||||
},
|
||||
"checkRunSettings": {
|
||||
"vulnerableCheckRunConclusionLevel": "success",
|
||||
"displayMode": "diff"
|
||||
},
|
||||
"issueSettings": {
|
||||
"minSeverityLevel": "LOW"
|
||||
},
|
||||
"enableRenovate": "true"
|
||||
}
|
@ -24,7 +24,7 @@ dependencies {
|
||||
implementation(libs.bstats)
|
||||
|
||||
// Paper
|
||||
compileOnlyApi(libs.paper)
|
||||
compileOnly(libs.paper)
|
||||
implementation(libs.paperlib)
|
||||
|
||||
// Plugins
|
||||
@ -32,15 +32,14 @@ dependencies {
|
||||
exclude(group = "org.bukkit")
|
||||
exclude(group = "org.spigotmc")
|
||||
}
|
||||
compileOnlyApi(libs.fastasyncworldeditBukkit)
|
||||
testImplementation(libs.fastasyncworldeditBukkit)
|
||||
compileOnly(libs.fastasyncworldeditBukkit) { isTransitive = false }
|
||||
testImplementation(libs.fastasyncworldeditBukkit) { isTransitive = false }
|
||||
compileOnly(libs.vault) {
|
||||
exclude(group = "org.bukkit")
|
||||
}
|
||||
compileOnly(libs.placeholderapi)
|
||||
compileOnly(libs.luckperms)
|
||||
compileOnly(libs.essentialsx)
|
||||
compileOnly(libs.hyperverse) { isTransitive = false }
|
||||
compileOnly(libs.mvdwapi) { isTransitive = false }
|
||||
|
||||
// Other libraries
|
||||
@ -75,7 +74,8 @@ tasks.named<ShadowJar>("shadowJar") {
|
||||
relocate("org.khelekore.prtree", "com.plotsquared.prtree")
|
||||
relocate("com.google.inject", "com.plotsquared.google")
|
||||
relocate("org.aopalliance", "com.plotsquared.core.aopalliance")
|
||||
relocate("com.intellectualsites.services", "com.plotsquared.core.services")
|
||||
relocate("cloud.commandframework.services", "com.plotsquared.core.services")
|
||||
relocate("io.leangen.geantyref", "com.plotsquared.core.geantyref")
|
||||
relocate("com.intellectualsites.arkitektonika", "com.plotsquared.core.arkitektonika")
|
||||
relocate("com.intellectualsites.http", "com.plotsquared.core.http")
|
||||
relocate("com.intellectualsites.paster", "com.plotsquared.core.paster")
|
||||
@ -83,6 +83,7 @@ tasks.named<ShadowJar>("shadowJar") {
|
||||
relocate("org.jetbrains", "com.plotsquared.core.annotations")
|
||||
relocate("org.intellij.lang", "com.plotsquared.core.intellij.annotations")
|
||||
relocate("javax.annotation", "com.plotsquared.core.annotation")
|
||||
relocate("com.google.code.findbugs", "com.plotsquared.core.findbugs")
|
||||
relocate("javax.inject", "com.plotsquared.core.annotation.inject")
|
||||
|
||||
// Get rid of all the libs which are 100% unused.
|
||||
@ -95,9 +96,9 @@ tasks {
|
||||
withType<Javadoc> {
|
||||
val opt = options as StandardJavadocDocletOptions
|
||||
opt.links("https://papermc.io/javadocs/paper/1.17/")
|
||||
opt.links("https://docs.enginehub.org/javadoc/com.sk89q.worldedit/worldedit-core/7.2.6/")
|
||||
opt.links("https://docs.enginehub.org/javadoc/com.sk89q.worldedit/worldedit-bukkit/7.2.6/")
|
||||
opt.links("https://jd.adventure.kyori.net/api/4.9.1/")
|
||||
opt.links("https://docs.enginehub.org/javadoc/com.sk89q.worldedit/worldedit-core/7.2.7/")
|
||||
opt.links("https://docs.enginehub.org/javadoc/com.sk89q.worldedit/worldedit-bukkit/7.2.7/")
|
||||
opt.links("https://jd.adventure.kyori.net/api/4.9.3/")
|
||||
opt.links("https://google.github.io/guice/api-docs/5.0.1/javadoc/")
|
||||
opt.links("https://checkerframework.org/api/")
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -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;
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -147,6 +147,8 @@ import java.io.File;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
@ -266,7 +268,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
||||
faweHook = true;
|
||||
} catch (Exception ignored) {
|
||||
LOGGER.error("Incompatible version of FAWE to enable hook, please upgrade: https://ci.athion" +
|
||||
".net/job/FastAsyncWorldEdit-1.17/");
|
||||
".net/job/FastAsyncWorldEdit/");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1141,8 +1143,10 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
||||
@Override
|
||||
public @NonNull String pluginsFormatted() {
|
||||
StringBuilder msg = new StringBuilder();
|
||||
Plugin[] plugins = Bukkit.getServer().getPluginManager().getPlugins();
|
||||
msg.append("Plugins (").append(plugins.length).append("): \n");
|
||||
List<Plugin> plugins = new ArrayList<>();
|
||||
Collections.addAll(plugins, Bukkit.getServer().getPluginManager().getPlugins());
|
||||
plugins.sort(Comparator.comparing(Plugin::getName));
|
||||
msg.append("Plugins (").append(plugins.size()).append("): \n");
|
||||
for (Plugin p : plugins) {
|
||||
msg.append(" - ").append(p.getName()).append(":").append("\n")
|
||||
.append(" • Version: ").append(p.getDescription().getVersion()).append("\n")
|
||||
@ -1156,6 +1160,21 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
||||
return msg.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("ConstantConditions")
|
||||
public @NonNull String worldEditImplementations() {
|
||||
StringBuilder msg = new StringBuilder();
|
||||
if (Bukkit.getPluginManager().getPlugin("FastAsyncWorldEdit") != null) {
|
||||
msg.append("FastAsyncWorldEdit: ").append(Bukkit.getPluginManager().getPlugin("FastAsyncWorldEdit").getDescription().getVersion());
|
||||
} else if (Bukkit.getPluginManager().getPlugin("AsyncWorldEdit") != null) {
|
||||
msg.append("AsyncWorldEdit: ").append(Bukkit.getPluginManager().getPlugin("AsyncWorldEdit").getDescription().getVersion()).append("\n");
|
||||
msg.append("WorldEdit: ").append(Bukkit.getPluginManager().getPlugin("WorldEdit").getDescription().getVersion());
|
||||
} else {
|
||||
msg.append("WorldEdit: ").append(Bukkit.getPluginManager().getPlugin("WorldEdit").getDescription().getVersion());
|
||||
}
|
||||
return msg.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public com.plotsquared.core.location.@NonNull World<?> getPlatformWorld(final @NonNull String worldName) {
|
||||
return BukkitWorld.of(worldName);
|
||||
@ -1180,6 +1199,11 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
||||
return this.injector;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull PlotAreaManager plotAreaManager() {
|
||||
return this.plotAreaManager;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Locale getLocale() {
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -29,7 +29,6 @@ import com.google.inject.AbstractModule;
|
||||
import com.google.inject.Provides;
|
||||
import com.google.inject.Singleton;
|
||||
import com.plotsquared.bukkit.managers.BukkitWorldManager;
|
||||
import com.plotsquared.bukkit.managers.HyperverseWorldManager;
|
||||
import com.plotsquared.bukkit.managers.MultiverseWorldManager;
|
||||
import com.plotsquared.core.util.PlatformWorldManager;
|
||||
import org.bukkit.Bukkit;
|
||||
@ -40,9 +39,7 @@ public class WorldManagerModule extends AbstractModule {
|
||||
@Provides
|
||||
@Singleton
|
||||
PlatformWorldManager<World> provideWorldManager() {
|
||||
if (Bukkit.getPluginManager().getPlugin("Hyperverse") != null) {
|
||||
return new HyperverseWorldManager();
|
||||
} else if (Bukkit.getPluginManager().getPlugin("Multiverse-Core") != null) {
|
||||
if (Bukkit.getPluginManager().getPlugin("Multiverse-Core") != null) {
|
||||
return new MultiverseWorldManager();
|
||||
} else {
|
||||
return new BukkitWorldManager();
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -318,8 +318,7 @@ public class BlockEventListener implements Listener {
|
||||
} else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER))
|
||||
TranslatableCaption.of("done.building_restricted")
|
||||
);
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
@ -401,8 +400,7 @@ public class BlockEventListener implements Listener {
|
||||
} else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
|
||||
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
||||
plotPlayer.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_OTHER))
|
||||
TranslatableCaption.of("done.building_restricted")
|
||||
);
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -32,6 +32,7 @@ import com.plotsquared.core.location.Location;
|
||||
import com.plotsquared.core.plot.Plot;
|
||||
import com.plotsquared.core.plot.PlotArea;
|
||||
import com.plotsquared.core.plot.world.PlotAreaManager;
|
||||
import com.plotsquared.core.plot.world.SinglePlotArea;
|
||||
import com.plotsquared.core.util.ReflectionUtils.RefClass;
|
||||
import com.plotsquared.core.util.ReflectionUtils.RefField;
|
||||
import com.plotsquared.core.util.ReflectionUtils.RefMethod;
|
||||
@ -107,41 +108,11 @@ public class ChunkListener implements Listener {
|
||||
this.isTrueForNotSave = false;
|
||||
} else {
|
||||
this.mustSave = classChunk.getField("mustNotSave");
|
||||
/*
|
||||
this.worldServer = classCraftWorld.getField("world");
|
||||
this.methodGetChunkProvider = getRefClass("{nms}.WorldServer").getMethod("getChunkProvider");
|
||||
this.playerChunkMap = getRefClass("{nms}.ChunkProviderServer").getField("playerChunkMap");
|
||||
RefClass classPlayerChunkMap = getRefClass("{nms}.PlayerChunkMap");
|
||||
if (PaperLib.isPaper() && version == 16) {
|
||||
this.updatingChunks = classPlayerChunkMap.getField("updatingChunks");
|
||||
this.methodGetVisibleMap = getRefClass("com.destroystokyo.paper.util.map.QueuedChangesMapLong2Object").getMethod(
|
||||
"getVisibleMap");
|
||||
} else {
|
||||
this.visibleChunks = classPlayerChunkMap.getField("visibleChunks");
|
||||
}
|
||||
this.methodGetFullChunk = getRefClass("{nms}.PlayerChunk").getMethod("getFullChunk");
|
||||
this.methodGetBukkitChunk = getRefClass("{nms}.Chunk").getMethod("getBukkitChunk");
|
||||
*/
|
||||
}
|
||||
} else if (version == 17) {
|
||||
} else {
|
||||
RefClass classChunk = getRefClass("net.minecraft.world.level.chunk.Chunk");
|
||||
this.mustSave = classChunk.getField("mustNotSave");
|
||||
/*
|
||||
this.worldServer = classCraftWorld.getField("world");
|
||||
this.methodGetChunkProvider = getRefClass("net.minecraft.server.level.WorldServer").getMethod(
|
||||
"getChunkProvider");
|
||||
this.playerChunkMap = getRefClass("net.minecraft.server.level.ChunkProviderServer").getField("a");
|
||||
RefClass classPlayerChunkMap = getRefClass("net.minecraft.server.level.PlayerChunkMap");
|
||||
if (PaperLib.isPaper()) {
|
||||
this.updatingChunks = classPlayerChunkMap.getField("updatingChunks");
|
||||
this.methodGetVisibleMap = getRefClass("com.destroystokyo.paper.util.map.QueuedChangesMapLong2Object").getMethod(
|
||||
"getVisibleMap");
|
||||
} else {
|
||||
this.visibleChunks = classPlayerChunkMap.getField("l");
|
||||
}
|
||||
this.methodGetFullChunk = getRefClass("net.minecraft.server.level.PlayerChunk").getMethod("getFullChunk");
|
||||
this.methodGetBukkitChunk = getRefClass("net.minecraft.world.level.chunk.Chunk").getMethod("getBukkitChunk");
|
||||
*/
|
||||
|
||||
}
|
||||
} catch (NoSuchFieldException e) {
|
||||
e.printStackTrace();
|
||||
@ -181,32 +152,7 @@ public class ChunkListener implements Listener {
|
||||
}
|
||||
toUnload.add(chunk);
|
||||
}
|
||||
}/* else {
|
||||
Object worldServer = this.worldServer.of(craftWorld).get();
|
||||
Object chunkProviderServer = methodGetChunkProvider.of(worldServer).call();
|
||||
Object playerChunkMap = this.playerChunkMap.of(chunkProviderServer).get();
|
||||
Long2ObjectLinkedOpenHashMap<?> chunks;
|
||||
if (PaperLib.isPaper() && version > 15) {
|
||||
Object updatingChunks = this.updatingChunks.of(playerChunkMap).get();
|
||||
chunks = (Long2ObjectLinkedOpenHashMap<?>) this.methodGetVisibleMap.of(updatingChunks).call();
|
||||
} else {
|
||||
chunks = (Long2ObjectLinkedOpenHashMap<?>) this.visibleChunks.of(playerChunkMap).get();
|
||||
}
|
||||
for (Object playerChunk : chunks.values()) {
|
||||
Object nmsChunk = this.methodGetFullChunk.of(playerChunk).call();
|
||||
if (nmsChunk == null) {
|
||||
continue;
|
||||
}
|
||||
Chunk chunk = (Chunk) this.methodGetBukkitChunk.of(nmsChunk).call();
|
||||
int x = chunk.getX();
|
||||
int z = chunk.getZ();
|
||||
if (!shouldSave(worldName, x, z)) {
|
||||
unloadChunk(worldName, chunk, false);
|
||||
continue;
|
||||
}
|
||||
toUnload.add(chunk);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
if (toUnload.isEmpty()) {
|
||||
return;
|
||||
@ -295,7 +241,7 @@ public class ChunkListener implements Listener {
|
||||
Chunk chunk = event.getChunk();
|
||||
if (Settings.Chunk_Processor.AUTO_TRIM) {
|
||||
String world = chunk.getWorld().getName();
|
||||
if (this.plotAreaManager.hasPlotArea(world)) {
|
||||
if ((!Settings.Enabled_Components.WORLDS || !SinglePlotArea.isSinglePlotWorld(world)) && this.plotAreaManager.hasPlotArea(world)) {
|
||||
if (unloadChunk(world, chunk, true)) {
|
||||
return;
|
||||
}
|
||||
@ -365,8 +311,7 @@ public class ChunkListener implements Listener {
|
||||
}
|
||||
|
||||
private void cleanChunk(final Chunk chunk) {
|
||||
TaskManager.index.incrementAndGet();
|
||||
final int currentIndex = TaskManager.index.get();
|
||||
final int currentIndex = TaskManager.index.incrementAndGet();
|
||||
PlotSquaredTask task = TaskManager.runTaskRepeat(() -> {
|
||||
if (!chunk.isLoaded()) {
|
||||
Objects.requireNonNull(TaskManager.removeTask(currentIndex)).cancel();
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -48,6 +48,7 @@ import com.plotsquared.core.util.Permissions;
|
||||
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
||||
import com.sk89q.worldedit.world.block.BlockType;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Ageable;
|
||||
@ -323,6 +324,10 @@ public class EntityEventListener implements Listener {
|
||||
}
|
||||
}
|
||||
event.setCancelled(true);
|
||||
//Spawn Explosion Particles when enabled in settings
|
||||
if (Settings.General.ALWAYS_SHOW_EXPLOSIONS) {
|
||||
event.getLocation().getWorld().spawnParticle(Particle.EXPLOSION_HUGE, event.getLocation(), 0);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
@ -371,14 +376,14 @@ public class EntityEventListener implements Listener {
|
||||
if (shooter instanceof Player) {
|
||||
PlotPlayer<?> pp = BukkitUtil.adapt((Player) shooter);
|
||||
if (plot == null) {
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_PROJECTILE_UNOWNED)) {
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED)) {
|
||||
entity.remove();
|
||||
event.setCancelled(true);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (plot.isAdded(pp.getUUID()) || Permissions
|
||||
.hasPermission(pp, Permission.PERMISSION_PROJECTILE_OTHER)) {
|
||||
.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) {
|
||||
return;
|
||||
}
|
||||
entity.remove();
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -75,8 +75,7 @@ public class EntitySpawnListener implements Listener {
|
||||
|
||||
public static void testCreate(final Entity entity) {
|
||||
@NonNull World world = entity.getWorld();
|
||||
if (areaName == world.getName()) {
|
||||
} else {
|
||||
if (!world.getName().equals(areaName)) {
|
||||
areaName = world.getName();
|
||||
hasPlotArea = PlotSquared.get().getPlotAreaManager().hasPlotArea(areaName);
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -39,11 +39,13 @@ import com.plotsquared.core.command.MainCommand;
|
||||
import com.plotsquared.core.configuration.Settings;
|
||||
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||
import com.plotsquared.core.location.Location;
|
||||
import com.plotsquared.core.permissions.Permission;
|
||||
import com.plotsquared.core.player.PlotPlayer;
|
||||
import com.plotsquared.core.plot.Plot;
|
||||
import com.plotsquared.core.plot.PlotArea;
|
||||
import com.plotsquared.core.plot.flag.implementations.DoneFlag;
|
||||
import com.plotsquared.core.plot.world.PlotAreaManager;
|
||||
import com.plotsquared.core.util.Permissions;
|
||||
import net.kyori.adventure.text.minimessage.Template;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.block.Block;
|
||||
@ -53,7 +55,6 @@ import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Projectile;
|
||||
import org.bukkit.entity.Slime;
|
||||
import org.bukkit.entity.ThrownPotion;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
@ -321,9 +322,6 @@ public class PaperListener implements Listener {
|
||||
return;
|
||||
}
|
||||
Projectile entity = event.getProjectile();
|
||||
if (!(entity instanceof ThrownPotion)) {
|
||||
return;
|
||||
}
|
||||
ProjectileSource shooter = entity.getShooter();
|
||||
if (!(shooter instanceof Player)) {
|
||||
return;
|
||||
@ -332,11 +330,36 @@ public class PaperListener implements Listener {
|
||||
if (!this.plotAreaManager.hasPlotArea(location.getWorldName())) {
|
||||
return;
|
||||
}
|
||||
PlotPlayer<?> pp = BukkitUtil.adapt((Player) shooter);
|
||||
PlotPlayer<Player> pp = BukkitUtil.adapt((Player) shooter);
|
||||
Plot plot = location.getOwnedPlot();
|
||||
if (plot != null && !plot.isAdded(pp.getUUID())) {
|
||||
entity.remove();
|
||||
event.setCancelled(true);
|
||||
|
||||
if (plot == null) {
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_ROAD)) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_ROAD))
|
||||
);
|
||||
entity.remove();
|
||||
event.setCancelled(true);
|
||||
}
|
||||
} else if (!plot.hasOwner()) {
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED)) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED))
|
||||
);
|
||||
entity.remove();
|
||||
event.setCancelled(true);
|
||||
}
|
||||
} else if (!plot.isAdded(pp.getUUID())) {
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_OTHER))
|
||||
);
|
||||
entity.remove();
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -68,11 +68,9 @@ import com.plotsquared.core.plot.flag.implementations.PlayerInteractFlag;
|
||||
import com.plotsquared.core.plot.flag.implementations.PreventCreativeCopyFlag;
|
||||
import com.plotsquared.core.plot.flag.implementations.TamedInteractFlag;
|
||||
import com.plotsquared.core.plot.flag.implementations.UntrustedVisitFlag;
|
||||
import com.plotsquared.core.plot.flag.implementations.UseFlag;
|
||||
import com.plotsquared.core.plot.flag.implementations.VehicleBreakFlag;
|
||||
import com.plotsquared.core.plot.flag.implementations.VehicleUseFlag;
|
||||
import com.plotsquared.core.plot.flag.implementations.VillagerInteractFlag;
|
||||
import com.plotsquared.core.plot.flag.types.BlockTypeWrapper;
|
||||
import com.plotsquared.core.plot.world.PlotAreaManager;
|
||||
import com.plotsquared.core.util.EventDispatcher;
|
||||
import com.plotsquared.core.util.MathMan;
|
||||
@ -94,6 +92,7 @@ import org.bukkit.FluidCollisionMode;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.block.data.Waterlogged;
|
||||
import org.bukkit.command.PluginCommand;
|
||||
import org.bukkit.entity.ArmorStand;
|
||||
@ -127,7 +126,6 @@ import org.bukkit.event.player.PlayerBucketFillEvent;
|
||||
import org.bukkit.event.player.PlayerChangedWorldEvent;
|
||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||
import org.bukkit.event.player.PlayerDropItemEvent;
|
||||
import org.bukkit.event.player.PlayerEggThrowEvent;
|
||||
import org.bukkit.event.player.PlayerEvent;
|
||||
import org.bukkit.event.player.PlayerInteractAtEntityEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||
@ -156,6 +154,7 @@ import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
@ -418,8 +417,8 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
.getHomeSynchronous()
|
||||
.equals(BukkitUtil.adaptComplete(to)))) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_ENTRY_DENIED))
|
||||
TranslatableCaption.of("deny.no_enter"),
|
||||
Template.of("plot", plot.toString())
|
||||
);
|
||||
event.setCancelled(true);
|
||||
}
|
||||
@ -552,8 +551,8 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
ForceFieldListener.handleForcefield(player, pp, now);
|
||||
} else if (!plotEntry(pp, now) && this.tmpTeleport) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_ENTRY_DENIED))
|
||||
TranslatableCaption.of("deny.no_enter"),
|
||||
Template.of("plot", now.toString())
|
||||
);
|
||||
this.tmpTeleport = false;
|
||||
to.setX(from.getBlockX());
|
||||
@ -564,19 +563,31 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
return;
|
||||
}
|
||||
int border = area.getBorder();
|
||||
int x1;
|
||||
if (x2 > border && this.tmpTeleport) {
|
||||
to.setX(border - 1);
|
||||
this.tmpTeleport = false;
|
||||
player.teleport(event.getTo());
|
||||
this.tmpTeleport = true;
|
||||
pp.sendMessage(TranslatableCaption.of("border.border"));
|
||||
}
|
||||
if (x2 < -border && this.tmpTeleport) {
|
||||
to.setX(-border + 1);
|
||||
this.tmpTeleport = false;
|
||||
player.teleport(event.getTo());
|
||||
this.tmpTeleport = true;
|
||||
pp.sendMessage(TranslatableCaption.of("border.border"));
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BYPASS_BORDER)) {
|
||||
to.setX(border - 1);
|
||||
this.tmpTeleport = false;
|
||||
player.teleport(event.getTo());
|
||||
this.tmpTeleport = true;
|
||||
pp.sendMessage(TranslatableCaption.of("border.denied"));
|
||||
} else if (MathMan.roundInt(from.getX()) <= border) { // Only send if they just moved out of the border
|
||||
pp.sendMessage(TranslatableCaption.of("border.bypass.exited"));
|
||||
}
|
||||
} else if (x2 < -border && this.tmpTeleport) {
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BYPASS_BORDER)) {
|
||||
to.setX(-border + 1);
|
||||
this.tmpTeleport = false;
|
||||
player.teleport(event.getTo());
|
||||
this.tmpTeleport = true;
|
||||
pp.sendMessage(TranslatableCaption.of("border.denied"));
|
||||
} else if (MathMan.roundInt(from.getX()) >= -border) { // Only send if they just moved out of the border
|
||||
pp.sendMessage(TranslatableCaption.of("border.bypass.exited"));
|
||||
}
|
||||
} else if (((x1 = MathMan.roundInt(from.getX())) >= border && x2 <= border) || (x1 <= -border && x2 >= -border)) {
|
||||
if (Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BYPASS_BORDER)) {
|
||||
pp.sendMessage(TranslatableCaption.of("border.bypass.entered"));
|
||||
}
|
||||
}
|
||||
}
|
||||
int z2;
|
||||
@ -601,13 +612,13 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
}
|
||||
return;
|
||||
}
|
||||
Plot now = area.getPlot(location);
|
||||
Plot plot = area.getPlot(location);
|
||||
Plot lastPlot;
|
||||
try (final MetaDataAccess<Plot> lastPlotAccess =
|
||||
pp.accessTemporaryMetaData(PlayerMetaDataKeys.TEMPORARY_LAST_PLOT)) {
|
||||
lastPlot = lastPlotAccess.get().orElse(null);
|
||||
}
|
||||
if (now == null) {
|
||||
if (plot == null) {
|
||||
try (final MetaDataAccess<Boolean> kickAccess =
|
||||
pp.accessTemporaryMetaData(PlayerMetaDataKeys.TEMPORARY_KICK)) {
|
||||
if (lastPlot != null && !plotExit(pp, lastPlot) && this.tmpTeleport && !kickAccess.get().orElse(false)) {
|
||||
@ -626,12 +637,12 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else if (now.equals(lastPlot)) {
|
||||
ForceFieldListener.handleForcefield(player, pp, now);
|
||||
} else if (!plotEntry(pp, now) && this.tmpTeleport) {
|
||||
} else if (plot.equals(lastPlot)) {
|
||||
ForceFieldListener.handleForcefield(player, pp, plot);
|
||||
} else if (!plotEntry(pp, plot) && this.tmpTeleport) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_ENTRY_DENIED))
|
||||
TranslatableCaption.of("deny.no_enter"),
|
||||
Template.of("plot", plot.toString())
|
||||
);
|
||||
this.tmpTeleport = false;
|
||||
player.teleport(from);
|
||||
@ -643,18 +654,31 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
return;
|
||||
}
|
||||
int border = area.getBorder();
|
||||
int z1;
|
||||
if (z2 > border && this.tmpTeleport) {
|
||||
to.setZ(border - 1);
|
||||
this.tmpTeleport = false;
|
||||
player.teleport(event.getTo());
|
||||
this.tmpTeleport = true;
|
||||
pp.sendMessage(TranslatableCaption.of("border.border"));
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BYPASS_BORDER)) {
|
||||
to.setZ(border - 1);
|
||||
this.tmpTeleport = false;
|
||||
player.teleport(event.getTo());
|
||||
this.tmpTeleport = true;
|
||||
pp.sendMessage(TranslatableCaption.of("border.denied"));
|
||||
} else if (MathMan.roundInt(from.getZ()) <= border) { // Only send if they just moved out of the border
|
||||
pp.sendMessage(TranslatableCaption.of("border.bypass.exited"));
|
||||
}
|
||||
} else if (z2 < -border && this.tmpTeleport) {
|
||||
to.setZ(-border + 1);
|
||||
this.tmpTeleport = false;
|
||||
player.teleport(event.getTo());
|
||||
this.tmpTeleport = true;
|
||||
pp.sendMessage(TranslatableCaption.of("border.border"));
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BYPASS_BORDER)) {
|
||||
to.setZ(-border + 1);
|
||||
this.tmpTeleport = false;
|
||||
player.teleport(event.getTo());
|
||||
this.tmpTeleport = true;
|
||||
pp.sendMessage(TranslatableCaption.of("border.denied"));
|
||||
} else if (MathMan.roundInt(from.getZ()) >= -border) { // Only send if they just moved out of the border
|
||||
pp.sendMessage(TranslatableCaption.of("border.bypass.exited"));
|
||||
}
|
||||
} else if (((z1 = MathMan.roundInt(from.getZ())) >= border && z2 <= border) || (z1 <= -border && z2 >= -border)) {
|
||||
if (Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BYPASS_BORDER)) {
|
||||
pp.sendMessage(TranslatableCaption.of("border.bypass.entered"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -960,8 +984,7 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER))
|
||||
TranslatableCaption.of("done.building_restricted")
|
||||
);
|
||||
e.setCancelled(true);
|
||||
return;
|
||||
@ -1215,13 +1238,6 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
);
|
||||
event.setCancelled(true);
|
||||
} else if (!plot.isAdded(pp.getUUID())) {
|
||||
List<BlockTypeWrapper> use = plot.getFlag(UseFlag.class);
|
||||
final BlockType blockType = BukkitAdapter.asBlockType(block.getType());
|
||||
for (final BlockTypeWrapper blockTypeWrapper : use) {
|
||||
if (blockTypeWrapper.accepts(blockType)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
||||
return;
|
||||
}
|
||||
@ -1233,8 +1249,7 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
} else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER))
|
||||
TranslatableCaption.of("done.building_restricted")
|
||||
);
|
||||
event.setCancelled(true);
|
||||
}
|
||||
@ -1288,14 +1303,6 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
);
|
||||
event.setCancelled(true);
|
||||
} else if (!plot.isAdded(plotPlayer.getUUID())) {
|
||||
List<BlockTypeWrapper> use = plot.getFlag(UseFlag.class);
|
||||
Block block = event.getBlockClicked();
|
||||
final BlockType blockType = BukkitAdapter.asBlockType(block.getType());
|
||||
for (final BlockTypeWrapper blockTypeWrapper : use) {
|
||||
if (blockTypeWrapper.accepts(blockType)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
||||
return;
|
||||
}
|
||||
@ -1307,8 +1314,7 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
} else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
|
||||
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
||||
plotPlayer.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER))
|
||||
TranslatableCaption.of("done.building_restricted")
|
||||
);
|
||||
event.setCancelled(true);
|
||||
}
|
||||
@ -1588,43 +1594,6 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void onPlayerEggThrow(PlayerEggThrowEvent event) {
|
||||
Location location = BukkitUtil.adapt(event.getEgg().getLocation());
|
||||
PlotArea area = location.getPlotArea();
|
||||
if (area == null) {
|
||||
return;
|
||||
}
|
||||
Player player = event.getPlayer();
|
||||
BukkitPlayer plotPlayer = BukkitUtil.adapt(player);
|
||||
Plot plot = area.getPlot(location);
|
||||
if (plot == null) {
|
||||
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PROJECTILE_ROAD)) {
|
||||
plotPlayer.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_ROAD))
|
||||
);
|
||||
event.setHatching(false);
|
||||
}
|
||||
} else if (!plot.hasOwner()) {
|
||||
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED)) {
|
||||
plotPlayer.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED))
|
||||
);
|
||||
event.setHatching(false);
|
||||
}
|
||||
} else if (!plot.isAdded(plotPlayer.getUUID())) {
|
||||
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) {
|
||||
plotPlayer.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_OTHER))
|
||||
);
|
||||
event.setHatching(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onItemDrop(PlayerDropItemEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
@ -1733,22 +1702,49 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onPortalCreation(PortalCreateEvent event) {
|
||||
Location location = BukkitUtil.adapt(event.getEntity().getLocation());
|
||||
PlotArea area = location.getPlotArea();
|
||||
if (area == null) {
|
||||
String world = event.getWorld().getName();
|
||||
if (PlotSquared.get().getPlotAreaManager().getPlotAreasSet(world).size() == 0) {
|
||||
return;
|
||||
}
|
||||
Plot plot = location.getOwnedPlot();
|
||||
if (plot == null) {
|
||||
if (area.isRoadFlags() && area.getRoadFlag(DenyPortalsFlag.class)) {
|
||||
event.setCancelled(true);
|
||||
int minX = Integer.MAX_VALUE;
|
||||
int maxX = Integer.MIN_VALUE;
|
||||
int minZ = Integer.MAX_VALUE;
|
||||
int maxZ = Integer.MIN_VALUE;
|
||||
for (BlockState state : event.getBlocks()) {
|
||||
minX = Math.min(state.getX(), minX);
|
||||
maxX = Math.max(state.getX(), maxX);
|
||||
minZ = Math.min(state.getZ(), minZ);
|
||||
maxZ = Math.max(state.getZ(), maxZ);
|
||||
}
|
||||
int y = event.getBlocks().get(0).getY(); // Don't need to worry about this too much
|
||||
for (Location location : Set.of( // Use Set to lazily avoid duplicate locations
|
||||
Location.at(world, minX, y, maxX),
|
||||
Location.at(world, minZ, y, maxZ),
|
||||
Location.at(world, minX, y, maxZ),
|
||||
Location.at(world, minZ, y, maxX)
|
||||
)) {
|
||||
PlotArea area = location.getPlotArea();
|
||||
if (area == null) {
|
||||
continue;
|
||||
}
|
||||
Plot plot = location.getOwnedPlot();
|
||||
if (plot == null) {
|
||||
if (area.isRoadFlags() && area.getRoadFlag(DenyPortalsFlag.class)) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (plot.getFlag(DenyPortalsFlag.class)) {
|
||||
if (plot.getFlag(DenyPortalsFlag.class)) {
|
||||
plot.debug(event.getEntity().getName() + " did not create a portal because of deny-portals = true");
|
||||
StringBuilder builder = new StringBuilder();
|
||||
if (event.getEntity() != null) {
|
||||
builder.append(event.getEntity().getName()).append(" did not create a portal");
|
||||
} else {
|
||||
builder.append("Portal creation cancelled");
|
||||
}
|
||||
plot.debug(builder.append(" because of deny-portals = true").toString());
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -28,6 +28,7 @@ package com.plotsquared.bukkit.listener;
|
||||
import com.google.inject.Inject;
|
||||
import com.plotsquared.bukkit.util.BukkitEntityUtil;
|
||||
import com.plotsquared.bukkit.util.BukkitUtil;
|
||||
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||
import com.plotsquared.core.location.Location;
|
||||
import com.plotsquared.core.permissions.Permission;
|
||||
import com.plotsquared.core.player.PlotPlayer;
|
||||
@ -36,6 +37,7 @@ import com.plotsquared.core.plot.PlotArea;
|
||||
import com.plotsquared.core.plot.PlotHandler;
|
||||
import com.plotsquared.core.plot.world.PlotAreaManager;
|
||||
import com.plotsquared.core.util.Permissions;
|
||||
import net.kyori.adventure.text.minimessage.Template;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -96,9 +98,6 @@ public class ProjectileEventListener implements Listener {
|
||||
@EventHandler
|
||||
public void onProjectileLaunch(ProjectileLaunchEvent event) {
|
||||
Projectile entity = event.getEntity();
|
||||
if (!(entity instanceof ThrownPotion)) {
|
||||
return;
|
||||
}
|
||||
ProjectileSource shooter = entity.getShooter();
|
||||
if (!(shooter instanceof Player)) {
|
||||
return;
|
||||
@ -109,9 +108,34 @@ public class ProjectileEventListener implements Listener {
|
||||
}
|
||||
PlotPlayer<Player> pp = BukkitUtil.adapt((Player) shooter);
|
||||
Plot plot = location.getOwnedPlot();
|
||||
if (plot != null && !plot.isAdded(pp.getUUID())) {
|
||||
entity.remove();
|
||||
event.setCancelled(true);
|
||||
|
||||
if (plot == null) {
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_ROAD)) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_ROAD))
|
||||
);
|
||||
entity.remove();
|
||||
event.setCancelled(true);
|
||||
}
|
||||
} else if (!plot.hasOwner()) {
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED)) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED))
|
||||
);
|
||||
entity.remove();
|
||||
event.setCancelled(true);
|
||||
}
|
||||
} else if (!plot.isAdded(pp.getUUID())) {
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) {
|
||||
pp.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_OTHER))
|
||||
);
|
||||
entity.remove();
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -131,14 +155,14 @@ public class ProjectileEventListener implements Listener {
|
||||
if (shooter instanceof Player) {
|
||||
PlotPlayer<?> pp = BukkitUtil.adapt((Player) shooter);
|
||||
if (plot == null) {
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_PROJECTILE_UNOWNED)) {
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED)) {
|
||||
entity.remove();
|
||||
event.setCancelled(true);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (plot.isAdded(pp.getUUID()) || Permissions
|
||||
.hasPermission(pp, Permission.PERMISSION_PROJECTILE_OTHER)) {
|
||||
.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) {
|
||||
return;
|
||||
}
|
||||
entity.remove();
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -27,6 +27,7 @@ package com.plotsquared.bukkit.listener;
|
||||
|
||||
import com.plotsquared.core.PlotSquared;
|
||||
import com.plotsquared.core.plot.world.PlotAreaManager;
|
||||
import com.plotsquared.core.plot.world.SinglePlotArea;
|
||||
import com.plotsquared.core.plot.world.SinglePlotAreaManager;
|
||||
import com.plotsquared.core.util.ReflectionUtils;
|
||||
import org.bukkit.Chunk;
|
||||
@ -86,7 +87,7 @@ public class SingleWorldListener implements Listener {
|
||||
if (!(man instanceof SinglePlotAreaManager)) {
|
||||
return;
|
||||
}
|
||||
if (!isPlotId(name)) {
|
||||
if (!SinglePlotArea.isSinglePlotWorld(name)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -103,31 +104,4 @@ public class SingleWorldListener implements Listener {
|
||||
handle(event);
|
||||
}
|
||||
|
||||
private boolean isPlotId(String worldName) {
|
||||
int len = worldName.length();
|
||||
int separator = 0;
|
||||
for (int i = 0; i < len; i++) {
|
||||
switch (worldName.charAt(i)) {
|
||||
case '_':
|
||||
separator++;
|
||||
break;
|
||||
case '-':
|
||||
case '0':
|
||||
case '1':
|
||||
case '2':
|
||||
case '3':
|
||||
case '4':
|
||||
case '5':
|
||||
case '6':
|
||||
case '7':
|
||||
case '8':
|
||||
case '9':
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return separator == 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -25,6 +25,7 @@
|
||||
*/
|
||||
package com.plotsquared.bukkit.managers;
|
||||
|
||||
/*
|
||||
import com.google.inject.Singleton;
|
||||
import org.bukkit.World;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
@ -35,10 +36,9 @@ import se.hyperver.hyperverse.world.WorldConfigurationBuilder;
|
||||
import se.hyperver.hyperverse.world.WorldFeatures;
|
||||
import se.hyperver.hyperverse.world.WorldType;
|
||||
|
||||
/**
|
||||
* Hyperverse specific manager that creates worlds
|
||||
* using Hyperverse's API
|
||||
*/
|
||||
Hyperverse implementation is currently put on ice until Hyperverse is released on a stable line and deployed to the central
|
||||
repository.
|
||||
|
||||
@Singleton
|
||||
public class HyperverseWorldManager extends BukkitWorldManager {
|
||||
|
||||
@ -67,3 +67,4 @@ public class HyperverseWorldManager extends BukkitWorldManager {
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -178,8 +178,7 @@ public class BukkitEntityUtil {
|
||||
if (!Permissions
|
||||
.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
||||
plotPlayer.sendMessage(
|
||||
TranslatableCaption.of("permission.no_permission_event"),
|
||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER))
|
||||
TranslatableCaption.of("done.building_restricted")
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -248,9 +248,12 @@ permissions:
|
||||
plots.admin.components.other: true
|
||||
plots.admin.vehicle.break.unowned: true
|
||||
plots.admin.pve.unowned: true
|
||||
plots.admin.border.bypass: true
|
||||
|
||||
plots.teleport.delay.bypass:
|
||||
default: op
|
||||
plots.admin.border.bypass:
|
||||
default: op
|
||||
plots.worldedit.bypass:
|
||||
default: op
|
||||
plots.gamemode.bypass:
|
||||
|
@ -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.
|
@ -5,8 +5,8 @@ dependencies {
|
||||
compileOnlyApi(libs.checkerqual)
|
||||
|
||||
// Minecraft expectations
|
||||
compileOnlyApi(libs.guava)
|
||||
compileOnlyApi(libs.gson)
|
||||
compileOnly(libs.guava)
|
||||
|
||||
// Platform expectations
|
||||
compileOnlyApi(libs.snakeyaml)
|
||||
@ -22,17 +22,17 @@ dependencies {
|
||||
api(libs.guiceassistedinject) {
|
||||
exclude("com.google.inject", "guice")
|
||||
}
|
||||
compileOnlyApi(libs.findbugs)
|
||||
api(libs.findbugs)
|
||||
|
||||
// Plugins
|
||||
compileOnlyApi(libs.worldeditCore) {
|
||||
compileOnly(libs.worldeditCore) {
|
||||
exclude(group = "bukkit-classloader-check")
|
||||
exclude(group = "mockito-core")
|
||||
exclude(group = "dummypermscompat")
|
||||
}
|
||||
testImplementation(libs.worldeditCore)
|
||||
compileOnlyApi(libs.fastasyncworldeditCore)
|
||||
testImplementation(libs.fastasyncworldeditCore)
|
||||
compileOnly(libs.fastasyncworldeditCore) { isTransitive = false }
|
||||
testImplementation(libs.fastasyncworldeditCore) { isTransitive = false }
|
||||
|
||||
// Logging
|
||||
compileOnlyApi(libs.log4j)
|
||||
@ -40,9 +40,7 @@ dependencies {
|
||||
// Other libraries
|
||||
api(libs.prtree)
|
||||
api(libs.aopalliance)
|
||||
api(libs.pipeline) {
|
||||
exclude(group = "com.google.guava")
|
||||
}
|
||||
api(libs.cloudServices)
|
||||
api(libs.arkitektonika)
|
||||
api(libs.paster)
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -25,10 +25,10 @@
|
||||
*/
|
||||
package com.plotsquared.core;
|
||||
|
||||
import cloud.commandframework.services.ServicePipeline;
|
||||
import com.google.inject.Injector;
|
||||
import com.google.inject.Key;
|
||||
import com.google.inject.TypeLiteral;
|
||||
import com.intellectualsites.services.ServicePipeline;
|
||||
import com.plotsquared.core.backup.BackupManager;
|
||||
import com.plotsquared.core.configuration.caption.LocaleHolder;
|
||||
import com.plotsquared.core.generator.GeneratorWrapper;
|
||||
@ -38,7 +38,9 @@ import com.plotsquared.core.inject.annotations.DefaultGenerator;
|
||||
import com.plotsquared.core.location.World;
|
||||
import com.plotsquared.core.permissions.PermissionHandler;
|
||||
import com.plotsquared.core.player.PlotPlayer;
|
||||
import com.plotsquared.core.plot.world.PlotAreaManager;
|
||||
import com.plotsquared.core.queue.GlobalBlockQueue;
|
||||
import com.plotsquared.core.util.AnnotationHelper;
|
||||
import com.plotsquared.core.util.ChunkManager;
|
||||
import com.plotsquared.core.util.EconHandler;
|
||||
import com.plotsquared.core.util.PlatformWorldManager;
|
||||
@ -268,6 +270,13 @@ public interface PlotPlatform<P> extends LocaleHolder {
|
||||
return injector().getInstance(ChunkManager.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the {@link PlotAreaManager} implementation.
|
||||
*
|
||||
* @return the PlotAreaManager
|
||||
*/
|
||||
@NonNull PlotAreaManager plotAreaManager();
|
||||
|
||||
/**
|
||||
* Get the platform specific console {@link Audience}
|
||||
*
|
||||
@ -283,6 +292,15 @@ public interface PlotPlatform<P> extends LocaleHolder {
|
||||
*/
|
||||
@NonNull String pluginsFormatted();
|
||||
|
||||
/**
|
||||
* Get the kind of WorldEdit implementation
|
||||
*
|
||||
* @return worldedit implementations
|
||||
* @since 6.3.0
|
||||
*/
|
||||
@AnnotationHelper.ApiDescription(info = "Internal use only")
|
||||
@NonNull String worldEditImplementations();
|
||||
|
||||
/**
|
||||
* Load the caption maps
|
||||
*/
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -283,7 +283,7 @@ public class PlotSquared {
|
||||
* @return Plot area manager
|
||||
*/
|
||||
public @NonNull PlotAreaManager getPlotAreaManager() {
|
||||
return this.platform.injector().getInstance(PlotAreaManager.class);
|
||||
return this.platform.plotAreaManager();
|
||||
}
|
||||
|
||||
public void startExpiryTasks() {
|
||||
@ -758,6 +758,9 @@ public class PlotSquared {
|
||||
if (this_max < last_max) {
|
||||
plot.getArea().setMeta("lastPlot", plot.getId());
|
||||
}
|
||||
if (callEvent) {
|
||||
eventDispatcher.callPostDelete(plot);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -193,19 +193,28 @@ public class PlayerBackupProfile implements BackupProfile {
|
||||
future.completeExceptionally(new IllegalArgumentException(
|
||||
"The backup is non-existent or not in the correct format"));
|
||||
} else {
|
||||
this.schematicHandler.paste(schematic, plot, 0, 1, 0, false, player, new RunnableVal<Boolean>() {
|
||||
@Override
|
||||
public void run(Boolean value) {
|
||||
if (value) {
|
||||
future.complete(null);
|
||||
} else {
|
||||
future.completeExceptionally(new RuntimeException(MINI_MESSAGE.stripTokens(
|
||||
TranslatableCaption
|
||||
.of("schematics.schematic_paste_failed")
|
||||
.getComponent(ConsolePlayer.getConsole()))));
|
||||
this.schematicHandler.paste(
|
||||
schematic,
|
||||
plot,
|
||||
0,
|
||||
plot.getArea().getMinBuildHeight(),
|
||||
0,
|
||||
false,
|
||||
player,
|
||||
new RunnableVal<>() {
|
||||
@Override
|
||||
public void run(Boolean value) {
|
||||
if (value) {
|
||||
future.complete(null);
|
||||
} else {
|
||||
future.completeExceptionally(new RuntimeException(MINI_MESSAGE.stripTokens(
|
||||
TranslatableCaption
|
||||
.of("schematics.schematic_paste_failed")
|
||||
.getComponent(ConsolePlayer.getConsole()))));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -8,7 +8,7 @@
|
||||
* | |
|
||||
* |_|
|
||||
* PlotSquared plot management system for Minecraft
|
||||
* Copyright (C) 2021 IntellectualSites
|
||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user