mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-07-03 22:24:43 +02:00
Compare commits
8 Commits
6.5.1
...
refactor/v
Author | SHA1 | Date | |
---|---|---|---|
1b5dab3ddd | |||
6198d98488 | |||
5325f90f7b | |||
b07bd6f39c | |||
b7d5fd4eaf | |||
0886f9ccd3 | |||
51abe5565c | |||
fda01502b2 |
2
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
2
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@ -7,7 +7,7 @@ body:
|
|||||||
attributes:
|
attributes:
|
||||||
value: |
|
value: |
|
||||||
Thanks for taking the time to fill out this bug report for PlotSquared! Fill out the following form to your best ability to help us fix the problem.
|
Thanks for taking the time to fill out this bug report for PlotSquared! Fill out the following form to your best ability to help us fix the problem.
|
||||||
Only use this if you're absolutely sure that you found a bug and can reproduce it. For anything else, use: [our Discord server](https://discord.gg/intellectualsites) or [the wiki](https://intellectualsites.github.io/plotsquared-documentation/).
|
Only use this if you're absolutely sure that you found a bug and can reproduce it. For anything else, use: [our Discord server](https://discord.gg/intellectualsites) or [the wiki](https://github.com/IntellectualSites/PlotSquared-Documentation/wiki).
|
||||||
Do NOT use the public issue tracker to report security vulnerabilities! They are disclosed using [this](https://forms.gle/btgdRn9yhGtzEiGW8) form!
|
Do NOT use the public issue tracker to report security vulnerabilities! They are disclosed using [this](https://forms.gle/btgdRn9yhGtzEiGW8) form!
|
||||||
|
|
||||||
- type: dropdown
|
- type: dropdown
|
||||||
|
2
.github/ISSUE_TEMPLATE/config.yml
vendored
2
.github/ISSUE_TEMPLATE/config.yml
vendored
@ -4,5 +4,5 @@ contact_links:
|
|||||||
url: https://discord.gg/intellectualsites
|
url: https://discord.gg/intellectualsites
|
||||||
about: Our support Discord, please ask questions and seek support here.
|
about: Our support Discord, please ask questions and seek support here.
|
||||||
- name: PlotSquared Wiki
|
- name: PlotSquared Wiki
|
||||||
url: https://intellectualsites.github.io/plotsquared-documentation/
|
url: https://github.com/IntellectualSites/PlotSquared-Documentation/wiki
|
||||||
about: Take a look at the wiki page for instructions how to setup PlotSquared and use its commands.
|
about: Take a look at the wiki page for instructions how to setup PlotSquared and use its commands.
|
||||||
|
2
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
2
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
@ -7,7 +7,7 @@ body:
|
|||||||
attributes:
|
attributes:
|
||||||
value: |
|
value: |
|
||||||
Thanks for taking the time to fill out this feature request for PlotSquared! Fill out the following form to your best ability to help us understand your feature request and greately improve the change of it getting added.
|
Thanks for taking the time to fill out this feature request for PlotSquared! Fill out the following form to your best ability to help us understand your feature request and greately improve the change of it getting added.
|
||||||
For anything else than a feature request, use: [our Discord server](https://discord.gg/intellectualsites) or [the wiki](https://intellectualsites.github.io/plotsquared-documentation/).
|
For anything else than a feature request, use: [our Discord server](https://discord.gg/intellectualsites) or [the wiki](https://github.com/IntellectualSites/PlotSquared-Documentation/wiki).
|
||||||
|
|
||||||
- type: textarea
|
- type: textarea
|
||||||
attributes:
|
attributes:
|
||||||
|
3
.github/workflows/build.yml
vendored
3
.github/workflows/build.yml
vendored
@ -4,7 +4,6 @@ on: [ pull_request, push ]
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
@ -12,7 +11,7 @@ jobs:
|
|||||||
- name: Validate Gradle Wrapper"
|
- name: Validate Gradle Wrapper"
|
||||||
uses: gradle/wrapper-validation-action@v1.0.4
|
uses: gradle/wrapper-validation-action@v1.0.4
|
||||||
- name: Setup Java
|
- name: Setup Java
|
||||||
uses: actions/setup-java@v2.5.0
|
uses: actions/setup-java@v2.4.0
|
||||||
with:
|
with:
|
||||||
distribution: temurin
|
distribution: temurin
|
||||||
java-version: 17
|
java-version: 17
|
||||||
|
37
.github/workflows/codeql.yml
vendored
37
.github/workflows/codeql.yml
vendored
@ -1,37 +0,0 @@
|
|||||||
name: "CodeQL"
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ v6 ]
|
|
||||||
pull_request:
|
|
||||||
# The branches below must be a subset of the branches above
|
|
||||||
branches: [ v6 ]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
analyze:
|
|
||||||
name: Analyze
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
actions: read
|
|
||||||
contents: read
|
|
||||||
security-events: write
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
language: [ 'java' ]
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Initialize CodeQL
|
|
||||||
uses: github/codeql-action/init@v1
|
|
||||||
with:
|
|
||||||
languages: ${{ matrix.language }}
|
|
||||||
|
|
||||||
- name: Autobuild
|
|
||||||
uses: github/codeql-action/autobuild@v1
|
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
|
||||||
uses: github/codeql-action/analyze@v1
|
|
7
.github/workflows/release-drafter.yml
vendored
7
.github/workflows/release-drafter.yml
vendored
@ -4,16 +4,11 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- v6
|
- v6
|
||||||
pull_request:
|
|
||||||
types: [ opened, reopened, synchronize ]
|
|
||||||
pull_request_target:
|
|
||||||
types: [ opened, reopened, synchronize ]
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
update_release_draft:
|
update_release_draft:
|
||||||
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: release-drafter/release-drafter@v5.18.1
|
- uses: release-drafter/release-drafter@v5.15.0
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
jdkVersion = "17"
|
|
||||||
build = "gradle clean build -x test"
|
|
||||||
tools = ["findsecbugs", "ErrorProne", "Semgrep", "Detekt", "Infer"]
|
|
||||||
ignoreRules = ["CatchAndPrintStackTrace", "ReferenceEquality", "FallThrough", "FutureReturnValueIgnored", "MixedMutabilityReturnType", "EmptyCatch", "MissingCasesInEnumSwitch", "OperatorPrecedence", "StaticAssignmentInConstructor", "ReferenceEquality", "EqualsHashCode", "EqualsGetClass", "TypeParameterUnusedInFormals", "StringSplitter", "InlineMeSuggester", "NULL_DEREFERENCE"]
|
|
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"
|
||||||
|
}
|
@ -40,6 +40,7 @@ dependencies {
|
|||||||
compileOnly(libs.placeholderapi)
|
compileOnly(libs.placeholderapi)
|
||||||
compileOnly(libs.luckperms)
|
compileOnly(libs.luckperms)
|
||||||
compileOnly(libs.essentialsx)
|
compileOnly(libs.essentialsx)
|
||||||
|
compileOnly(libs.hyperverse) { isTransitive = false }
|
||||||
compileOnly(libs.mvdwapi) { isTransitive = false }
|
compileOnly(libs.mvdwapi) { isTransitive = false }
|
||||||
|
|
||||||
// Other libraries
|
// Other libraries
|
||||||
@ -74,8 +75,7 @@ tasks.named<ShadowJar>("shadowJar") {
|
|||||||
relocate("org.khelekore.prtree", "com.plotsquared.prtree")
|
relocate("org.khelekore.prtree", "com.plotsquared.prtree")
|
||||||
relocate("com.google.inject", "com.plotsquared.google")
|
relocate("com.google.inject", "com.plotsquared.google")
|
||||||
relocate("org.aopalliance", "com.plotsquared.core.aopalliance")
|
relocate("org.aopalliance", "com.plotsquared.core.aopalliance")
|
||||||
relocate("cloud.commandframework.services", "com.plotsquared.core.services")
|
relocate("com.intellectualsites.services", "com.plotsquared.core.services")
|
||||||
relocate("io.leangen.geantyref", "com.plotsquared.core.geantyref")
|
|
||||||
relocate("com.intellectualsites.arkitektonika", "com.plotsquared.core.arkitektonika")
|
relocate("com.intellectualsites.arkitektonika", "com.plotsquared.core.arkitektonika")
|
||||||
relocate("com.intellectualsites.http", "com.plotsquared.core.http")
|
relocate("com.intellectualsites.http", "com.plotsquared.core.http")
|
||||||
relocate("com.intellectualsites.paster", "com.plotsquared.core.paster")
|
relocate("com.intellectualsites.paster", "com.plotsquared.core.paster")
|
||||||
@ -83,7 +83,6 @@ tasks.named<ShadowJar>("shadowJar") {
|
|||||||
relocate("org.jetbrains", "com.plotsquared.core.annotations")
|
relocate("org.jetbrains", "com.plotsquared.core.annotations")
|
||||||
relocate("org.intellij.lang", "com.plotsquared.core.intellij.annotations")
|
relocate("org.intellij.lang", "com.plotsquared.core.intellij.annotations")
|
||||||
relocate("javax.annotation", "com.plotsquared.core.annotation")
|
relocate("javax.annotation", "com.plotsquared.core.annotation")
|
||||||
relocate("com.google.code.findbugs", "com.plotsquared.core.findbugs")
|
|
||||||
relocate("javax.inject", "com.plotsquared.core.annotation.inject")
|
relocate("javax.inject", "com.plotsquared.core.annotation.inject")
|
||||||
|
|
||||||
// Get rid of all the libs which are 100% unused.
|
// Get rid of all the libs which are 100% unused.
|
||||||
@ -95,11 +94,12 @@ tasks.named<ShadowJar>("shadowJar") {
|
|||||||
tasks {
|
tasks {
|
||||||
withType<Javadoc> {
|
withType<Javadoc> {
|
||||||
val opt = options as StandardJavadocDocletOptions
|
val opt = options as StandardJavadocDocletOptions
|
||||||
opt.links("https://papermc.io/javadocs/paper/1.18/")
|
opt.links("https://papermc.io/javadocs/paper/1.17/")
|
||||||
opt.links("https://docs.enginehub.org/javadoc/com.sk89q.worldedit/worldedit-bukkit/" + libs.worldeditBukkit.get().versionConstraint.toString())
|
opt.links("https://docs.enginehub.org/javadoc/com.sk89q.worldedit/worldedit-core/7.2.7/")
|
||||||
opt.links("https://javadoc.io/doc/com.plotsquared/PlotSquared-Core/latest/")
|
opt.links("https://docs.enginehub.org/javadoc/com.sk89q.worldedit/worldedit-bukkit/7.2.7/")
|
||||||
opt.links("https://jd.adventure.kyori.net/api/" + libs.adventure.get().versionConstraint.toString())
|
opt.links("https://jd.adventure.kyori.net/api/4.9.3/")
|
||||||
opt.links("https://google.github.io/guice/api-docs/" + libs.guice.get().versionConstraint.toString() + "/javadoc/")
|
opt.links("https://google.github.io/guice/api-docs/5.0.1/javadoc/")
|
||||||
opt.links("https://checkerframework.org/api/")
|
opt.links("https://checkerframework.org/api/")
|
||||||
|
opt.links("https://notmyfault.github.io/MiniMessage-Javadocs/") // Temporary hosting until Kyori adds hosted Javadocs
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -147,8 +147,6 @@ import java.io.File;
|
|||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
@ -218,7 +216,6 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
|||||||
private PlatformWorldManager<World> worldManager;
|
private PlatformWorldManager<World> worldManager;
|
||||||
private Locale serverLocale;
|
private Locale serverLocale;
|
||||||
|
|
||||||
@SuppressWarnings("StringSplitter")
|
|
||||||
@Override
|
@Override
|
||||||
public int @NonNull [] serverVersion() {
|
public int @NonNull [] serverVersion() {
|
||||||
if (this.version == null) {
|
if (this.version == null) {
|
||||||
@ -269,7 +266,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
|||||||
faweHook = true;
|
faweHook = true;
|
||||||
} catch (Exception ignored) {
|
} catch (Exception ignored) {
|
||||||
LOGGER.error("Incompatible version of FAWE to enable hook, please upgrade: https://ci.athion" +
|
LOGGER.error("Incompatible version of FAWE to enable hook, please upgrade: https://ci.athion" +
|
||||||
".net/job/FastAsyncWorldEdit/");
|
".net/job/FastAsyncWorldEdit-1.17/");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -324,6 +321,8 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
|||||||
// Comments
|
// Comments
|
||||||
CommentManager.registerDefaultInboxes();
|
CommentManager.registerDefaultInboxes();
|
||||||
|
|
||||||
|
plotSquared.startExpiryTasks();
|
||||||
|
|
||||||
// Do stuff that was previously done in PlotSquared
|
// Do stuff that was previously done in PlotSquared
|
||||||
// Kill entities
|
// Kill entities
|
||||||
if (Settings.Enabled_Components.KILL_ROAD_MOBS || Settings.Enabled_Components.KILL_ROAD_VEHICLES) {
|
if (Settings.Enabled_Components.KILL_ROAD_MOBS || Settings.Enabled_Components.KILL_ROAD_VEHICLES) {
|
||||||
@ -420,8 +419,6 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
|||||||
}, TaskTime.ticks(1L));
|
}, TaskTime.ticks(1L));
|
||||||
}
|
}
|
||||||
|
|
||||||
plotSquared.startExpiryTasks();
|
|
||||||
|
|
||||||
// Once the server has loaded force updating all generators known to P2
|
// Once the server has loaded force updating all generators known to P2
|
||||||
TaskManager.runTaskLater(() -> PlotSquared.platform().setupUtils().updateGenerators(true), TaskTime.ticks(1L));
|
TaskManager.runTaskLater(() -> PlotSquared.platform().setupUtils().updateGenerators(true), TaskTime.ticks(1L));
|
||||||
|
|
||||||
@ -971,6 +968,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
|||||||
}
|
}
|
||||||
iterator.remove();
|
iterator.remove();
|
||||||
entity.remove();
|
entity.remove();
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -982,6 +980,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
|||||||
}
|
}
|
||||||
iterator.remove();
|
iterator.remove();
|
||||||
entity.remove();
|
entity.remove();
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1142,10 +1141,8 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
|||||||
@Override
|
@Override
|
||||||
public @NonNull String pluginsFormatted() {
|
public @NonNull String pluginsFormatted() {
|
||||||
StringBuilder msg = new StringBuilder();
|
StringBuilder msg = new StringBuilder();
|
||||||
List<Plugin> plugins = new ArrayList<>();
|
Plugin[] plugins = Bukkit.getServer().getPluginManager().getPlugins();
|
||||||
Collections.addAll(plugins, Bukkit.getServer().getPluginManager().getPlugins());
|
msg.append("Plugins (").append(plugins.length).append("): \n");
|
||||||
plugins.sort(Comparator.comparing(Plugin::getName));
|
|
||||||
msg.append("Plugins (").append(plugins.size()).append("): \n");
|
|
||||||
for (Plugin p : plugins) {
|
for (Plugin p : plugins) {
|
||||||
msg.append(" - ").append(p.getName()).append(":").append("\n")
|
msg.append(" - ").append(p.getName()).append(":").append("\n")
|
||||||
.append(" • Version: ").append(p.getDescription().getVersion()).append("\n")
|
.append(" • Version: ").append(p.getDescription().getVersion()).append("\n")
|
||||||
@ -1159,21 +1156,6 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
|||||||
return msg.toString();
|
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
|
@Override
|
||||||
public com.plotsquared.core.location.@NonNull World<?> getPlatformWorld(final @NonNull String worldName) {
|
public com.plotsquared.core.location.@NonNull World<?> getPlatformWorld(final @NonNull String worldName) {
|
||||||
return BukkitWorld.of(worldName);
|
return BukkitWorld.of(worldName);
|
||||||
@ -1222,7 +1204,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@NonNull
|
@NonNull
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("ALL")
|
||||||
public PlayerManager<? extends PlotPlayer<Player>, ? extends Player> playerManager() {
|
public PlayerManager<? extends PlotPlayer<Player>, ? extends Player> playerManager() {
|
||||||
return (PlayerManager<BukkitPlayer, Player>) injector().getInstance(PlayerManager.class);
|
return (PlayerManager<BukkitPlayer, Player>) injector().getInstance(PlayerManager.class);
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -461,7 +461,6 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
|
|||||||
this.tamed.tamed = tamed.isTamed();
|
this.tamed.tamed = tamed.isTamed();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation") // Paper deprecation
|
|
||||||
@Override
|
@Override
|
||||||
public Entity spawn(World world, int xOffset, int zOffset) {
|
public Entity spawn(World world, int xOffset, int zOffset) {
|
||||||
Location location = new Location(world, this.getX() + xOffset, this.getY(), this.z + zOffset);
|
Location location = new Location(world, this.getX() + xOffset, this.getY(), this.z + zOffset);
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -29,6 +29,7 @@ import com.google.inject.AbstractModule;
|
|||||||
import com.google.inject.Provides;
|
import com.google.inject.Provides;
|
||||||
import com.google.inject.Singleton;
|
import com.google.inject.Singleton;
|
||||||
import com.plotsquared.bukkit.managers.BukkitWorldManager;
|
import com.plotsquared.bukkit.managers.BukkitWorldManager;
|
||||||
|
import com.plotsquared.bukkit.managers.HyperverseWorldManager;
|
||||||
import com.plotsquared.bukkit.managers.MultiverseWorldManager;
|
import com.plotsquared.bukkit.managers.MultiverseWorldManager;
|
||||||
import com.plotsquared.core.util.PlatformWorldManager;
|
import com.plotsquared.core.util.PlatformWorldManager;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
@ -36,11 +37,12 @@ import org.bukkit.World;
|
|||||||
|
|
||||||
public class WorldManagerModule extends AbstractModule {
|
public class WorldManagerModule extends AbstractModule {
|
||||||
|
|
||||||
@SuppressWarnings("removal") // Internal use only
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
PlatformWorldManager<World> provideWorldManager() {
|
PlatformWorldManager<World> provideWorldManager() {
|
||||||
if (Bukkit.getPluginManager().getPlugin("Multiverse-Core") != null) {
|
if (Bukkit.getPluginManager().getPlugin("Hyperverse") != null) {
|
||||||
|
return new HyperverseWorldManager();
|
||||||
|
} else if (Bukkit.getPluginManager().getPlugin("Multiverse-Core") != null) {
|
||||||
return new MultiverseWorldManager();
|
return new MultiverseWorldManager();
|
||||||
} else {
|
} else {
|
||||||
return new BukkitWorldManager();
|
return new BukkitWorldManager();
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -68,13 +68,12 @@ import com.plotsquared.core.util.task.TaskTime;
|
|||||||
import com.sk89q.worldedit.WorldEdit;
|
import com.sk89q.worldedit.WorldEdit;
|
||||||
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
||||||
import com.sk89q.worldedit.world.block.BlockType;
|
import com.sk89q.worldedit.world.block.BlockType;
|
||||||
import net.kyori.adventure.text.minimessage.Template;
|
import net.kyori.adventure.text.minimessage.placeholder.Placeholder;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
import org.bukkit.block.BlockState;
|
|
||||||
import org.bukkit.block.data.BlockData;
|
import org.bukkit.block.data.BlockData;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.Fireball;
|
import org.bukkit.entity.Fireball;
|
||||||
@ -93,7 +92,6 @@ import org.bukkit.event.block.BlockFormEvent;
|
|||||||
import org.bukkit.event.block.BlockFromToEvent;
|
import org.bukkit.event.block.BlockFromToEvent;
|
||||||
import org.bukkit.event.block.BlockGrowEvent;
|
import org.bukkit.event.block.BlockGrowEvent;
|
||||||
import org.bukkit.event.block.BlockIgniteEvent;
|
import org.bukkit.event.block.BlockIgniteEvent;
|
||||||
import org.bukkit.event.block.BlockMultiPlaceEvent;
|
|
||||||
import org.bukkit.event.block.BlockPhysicsEvent;
|
import org.bukkit.event.block.BlockPhysicsEvent;
|
||||||
import org.bukkit.event.block.BlockPistonExtendEvent;
|
import org.bukkit.event.block.BlockPistonExtendEvent;
|
||||||
import org.bukkit.event.block.BlockPistonRetractEvent;
|
import org.bukkit.event.block.BlockPistonRetractEvent;
|
||||||
@ -168,7 +166,7 @@ public class BlockEventListener implements Listener {
|
|||||||
}
|
}
|
||||||
if (Settings.Redstone.DISABLE_OFFLINE) {
|
if (Settings.Redstone.DISABLE_OFFLINE) {
|
||||||
boolean disable = false;
|
boolean disable = false;
|
||||||
if (!DBFunc.SERVER.equals(plot.getOwner())) {
|
if (!plot.getOwner().equals(DBFunc.SERVER)) {
|
||||||
if (plot.isMerged()) {
|
if (plot.isMerged()) {
|
||||||
disable = true;
|
disable = true;
|
||||||
for (UUID owner : plot.getOwners()) {
|
for (UUID owner : plot.getOwners()) {
|
||||||
@ -279,21 +277,21 @@ public class BlockEventListener implements Listener {
|
|||||||
BukkitPlayer pp = BukkitUtil.adapt(player);
|
BukkitPlayer pp = BukkitUtil.adapt(player);
|
||||||
Plot plot = area.getPlot(location);
|
Plot plot = area.getPlot(location);
|
||||||
if (plot != null) {
|
if (plot != null) {
|
||||||
if ((location.getY() >= area.getMaxBuildHeight() || location.getY() < area
|
if ((location.getY() > area.getMaxBuildHeight() || location.getY() < area
|
||||||
.getMinBuildHeight()) && !Permissions
|
.getMinBuildHeight()) && !Permissions
|
||||||
.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_HEIGHT_LIMIT)) {
|
.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_HEIGHT_LIMIT)) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("height.height_limit"),
|
TranslatableCaption.miniMessage("height.height_limit"),
|
||||||
Template.of("minHeight", String.valueOf(area.getMinBuildHeight())),
|
Placeholder.miniMessage("minHeight", String.valueOf(area.getMinBuildHeight())),
|
||||||
Template.of("maxHeight", String.valueOf(area.getMaxBuildHeight()))
|
Placeholder.miniMessage("maxHeight", String.valueOf(area.getMaxBuildHeight()))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (!plot.hasOwner()) {
|
if (!plot.hasOwner()) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) {
|
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_UNOWNED))
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_UNOWNED))
|
||||||
);
|
);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
@ -309,8 +307,8 @@ public class BlockEventListener implements Listener {
|
|||||||
}
|
}
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER))
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER))
|
||||||
);
|
);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
plot.debug(player.getName() + " could not place " + event.getBlock().getType()
|
plot.debug(player.getName() + " could not place " + event.getBlock().getType()
|
||||||
@ -320,7 +318,7 @@ public class BlockEventListener implements Listener {
|
|||||||
} else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
|
} else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("done.building_restricted")
|
TranslatableCaption.miniMessage("done.building_restricted")
|
||||||
);
|
);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
@ -336,8 +334,8 @@ public class BlockEventListener implements Listener {
|
|||||||
}
|
}
|
||||||
} else if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_ROAD)) {
|
} else if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_ROAD)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_ROAD))
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_ROAD))
|
||||||
);
|
);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
@ -358,20 +356,20 @@ public class BlockEventListener implements Listener {
|
|||||||
if (!Permissions
|
if (!Permissions
|
||||||
.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_DESTROY_GROUNDLEVEL)) {
|
.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_DESTROY_GROUNDLEVEL)) {
|
||||||
plotPlayer.sendMessage(
|
plotPlayer.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_GROUNDLEVEL))
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_GROUNDLEVEL))
|
||||||
);
|
);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if ((location.getY() >= area.getMaxBuildHeight() || location.getY() < area
|
} else if ((location.getY() > area.getMaxBuildHeight() || location.getY() < area
|
||||||
.getMinBuildHeight()) && !Permissions
|
.getMinBuildHeight()) && !Permissions
|
||||||
.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_HEIGHT_LIMIT)) {
|
.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_HEIGHT_LIMIT)) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
plotPlayer.sendMessage(
|
plotPlayer.sendMessage(
|
||||||
TranslatableCaption.of("height.height_limit"),
|
TranslatableCaption.miniMessage("height.height_limit"),
|
||||||
Template.of("minHeight", String.valueOf(area.getMinBuildHeight())),
|
Placeholder.miniMessage("minHeight", String.valueOf(area.getMinBuildHeight())),
|
||||||
Template.of("maxHeight", String.valueOf(area.getMaxBuildHeight()))
|
Placeholder.miniMessage("maxHeight", String.valueOf(area.getMaxBuildHeight()))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (!plot.hasOwner()) {
|
if (!plot.hasOwner()) {
|
||||||
@ -395,14 +393,14 @@ public class BlockEventListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
plotPlayer.sendMessage(
|
plotPlayer.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_OTHER))
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_OTHER))
|
||||||
);
|
);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
} else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
|
} else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
|
||||||
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
||||||
plotPlayer.sendMessage(
|
plotPlayer.sendMessage(
|
||||||
TranslatableCaption.of("done.building_restricted")
|
TranslatableCaption.miniMessage("done.building_restricted")
|
||||||
);
|
);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
@ -421,8 +419,8 @@ public class BlockEventListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_ROAD))
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_ROAD))
|
||||||
);
|
);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
@ -1096,24 +1094,24 @@ public class BlockEventListener implements Listener {
|
|||||||
if (plot == null) {
|
if (plot == null) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_ROAD)) {
|
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_ROAD)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_ROAD))
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_ROAD))
|
||||||
);
|
);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
} else if (!plot.hasOwner()) {
|
} else if (!plot.hasOwner()) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) {
|
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_UNOWNED))
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_UNOWNED))
|
||||||
);
|
);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
} else if (!plot.isAdded(pp.getUUID())) {
|
} else if (!plot.isAdded(pp.getUUID())) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER))
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER))
|
||||||
);
|
);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
@ -1210,51 +1208,4 @@ public class BlockEventListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* BlockMultiPlaceEvent is called unrelated to the BlockPlaceEvent itself and therefore doesn't respect the cancellation.
|
|
||||||
*/
|
|
||||||
@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST)
|
|
||||||
public void onBlockMultiPlace(BlockMultiPlaceEvent event) {
|
|
||||||
// Check if the generic block place event would be cancelled
|
|
||||||
blockCreate(event);
|
|
||||||
if (event.isCancelled()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
BukkitPlayer pp = BukkitUtil.adapt(event.getPlayer());
|
|
||||||
Location placedLocation = BukkitUtil.adapt(event.getBlockReplacedState().getLocation());
|
|
||||||
PlotArea area = placedLocation.getPlotArea();
|
|
||||||
if (area == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Plot plot = placedLocation.getPlot();
|
|
||||||
|
|
||||||
for (final BlockState state : event.getReplacedBlockStates()) {
|
|
||||||
Location currentLocation = BukkitUtil.adapt(state.getLocation());
|
|
||||||
if (!Permissions.hasPermission(
|
|
||||||
pp,
|
|
||||||
Permission.PERMISSION_ADMIN_BUILD_ROAD
|
|
||||||
) && !(Objects.equals(currentLocation.getPlot(), plot))) {
|
|
||||||
pp.sendMessage(
|
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_ROAD))
|
|
||||||
);
|
|
||||||
event.setCancelled(true);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_HEIGHT_LIMIT)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (currentLocation.getY() >= area.getMaxBuildHeight() || currentLocation.getY() < area.getMinBuildHeight()) {
|
|
||||||
pp.sendMessage(
|
|
||||||
TranslatableCaption.of("height.height_limit"),
|
|
||||||
Template.of("minHeight", String.valueOf(area.getMinBuildHeight())),
|
|
||||||
Template.of("maxHeight", String.valueOf(area.getMaxBuildHeight()))
|
|
||||||
);
|
|
||||||
event.setCancelled(true);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -108,11 +108,41 @@ public class ChunkListener implements Listener {
|
|||||||
this.isTrueForNotSave = false;
|
this.isTrueForNotSave = false;
|
||||||
} else {
|
} else {
|
||||||
this.mustSave = classChunk.getField("mustNotSave");
|
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 {
|
} else if (version == 17) {
|
||||||
RefClass classChunk = getRefClass("net.minecraft.world.level.chunk.Chunk");
|
RefClass classChunk = getRefClass("net.minecraft.world.level.chunk.Chunk");
|
||||||
this.mustSave = classChunk.getField("mustNotSave");
|
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) {
|
} catch (NoSuchFieldException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@ -152,7 +182,32 @@ public class ChunkListener implements Listener {
|
|||||||
}
|
}
|
||||||
toUnload.add(chunk);
|
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()) {
|
if (toUnload.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -48,7 +48,6 @@ import com.plotsquared.core.util.Permissions;
|
|||||||
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
||||||
import com.sk89q.worldedit.world.block.BlockType;
|
import com.sk89q.worldedit.world.block.BlockType;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Particle;
|
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.entity.Ageable;
|
import org.bukkit.entity.Ageable;
|
||||||
@ -324,10 +323,6 @@ public class EntityEventListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
event.setCancelled(true);
|
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)
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -36,7 +36,6 @@ import com.plotsquared.core.plot.flag.implementations.DoneFlag;
|
|||||||
import io.papermc.lib.PaperLib;
|
import io.papermc.lib.PaperLib;
|
||||||
import org.bukkit.Chunk;
|
import org.bukkit.Chunk;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.block.Block;
|
|
||||||
import org.bukkit.entity.ArmorStand;
|
import org.bukkit.entity.ArmorStand;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
@ -61,7 +60,7 @@ import java.util.List;
|
|||||||
|
|
||||||
public class EntitySpawnListener implements Listener {
|
public class EntitySpawnListener implements Listener {
|
||||||
|
|
||||||
private static final String KEY = "P2";
|
private final static String KEY = "P2";
|
||||||
private static boolean ignoreTP = false;
|
private static boolean ignoreTP = false;
|
||||||
private static boolean hasPlotArea = false;
|
private static boolean hasPlotArea = false;
|
||||||
private static String areaName = null;
|
private static String areaName = null;
|
||||||
@ -76,7 +75,8 @@ public class EntitySpawnListener implements Listener {
|
|||||||
|
|
||||||
public static void testCreate(final Entity entity) {
|
public static void testCreate(final Entity entity) {
|
||||||
@NonNull World world = entity.getWorld();
|
@NonNull World world = entity.getWorld();
|
||||||
if (!world.getName().equals(areaName)) {
|
if (areaName.equals(world.getName())) {
|
||||||
|
} else {
|
||||||
areaName = world.getName();
|
areaName = world.getName();
|
||||||
hasPlotArea = PlotSquared.get().getPlotAreaManager().hasPlotArea(areaName);
|
hasPlotArea = PlotSquared.get().getPlotAreaManager().hasPlotArea(areaName);
|
||||||
}
|
}
|
||||||
@ -192,32 +192,8 @@ public class EntitySpawnListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onTeleport(EntityTeleportEvent event) {
|
public void onTeleport(EntityTeleportEvent event) {
|
||||||
Entity entity = event.getEntity();
|
Entity ent = event.getEntity();
|
||||||
Entity fromLocation = event.getEntity();
|
if (ent instanceof Vehicle || ent instanceof ArmorStand) {
|
||||||
Block toLocation = event.getTo().getBlock();
|
|
||||||
final Location fromLocLocation = BukkitUtil.adapt(fromLocation.getLocation());
|
|
||||||
final PlotArea fromArea = fromLocLocation.getPlotArea();
|
|
||||||
Location toLocLocation = BukkitUtil.adapt(toLocation.getLocation());
|
|
||||||
PlotArea toArea = toLocLocation.getPlotArea();
|
|
||||||
|
|
||||||
if (toArea == null) {
|
|
||||||
if (fromLocation.getType() == EntityType.SHULKER && fromArea != null) {
|
|
||||||
event.setCancelled(true);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Plot toPlot = toArea.getOwnedPlot(toLocLocation);
|
|
||||||
if (fromLocation.getType() == EntityType.SHULKER && fromArea != null) {
|
|
||||||
final Plot fromPlot = fromArea.getOwnedPlot(fromLocLocation);
|
|
||||||
|
|
||||||
if (fromPlot != null || toPlot != null) {
|
|
||||||
if ((fromPlot == null || !fromPlot.equals(toPlot)) && (toPlot == null || !toPlot.equals(fromPlot))) {
|
|
||||||
event.setCancelled(true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (entity instanceof Vehicle || entity instanceof ArmorStand) {
|
|
||||||
testNether(event.getEntity());
|
testNether(event.getEntity());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -46,7 +46,7 @@ import com.plotsquared.core.plot.PlotArea;
|
|||||||
import com.plotsquared.core.plot.flag.implementations.DoneFlag;
|
import com.plotsquared.core.plot.flag.implementations.DoneFlag;
|
||||||
import com.plotsquared.core.plot.world.PlotAreaManager;
|
import com.plotsquared.core.plot.world.PlotAreaManager;
|
||||||
import com.plotsquared.core.util.Permissions;
|
import com.plotsquared.core.util.Permissions;
|
||||||
import net.kyori.adventure.text.minimessage.Template;
|
import net.kyori.adventure.text.minimessage.placeholder.Placeholder;
|
||||||
import org.bukkit.Chunk;
|
import org.bukkit.Chunk;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.block.TileState;
|
import org.bukkit.block.TileState;
|
||||||
@ -302,8 +302,8 @@ public class PaperListener implements Listener {
|
|||||||
if (tileEntityCount >= Settings.Chunk_Processor.MAX_TILES) {
|
if (tileEntityCount >= Settings.Chunk_Processor.MAX_TILES) {
|
||||||
final PlotPlayer<?> plotPlayer = BukkitUtil.adapt(event.getPlayer());
|
final PlotPlayer<?> plotPlayer = BukkitUtil.adapt(event.getPlayer());
|
||||||
plotPlayer.sendMessage(
|
plotPlayer.sendMessage(
|
||||||
TranslatableCaption.of("errors.tile_entity_cap_reached"),
|
TranslatableCaption.miniMessage("errors.tile_entity_cap_reached"),
|
||||||
Template.of("amount", String.valueOf(Settings.Chunk_Processor.MAX_TILES))
|
Placeholder.miniMessage("amount", String.valueOf(Settings.Chunk_Processor.MAX_TILES))
|
||||||
);
|
);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
event.setBuild(false);
|
event.setBuild(false);
|
||||||
@ -336,8 +336,8 @@ public class PaperListener implements Listener {
|
|||||||
if (plot == null) {
|
if (plot == null) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_ROAD)) {
|
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_ROAD)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_ROAD))
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_ROAD))
|
||||||
);
|
);
|
||||||
entity.remove();
|
entity.remove();
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
@ -345,8 +345,8 @@ public class PaperListener implements Listener {
|
|||||||
} else if (!plot.hasOwner()) {
|
} else if (!plot.hasOwner()) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED)) {
|
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED))
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED))
|
||||||
);
|
);
|
||||||
entity.remove();
|
entity.remove();
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
@ -354,8 +354,8 @@ public class PaperListener implements Listener {
|
|||||||
} else if (!plot.isAdded(pp.getUUID())) {
|
} else if (!plot.isAdded(pp.getUUID())) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) {
|
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_OTHER))
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_OTHER))
|
||||||
);
|
);
|
||||||
entity.remove();
|
entity.remove();
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -33,9 +33,10 @@ import com.plotsquared.core.location.Location;
|
|||||||
import com.plotsquared.core.player.PlotPlayer;
|
import com.plotsquared.core.player.PlotPlayer;
|
||||||
import com.plotsquared.core.plot.PlotArea;
|
import com.plotsquared.core.plot.PlotArea;
|
||||||
import com.plotsquared.core.plot.world.PlotAreaManager;
|
import com.plotsquared.core.plot.world.PlotAreaManager;
|
||||||
import net.kyori.adventure.text.minimessage.Template;
|
import net.kyori.adventure.text.minimessage.placeholder.Placeholder;
|
||||||
import org.bukkit.block.Banner;
|
import org.bukkit.block.Banner;
|
||||||
import org.bukkit.block.Beacon;
|
import org.bukkit.block.Beacon;
|
||||||
|
import org.bukkit.block.Bed;
|
||||||
import org.bukkit.block.BlockState;
|
import org.bukkit.block.BlockState;
|
||||||
import org.bukkit.block.CommandBlock;
|
import org.bukkit.block.CommandBlock;
|
||||||
import org.bukkit.block.Comparator;
|
import org.bukkit.block.Comparator;
|
||||||
@ -50,7 +51,6 @@ import org.bukkit.block.Jukebox;
|
|||||||
import org.bukkit.block.Sign;
|
import org.bukkit.block.Sign;
|
||||||
import org.bukkit.block.Skull;
|
import org.bukkit.block.Skull;
|
||||||
import org.bukkit.block.Structure;
|
import org.bukkit.block.Structure;
|
||||||
import org.bukkit.block.data.type.Bed;
|
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.block.BlockPlaceEvent;
|
import org.bukkit.event.block.BlockPlaceEvent;
|
||||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||||
@ -83,8 +83,8 @@ public class PaperListener113 extends PaperListener {
|
|||||||
if (tileEntityCount >= Settings.Chunk_Processor.MAX_TILES) {
|
if (tileEntityCount >= Settings.Chunk_Processor.MAX_TILES) {
|
||||||
final PlotPlayer<?> plotPlayer = BukkitUtil.adapt(event.getPlayer());
|
final PlotPlayer<?> plotPlayer = BukkitUtil.adapt(event.getPlayer());
|
||||||
plotPlayer.sendMessage(
|
plotPlayer.sendMessage(
|
||||||
TranslatableCaption.of("errors.tile_entity_cap_reached"),
|
TranslatableCaption.miniMessage("errors.tile_entity_cap_reached"),
|
||||||
Template.of("amount", String.valueOf(Settings.Chunk_Processor.MAX_TILES))
|
Placeholder.miniMessage("amount", String.valueOf(Settings.Chunk_Processor.MAX_TILES))
|
||||||
);
|
);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
event.setBuild(false);
|
event.setBuild(false);
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -68,9 +68,11 @@ import com.plotsquared.core.plot.flag.implementations.PlayerInteractFlag;
|
|||||||
import com.plotsquared.core.plot.flag.implementations.PreventCreativeCopyFlag;
|
import com.plotsquared.core.plot.flag.implementations.PreventCreativeCopyFlag;
|
||||||
import com.plotsquared.core.plot.flag.implementations.TamedInteractFlag;
|
import com.plotsquared.core.plot.flag.implementations.TamedInteractFlag;
|
||||||
import com.plotsquared.core.plot.flag.implementations.UntrustedVisitFlag;
|
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.VehicleBreakFlag;
|
||||||
import com.plotsquared.core.plot.flag.implementations.VehicleUseFlag;
|
import com.plotsquared.core.plot.flag.implementations.VehicleUseFlag;
|
||||||
import com.plotsquared.core.plot.flag.implementations.VillagerInteractFlag;
|
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.plot.world.PlotAreaManager;
|
||||||
import com.plotsquared.core.util.EventDispatcher;
|
import com.plotsquared.core.util.EventDispatcher;
|
||||||
import com.plotsquared.core.util.MathMan;
|
import com.plotsquared.core.util.MathMan;
|
||||||
@ -85,14 +87,13 @@ import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
|||||||
import com.sk89q.worldedit.world.block.BlockType;
|
import com.sk89q.worldedit.world.block.BlockType;
|
||||||
import io.papermc.lib.PaperLib;
|
import io.papermc.lib.PaperLib;
|
||||||
import net.kyori.adventure.text.Component;
|
import net.kyori.adventure.text.Component;
|
||||||
import net.kyori.adventure.text.minimessage.Template;
|
import net.kyori.adventure.text.minimessage.placeholder.Placeholder;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.FluidCollisionMode;
|
import org.bukkit.FluidCollisionMode;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
import org.bukkit.block.BlockState;
|
|
||||||
import org.bukkit.block.data.Waterlogged;
|
import org.bukkit.block.data.Waterlogged;
|
||||||
import org.bukkit.command.PluginCommand;
|
import org.bukkit.command.PluginCommand;
|
||||||
import org.bukkit.entity.ArmorStand;
|
import org.bukkit.entity.ArmorStand;
|
||||||
@ -223,7 +224,6 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("StringSplitter")
|
|
||||||
@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST)
|
@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST)
|
||||||
public void playerCommand(PlayerCommandPreprocessEvent event) {
|
public void playerCommand(PlayerCommandPreprocessEvent event) {
|
||||||
String msg = event.getMessage().toLowerCase().replaceAll("/", "").trim();
|
String msg = event.getMessage().toLowerCase().replaceAll("/", "").trim();
|
||||||
@ -308,7 +308,7 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
perm = "plots.admin.command.blocked-cmds.road";
|
perm = "plots.admin.command.blocked-cmds.road";
|
||||||
}
|
}
|
||||||
if (!Permissions.hasPermission(plotPlayer, perm)) {
|
if (!Permissions.hasPermission(plotPlayer, perm)) {
|
||||||
plotPlayer.sendMessage(TranslatableCaption.of("blockedcmds.command_blocked"));
|
plotPlayer.sendMessage(TranslatableCaption.miniMessage("blockedcmds.command_blocked"));
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -361,11 +361,11 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
|
|
||||||
if (pp.hasPermission(Permission.PERMISSION_ADMIN_UPDATE_NOTIFICATION.toString()) && Settings.Enabled_Components.UPDATE_NOTIFICATIONS
|
if (pp.hasPermission(Permission.PERMISSION_ADMIN_UPDATE_NOTIFICATION.toString()) && Settings.Enabled_Components.UPDATE_NOTIFICATIONS
|
||||||
&& PremiumVerification.isPremium() && UpdateUtility.hasUpdate) {
|
&& PremiumVerification.isPremium() && UpdateUtility.hasUpdate) {
|
||||||
Caption boundary = TranslatableCaption.of("update.update_boundary");
|
Caption boundary = TranslatableCaption.miniMessage("update.update_boundary");
|
||||||
Caption updateNotification = TranslatableCaption.of("update.update_notification");
|
Caption updateNotification = TranslatableCaption.miniMessage("update.update_notification");
|
||||||
Template internalVersion = Template.of("p2version", UpdateUtility.internalVersion.versionString());
|
Placeholder<?> internalVersion = Placeholder.miniMessage("p2version", UpdateUtility.internalVersion.versionString());
|
||||||
Template spigotVersion = Template.of("spigotversion", UpdateUtility.spigotVersion);
|
Placeholder<?> spigotVersion = Placeholder.miniMessage("spigotversion", UpdateUtility.spigotVersion);
|
||||||
Template downloadUrl = Template.of("downloadurl", "https://www.spigotmc.org/resources/77506/updates");
|
Placeholder<?> downloadUrl = Placeholder.miniMessage("downloadurl", "https://www.spigotmc.org/resources/77506/updates");
|
||||||
pp.sendMessage(boundary);
|
pp.sendMessage(boundary);
|
||||||
pp.sendMessage(updateNotification, internalVersion, spigotVersion, downloadUrl);
|
pp.sendMessage(updateNotification, internalVersion, spigotVersion, downloadUrl);
|
||||||
pp.sendMessage(boundary);
|
pp.sendMessage(boundary);
|
||||||
@ -379,7 +379,6 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
this.eventDispatcher.doRespawnTask(pp);
|
this.eventDispatcher.doRespawnTask(pp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation") // We explicitly want #getHomeSynchronous here
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
public void onTeleport(PlayerTeleportEvent event) {
|
public void onTeleport(PlayerTeleportEvent event) {
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
@ -418,8 +417,8 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
.getHomeSynchronous()
|
.getHomeSynchronous()
|
||||||
.equals(BukkitUtil.adaptComplete(to)))) {
|
.equals(BukkitUtil.adaptComplete(to)))) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("deny.no_enter"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("plot", plot.toString())
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_ENTRY_DENIED))
|
||||||
);
|
);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
@ -507,7 +506,7 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
BukkitPlayer pp = BukkitUtil.adapt(player);
|
BukkitPlayer pp = BukkitUtil.adapt(player);
|
||||||
// Cancel teleport
|
// Cancel teleport
|
||||||
if (TaskManager.removeFromTeleportQueue(pp.getName())) {
|
if (TaskManager.removeFromTeleportQueue(pp.getName())) {
|
||||||
pp.sendMessage(TranslatableCaption.of("teleport.teleport_failed"));
|
pp.sendMessage(TranslatableCaption.miniMessage("teleport.teleport_failed"));
|
||||||
}
|
}
|
||||||
// Set last location
|
// Set last location
|
||||||
Location location = BukkitUtil.adapt(to);
|
Location location = BukkitUtil.adapt(to);
|
||||||
@ -534,8 +533,8 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
pp.accessTemporaryMetaData(PlayerMetaDataKeys.TEMPORARY_KICK)) {
|
pp.accessTemporaryMetaData(PlayerMetaDataKeys.TEMPORARY_KICK)) {
|
||||||
if (lastPlot != null && !plotExit(pp, lastPlot) && this.tmpTeleport && !kickAccess.get().orElse(false)) {
|
if (lastPlot != null && !plotExit(pp, lastPlot) && this.tmpTeleport && !kickAccess.get().orElse(false)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_EXIT_DENIED))
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_EXIT_DENIED))
|
||||||
);
|
);
|
||||||
this.tmpTeleport = false;
|
this.tmpTeleport = false;
|
||||||
if (lastPlot.equals(BukkitUtil.adapt(from).getPlot())) {
|
if (lastPlot.equals(BukkitUtil.adapt(from).getPlot())) {
|
||||||
@ -552,8 +551,8 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
ForceFieldListener.handleForcefield(player, pp, now);
|
ForceFieldListener.handleForcefield(player, pp, now);
|
||||||
} else if (!plotEntry(pp, now) && this.tmpTeleport) {
|
} else if (!plotEntry(pp, now) && this.tmpTeleport) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("deny.no_enter"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("plot", now.toString())
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_ENTRY_DENIED))
|
||||||
);
|
);
|
||||||
this.tmpTeleport = false;
|
this.tmpTeleport = false;
|
||||||
to.setX(from.getBlockX());
|
to.setX(from.getBlockX());
|
||||||
@ -571,9 +570,9 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
this.tmpTeleport = false;
|
this.tmpTeleport = false;
|
||||||
player.teleport(event.getTo());
|
player.teleport(event.getTo());
|
||||||
this.tmpTeleport = true;
|
this.tmpTeleport = true;
|
||||||
pp.sendMessage(TranslatableCaption.of("border.denied"));
|
pp.sendMessage(TranslatableCaption.miniMessage("border.denied"));
|
||||||
} else if (MathMan.roundInt(from.getX()) <= border) { // Only send if they just moved out of the border
|
} else {
|
||||||
pp.sendMessage(TranslatableCaption.of("border.bypass.exited"));
|
pp.sendMessage(TranslatableCaption.miniMessage("border.bypass.exited"));
|
||||||
}
|
}
|
||||||
} else if (x2 < -border && this.tmpTeleport) {
|
} else if (x2 < -border && this.tmpTeleport) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BYPASS_BORDER)) {
|
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BYPASS_BORDER)) {
|
||||||
@ -581,13 +580,13 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
this.tmpTeleport = false;
|
this.tmpTeleport = false;
|
||||||
player.teleport(event.getTo());
|
player.teleport(event.getTo());
|
||||||
this.tmpTeleport = true;
|
this.tmpTeleport = true;
|
||||||
pp.sendMessage(TranslatableCaption.of("border.denied"));
|
pp.sendMessage(TranslatableCaption.miniMessage("border.denied"));
|
||||||
} else if (MathMan.roundInt(from.getX()) >= -border) { // Only send if they just moved out of the border
|
} else {
|
||||||
pp.sendMessage(TranslatableCaption.of("border.bypass.exited"));
|
pp.sendMessage(TranslatableCaption.miniMessage("border.bypass.exited"));
|
||||||
}
|
}
|
||||||
} else if (((x1 = MathMan.roundInt(from.getX())) >= border && x2 <= border) || (x1 <= -border && x2 >= -border)) {
|
} else if (((x1 = MathMan.roundInt(from.getX())) >= border && x2 <= border) || (x1 <= -border && x2 >= -border)) {
|
||||||
if (Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BYPASS_BORDER)) {
|
if (Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BYPASS_BORDER)) {
|
||||||
pp.sendMessage(TranslatableCaption.of("border.bypass.entered"));
|
pp.sendMessage(TranslatableCaption.miniMessage("border.bypass.entered"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -597,7 +596,7 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
BukkitPlayer pp = BukkitUtil.adapt(player);
|
BukkitPlayer pp = BukkitUtil.adapt(player);
|
||||||
// Cancel teleport
|
// Cancel teleport
|
||||||
if (TaskManager.removeFromTeleportQueue(pp.getName())) {
|
if (TaskManager.removeFromTeleportQueue(pp.getName())) {
|
||||||
pp.sendMessage(TranslatableCaption.of("teleport.teleport_failed"));
|
pp.sendMessage(TranslatableCaption.miniMessage("teleport.teleport_failed"));
|
||||||
}
|
}
|
||||||
// Set last location
|
// Set last location
|
||||||
Location location = BukkitUtil.adapt(to);
|
Location location = BukkitUtil.adapt(to);
|
||||||
@ -613,19 +612,19 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Plot plot = area.getPlot(location);
|
Plot now = area.getPlot(location);
|
||||||
Plot lastPlot;
|
Plot lastPlot;
|
||||||
try (final MetaDataAccess<Plot> lastPlotAccess =
|
try (final MetaDataAccess<Plot> lastPlotAccess =
|
||||||
pp.accessTemporaryMetaData(PlayerMetaDataKeys.TEMPORARY_LAST_PLOT)) {
|
pp.accessTemporaryMetaData(PlayerMetaDataKeys.TEMPORARY_LAST_PLOT)) {
|
||||||
lastPlot = lastPlotAccess.get().orElse(null);
|
lastPlot = lastPlotAccess.get().orElse(null);
|
||||||
}
|
}
|
||||||
if (plot == null) {
|
if (now == null) {
|
||||||
try (final MetaDataAccess<Boolean> kickAccess =
|
try (final MetaDataAccess<Boolean> kickAccess =
|
||||||
pp.accessTemporaryMetaData(PlayerMetaDataKeys.TEMPORARY_KICK)) {
|
pp.accessTemporaryMetaData(PlayerMetaDataKeys.TEMPORARY_KICK)) {
|
||||||
if (lastPlot != null && !plotExit(pp, lastPlot) && this.tmpTeleport && !kickAccess.get().orElse(false)) {
|
if (lastPlot != null && !plotExit(pp, lastPlot) && this.tmpTeleport && !kickAccess.get().orElse(false)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_EXIT_DENIED))
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_EXIT_DENIED))
|
||||||
);
|
);
|
||||||
this.tmpTeleport = false;
|
this.tmpTeleport = false;
|
||||||
if (lastPlot.equals(BukkitUtil.adapt(from).getPlot())) {
|
if (lastPlot.equals(BukkitUtil.adapt(from).getPlot())) {
|
||||||
@ -638,12 +637,12 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (plot.equals(lastPlot)) {
|
} else if (now.equals(lastPlot)) {
|
||||||
ForceFieldListener.handleForcefield(player, pp, plot);
|
ForceFieldListener.handleForcefield(player, pp, now);
|
||||||
} else if (!plotEntry(pp, plot) && this.tmpTeleport) {
|
} else if (!plotEntry(pp, now) && this.tmpTeleport) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("deny.no_enter"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("plot", plot.toString())
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_ENTRY_DENIED))
|
||||||
);
|
);
|
||||||
this.tmpTeleport = false;
|
this.tmpTeleport = false;
|
||||||
player.teleport(from);
|
player.teleport(from);
|
||||||
@ -662,9 +661,9 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
this.tmpTeleport = false;
|
this.tmpTeleport = false;
|
||||||
player.teleport(event.getTo());
|
player.teleport(event.getTo());
|
||||||
this.tmpTeleport = true;
|
this.tmpTeleport = true;
|
||||||
pp.sendMessage(TranslatableCaption.of("border.denied"));
|
pp.sendMessage(TranslatableCaption.miniMessage("border.denied"));
|
||||||
} else if (MathMan.roundInt(from.getZ()) <= border) { // Only send if they just moved out of the border
|
} else {
|
||||||
pp.sendMessage(TranslatableCaption.of("border.bypass.exited"));
|
pp.sendMessage(TranslatableCaption.miniMessage("border.bypass.exited"));
|
||||||
}
|
}
|
||||||
} else if (z2 < -border && this.tmpTeleport) {
|
} else if (z2 < -border && this.tmpTeleport) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BYPASS_BORDER)) {
|
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BYPASS_BORDER)) {
|
||||||
@ -672,13 +671,13 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
this.tmpTeleport = false;
|
this.tmpTeleport = false;
|
||||||
player.teleport(event.getTo());
|
player.teleport(event.getTo());
|
||||||
this.tmpTeleport = true;
|
this.tmpTeleport = true;
|
||||||
pp.sendMessage(TranslatableCaption.of("border.denied"));
|
pp.sendMessage(TranslatableCaption.miniMessage("border.denied"));
|
||||||
} else if (MathMan.roundInt(from.getZ()) >= -border) { // Only send if they just moved out of the border
|
} else {
|
||||||
pp.sendMessage(TranslatableCaption.of("border.bypass.exited"));
|
pp.sendMessage(TranslatableCaption.miniMessage("border.bypass.exited"));
|
||||||
}
|
}
|
||||||
} else if (((z1 = MathMan.roundInt(from.getZ())) >= border && z2 <= border) || (z1 <= -border && z2 >= -border)) {
|
} else if (((z1 = MathMan.roundInt(from.getZ())) >= border && z2 <= border) || (z1 <= -border && z2 >= -border)) {
|
||||||
if (Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BYPASS_BORDER)) {
|
if (Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BYPASS_BORDER)) {
|
||||||
pp.sendMessage(TranslatableCaption.of("border.bypass.entered"));
|
pp.sendMessage(TranslatableCaption.miniMessage("border.bypass.entered"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -727,45 +726,45 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
String sender = event.getPlayer().getDisplayName();
|
String sender = event.getPlayer().getDisplayName();
|
||||||
PlotId id = plot.getId();
|
PlotId id = plot.getId();
|
||||||
String worldName = plot.getWorldName();
|
String worldName = plot.getWorldName();
|
||||||
Caption msg = TranslatableCaption.of("chat.plot_chat_format");
|
Caption msg = TranslatableCaption.miniMessage("chat.plot_chat_format");
|
||||||
Template msgTemplate;
|
Placeholder<?> msgTemplate;
|
||||||
Template worldNameTemplate = Template.of("world", worldName);
|
Placeholder<?> worldNameTemplate = Placeholder.miniMessage("world", worldName);
|
||||||
Template plotTemplate = Template.of("plot_id", id.toString());
|
Placeholder<?> plotTemplate = Placeholder.miniMessage("plot_id", id.toString());
|
||||||
Template senderTemplate = Template.of("sender", sender);
|
Placeholder<?> senderTemplate = Placeholder.miniMessage("sender", sender);
|
||||||
// If we do/don't want colour, we need to be careful about how to go about it, as players could attempt either <gold></gold> or &6 etc.
|
// If we do/don't want colour, we need to be careful about how to go about it, as players could attempt either <gold></gold> or &6 etc.
|
||||||
// In both cases, we want to use a Component Template to ensure that the player cannot use any placeholders in their message on purpose
|
// In both cases, we want to use a Component Template to ensure that the player cannot use any placeholders in their message on purpose
|
||||||
// or accidentally, as component templates are done at the end. We also need to deserialize from legacy color codes to a Component if
|
// or accidentally, as component templates are done at the end. We also need to deserialize from legacy color codes to a Component if
|
||||||
// allowing colour.
|
// allowing colour.
|
||||||
if (plotPlayer.hasPermission("plots.chat.color")) {
|
if (plotPlayer.hasPermission("plots.chat.color")) {
|
||||||
msgTemplate = Template
|
msgTemplate = Placeholder
|
||||||
.of(
|
.miniMessage(
|
||||||
"msg",
|
"msg",
|
||||||
BukkitUtil.LEGACY_COMPONENT_SERIALIZER.deserialize(ChatColor.translateAlternateColorCodes(
|
BukkitUtil.LEGACY_COMPONENT_SERIALIZER.deserialize(ChatColor.translateAlternateColorCodes(
|
||||||
'&',
|
'&',
|
||||||
message
|
message
|
||||||
))
|
)).toString()
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
msgTemplate = Template.of("msg", BukkitUtil.MINI_MESSAGE.deserialize(
|
msgTemplate = Placeholder.miniMessage("msg", BukkitUtil.MINI_MESSAGE.deserialize(
|
||||||
ChatColor.stripColor(BukkitUtil.LEGACY_COMPONENT_SERIALIZER.serialize(Component.text(message)))));
|
ChatColor.stripColor(BukkitUtil.LEGACY_COMPONENT_SERIALIZER.serialize(Component.text(message)))).toString());
|
||||||
}
|
}
|
||||||
for (PlotPlayer<?> receiver : plotRecipients) {
|
for (PlotPlayer<?> receiver : plotRecipients) {
|
||||||
receiver.sendMessage(msg, worldNameTemplate, msgTemplate, plotTemplate, senderTemplate);
|
receiver.sendMessage(msg, worldNameTemplate, msgTemplate, plotTemplate, senderTemplate);
|
||||||
}
|
}
|
||||||
if (!spies.isEmpty()) {
|
if (!spies.isEmpty()) {
|
||||||
Caption spymsg = TranslatableCaption.of("chat.plot_chat_spy_format");
|
Caption spymsg = TranslatableCaption.miniMessage("chat.plot_chat_spy_format");
|
||||||
Template plotidTemplate = Template.of("plot_id", id.getX() + ";" + id.getY());
|
Placeholder<?> plotidTemplate = Placeholder.miniMessage("plot_id", id.getX() + ";" + id.getY());
|
||||||
Template spysenderTemplate = Template.of("sender", sender);
|
Placeholder<?> spysenderTemplate = Placeholder.miniMessage("sender", sender);
|
||||||
Template spymessageTemplate = Template.of("msg", Component.text(message));
|
Placeholder<?> spymessageTemplate = Placeholder.miniMessage("msg", Component.text(message).toString());
|
||||||
for (PlotPlayer<?> player : spies) {
|
for (PlotPlayer<?> player : spies) {
|
||||||
player.sendMessage(spymsg, worldNameTemplate, plotidTemplate, spysenderTemplate, spymessageTemplate);
|
player.sendMessage(spymsg, worldNameTemplate, plotidTemplate, spysenderTemplate, spymessageTemplate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (Settings.Chat.LOG_PLOTCHAT_TO_CONSOLE) {
|
if (Settings.Chat.LOG_PLOTCHAT_TO_CONSOLE) {
|
||||||
Caption spymsg = TranslatableCaption.of("chat.plot_chat_spy_format");
|
Caption spymsg = TranslatableCaption.miniMessage("chat.plot_chat_spy_format");
|
||||||
Template plotidTemplate = Template.of("plot_id", id.getX() + ";" + id.getY());
|
Placeholder<?> plotidTemplate = Placeholder.miniMessage("plot_id", id.getX() + ";" + id.getY());
|
||||||
Template spysenderTemplate = Template.of("sender", sender);
|
Placeholder<?> spysenderTemplate = Placeholder.miniMessage("sender", sender);
|
||||||
Template spymessageTemplate = Template.of("msg", Component.text(message));
|
Placeholder<?> spymessageTemplate = Placeholder.miniMessage("msg", Component.text(message).toString());
|
||||||
ConsolePlayer.getConsole().sendMessage(spymsg, worldNameTemplate, plotidTemplate, spysenderTemplate,
|
ConsolePlayer.getConsole().sendMessage(spymsg, worldNameTemplate, plotidTemplate, spysenderTemplate,
|
||||||
spymessageTemplate
|
spymessageTemplate
|
||||||
);
|
);
|
||||||
@ -920,16 +919,16 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
if (plot == null) {
|
if (plot == null) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_ROAD)) {
|
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_ROAD)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_ROAD))
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_ROAD))
|
||||||
);
|
);
|
||||||
cancelled = true;
|
cancelled = true;
|
||||||
}
|
}
|
||||||
} else if (!plot.hasOwner()) {
|
} else if (!plot.hasOwner()) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_UNOWNED)) {
|
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_UNOWNED)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_UNOWNED))
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_UNOWNED))
|
||||||
);
|
);
|
||||||
cancelled = true;
|
cancelled = true;
|
||||||
}
|
}
|
||||||
@ -938,8 +937,8 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
if (!plot.isAdded(uuid)) {
|
if (!plot.isAdded(uuid)) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_OTHER)) {
|
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_OTHER)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_OTHER))
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_OTHER))
|
||||||
);
|
);
|
||||||
cancelled = true;
|
cancelled = true;
|
||||||
}
|
}
|
||||||
@ -976,8 +975,8 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
if (!area.isRoadFlags() && !area.getRoadFlag(MiscInteractFlag.class) && !Permissions
|
if (!area.isRoadFlags() && !area.getRoadFlag(MiscInteractFlag.class) && !Permissions
|
||||||
.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_ROAD)) {
|
.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_ROAD)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_ROAD))
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_ROAD))
|
||||||
);
|
);
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
@ -985,7 +984,7 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
|
if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("done.building_restricted")
|
TranslatableCaption.miniMessage("done.building_restricted")
|
||||||
);
|
);
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
@ -994,8 +993,8 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
if (!plot.hasOwner()) {
|
if (!plot.hasOwner()) {
|
||||||
if (!Permissions.hasPermission(pp, "plots.admin.interact.unowned")) {
|
if (!Permissions.hasPermission(pp, "plots.admin.interact.unowned")) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_UNOWNED))
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_UNOWNED))
|
||||||
);
|
);
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
@ -1009,8 +1008,8 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
}
|
}
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_OTHER)) {
|
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_OTHER)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_OTHER))
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_OTHER))
|
||||||
);
|
);
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
plot.debug(pp.getName() + " could not interact with " + entity.getType()
|
plot.debug(pp.getName() + " could not interact with " + entity.getType()
|
||||||
@ -1064,13 +1063,9 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
if (area == null) {
|
if (area == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
PlayerBlockEventType eventType;
|
PlayerBlockEventType eventType = null;
|
||||||
BlockType blocktype1;
|
BlockType blocktype1;
|
||||||
Block block = event.getClickedBlock();
|
Block block = event.getClickedBlock();
|
||||||
if (block == null) {
|
|
||||||
// We do not care in this case, the player is likely interacting with air ("nothing").
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Location location = BukkitUtil.adapt(block.getLocation());
|
Location location = BukkitUtil.adapt(block.getLocation());
|
||||||
Action action = event.getAction();
|
Action action = event.getAction();
|
||||||
switch (action) {
|
switch (action) {
|
||||||
@ -1229,8 +1224,8 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_ROAD))
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_ROAD))
|
||||||
);
|
);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
} else if (!plot.hasOwner()) {
|
} else if (!plot.hasOwner()) {
|
||||||
@ -1238,8 +1233,8 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_UNOWNED))
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_UNOWNED))
|
||||||
);
|
);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
} else if (!plot.isAdded(pp.getUUID())) {
|
} else if (!plot.isAdded(pp.getUUID())) {
|
||||||
@ -1247,14 +1242,14 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER))
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER))
|
||||||
);
|
);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
} else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
|
} else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("done.building_restricted")
|
TranslatableCaption.miniMessage("done.building_restricted")
|
||||||
);
|
);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
@ -1294,8 +1289,8 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
plotPlayer.sendMessage(
|
plotPlayer.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_ROAD))
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_ROAD))
|
||||||
);
|
);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
} else if (!plot.hasOwner()) {
|
} else if (!plot.hasOwner()) {
|
||||||
@ -1303,8 +1298,8 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
plotPlayer.sendMessage(
|
plotPlayer.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_UNOWNED))
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_UNOWNED))
|
||||||
);
|
);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
} else if (!plot.isAdded(plotPlayer.getUUID())) {
|
} else if (!plot.isAdded(plotPlayer.getUUID())) {
|
||||||
@ -1312,14 +1307,14 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
plotPlayer.sendMessage(
|
plotPlayer.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER))
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER))
|
||||||
);
|
);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
} else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
|
} else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
|
||||||
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
||||||
plotPlayer.sendMessage(
|
plotPlayer.sendMessage(
|
||||||
TranslatableCaption.of("done.building_restricted")
|
TranslatableCaption.miniMessage("done.building_restricted")
|
||||||
);
|
);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
@ -1344,8 +1339,8 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
if (plot == null) {
|
if (plot == null) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_ROAD)) {
|
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_ROAD)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_ROAD))
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_ROAD))
|
||||||
);
|
);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
@ -1353,8 +1348,8 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
if (!plot.hasOwner()) {
|
if (!plot.hasOwner()) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) {
|
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_UNOWNED))
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_UNOWNED))
|
||||||
);
|
);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
@ -1364,8 +1359,8 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
if (!plot.getFlag(HangingPlaceFlag.class)) {
|
if (!plot.getFlag(HangingPlaceFlag.class)) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER))
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER))
|
||||||
);
|
);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
@ -1393,16 +1388,16 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
if (plot == null) {
|
if (plot == null) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_ROAD)) {
|
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_ROAD)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_ROAD))
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_ROAD))
|
||||||
);
|
);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
} else if (!plot.hasOwner()) {
|
} else if (!plot.hasOwner()) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_UNOWNED)) {
|
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_UNOWNED)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_UNOWNED))
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_UNOWNED))
|
||||||
);
|
);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
@ -1412,8 +1407,8 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
}
|
}
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_OTHER)) {
|
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_OTHER)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_OTHER))
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_OTHER))
|
||||||
);
|
);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
plot.debug(p.getName()
|
plot.debug(p.getName()
|
||||||
@ -1434,8 +1429,8 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
if (!Permissions
|
if (!Permissions
|
||||||
.hasPermission(player, Permission.PERMISSION_ADMIN_DESTROY_UNOWNED)) {
|
.hasPermission(player, Permission.PERMISSION_ADMIN_DESTROY_UNOWNED)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_UNOWNED))
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_UNOWNED))
|
||||||
);
|
);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
@ -1444,8 +1439,8 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
if (!Permissions
|
if (!Permissions
|
||||||
.hasPermission(player, Permission.PERMISSION_ADMIN_DESTROY_OTHER)) {
|
.hasPermission(player, Permission.PERMISSION_ADMIN_DESTROY_OTHER)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_OTHER))
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_OTHER))
|
||||||
);
|
);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
plot.debug(player.getName()
|
plot.debug(player.getName()
|
||||||
@ -1476,16 +1471,16 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
if (plot == null && !area.isRoadFlags()) {
|
if (plot == null && !area.isRoadFlags()) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_ROAD)) {
|
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_ROAD)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_ROAD))
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_ROAD))
|
||||||
);
|
);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
} else if (plot != null && !plot.hasOwner()) {
|
} else if (plot != null && !plot.hasOwner()) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_UNOWNED)) {
|
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_UNOWNED)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_UNOWNED))
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_UNOWNED))
|
||||||
);
|
);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
@ -1542,8 +1537,8 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
|
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_OTHER)) {
|
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_OTHER)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_OTHER))
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_OTHER))
|
||||||
);
|
);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
@ -1564,8 +1559,8 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
if (plot == null) {
|
if (plot == null) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_ROAD)) {
|
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_ROAD)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_ROAD))
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_ROAD))
|
||||||
);
|
);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
@ -1573,8 +1568,8 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
if (!plot.hasOwner()) {
|
if (!plot.hasOwner()) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_UNOWNED)) {
|
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_UNOWNED)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_UNOWNED))
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_UNOWNED))
|
||||||
);
|
);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
@ -1587,8 +1582,8 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
}
|
}
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_OTHER)) {
|
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_OTHER)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_OTHER))
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_OTHER))
|
||||||
);
|
);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
plot.debug(pp.getName()
|
plot.debug(pp.getName()
|
||||||
@ -1672,7 +1667,6 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation") // #getLocate is needed for Spigot compatibility
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onLocaleChange(final PlayerLocaleChangeEvent event) {
|
public void onLocaleChange(final PlayerLocaleChangeEvent event) {
|
||||||
// The event is fired before the player is deemed online upon login
|
// The event is fired before the player is deemed online upon login
|
||||||
@ -1708,49 +1702,22 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPortalCreation(PortalCreateEvent event) {
|
public void onPortalCreation(PortalCreateEvent event) {
|
||||||
String world = event.getWorld().getName();
|
Location location = BukkitUtil.adapt(event.getEntity().getLocation());
|
||||||
if (PlotSquared.get().getPlotAreaManager().getPlotAreasSet(world).size() == 0) {
|
PlotArea area = location.getPlotArea();
|
||||||
|
if (area == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int minX = Integer.MAX_VALUE;
|
Plot plot = location.getOwnedPlot();
|
||||||
int maxX = Integer.MIN_VALUE;
|
if (plot == null) {
|
||||||
int minZ = Integer.MAX_VALUE;
|
if (area.isRoadFlags() && area.getRoadFlag(DenyPortalsFlag.class)) {
|
||||||
int maxZ = Integer.MIN_VALUE;
|
event.setCancelled(true);
|
||||||
for (BlockState state : event.getBlocks()) {
|
}
|
||||||
minX = Math.min(state.getX(), minX);
|
return;
|
||||||
maxX = Math.max(state.getX(), maxX);
|
}
|
||||||
minZ = Math.min(state.getZ(), minZ);
|
if (plot.getFlag(DenyPortalsFlag.class)) {
|
||||||
maxZ = Math.max(state.getZ(), maxZ);
|
if (plot.getFlag(DenyPortalsFlag.class)) {
|
||||||
}
|
plot.debug(event.getEntity().getName() + " did not create a portal because of deny-portals = true");
|
||||||
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;
|
|
||||||
}
|
|
||||||
if (plot.getFlag(DenyPortalsFlag.class)) {
|
|
||||||
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);
|
event.setCancelled(true);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -37,7 +37,7 @@ import com.plotsquared.core.plot.PlotArea;
|
|||||||
import com.plotsquared.core.plot.PlotHandler;
|
import com.plotsquared.core.plot.PlotHandler;
|
||||||
import com.plotsquared.core.plot.world.PlotAreaManager;
|
import com.plotsquared.core.plot.world.PlotAreaManager;
|
||||||
import com.plotsquared.core.util.Permissions;
|
import com.plotsquared.core.util.Permissions;
|
||||||
import net.kyori.adventure.text.minimessage.Template;
|
import net.kyori.adventure.text.minimessage.placeholder.Placeholder;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -112,8 +112,8 @@ public class ProjectileEventListener implements Listener {
|
|||||||
if (plot == null) {
|
if (plot == null) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_ROAD)) {
|
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_ROAD)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_ROAD))
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_ROAD))
|
||||||
);
|
);
|
||||||
entity.remove();
|
entity.remove();
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
@ -121,8 +121,8 @@ public class ProjectileEventListener implements Listener {
|
|||||||
} else if (!plot.hasOwner()) {
|
} else if (!plot.hasOwner()) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED)) {
|
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED))
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED))
|
||||||
);
|
);
|
||||||
entity.remove();
|
entity.remove();
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
@ -130,8 +130,8 @@ public class ProjectileEventListener implements Listener {
|
|||||||
} else if (!plot.isAdded(pp.getUUID())) {
|
} else if (!plot.isAdded(pp.getUUID())) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) {
|
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_OTHER))
|
Placeholder.miniMessage("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_OTHER))
|
||||||
);
|
);
|
||||||
entity.remove();
|
entity.remove();
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -50,7 +50,7 @@ public class ServerListener implements Listener {
|
|||||||
public void onServerLoad(ServerLoadEvent event) {
|
public void onServerLoad(ServerLoadEvent event) {
|
||||||
if (Bukkit.getPluginManager().getPlugin("MVdWPlaceholderAPI") != null && Settings.Enabled_Components.USE_MVDWAPI) {
|
if (Bukkit.getPluginManager().getPlugin("MVdWPlaceholderAPI") != null && Settings.Enabled_Components.USE_MVDWAPI) {
|
||||||
new MVdWPlaceholders(this.plugin, this.plugin.placeholderRegistry());
|
new MVdWPlaceholders(this.plugin, this.plugin.placeholderRegistry());
|
||||||
ConsolePlayer.getConsole().sendMessage(TranslatableCaption.of("placeholder.hooked"));
|
ConsolePlayer.getConsole().sendMessage(TranslatableCaption.miniMessage("placeholder.hooked"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -43,6 +43,7 @@ import java.lang.reflect.Method;
|
|||||||
|
|
||||||
import static com.plotsquared.core.util.ReflectionUtils.getRefClass;
|
import static com.plotsquared.core.util.ReflectionUtils.getRefClass;
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
public class SingleWorldListener implements Listener {
|
public class SingleWorldListener implements Listener {
|
||||||
|
|
||||||
private final Method methodGetHandleChunk;
|
private final Method methodGetHandleChunk;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -25,7 +25,6 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.bukkit.managers;
|
package com.plotsquared.bukkit.managers;
|
||||||
|
|
||||||
/*
|
|
||||||
import com.google.inject.Singleton;
|
import com.google.inject.Singleton;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||||
@ -36,9 +35,10 @@ import se.hyperver.hyperverse.world.WorldConfigurationBuilder;
|
|||||||
import se.hyperver.hyperverse.world.WorldFeatures;
|
import se.hyperver.hyperverse.world.WorldFeatures;
|
||||||
import se.hyperver.hyperverse.world.WorldType;
|
import se.hyperver.hyperverse.world.WorldType;
|
||||||
|
|
||||||
Hyperverse implementation is currently put on ice until Hyperverse is released on a stable line and deployed to the central
|
/**
|
||||||
repository.
|
* Hyperverse specific manager that creates worlds
|
||||||
|
* using Hyperverse's API
|
||||||
|
*/
|
||||||
@Singleton
|
@Singleton
|
||||||
public class HyperverseWorldManager extends BukkitWorldManager {
|
public class HyperverseWorldManager extends BukkitWorldManager {
|
||||||
|
|
||||||
@ -67,4 +67,3 @@ public class HyperverseWorldManager extends BukkitWorldManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -36,9 +36,9 @@ import org.checkerframework.checker.nullness.qual.Nullable;
|
|||||||
* world creation by executing a console command
|
* world creation by executing a console command
|
||||||
*
|
*
|
||||||
* @deprecated Deprecated and scheduled for removal without replacement
|
* @deprecated Deprecated and scheduled for removal without replacement
|
||||||
* in favor of the build in setup wizard.
|
* in favor of the build in setup wizard.
|
||||||
*/
|
*/
|
||||||
@Deprecated(forRemoval = true, since = "6.0.0")
|
@Deprecated(forRemoval = true)
|
||||||
@Singleton
|
@Singleton
|
||||||
public class MultiverseWorldManager extends BukkitWorldManager {
|
public class MultiverseWorldManager extends BukkitWorldManager {
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -162,7 +162,6 @@ public class BukkitPlayer extends PlotPlayer<Player> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("StringSplitter")
|
|
||||||
@Override
|
@Override
|
||||||
@NonNegative
|
@NonNegative
|
||||||
public int hasPermissionRange(
|
public int hasPermissionRange(
|
||||||
@ -320,7 +319,7 @@ public class BukkitPlayer extends PlotPlayer<Player> {
|
|||||||
if (id == ItemTypes.AIR) {
|
if (id == ItemTypes.AIR) {
|
||||||
// Let's just stop all the discs because why not?
|
// Let's just stop all the discs because why not?
|
||||||
for (final Sound sound : Arrays.stream(Sound.values())
|
for (final Sound sound : Arrays.stream(Sound.values())
|
||||||
.filter(sound -> sound.name().contains("DISC")).toList()) {
|
.filter(sound -> sound.name().contains("DISC")).collect(Collectors.toList())) {
|
||||||
player.stopSound(sound);
|
player.stopSound(sound);
|
||||||
}
|
}
|
||||||
// this.player.playEffect(BukkitUtil.getLocation(location), Effect.RECORD_PLAY, Material.AIR);
|
// this.player.playEffect(BukkitUtil.getLocation(location), Effect.RECORD_PLAY, Material.AIR);
|
||||||
@ -332,7 +331,6 @@ public class BukkitPlayer extends PlotPlayer<Player> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation") // Needed for Spigot compatibility
|
|
||||||
@Override
|
@Override
|
||||||
public void kick(final String message) {
|
public void kick(final String message) {
|
||||||
this.player.kickPlayer(message);
|
this.player.kickPlayer(message);
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -51,6 +51,7 @@ import com.sk89q.worldedit.world.biome.BiomeType;
|
|||||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||||
import com.sk89q.worldedit.world.block.BlockState;
|
import com.sk89q.worldedit.world.block.BlockState;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.Chunk;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.block.Container;
|
import org.bukkit.block.Container;
|
||||||
import org.bukkit.block.data.BlockData;
|
import org.bukkit.block.data.BlockData;
|
||||||
@ -198,7 +199,7 @@ public class BukkitQueueCoordinator extends BasicQueueCoordinator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (localChunk.getTiles().size() > 0) {
|
if (localChunk.getTiles().size() > 0) {
|
||||||
localChunk.getTiles().forEach((blockVector3, tag) -> {
|
localChunk.getTiles().forEach(((blockVector3, tag) -> {
|
||||||
try {
|
try {
|
||||||
BaseBlock block = getWorld().getBlock(blockVector3).toBaseBlock(tag);
|
BaseBlock block = getWorld().getBlock(blockVector3).toBaseBlock(tag);
|
||||||
getWorld().setBlock(blockVector3, block, noSideEffectSet);
|
getWorld().setBlock(blockVector3, block, noSideEffectSet);
|
||||||
@ -206,7 +207,7 @@ public class BukkitQueueCoordinator extends BasicQueueCoordinator {
|
|||||||
StateWrapper sw = new StateWrapper(tag);
|
StateWrapper sw = new StateWrapper(tag);
|
||||||
sw.restoreTag(getWorld().getName(), blockVector3.getX(), blockVector3.getY(), blockVector3.getZ());
|
sw.restoreTag(getWorld().getName(), blockVector3.getX(), blockVector3.getY(), blockVector3.getZ());
|
||||||
}
|
}
|
||||||
});
|
}));
|
||||||
}
|
}
|
||||||
if (localChunk.getEntities().size() > 0) {
|
if (localChunk.getEntities().size() > 0) {
|
||||||
localChunk.getEntities().forEach((location, entity) -> getWorld().createEntity(location, entity));
|
localChunk.getEntities().forEach((location, entity) -> getWorld().createEntity(location, entity));
|
||||||
@ -237,7 +238,6 @@ public class BukkitQueueCoordinator extends BasicQueueCoordinator {
|
|||||||
/**
|
/**
|
||||||
* Set a block to the world. First tries WNA but defaults to normal block setting methods if that fails
|
* Set a block to the world. First tries WNA but defaults to normal block setting methods if that fails
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private void setWorldBlock(int x, int y, int z, @NonNull BaseBlock block, @NonNull BlockVector2 blockVector2, boolean edge) {
|
private void setWorldBlock(int x, int y, int z, @NonNull BaseBlock block, @NonNull BlockVector2 blockVector2, boolean edge) {
|
||||||
try {
|
try {
|
||||||
BlockVector3 loc = BlockVector3.at(x, y, z);
|
BlockVector3 loc = BlockVector3.at(x, y, z);
|
||||||
@ -266,7 +266,9 @@ public class BukkitQueueCoordinator extends BasicQueueCoordinator {
|
|||||||
} catch (WorldEditException ignored) {
|
} catch (WorldEditException ignored) {
|
||||||
// Fallback to not so nice method
|
// Fallback to not so nice method
|
||||||
BlockData blockData = BukkitAdapter.adapt(block);
|
BlockData blockData = BukkitAdapter.adapt(block);
|
||||||
Block existing = getBukkitWorld().getBlockAt(x, y, z);
|
Chunk chunk = getBukkitWorld().getChunkAt(blockVector2.getX(), blockVector2.getZ());
|
||||||
|
|
||||||
|
Block existing = chunk.getBlock(x, y, z);
|
||||||
final BlockState existingBaseBlock = BukkitAdapter.adapt(existing.getBlockData());
|
final BlockState existingBaseBlock = BukkitAdapter.adapt(existing.getBlockData());
|
||||||
if (BukkitBlockUtil.get(existing).equals(existingBaseBlock) && existing.getBlockData().matches(blockData)) {
|
if (BukkitBlockUtil.get(existing).equals(existingBaseBlock) && existing.getBlockData().matches(blockData)) {
|
||||||
return;
|
return;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -166,7 +166,6 @@ public class StateWrapper {
|
|||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation") // #setLine is needed for Spigot compatibility
|
|
||||||
public boolean restoreTag(String worldName, int x, int y, int z) {
|
public boolean restoreTag(String worldName, int x, int y, int z) {
|
||||||
if (this.tag == null) {
|
if (this.tag == null) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -50,7 +50,7 @@ import com.plotsquared.core.util.EntityUtil;
|
|||||||
import com.plotsquared.core.util.Permissions;
|
import com.plotsquared.core.util.Permissions;
|
||||||
import com.plotsquared.core.util.entity.EntityCategories;
|
import com.plotsquared.core.util.entity.EntityCategories;
|
||||||
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
||||||
import net.kyori.adventure.text.minimessage.Template;
|
import net.kyori.adventure.text.minimessage.placeholder.Placeholder;
|
||||||
import org.bukkit.entity.Arrow;
|
import org.bukkit.entity.Arrow;
|
||||||
import org.bukkit.entity.Creature;
|
import org.bukkit.entity.Creature;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
@ -178,7 +178,7 @@ public class BukkitEntityUtil {
|
|||||||
if (!Permissions
|
if (!Permissions
|
||||||
.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
||||||
plotPlayer.sendMessage(
|
plotPlayer.sendMessage(
|
||||||
TranslatableCaption.of("done.building_restricted")
|
TranslatableCaption.miniMessage("done.building_restricted")
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -187,8 +187,8 @@ public class BukkitEntityUtil {
|
|||||||
}
|
}
|
||||||
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_DESTROY + "." + stub)) {
|
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_DESTROY + "." + stub)) {
|
||||||
plotPlayer.sendMessage(
|
plotPlayer.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", Permission.PERMISSION_ADMIN_DESTROY + "." + stub)
|
Placeholder.miniMessage("node", Permission.PERMISSION_ADMIN_DESTROY + "." + stub)
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -199,8 +199,8 @@ public class BukkitEntityUtil {
|
|||||||
}
|
}
|
||||||
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_DESTROY + "." + stub)) {
|
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_DESTROY + "." + stub)) {
|
||||||
plotPlayer.sendMessage(
|
plotPlayer.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", Permission.PERMISSION_ADMIN_DESTROY + "." + stub)
|
Placeholder.miniMessage("node", Permission.PERMISSION_ADMIN_DESTROY + "." + stub)
|
||||||
);
|
);
|
||||||
if (plot != null) {
|
if (plot != null) {
|
||||||
plot.debug(player.getName()
|
plot.debug(player.getName()
|
||||||
@ -220,8 +220,8 @@ public class BukkitEntityUtil {
|
|||||||
}
|
}
|
||||||
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVE + "." + stub)) {
|
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVE + "." + stub)) {
|
||||||
plotPlayer.sendMessage(
|
plotPlayer.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", Permission.PERMISSION_ADMIN_PVE + "." + stub)
|
Placeholder.miniMessage("node", Permission.PERMISSION_ADMIN_PVE + "." + stub)
|
||||||
);
|
);
|
||||||
if (plot != null) {
|
if (plot != null) {
|
||||||
plot.debug(player.getName() + " could not attack " + entityType
|
plot.debug(player.getName() + " could not attack " + entityType
|
||||||
@ -241,8 +241,8 @@ public class BukkitEntityUtil {
|
|||||||
}
|
}
|
||||||
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVE + "." + stub)) {
|
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVE + "." + stub)) {
|
||||||
plotPlayer.sendMessage(
|
plotPlayer.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", Permission.PERMISSION_ADMIN_PVE + "." + stub)
|
Placeholder.miniMessage("node", Permission.PERMISSION_ADMIN_PVE + "." + stub)
|
||||||
);
|
);
|
||||||
if (plot != null) {
|
if (plot != null) {
|
||||||
plot.debug(player.getName() + " could not attack " + entityType
|
plot.debug(player.getName() + " could not attack " + entityType
|
||||||
@ -255,8 +255,8 @@ public class BukkitEntityUtil {
|
|||||||
if (!plot.getFlag(PvpFlag.class) && !Permissions
|
if (!plot.getFlag(PvpFlag.class) && !Permissions
|
||||||
.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVP + "." + stub)) {
|
.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVP + "." + stub)) {
|
||||||
plotPlayer.sendMessage(
|
plotPlayer.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", Permission.PERMISSION_ADMIN_PVP + "." + stub)
|
Placeholder.miniMessage("node", Permission.PERMISSION_ADMIN_PVP + "." + stub)
|
||||||
);
|
);
|
||||||
plot.debug(player.getName() + " could not attack " + entityType
|
plot.debug(player.getName() + " could not attack " + entityType
|
||||||
+ " because pve = false");
|
+ " because pve = false");
|
||||||
@ -269,8 +269,8 @@ public class BukkitEntityUtil {
|
|||||||
}
|
}
|
||||||
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVP + "." + stub)) {
|
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVP + "." + stub)) {
|
||||||
plotPlayer.sendMessage(
|
plotPlayer.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", Permission.PERMISSION_ADMIN_PVP + "." + stub)
|
Placeholder.miniMessage("node", Permission.PERMISSION_ADMIN_PVP + "." + stub)
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -286,8 +286,8 @@ public class BukkitEntityUtil {
|
|||||||
}
|
}
|
||||||
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVE + "." + stub)) {
|
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVE + "." + stub)) {
|
||||||
plotPlayer.sendMessage(
|
plotPlayer.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", Permission.PERMISSION_ADMIN_PVE + "." + stub)
|
Placeholder.miniMessage("node", Permission.PERMISSION_ADMIN_PVE + "." + stub)
|
||||||
);
|
);
|
||||||
if (plot != null) {
|
if (plot != null) {
|
||||||
plot.debug(player.getName() + " could not attack " + entityType
|
plot.debug(player.getName() + " could not attack " + entityType
|
||||||
@ -308,8 +308,8 @@ public class BukkitEntityUtil {
|
|||||||
}
|
}
|
||||||
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVE + "." + stub)) {
|
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVE + "." + stub)) {
|
||||||
plotPlayer.sendMessage(
|
plotPlayer.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.miniMessage("permission.no_permission_event"),
|
||||||
Template.of("node", Permission.PERMISSION_ADMIN_PVE + "." + stub)
|
Placeholder.miniMessage("node", Permission.PERMISSION_ADMIN_PVE + "." + stub)
|
||||||
);
|
);
|
||||||
if (plot != null) {
|
if (plot != null) {
|
||||||
plot.debug(player.getName() + " could not attack " + entityType
|
plot.debug(player.getName() + " could not attack " + entityType
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -42,7 +42,6 @@ import org.bukkit.inventory.InventoryView;
|
|||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.PlayerInventory;
|
import org.bukkit.inventory.PlayerInventory;
|
||||||
import org.bukkit.inventory.meta.ItemMeta;
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -51,15 +50,11 @@ import java.util.stream.IntStream;
|
|||||||
@Singleton
|
@Singleton
|
||||||
public class BukkitInventoryUtil extends InventoryUtil {
|
public class BukkitInventoryUtil extends InventoryUtil {
|
||||||
|
|
||||||
private static @Nullable ItemStack getItem(PlotItemStack item) {
|
private static ItemStack getItem(PlotItemStack item) {
|
||||||
if (item == null) {
|
if (item == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
Material material = BukkitAdapter.adapt(item.getType());
|
ItemStack stack = new ItemStack(BukkitAdapter.adapt(item.getType()), item.getAmount());
|
||||||
if (material == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
ItemStack stack = new ItemStack(material, item.getAmount());
|
|
||||||
ItemMeta meta = null;
|
ItemMeta meta = null;
|
||||||
if (item.getName() != null) {
|
if (item.getName() != null) {
|
||||||
meta = stack.getItemMeta();
|
meta = stack.getItemMeta();
|
||||||
@ -82,7 +77,6 @@ public class BukkitInventoryUtil extends InventoryUtil {
|
|||||||
return stack;
|
return stack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation") // Paper deprecation
|
|
||||||
@Override
|
@Override
|
||||||
public void open(PlotInventory inv) {
|
public void open(PlotInventory inv) {
|
||||||
BukkitPlayer bp = (BukkitPlayer) inv.getPlayer();
|
BukkitPlayer bp = (BukkitPlayer) inv.getPlayer();
|
||||||
@ -109,22 +103,16 @@ public class BukkitInventoryUtil extends InventoryUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setItemChecked(PlotInventory inv, int index, PlotItemStack item) {
|
public void setItem(PlotInventory inv, int index, PlotItemStack item) {
|
||||||
BukkitPlayer bp = (BukkitPlayer) inv.getPlayer();
|
BukkitPlayer bp = (BukkitPlayer) inv.getPlayer();
|
||||||
InventoryView opened = bp.player.getOpenInventory();
|
InventoryView opened = bp.player.getOpenInventory();
|
||||||
ItemStack stack = getItem(item);
|
|
||||||
if (stack == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (!inv.isOpen()) {
|
if (!inv.isOpen()) {
|
||||||
return true;
|
return;
|
||||||
}
|
}
|
||||||
opened.setItem(index, stack);
|
opened.setItem(index, getItem(item));
|
||||||
bp.player.updateInventory();
|
bp.player.updateInventory();
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation") // Paper deprecation
|
|
||||||
public PlotItemStack getItem(ItemStack item) {
|
public PlotItemStack getItem(ItemStack item) {
|
||||||
if (item == null) {
|
if (item == null) {
|
||||||
return null;
|
return null;
|
||||||
@ -157,7 +145,6 @@ public class BukkitInventoryUtil extends InventoryUtil {
|
|||||||
.toArray(PlotItemStack[]::new);
|
.toArray(PlotItemStack[]::new);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation") // #getTitle is needed for Spigot compatibility
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isOpen(PlotInventory plotInventory) {
|
public boolean isOpen(PlotInventory plotInventory) {
|
||||||
if (!plotInventory.isOpen()) {
|
if (!plotInventory.isOpen()) {
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -53,7 +53,8 @@ import com.sk89q.worldedit.world.block.BlockTypes;
|
|||||||
import io.papermc.lib.PaperLib;
|
import io.papermc.lib.PaperLib;
|
||||||
import net.kyori.adventure.platform.bukkit.BukkitAudiences;
|
import net.kyori.adventure.platform.bukkit.BukkitAudiences;
|
||||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||||
import net.kyori.adventure.text.minimessage.Template;
|
import net.kyori.adventure.text.minimessage.placeholder.Placeholder;
|
||||||
|
import net.kyori.adventure.text.minimessage.placeholder.PlaceholderResolver;
|
||||||
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
|
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
@ -337,7 +338,7 @@ public class BukkitUtil extends WorldUtil {
|
|||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public void setSign(
|
public void setSign(
|
||||||
final @NonNull Location location, final @NonNull Caption[] lines,
|
final @NonNull Location location, final @NonNull Caption[] lines,
|
||||||
final @NonNull Template... replacements
|
final @NonNull Placeholder<?>... replacements
|
||||||
) {
|
) {
|
||||||
ensureLoaded(location.getWorldName(), location.getX(), location.getZ(), chunk -> {
|
ensureLoaded(location.getWorldName(), location.getX(), location.getZ(), chunk -> {
|
||||||
PlotArea area = location.getPlotArea();
|
PlotArea area = location.getPlotArea();
|
||||||
@ -369,7 +370,8 @@ public class BukkitUtil extends WorldUtil {
|
|||||||
if (blockstate instanceof final Sign sign) {
|
if (blockstate instanceof final Sign sign) {
|
||||||
for (int i = 0; i < lines.length; i++) {
|
for (int i = 0; i < lines.length; i++) {
|
||||||
sign.setLine(i, LEGACY_COMPONENT_SERIALIZER
|
sign.setLine(i, LEGACY_COMPONENT_SERIALIZER
|
||||||
.serialize(MINI_MESSAGE.parse(lines[i].getComponent(LocaleHolder.console()), replacements)));
|
.serialize(MINI_MESSAGE.deserialize(lines[i].getComponent(LocaleHolder.console()),
|
||||||
|
PlaceholderResolver.placeholders(replacements))));
|
||||||
}
|
}
|
||||||
sign.update(true);
|
sign.update(true);
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -61,7 +61,6 @@ public class UpdateUtility implements Listener {
|
|||||||
internalVersion = PlotSquared.get().getVersion();
|
internalVersion = PlotSquared.get().getVersion();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings({"deprecation", "DefaultCharset"}) // Suppress Json deprecation, we can't use features from gson 2.8.1 and newer yet
|
|
||||||
public void updateChecker() {
|
public void updateChecker() {
|
||||||
task = Bukkit.getScheduler().runTaskTimerAsynchronously(this.javaPlugin, () -> {
|
task = Bukkit.getScheduler().runTaskTimerAsynchronously(this.javaPlugin, () -> {
|
||||||
try {
|
try {
|
||||||
@ -69,7 +68,7 @@ public class UpdateUtility implements Listener {
|
|||||||
"https://api.spigotmc.org/simple/0.1/index.php?action=getResource&id=77506")
|
"https://api.spigotmc.org/simple/0.1/index.php?action=getResource&id=77506")
|
||||||
.openConnection();
|
.openConnection();
|
||||||
connection.setRequestMethod("GET");
|
connection.setRequestMethod("GET");
|
||||||
JsonObject result = new JsonParser()
|
JsonObject result = (new JsonParser())
|
||||||
.parse(new JsonReader(new InputStreamReader(connection.getInputStream())))
|
.parse(new JsonReader(new InputStreamReader(connection.getInputStream())))
|
||||||
.getAsJsonObject();
|
.getAsJsonObject();
|
||||||
spigotVersion = result.get("current_version").getAsString();
|
spigotVersion = result.get("current_version").getAsString();
|
||||||
@ -92,7 +91,7 @@ public class UpdateUtility implements Listener {
|
|||||||
notify = false;
|
notify = false;
|
||||||
LOGGER.info("Congratulations! You are running the latest PlotSquared version");
|
LOGGER.info("Congratulations! You are running the latest PlotSquared version");
|
||||||
}
|
}
|
||||||
}, 0L, (long) Settings.UpdateChecker.POLL_RATE * 60 * 20);
|
}, 0L, Settings.UpdateChecker.POLL_RATE * 60 * 20);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void cancelTask() {
|
private void cancelTask() {
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -75,7 +75,6 @@ public class FaweSchematicHandler extends SchematicHandler {
|
|||||||
return delegate.save(tag, path);
|
return delegate.save(tag, path);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("removal") // Just the override
|
|
||||||
@Override
|
@Override
|
||||||
public void upload(final CompoundTag tag, final UUID uuid, final String file, final RunnableVal<URL> whenDone) {
|
public void upload(final CompoundTag tag, final UUID uuid, final String file, final RunnableVal<URL> whenDone) {
|
||||||
delegate.upload(tag, uuid, file, whenDone);
|
delegate.upload(tag, uuid, file, whenDone);
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -4,16 +4,16 @@ api-version: "1.13"
|
|||||||
version: "${version}"
|
version: "${version}"
|
||||||
load: STARTUP
|
load: STARTUP
|
||||||
description: "Easy, yet powerful Plot World generation and management."
|
description: "Easy, yet powerful Plot World generation and management."
|
||||||
authors: [Citymonstret, Empire92, MattBDev, dordsor21, NotMyFault, SirYwell]
|
authors: [ Citymonstret, Empire92, MattBDev, dordsor21, NotMyFault, SirYwell ]
|
||||||
website: https://www.spigotmc.org/resources/77506/
|
website: https://www.spigotmc.org/resources/77506/
|
||||||
softdepend: [Vault, PlaceholderAPI, Essentials, LuckPerms, BungeePerms, MVdWPlaceholderAPI]
|
softdepend: [ Vault, PlaceholderAPI, Essentials, LuckPerms, BungeePerms, MVdWPlaceholderAPI ]
|
||||||
loadbefore: [MultiWorld, Multiverse-Core]
|
loadbefore: [ MultiWorld, Multiverse-Core ]
|
||||||
depend: [WorldEdit]
|
depend: [ WorldEdit ]
|
||||||
database: false
|
database: false
|
||||||
commands:
|
commands:
|
||||||
plots:
|
plots:
|
||||||
description: Plot command.
|
description: Plot command.
|
||||||
aliases: [p,plot,ps,plotsquared,p2,2,plotme]
|
aliases: [ p,plot,ps,plotsquared,p2,2,plotme ]
|
||||||
permission: plots.use
|
permission: plots.use
|
||||||
permission-message: "You are lacking the permission node 'plots.use'"
|
permission-message: "You are lacking the permission node 'plots.use'"
|
||||||
permissions:
|
permissions:
|
||||||
|
@ -22,7 +22,7 @@ dependencies {
|
|||||||
api(libs.guiceassistedinject) {
|
api(libs.guiceassistedinject) {
|
||||||
exclude("com.google.inject", "guice")
|
exclude("com.google.inject", "guice")
|
||||||
}
|
}
|
||||||
api(libs.findbugs)
|
compileOnlyApi(libs.findbugs)
|
||||||
|
|
||||||
// Plugins
|
// Plugins
|
||||||
compileOnly(libs.worldeditCore) {
|
compileOnly(libs.worldeditCore) {
|
||||||
@ -40,7 +40,9 @@ dependencies {
|
|||||||
// Other libraries
|
// Other libraries
|
||||||
api(libs.prtree)
|
api(libs.prtree)
|
||||||
api(libs.aopalliance)
|
api(libs.aopalliance)
|
||||||
api(libs.cloudServices)
|
api(libs.rorledning) {
|
||||||
|
exclude(group = "com.google.guava")
|
||||||
|
}
|
||||||
api(libs.arkitektonika)
|
api(libs.arkitektonika)
|
||||||
api(libs.paster)
|
api(libs.paster)
|
||||||
}
|
}
|
||||||
@ -48,19 +50,9 @@ dependencies {
|
|||||||
tasks.processResources {
|
tasks.processResources {
|
||||||
filesMatching("plugin.properties") {
|
filesMatching("plugin.properties") {
|
||||||
expand(
|
expand(
|
||||||
"version" to project.version.toString(),
|
"version" to project.version.toString(),
|
||||||
"commit" to rootProject.grgit.head().abbreviatedId,
|
"commit" to rootProject.grgit.head().abbreviatedId,
|
||||||
"date" to rootProject.grgit.head().dateTime.format(DateTimeFormatter.ofPattern("yy.MM.dd"))
|
"date" to rootProject.grgit.head().dateTime.format(DateTimeFormatter.ofPattern("yy.MM.dd"))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
|
||||||
withType<Javadoc> {
|
|
||||||
val opt = options as StandardJavadocDocletOptions
|
|
||||||
opt.links("https://docs.enginehub.org/javadoc/com.sk89q.worldedit/worldedit-core/" + libs.worldeditCore.get().versionConstraint.toString())
|
|
||||||
opt.links("https://jd.adventure.kyori.net/api/" + libs.adventure.get().versionConstraint.toString())
|
|
||||||
opt.links("https://google.github.io/guice/api-docs/" + libs.guice.get().versionConstraint.toString() + "/javadoc/")
|
|
||||||
opt.links("https://checkerframework.org/api/")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -37,7 +37,7 @@ import com.plotsquared.core.util.ChunkManager;
|
|||||||
import com.plotsquared.core.util.EventDispatcher;
|
import com.plotsquared.core.util.EventDispatcher;
|
||||||
import com.plotsquared.core.util.SchematicHandler;
|
import com.plotsquared.core.util.SchematicHandler;
|
||||||
import com.plotsquared.core.util.query.PlotQuery;
|
import com.plotsquared.core.util.query.PlotQuery;
|
||||||
import net.kyori.adventure.text.minimessage.Template;
|
import net.kyori.adventure.text.minimessage.placeholder.Placeholder;
|
||||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||||
|
|
||||||
@ -152,9 +152,9 @@ public class PlotAPI {
|
|||||||
*/
|
*/
|
||||||
public void sendConsoleMessage(
|
public void sendConsoleMessage(
|
||||||
final @NonNull String message,
|
final @NonNull String message,
|
||||||
final @NonNull Template @NonNull ... replacements
|
final @NonNull Placeholder<?> @NonNull ... replacements
|
||||||
) {
|
) {
|
||||||
ConsolePlayer.getConsole().sendMessage(StaticCaption.of(message), replacements);
|
ConsolePlayer.getConsole().sendMessage(StaticCaption.miniMessage(message), replacements);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -165,7 +165,7 @@ public class PlotAPI {
|
|||||||
*/
|
*/
|
||||||
public void sendConsoleMessage(
|
public void sendConsoleMessage(
|
||||||
final @NonNull Caption caption,
|
final @NonNull Caption caption,
|
||||||
final @NonNull Template @NonNull ... replacements
|
final @NonNull Placeholder<?> @NonNull ... replacements
|
||||||
) {
|
) {
|
||||||
ConsolePlayer.getConsole().sendMessage(caption, replacements);
|
ConsolePlayer.getConsole().sendMessage(caption, replacements);
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -25,10 +25,10 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core;
|
package com.plotsquared.core;
|
||||||
|
|
||||||
import cloud.commandframework.services.ServicePipeline;
|
|
||||||
import com.google.inject.Injector;
|
import com.google.inject.Injector;
|
||||||
import com.google.inject.Key;
|
import com.google.inject.Key;
|
||||||
import com.google.inject.TypeLiteral;
|
import com.google.inject.TypeLiteral;
|
||||||
|
import com.intellectualsites.services.ServicePipeline;
|
||||||
import com.plotsquared.core.backup.BackupManager;
|
import com.plotsquared.core.backup.BackupManager;
|
||||||
import com.plotsquared.core.configuration.caption.LocaleHolder;
|
import com.plotsquared.core.configuration.caption.LocaleHolder;
|
||||||
import com.plotsquared.core.generator.GeneratorWrapper;
|
import com.plotsquared.core.generator.GeneratorWrapper;
|
||||||
@ -40,7 +40,6 @@ import com.plotsquared.core.permissions.PermissionHandler;
|
|||||||
import com.plotsquared.core.player.PlotPlayer;
|
import com.plotsquared.core.player.PlotPlayer;
|
||||||
import com.plotsquared.core.plot.world.PlotAreaManager;
|
import com.plotsquared.core.plot.world.PlotAreaManager;
|
||||||
import com.plotsquared.core.queue.GlobalBlockQueue;
|
import com.plotsquared.core.queue.GlobalBlockQueue;
|
||||||
import com.plotsquared.core.util.AnnotationHelper;
|
|
||||||
import com.plotsquared.core.util.ChunkManager;
|
import com.plotsquared.core.util.ChunkManager;
|
||||||
import com.plotsquared.core.util.EconHandler;
|
import com.plotsquared.core.util.EconHandler;
|
||||||
import com.plotsquared.core.util.PlatformWorldManager;
|
import com.plotsquared.core.util.PlatformWorldManager;
|
||||||
@ -274,7 +273,6 @@ public interface PlotPlatform<P> extends LocaleHolder {
|
|||||||
* Get the {@link PlotAreaManager} implementation.
|
* Get the {@link PlotAreaManager} implementation.
|
||||||
*
|
*
|
||||||
* @return the PlotAreaManager
|
* @return the PlotAreaManager
|
||||||
* @since 6.1.4
|
|
||||||
*/
|
*/
|
||||||
@NonNull PlotAreaManager plotAreaManager();
|
@NonNull PlotAreaManager plotAreaManager();
|
||||||
|
|
||||||
@ -293,15 +291,6 @@ public interface PlotPlatform<P> extends LocaleHolder {
|
|||||||
*/
|
*/
|
||||||
@NonNull String pluginsFormatted();
|
@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
|
* Load the caption maps
|
||||||
*/
|
*/
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -306,7 +306,7 @@ public class PlotSquared {
|
|||||||
*
|
*
|
||||||
* @param version First version
|
* @param version First version
|
||||||
* @param version2 Second version
|
* @param version2 Second version
|
||||||
* @return {@code true} if `version` is >= `version2`
|
* @return true if `version` is >= `version2`
|
||||||
*/
|
*/
|
||||||
public boolean checkVersion(
|
public boolean checkVersion(
|
||||||
final int[] version,
|
final int[] version,
|
||||||
@ -338,13 +338,10 @@ public class PlotSquared {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a global reference to a plot world.
|
* Add a global reference to a plot world.
|
||||||
* <p>
|
|
||||||
* You can remove the reference by calling {@link #removePlotArea(PlotArea)}
|
|
||||||
* </p>
|
|
||||||
*
|
*
|
||||||
* @param plotArea the {@link PlotArea} to add.
|
* @param plotArea the {@link PlotArea} to add.
|
||||||
|
* @see #removePlotArea(PlotArea) To remove the reference
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public void addPlotArea(final @NonNull PlotArea plotArea) {
|
public void addPlotArea(final @NonNull PlotArea plotArea) {
|
||||||
HashMap<PlotId, Plot> plots;
|
HashMap<PlotId, Plot> plots;
|
||||||
if (plots_tmp == null || (plots = plots_tmp.remove(plotArea.toString())) == null) {
|
if (plots_tmp == null || (plots = plots_tmp.remove(plotArea.toString())) == null) {
|
||||||
@ -559,7 +556,6 @@ public class PlotSquared {
|
|||||||
*
|
*
|
||||||
* @param input an array of plots to sort
|
* @param input an array of plots to sort
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
private void sortPlotsByHash(final @NonNull Plot @NonNull [] input) {
|
private void sortPlotsByHash(final @NonNull Plot @NonNull [] input) {
|
||||||
List<Plot>[] bucket = new ArrayList[32];
|
List<Plot>[] bucket = new ArrayList[32];
|
||||||
Arrays.fill(bucket, new ArrayList<>());
|
Arrays.fill(bucket, new ArrayList<>());
|
||||||
@ -700,12 +696,20 @@ public class PlotSquared {
|
|||||||
ArrayList<Plot> toReturn = new ArrayList<>(plots.size());
|
ArrayList<Plot> toReturn = new ArrayList<>(plots.size());
|
||||||
for (PlotArea area : areas) {
|
for (PlotArea area : areas) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case CREATION_DATE -> toReturn.addAll(sortPlotsByTemp(map.get(area)));
|
case CREATION_DATE:
|
||||||
case CREATION_DATE_TIMESTAMP -> toReturn.addAll(sortPlotsByTimestamp(map.get(area)));
|
toReturn.addAll(sortPlotsByTemp(map.get(area)));
|
||||||
case DISTANCE_FROM_ORIGIN -> toReturn.addAll(sortPlotsByHash(map.get(area)));
|
break;
|
||||||
case LAST_MODIFIED -> toReturn.addAll(sortPlotsByModified(map.get(area)));
|
case CREATION_DATE_TIMESTAMP:
|
||||||
default -> {
|
toReturn.addAll(sortPlotsByTimestamp(map.get(area)));
|
||||||
}
|
break;
|
||||||
|
case DISTANCE_FROM_ORIGIN:
|
||||||
|
toReturn.addAll(sortPlotsByHash(map.get(area)));
|
||||||
|
break;
|
||||||
|
case LAST_MODIFIED:
|
||||||
|
toReturn.addAll(sortPlotsByModified(map.get(area)));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return toReturn;
|
return toReturn;
|
||||||
@ -735,7 +739,7 @@ public class PlotSquared {
|
|||||||
*
|
*
|
||||||
* @param plot the plot to remove
|
* @param plot the plot to remove
|
||||||
* @param callEvent If to call an event about the plot being removed
|
* @param callEvent If to call an event about the plot being removed
|
||||||
* @return {@code true} if plot existed | {@code false} if it didn't
|
* @return true if plot existed | false if it didn't
|
||||||
*/
|
*/
|
||||||
public boolean removePlot(
|
public boolean removePlot(
|
||||||
final @NonNull Plot plot,
|
final @NonNull Plot plot,
|
||||||
@ -1478,7 +1482,7 @@ public class PlotSquared {
|
|||||||
*
|
*
|
||||||
* @param world World name
|
* @param world World name
|
||||||
* @param chunkCoordinates Chunk coordinates
|
* @param chunkCoordinates Chunk coordinates
|
||||||
* @return {@code true} if the chunk uses non-standard generation, {@code false} if not
|
* @return True if the chunk uses non-standard generation, false if not
|
||||||
*/
|
*/
|
||||||
public boolean isNonStandardGeneration(
|
public boolean isNonStandardGeneration(
|
||||||
final @NonNull String world,
|
final @NonNull String world,
|
||||||
@ -1523,12 +1527,10 @@ public class PlotSquared {
|
|||||||
/**
|
/**
|
||||||
* Get the caption map belonging to a namespace. If none exists, a dummy
|
* Get the caption map belonging to a namespace. If none exists, a dummy
|
||||||
* caption map will be returned.
|
* caption map will be returned.
|
||||||
* <p>
|
|
||||||
* You can register a caption map by calling {@link #registerCaptionMap(String, CaptionMap)}
|
|
||||||
* </p>
|
|
||||||
*
|
*
|
||||||
* @param namespace Namespace
|
* @param namespace Namespace
|
||||||
* @return Map instance
|
* @return Map instance
|
||||||
|
* @see #registerCaptionMap(String, CaptionMap) To register a caption map
|
||||||
*/
|
*/
|
||||||
public @NonNull CaptionMap getCaptionMap(final @NonNull String namespace) {
|
public @NonNull CaptionMap getCaptionMap(final @NonNull String namespace) {
|
||||||
return this.captionMaps.computeIfAbsent(
|
return this.captionMaps.computeIfAbsent(
|
||||||
@ -1538,7 +1540,7 @@ public class PlotSquared {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register a caption map. The namespace needs to be equal to the namespace used for
|
* Register a caption map. The namespace needs be equal to the namespace used for
|
||||||
* the {@link TranslatableCaption}s inside the map.
|
* the {@link TranslatableCaption}s inside the map.
|
||||||
*
|
*
|
||||||
* @param namespace Namespace
|
* @param namespace Namespace
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -122,7 +122,7 @@ public final class PlotVersion {
|
|||||||
* Compare a given version string with the one cached here.
|
* Compare a given version string with the one cached here.
|
||||||
*
|
*
|
||||||
* @param versionString the version to compare
|
* @param versionString the version to compare
|
||||||
* @return {@code true} if the given version is a "later" version
|
* @return true if the given version is a "later" version
|
||||||
*/
|
*/
|
||||||
public boolean isLaterVersion(final @NonNull String versionString) {
|
public boolean isLaterVersion(final @NonNull String versionString) {
|
||||||
int dash = versionString.indexOf('-');
|
int dash = versionString.indexOf('-');
|
||||||
@ -144,7 +144,7 @@ public final class PlotVersion {
|
|||||||
* Compare a given version with the one cached here.
|
* Compare a given version with the one cached here.
|
||||||
*
|
*
|
||||||
* @param verArray the version to compare
|
* @param verArray the version to compare
|
||||||
* @return {@code true} if the given version is a "later" version
|
* @return true if the given version is a "later" version
|
||||||
*/
|
*/
|
||||||
public boolean isLaterVersion(int[] verArray) {
|
public boolean isLaterVersion(int[] verArray) {
|
||||||
if (verArray[0] > version[0]) {
|
if (verArray[0] > version[0]) {
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -88,7 +88,7 @@ public interface BackupManager {
|
|||||||
* Returns true if (potentially) destructive actions should cause
|
* Returns true if (potentially) destructive actions should cause
|
||||||
* PlotSquared to create automatic plot backups
|
* PlotSquared to create automatic plot backups
|
||||||
*
|
*
|
||||||
* @return {@code true} if automatic backups are enabled
|
* @return True if automatic backups are enabled
|
||||||
*/
|
*/
|
||||||
boolean shouldAutomaticallyBackup();
|
boolean shouldAutomaticallyBackup();
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -209,7 +209,7 @@ public class PlayerBackupProfile implements BackupProfile {
|
|||||||
} else {
|
} else {
|
||||||
future.completeExceptionally(new RuntimeException(MINI_MESSAGE.stripTokens(
|
future.completeExceptionally(new RuntimeException(MINI_MESSAGE.stripTokens(
|
||||||
TranslatableCaption
|
TranslatableCaption
|
||||||
.of("schematics.schematic_paste_failed")
|
.miniMessage("schematics.schematic_paste_failed")
|
||||||
.getComponent(ConsolePlayer.getConsole()))));
|
.getComponent(ConsolePlayer.getConsole()))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -31,13 +31,12 @@ import com.google.inject.Inject;
|
|||||||
import com.google.inject.Singleton;
|
import com.google.inject.Singleton;
|
||||||
import com.plotsquared.core.PlotSquared;
|
import com.plotsquared.core.PlotSquared;
|
||||||
import com.plotsquared.core.configuration.Settings;
|
import com.plotsquared.core.configuration.Settings;
|
||||||
import com.plotsquared.core.configuration.caption.Templates;
|
import com.plotsquared.core.configuration.caption.Placeholders;
|
||||||
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.inject.factory.PlayerBackupProfileFactory;
|
import com.plotsquared.core.inject.factory.PlayerBackupProfileFactory;
|
||||||
import com.plotsquared.core.player.PlotPlayer;
|
import com.plotsquared.core.player.PlotPlayer;
|
||||||
import com.plotsquared.core.plot.Plot;
|
import com.plotsquared.core.plot.Plot;
|
||||||
import com.plotsquared.core.util.task.TaskManager;
|
import com.plotsquared.core.util.task.TaskManager;
|
||||||
import net.kyori.adventure.text.minimessage.Template;
|
|
||||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||||
|
|
||||||
@ -106,22 +105,22 @@ public class SimpleBackupManager implements BackupManager {
|
|||||||
} else {
|
} else {
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("backups.backup_automatic_started"),
|
TranslatableCaption.miniMessage("backups.backup_automatic_started"),
|
||||||
Template.of("plot", plot.getId().toString())
|
Placeholders.miniMessage("plot", plot.getId().toString())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
profile.createBackup().whenComplete((backup, throwable) -> {
|
profile.createBackup().whenComplete((backup, throwable) -> {
|
||||||
if (throwable != null) {
|
if (throwable != null) {
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("backups.backup_automatic_failure"),
|
TranslatableCaption.miniMessage("backups.backup_automatic_failure"),
|
||||||
Templates.of("reason", throwable.getMessage())
|
Placeholders.miniMessage("reason", throwable.getMessage())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
throwable.printStackTrace();
|
throwable.printStackTrace();
|
||||||
} else {
|
} else {
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
player.sendMessage(TranslatableCaption.of("backups.backup_automatic_finished"));
|
player.sendMessage(TranslatableCaption.miniMessage("backups.backup_automatic_finished"));
|
||||||
TaskManager.runTaskAsync(whenDone);
|
TaskManager.runTaskAsync(whenDone);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -29,8 +29,7 @@ import java.util.Arrays;
|
|||||||
|
|
||||||
public class ArrayUtil {
|
public class ArrayUtil {
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
public static final <T> T[] concatAll(T[] first, T[]... rest) {
|
||||||
public static <T> T[] concatAll(T[] first, T[]... rest) {
|
|
||||||
int totalLength = first.length;
|
int totalLength = first.length;
|
||||||
for (T[] array : rest) {
|
for (T[] array : rest) {
|
||||||
totalLength += array.length;
|
totalLength += array.length;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -35,7 +35,6 @@ public class FlatRandomCollection<T> extends RandomCollection<T> {
|
|||||||
|
|
||||||
private final T[] values;
|
private final T[] values;
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public FlatRandomCollection(Map<T, Double> weights, Random random) {
|
public FlatRandomCollection(Map<T, Double> weights, Random random) {
|
||||||
super(weights, random);
|
super(weights, random);
|
||||||
int max = 0;
|
int max = 0;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -241,7 +241,6 @@ public class QuadMap<T> {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public void recalculateSkip() {
|
public void recalculateSkip() {
|
||||||
QuadMap<T> map = null;
|
QuadMap<T> map = null;
|
||||||
for (QuadMap<T> current : new QuadMap[]{this.one, this.two, this.three, this.four}) {
|
for (QuadMap<T> current : new QuadMap[]{this.one, this.two, this.three, this.four}) {
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* | |
|
* | |
|
||||||
* |_|
|
* |_|
|
||||||
* PlotSquared plot management system for Minecraft
|
* PlotSquared plot management system for Minecraft
|
||||||
* Copyright (C) 2014 - 2022 IntellectualSites
|
* Copyright (C) 2021 IntellectualSites
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* 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