mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-07-04 14:44:43 +02:00
Compare commits
1 Commits
fix/v7/buk
...
fix/plotMu
Author | SHA1 | Date | |
---|---|---|---|
8607b9c49c |
2
.github/workflows/build-pr.yml
vendored
2
.github/workflows/build-pr.yml
vendored
@ -11,7 +11,7 @@ jobs:
|
|||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: Validate Gradle Wrapper
|
- name: Validate Gradle Wrapper
|
||||||
uses: gradle/actions/wrapper-validation@v3
|
uses: gradle/wrapper-validation-action@v2
|
||||||
- name: Setup Java
|
- name: Setup Java
|
||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
|
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@ -11,7 +11,7 @@ jobs:
|
|||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: Validate Gradle Wrapper
|
- name: Validate Gradle Wrapper
|
||||||
uses: gradle/actions/wrapper-validation@v3
|
uses: gradle/wrapper-validation-action@v2
|
||||||
- name: Setup Java
|
- name: Setup Java
|
||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
|
2
.github/workflows/label-merge-conflicts.yaml
vendored
2
.github/workflows/label-merge-conflicts.yaml
vendored
@ -15,7 +15,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Label conflicting PRs
|
- name: Label conflicting PRs
|
||||||
uses: eps1lon/actions-label-merge-conflict@v3.0.2
|
uses: eps1lon/actions-label-merge-conflict@v3.0.0
|
||||||
with:
|
with:
|
||||||
dirtyLabel: "unresolved-merge-conflict"
|
dirtyLabel: "unresolved-merge-conflict"
|
||||||
repoToken: "${{ secrets.GITHUB_TOKEN }}"
|
repoToken: "${{ secrets.GITHUB_TOKEN }}"
|
||||||
|
@ -113,6 +113,5 @@ tasks {
|
|||||||
opt.encoding("UTF-8")
|
opt.encoding("UTF-8")
|
||||||
opt.keyWords()
|
opt.keyWords()
|
||||||
opt.addStringOption("-since", isRelease)
|
opt.addStringOption("-since", isRelease)
|
||||||
opt.noTimestamp()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,7 @@ import com.google.inject.Injector;
|
|||||||
import com.google.inject.Key;
|
import com.google.inject.Key;
|
||||||
import com.google.inject.Singleton;
|
import com.google.inject.Singleton;
|
||||||
import com.google.inject.Stage;
|
import com.google.inject.Stage;
|
||||||
|
import com.google.inject.TypeLiteral;
|
||||||
import com.plotsquared.bukkit.generator.BukkitPlotGenerator;
|
import com.plotsquared.bukkit.generator.BukkitPlotGenerator;
|
||||||
import com.plotsquared.bukkit.inject.BackupModule;
|
import com.plotsquared.bukkit.inject.BackupModule;
|
||||||
import com.plotsquared.bukkit.inject.BukkitModule;
|
import com.plotsquared.bukkit.inject.BukkitModule;
|
||||||
@ -34,7 +35,6 @@ import com.plotsquared.bukkit.listener.BlockEventListener117;
|
|||||||
import com.plotsquared.bukkit.listener.ChunkListener;
|
import com.plotsquared.bukkit.listener.ChunkListener;
|
||||||
import com.plotsquared.bukkit.listener.EntityEventListener;
|
import com.plotsquared.bukkit.listener.EntityEventListener;
|
||||||
import com.plotsquared.bukkit.listener.EntitySpawnListener;
|
import com.plotsquared.bukkit.listener.EntitySpawnListener;
|
||||||
import com.plotsquared.bukkit.listener.HighFreqBlockEventListener;
|
|
||||||
import com.plotsquared.bukkit.listener.PaperListener;
|
import com.plotsquared.bukkit.listener.PaperListener;
|
||||||
import com.plotsquared.bukkit.listener.PlayerEventListener;
|
import com.plotsquared.bukkit.listener.PlayerEventListener;
|
||||||
import com.plotsquared.bukkit.listener.PlayerEventListener1201;
|
import com.plotsquared.bukkit.listener.PlayerEventListener1201;
|
||||||
@ -45,6 +45,7 @@ import com.plotsquared.bukkit.listener.SpigotListener;
|
|||||||
import com.plotsquared.bukkit.listener.WorldEvents;
|
import com.plotsquared.bukkit.listener.WorldEvents;
|
||||||
import com.plotsquared.bukkit.placeholder.PAPIPlaceholders;
|
import com.plotsquared.bukkit.placeholder.PAPIPlaceholders;
|
||||||
import com.plotsquared.bukkit.placeholder.PlaceholderFormatter;
|
import com.plotsquared.bukkit.placeholder.PlaceholderFormatter;
|
||||||
|
import com.plotsquared.bukkit.player.BukkitPlayer;
|
||||||
import com.plotsquared.bukkit.player.BukkitPlayerManager;
|
import com.plotsquared.bukkit.player.BukkitPlayerManager;
|
||||||
import com.plotsquared.bukkit.util.BukkitUtil;
|
import com.plotsquared.bukkit.util.BukkitUtil;
|
||||||
import com.plotsquared.bukkit.util.BukkitWorld;
|
import com.plotsquared.bukkit.util.BukkitWorld;
|
||||||
@ -363,9 +364,6 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
|||||||
getServer().getPluginManager().registerEvents(injector().getInstance(PlayerEventListener1201.class), this);
|
getServer().getPluginManager().registerEvents(injector().getInstance(PlayerEventListener1201.class), this);
|
||||||
}
|
}
|
||||||
getServer().getPluginManager().registerEvents(injector().getInstance(BlockEventListener.class), this);
|
getServer().getPluginManager().registerEvents(injector().getInstance(BlockEventListener.class), this);
|
||||||
if (Settings.HIGH_FREQUENCY_LISTENER) {
|
|
||||||
getServer().getPluginManager().registerEvents(injector().getInstance(HighFreqBlockEventListener.class), this);
|
|
||||||
}
|
|
||||||
if (serverVersion()[1] >= 17) {
|
if (serverVersion()[1] >= 17) {
|
||||||
getServer().getPluginManager().registerEvents(injector().getInstance(BlockEventListener117.class), this);
|
getServer().getPluginManager().registerEvents(injector().getInstance(BlockEventListener117.class), this);
|
||||||
}
|
}
|
||||||
@ -1273,13 +1271,15 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public @NonNull PlatformWorldManager<?> worldManager() {
|
public @NonNull PlatformWorldManager<?> worldManager() {
|
||||||
return this.worldManager;
|
return injector().getInstance(Key.get(new TypeLiteral<PlatformWorldManager<World>>() {
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@NonNull
|
@NonNull
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public PlayerManager<? extends PlotPlayer<Player>, ? extends Player> playerManager() {
|
public PlayerManager<? extends PlotPlayer<Player>, ? extends Player> playerManager() {
|
||||||
return this.playerManager;
|
return (PlayerManager<BukkitPlayer, Player>) injector().getInstance(PlayerManager.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -24,6 +24,7 @@ import com.plotsquared.bukkit.util.BukkitUtil;
|
|||||||
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.TranslatableCaption;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
|
import com.plotsquared.core.database.DBFunc;
|
||||||
import com.plotsquared.core.location.Location;
|
import com.plotsquared.core.location.Location;
|
||||||
import com.plotsquared.core.permissions.Permission;
|
import com.plotsquared.core.permissions.Permission;
|
||||||
import com.plotsquared.core.player.PlotPlayer;
|
import com.plotsquared.core.player.PlotPlayer;
|
||||||
@ -47,6 +48,7 @@ import com.plotsquared.core.plot.flag.implementations.LeafDecayFlag;
|
|||||||
import com.plotsquared.core.plot.flag.implementations.LiquidFlowFlag;
|
import com.plotsquared.core.plot.flag.implementations.LiquidFlowFlag;
|
||||||
import com.plotsquared.core.plot.flag.implementations.MycelGrowFlag;
|
import com.plotsquared.core.plot.flag.implementations.MycelGrowFlag;
|
||||||
import com.plotsquared.core.plot.flag.implementations.PlaceFlag;
|
import com.plotsquared.core.plot.flag.implementations.PlaceFlag;
|
||||||
|
import com.plotsquared.core.plot.flag.implementations.RedstoneFlag;
|
||||||
import com.plotsquared.core.plot.flag.implementations.SnowFormFlag;
|
import com.plotsquared.core.plot.flag.implementations.SnowFormFlag;
|
||||||
import com.plotsquared.core.plot.flag.implementations.SnowMeltFlag;
|
import com.plotsquared.core.plot.flag.implementations.SnowMeltFlag;
|
||||||
import com.plotsquared.core.plot.flag.implementations.SoilDryFlag;
|
import com.plotsquared.core.plot.flag.implementations.SoilDryFlag;
|
||||||
@ -60,6 +62,7 @@ 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.Component;
|
||||||
import net.kyori.adventure.text.minimessage.tag.Tag;
|
import net.kyori.adventure.text.minimessage.tag.Tag;
|
||||||
import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver;
|
import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
@ -89,9 +92,11 @@ 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.BlockMultiPlaceEvent;
|
||||||
|
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;
|
||||||
import org.bukkit.event.block.BlockPlaceEvent;
|
import org.bukkit.event.block.BlockPlaceEvent;
|
||||||
|
import org.bukkit.event.block.BlockRedstoneEvent;
|
||||||
import org.bukkit.event.block.BlockSpreadEvent;
|
import org.bukkit.event.block.BlockSpreadEvent;
|
||||||
import org.bukkit.event.block.CauldronLevelChangeEvent;
|
import org.bukkit.event.block.CauldronLevelChangeEvent;
|
||||||
import org.bukkit.event.block.EntityBlockFormEvent;
|
import org.bukkit.event.block.EntityBlockFormEvent;
|
||||||
@ -107,6 +112,7 @@ import java.util.Iterator;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
@ -117,6 +123,14 @@ import static org.bukkit.Tag.WALL_CORALS;
|
|||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
public class BlockEventListener implements Listener {
|
public class BlockEventListener implements Listener {
|
||||||
|
|
||||||
|
private static final Set<Material> PISTONS = Set.of(
|
||||||
|
Material.PISTON,
|
||||||
|
Material.STICKY_PISTON
|
||||||
|
);
|
||||||
|
private static final Set<Material> PHYSICS_BLOCKS = Set.of(
|
||||||
|
Material.TURTLE_EGG,
|
||||||
|
Material.TURTLE_SPAWN_EGG
|
||||||
|
);
|
||||||
private static final Set<Material> SNOW = Stream.of(Material.values()) // needed as Tag.SNOW isn't present in 1.16.5
|
private static final Set<Material> SNOW = Stream.of(Material.values()) // needed as Tag.SNOW isn't present in 1.16.5
|
||||||
.filter(material -> material.name().contains("SNOW"))
|
.filter(material -> material.name().contains("SNOW"))
|
||||||
.filter(Material::isBlock)
|
.filter(Material::isBlock)
|
||||||
@ -150,6 +164,114 @@ public class BlockEventListener implements Listener {
|
|||||||
}, TaskTime.ticks(3L));
|
}, TaskTime.ticks(3L));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onRedstoneEvent(BlockRedstoneEvent event) {
|
||||||
|
Block block = event.getBlock();
|
||||||
|
Location location = BukkitUtil.adapt(block.getLocation());
|
||||||
|
PlotArea area = location.getPlotArea();
|
||||||
|
if (area == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Plot plot = location.getOwnedPlot();
|
||||||
|
if (plot == null) {
|
||||||
|
if (PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, RedstoneFlag.class, false)) {
|
||||||
|
event.setNewCurrent(0);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!plot.getFlag(RedstoneFlag.class)) {
|
||||||
|
event.setNewCurrent(0);
|
||||||
|
plot.debug("Redstone event was cancelled because redstone = false");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (Settings.Redstone.DISABLE_OFFLINE) {
|
||||||
|
boolean disable = false;
|
||||||
|
if (!DBFunc.SERVER.equals(plot.getOwner())) {
|
||||||
|
if (plot.isMerged()) {
|
||||||
|
disable = true;
|
||||||
|
for (UUID owner : plot.getOwners()) {
|
||||||
|
if (PlotSquared.platform().playerManager().getPlayerIfExists(owner) != null) {
|
||||||
|
disable = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
disable = PlotSquared.platform().playerManager().getPlayerIfExists(plot.getOwnerAbs()) == null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (disable) {
|
||||||
|
for (UUID trusted : plot.getTrusted()) {
|
||||||
|
if (PlotSquared.platform().playerManager().getPlayerIfExists(trusted) != null) {
|
||||||
|
disable = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (disable) {
|
||||||
|
event.setNewCurrent(0);
|
||||||
|
plot.debug("Redstone event was cancelled because no trusted player was in the plot");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (Settings.Redstone.DISABLE_UNOCCUPIED) {
|
||||||
|
for (final PlotPlayer<?> player : PlotSquared.platform().playerManager().getPlayers()) {
|
||||||
|
if (plot.equals(player.getCurrentPlot())) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
event.setNewCurrent(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST)
|
||||||
|
public void onPhysicsEvent(BlockPhysicsEvent event) {
|
||||||
|
Block block = event.getBlock();
|
||||||
|
Location location = BukkitUtil.adapt(block.getLocation());
|
||||||
|
PlotArea area = location.getPlotArea();
|
||||||
|
if (area == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Plot plot = area.getOwnedPlotAbs(location);
|
||||||
|
if (plot == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (event.getChangedType().hasGravity() && plot.getFlag(DisablePhysicsFlag.class)) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
sendBlockChange(event.getBlock().getLocation(), event.getBlock().getBlockData());
|
||||||
|
plot.debug("Prevented block physics and resent block change because disable-physics = true");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (event.getChangedType() == Material.COMPARATOR) {
|
||||||
|
if (!plot.getFlag(RedstoneFlag.class)) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
plot.debug("Prevented comparator update because redstone = false");
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (PHYSICS_BLOCKS.contains(event.getChangedType())) {
|
||||||
|
if (plot.getFlag(DisablePhysicsFlag.class)) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
plot.debug("Prevented block physics because disable-physics = true");
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (Settings.Redstone.DETECT_INVALID_EDGE_PISTONS) {
|
||||||
|
if (PISTONS.contains(block.getType())) {
|
||||||
|
org.bukkit.block.data.Directional piston = (org.bukkit.block.data.Directional) block.getBlockData();
|
||||||
|
final BlockFace facing = piston.getFacing();
|
||||||
|
location = location.add(facing.getModX(), facing.getModY(), facing.getModZ());
|
||||||
|
Plot newPlot = area.getOwnedPlotAbs(location);
|
||||||
|
if (plot.equals(newPlot)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!plot.isMerged() || !plot.getConnectedPlots().contains(newPlot)) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
plot.debug("Prevented piston update because of invalid edge piston detection");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
public void blockCreate(BlockPlaceEvent event) {
|
public void blockCreate(BlockPlaceEvent event) {
|
||||||
Location location = BukkitUtil.adapt(event.getBlock().getLocation());
|
Location location = BukkitUtil.adapt(event.getBlock().getLocation());
|
||||||
@ -163,6 +285,13 @@ public class BlockEventListener implements Listener {
|
|||||||
if (plot != null) {
|
if (plot != null) {
|
||||||
if (area.notifyIfOutsideBuildArea(pp, location.getY())) {
|
if (area.notifyIfOutsideBuildArea(pp, location.getY())) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
pp.sendMessage(
|
||||||
|
TranslatableCaption.of("height.height_limit"),
|
||||||
|
TagResolver.builder()
|
||||||
|
.tag("minheight", Tag.inserting(Component.text(area.getMinBuildHeight())))
|
||||||
|
.tag("maxheight", Tag.inserting(Component.text(area.getMaxBuildHeight())))
|
||||||
|
.build()
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!plot.hasOwner()) {
|
if (!plot.hasOwner()) {
|
||||||
@ -254,6 +383,13 @@ public class BlockEventListener implements Listener {
|
|||||||
}
|
}
|
||||||
} else if (area.notifyIfOutsideBuildArea(plotPlayer, location.getY())) {
|
} else if (area.notifyIfOutsideBuildArea(plotPlayer, location.getY())) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
plotPlayer.sendMessage(
|
||||||
|
TranslatableCaption.of("height.height_limit"),
|
||||||
|
TagResolver.builder()
|
||||||
|
.tag("minheight", Tag.inserting(Component.text(area.getMinBuildHeight())))
|
||||||
|
.tag("maxheight", Tag.inserting(Component.text(area.getMaxBuildHeight())))
|
||||||
|
.build()
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!plot.hasOwner()) {
|
if (!plot.hasOwner()) {
|
||||||
@ -1209,11 +1345,20 @@ public class BlockEventListener implements Listener {
|
|||||||
if (pp.hasPermission(Permission.PERMISSION_ADMIN_BUILD_HEIGHT_LIMIT)) {
|
if (pp.hasPermission(Permission.PERMISSION_ADMIN_BUILD_HEIGHT_LIMIT)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (currentLocation.getY() >= area.getMaxBuildHeight() || currentLocation.getY() < area.getMinBuildHeight()) {
|
||||||
|
pp.sendMessage(
|
||||||
|
TranslatableCaption.of("height.height_limit"),
|
||||||
|
TagResolver.builder()
|
||||||
|
.tag("minheight", Tag.inserting(Component.text(area.getMinBuildHeight())))
|
||||||
|
.tag("maxheight", Tag.inserting(Component.text(area.getMaxBuildHeight())))
|
||||||
|
.build()
|
||||||
|
);
|
||||||
if (area.notifyIfOutsideBuildArea(pp, currentLocation.getY())) {
|
if (area.notifyIfOutsideBuildArea(pp, currentLocation.getY())) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,201 +0,0 @@
|
|||||||
/*
|
|
||||||
* PlotSquared, a land and world management plugin for Minecraft.
|
|
||||||
* Copyright (C) IntellectualSites <https://intellectualsites.com>
|
|
||||||
* Copyright (C) IntellectualSites team and contributors
|
|
||||||
*
|
|
||||||
* 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
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
package com.plotsquared.bukkit.listener;
|
|
||||||
|
|
||||||
import com.google.inject.Inject;
|
|
||||||
import com.plotsquared.bukkit.player.BukkitPlayer;
|
|
||||||
import com.plotsquared.bukkit.util.BukkitUtil;
|
|
||||||
import com.plotsquared.core.PlotSquared;
|
|
||||||
import com.plotsquared.core.configuration.Settings;
|
|
||||||
import com.plotsquared.core.database.DBFunc;
|
|
||||||
import com.plotsquared.core.location.Location;
|
|
||||||
import com.plotsquared.core.player.PlotPlayer;
|
|
||||||
import com.plotsquared.core.plot.Plot;
|
|
||||||
import com.plotsquared.core.plot.PlotArea;
|
|
||||||
import com.plotsquared.core.plot.flag.implementations.DisablePhysicsFlag;
|
|
||||||
import com.plotsquared.core.plot.flag.implementations.RedstoneFlag;
|
|
||||||
import com.plotsquared.core.plot.world.PlotAreaManager;
|
|
||||||
import com.plotsquared.core.util.PlotFlagUtil;
|
|
||||||
import com.plotsquared.core.util.task.TaskManager;
|
|
||||||
import com.plotsquared.core.util.task.TaskTime;
|
|
||||||
import com.sk89q.worldedit.WorldEdit;
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.block.Block;
|
|
||||||
import org.bukkit.block.BlockFace;
|
|
||||||
import org.bukkit.block.data.BlockData;
|
|
||||||
import org.bukkit.event.EventHandler;
|
|
||||||
import org.bukkit.event.EventPriority;
|
|
||||||
import org.bukkit.event.Listener;
|
|
||||||
import org.bukkit.event.block.BlockPhysicsEvent;
|
|
||||||
import org.bukkit.event.block.BlockRedstoneEvent;
|
|
||||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
|
||||||
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
public class HighFreqBlockEventListener implements Listener {
|
|
||||||
|
|
||||||
private static final Set<Material> PISTONS = Set.of(
|
|
||||||
Material.PISTON,
|
|
||||||
Material.STICKY_PISTON
|
|
||||||
);
|
|
||||||
private static final Set<Material> PHYSICS_BLOCKS = Set.of(
|
|
||||||
Material.TURTLE_EGG,
|
|
||||||
Material.TURTLE_SPAWN_EGG
|
|
||||||
);
|
|
||||||
|
|
||||||
private final PlotAreaManager plotAreaManager;
|
|
||||||
private final WorldEdit worldEdit;
|
|
||||||
|
|
||||||
@Inject
|
|
||||||
public HighFreqBlockEventListener(final @NonNull PlotAreaManager plotAreaManager, final @NonNull WorldEdit worldEdit) {
|
|
||||||
this.plotAreaManager = plotAreaManager;
|
|
||||||
this.worldEdit = worldEdit;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void sendBlockChange(final org.bukkit.Location bloc, final BlockData data) {
|
|
||||||
TaskManager.runTaskLater(() -> {
|
|
||||||
String world = bloc.getWorld().getName();
|
|
||||||
int x = bloc.getBlockX();
|
|
||||||
int z = bloc.getBlockZ();
|
|
||||||
int distance = Bukkit.getViewDistance() * 16;
|
|
||||||
|
|
||||||
for (final PlotPlayer<?> player : PlotSquared.platform().playerManager().getPlayers()) {
|
|
||||||
Location location = player.getLocation();
|
|
||||||
if (location.getWorldName().equals(world)) {
|
|
||||||
if (16 * Math.abs(location.getX() - x) / 16 > distance || 16 * Math.abs(location.getZ() - z) / 16 > distance) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
((BukkitPlayer) player).player.sendBlockChange(bloc, data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, TaskTime.ticks(3L));
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void onRedstoneEvent(BlockRedstoneEvent event) {
|
|
||||||
Block block = event.getBlock();
|
|
||||||
Location location = BukkitUtil.adapt(block.getLocation());
|
|
||||||
PlotArea area = location.getPlotArea();
|
|
||||||
if (area == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Plot plot = location.getOwnedPlot();
|
|
||||||
if (plot == null) {
|
|
||||||
if (PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, RedstoneFlag.class, false)) {
|
|
||||||
event.setNewCurrent(0);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!plot.getFlag(RedstoneFlag.class)) {
|
|
||||||
event.setNewCurrent(0);
|
|
||||||
plot.debug("Redstone event was cancelled because redstone = false");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (Settings.Redstone.DISABLE_OFFLINE) {
|
|
||||||
boolean disable = false;
|
|
||||||
if (!DBFunc.SERVER.equals(plot.getOwner())) {
|
|
||||||
if (plot.isMerged()) {
|
|
||||||
disable = true;
|
|
||||||
for (UUID owner : plot.getOwners()) {
|
|
||||||
if (PlotSquared.platform().playerManager().getPlayerIfExists(owner) != null) {
|
|
||||||
disable = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
disable = PlotSquared.platform().playerManager().getPlayerIfExists(plot.getOwnerAbs()) == null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (disable) {
|
|
||||||
for (UUID trusted : plot.getTrusted()) {
|
|
||||||
if (PlotSquared.platform().playerManager().getPlayerIfExists(trusted) != null) {
|
|
||||||
disable = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (disable) {
|
|
||||||
event.setNewCurrent(0);
|
|
||||||
plot.debug("Redstone event was cancelled because no trusted player was in the plot");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (Settings.Redstone.DISABLE_UNOCCUPIED) {
|
|
||||||
for (final PlotPlayer<?> player : PlotSquared.platform().playerManager().getPlayers()) {
|
|
||||||
if (plot.equals(player.getCurrentPlot())) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
event.setNewCurrent(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST)
|
|
||||||
public void onPhysicsEvent(BlockPhysicsEvent event) {
|
|
||||||
Block block = event.getBlock();
|
|
||||||
Location location = BukkitUtil.adapt(block.getLocation());
|
|
||||||
PlotArea area = location.getPlotArea();
|
|
||||||
if (area == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Plot plot = area.getOwnedPlotAbs(location);
|
|
||||||
if (plot == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (event.getChangedType().hasGravity() && plot.getFlag(DisablePhysicsFlag.class)) {
|
|
||||||
event.setCancelled(true);
|
|
||||||
sendBlockChange(event.getBlock().getLocation(), event.getBlock().getBlockData());
|
|
||||||
plot.debug("Prevented block physics and resent block change because disable-physics = true");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (event.getChangedType() == Material.COMPARATOR) {
|
|
||||||
if (!plot.getFlag(RedstoneFlag.class)) {
|
|
||||||
event.setCancelled(true);
|
|
||||||
plot.debug("Prevented comparator update because redstone = false");
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (PHYSICS_BLOCKS.contains(event.getChangedType())) {
|
|
||||||
if (plot.getFlag(DisablePhysicsFlag.class)) {
|
|
||||||
event.setCancelled(true);
|
|
||||||
plot.debug("Prevented block physics because disable-physics = true");
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (Settings.Redstone.DETECT_INVALID_EDGE_PISTONS) {
|
|
||||||
if (PISTONS.contains(block.getType())) {
|
|
||||||
org.bukkit.block.data.Directional piston = (org.bukkit.block.data.Directional) block.getBlockData();
|
|
||||||
final BlockFace facing = piston.getFacing();
|
|
||||||
location = location.add(facing.getModX(), facing.getModY(), facing.getModZ());
|
|
||||||
Plot newPlot = area.getOwnedPlotAbs(location);
|
|
||||||
if (plot.equals(newPlot)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!plot.isMerged() || !plot.getConnectedPlots().contains(newPlot)) {
|
|
||||||
event.setCancelled(true);
|
|
||||||
plot.debug("Prevented piston update because of invalid edge piston detection");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -95,8 +95,7 @@ public class SingleWorldListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler(priority = EventPriority.LOWEST)
|
@EventHandler(priority = EventPriority.LOWEST)
|
||||||
public void onChunkLoad(ChunkLoadEvent event) {
|
public void onChunkLoad(ChunkLoadEvent event) {
|
||||||
// disable this for now, should address https://github.com/IntellectualSites/PlotSquared/issues/4413
|
handle(event);
|
||||||
// handle(event);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -23,15 +23,11 @@ import com.plotsquared.core.location.World;
|
|||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||||
|
|
||||||
import java.lang.ref.SoftReference;
|
|
||||||
import java.lang.ref.WeakReference;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class BukkitWorld implements World<org.bukkit.World> {
|
public class BukkitWorld implements World<org.bukkit.World> {
|
||||||
|
|
||||||
// Upon world unload we should probably have the P2 BukkitWorld be GCed relatively eagerly, thus freeing the bukkit world.
|
private static final Map<String, BukkitWorld> worldMap = Maps.newHashMap();
|
||||||
// We also want to avoid circumstances where a bukkit world has been GCed, but a P2 BukkitWorld has not
|
|
||||||
private static final Map<String, WeakReference<BukkitWorld>> worldMap = Maps.newHashMap();
|
|
||||||
private static final boolean HAS_MIN_Y;
|
private static final boolean HAS_MIN_Y;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
@ -45,11 +41,10 @@ public class BukkitWorld implements World<org.bukkit.World> {
|
|||||||
HAS_MIN_Y = temp;
|
HAS_MIN_Y = temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
// We want to allow GC to remove bukkit worlds, but not too eagerly
|
private final org.bukkit.World world;
|
||||||
private final SoftReference<org.bukkit.World> world;
|
|
||||||
|
|
||||||
private BukkitWorld(final org.bukkit.World world) {
|
private BukkitWorld(final org.bukkit.World world) {
|
||||||
this.world = new SoftReference<>(world);
|
this.world = world;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -73,13 +68,12 @@ public class BukkitWorld implements World<org.bukkit.World> {
|
|||||||
* @return World instance
|
* @return World instance
|
||||||
*/
|
*/
|
||||||
public static @NonNull BukkitWorld of(final org.bukkit.World world) {
|
public static @NonNull BukkitWorld of(final org.bukkit.World world) {
|
||||||
WeakReference<BukkitWorld> bukkitWorldRef = worldMap.get(world.getName());
|
BukkitWorld bukkitWorld = worldMap.get(world.getName());
|
||||||
BukkitWorld bukkitWorld;
|
if (bukkitWorld != null && bukkitWorld.getPlatformWorld().equals(world)) {
|
||||||
if (bukkitWorldRef != null && (bukkitWorld = bukkitWorldRef.get()) != null && world.equals(bukkitWorld.world.get())) {
|
|
||||||
return bukkitWorld;
|
return bukkitWorld;
|
||||||
}
|
}
|
||||||
bukkitWorld = new BukkitWorld(world);
|
bukkitWorld = new BukkitWorld(world);
|
||||||
worldMap.put(world.getName(), new WeakReference<>(bukkitWorld));
|
worldMap.put(world.getName(), bukkitWorld);
|
||||||
return bukkitWorld;
|
return bukkitWorld;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,26 +97,22 @@ public class BukkitWorld implements World<org.bukkit.World> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public org.bukkit.World getPlatformWorld() {
|
public org.bukkit.World getPlatformWorld() {
|
||||||
org.bukkit.World world = this.world.get();
|
return this.world;
|
||||||
if (world == null) {
|
|
||||||
throw new IllegalStateException("Bukkit platform world was unloaded from memory");
|
|
||||||
}
|
|
||||||
return world;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public @NonNull String getName() {
|
public @NonNull String getName() {
|
||||||
return this.getPlatformWorld().getName();
|
return this.world.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMinHeight() {
|
public int getMinHeight() {
|
||||||
return getMinWorldHeight(getPlatformWorld());
|
return getMinWorldHeight(world);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMaxHeight() {
|
public int getMaxHeight() {
|
||||||
return getMaxWorldHeight(getPlatformWorld()) - 1;
|
return getMaxWorldHeight(world) - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -78,6 +78,5 @@ tasks {
|
|||||||
opt.encoding("UTF-8")
|
opt.encoding("UTF-8")
|
||||||
opt.keyWords()
|
opt.keyWords()
|
||||||
opt.addStringOption("-since", isRelease)
|
opt.addStringOption("-since", isRelease)
|
||||||
opt.noTimestamp()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,11 +43,6 @@ public class Settings extends Config {
|
|||||||
"Leave it off if you don't need it, it can spam your console."})
|
"Leave it off if you don't need it, it can spam your console."})
|
||||||
public static boolean DEBUG = true;
|
public static boolean DEBUG = true;
|
||||||
|
|
||||||
@Comment({"The activity of high-frequency event listener can be deactivated here to improve the server performance. ",
|
|
||||||
"Affected settings: 'redstone' settings here below. Affected flags: 'disable-physics', 'redstone'. ",
|
|
||||||
"Only deactivate this setting if you do not need any of the mentioned settings or flags."})
|
|
||||||
public static boolean HIGH_FREQUENCY_LISTENER = true;
|
|
||||||
|
|
||||||
@Create // This value will be generated automatically
|
@Create // This value will be generated automatically
|
||||||
public static ConfigBlock<Auto_Clear> AUTO_CLEAR = null;
|
public static ConfigBlock<Auto_Clear> AUTO_CLEAR = null;
|
||||||
// A ConfigBlock is a section that can have multiple instances e.g. multiple expiry tasks
|
// A ConfigBlock is a section that can have multiple instances e.g. multiple expiry tasks
|
||||||
|
@ -24,7 +24,7 @@ import com.plotsquared.core.plot.Plot;
|
|||||||
public class PlayerEnterPlotEvent extends PlotPlayerEvent {
|
public class PlayerEnterPlotEvent extends PlotPlayerEvent {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PlayerEnterPlotEvent: Called when a player enters a plot
|
* Called when a player leaves a plot.
|
||||||
*
|
*
|
||||||
* @param player Player that entered the plot
|
* @param player Player that entered the plot
|
||||||
* @param plot Plot that was entered
|
* @param plot Plot that was entered
|
||||||
|
@ -106,10 +106,6 @@ public class PlotListener {
|
|||||||
iterator.remove();
|
iterator.remove();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// Don't attempt to heal dead players - they will get stuck in the abyss (#4406)
|
|
||||||
if (PlotSquared.platform().worldUtil().getHealth(player) <= 0) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
double level = PlotSquared.platform().worldUtil().getHealth(player);
|
double level = PlotSquared.platform().worldUtil().getHealth(player);
|
||||||
if (level != value.max) {
|
if (level != value.max) {
|
||||||
PlotSquared.platform().worldUtil().setHealth(player, Math.min(level + value.amount, value.max));
|
PlotSquared.platform().worldUtil().setHealth(player, Math.min(level + value.amount, value.max));
|
||||||
|
@ -643,23 +643,36 @@ public class Plot {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets an immutable set of owner UUIDs for a plot (supports multi-owner mega-plots).
|
* Gets a immutable set of owner UUIDs for a plot (supports multi-owner mega-plots).
|
||||||
* <p>
|
* <p>
|
||||||
* This method cannot be used to add or remove owners from a plot.
|
* This method cannot be used to add or remove owners from a plot.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @return Immutable set of plot owners
|
* @return Immutable view of plot owners
|
||||||
*/
|
*/
|
||||||
public @NonNull Set<UUID> getOwners() {
|
public @NonNull Set<UUID> getOwners() {
|
||||||
|
if (this.getOwner() == null) {
|
||||||
|
return ImmutableSet.of();
|
||||||
|
}
|
||||||
|
if (isMerged()) {
|
||||||
|
Set<Plot> plots = getConnectedPlots();
|
||||||
|
Plot[] array = plots.toArray(new Plot[0]);
|
||||||
ImmutableSet.Builder<UUID> owners = ImmutableSet.builder();
|
ImmutableSet.Builder<UUID> owners = ImmutableSet.builder();
|
||||||
for (Plot plot : getConnectedPlots()) {
|
UUID last = this.getOwner();
|
||||||
UUID owner = plot.getOwner();
|
owners.add(this.getOwner());
|
||||||
if (owner != null) {
|
for (final Plot current : array) {
|
||||||
owners.add(owner);
|
if (current.getOwner() == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (last == null || current.getOwner().getMostSignificantBits() != last.getMostSignificantBits()) {
|
||||||
|
owners.add(current.getOwner());
|
||||||
|
last = current.getOwner();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return owners.build();
|
return owners.build();
|
||||||
}
|
}
|
||||||
|
return ImmutableSet.of(this.getOwner());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the player is either the owner or on the trusted/added list.
|
* Checks if the player is either the owner or on the trusted/added list.
|
||||||
@ -2561,7 +2574,7 @@ public class Plot {
|
|||||||
*/
|
*/
|
||||||
public void teleportPlayer(final PlotPlayer<?> player, TeleportCause cause, Consumer<Boolean> resultConsumer) {
|
public void teleportPlayer(final PlotPlayer<?> player, TeleportCause cause, Consumer<Boolean> resultConsumer) {
|
||||||
Plot plot = this.getBasePlot(false);
|
Plot plot = this.getBasePlot(false);
|
||||||
if ((getArea() == null || !(getArea() instanceof SinglePlotArea)) && !WorldUtil.isValidLocation(plot.getBottomAbs())) {
|
if (!WorldUtil.isValidLocation(plot.getBottomAbs())) {
|
||||||
// prevent from teleporting into unsafe regions
|
// prevent from teleporting into unsafe regions
|
||||||
player.sendMessage(TranslatableCaption.of("border.denied"));
|
player.sendMessage(TranslatableCaption.of("border.denied"));
|
||||||
resultConsumer.accept(false);
|
resultConsumer.accept(false);
|
||||||
|
@ -679,8 +679,10 @@ public abstract class PlotArea implements ComponentLike {
|
|||||||
TranslatableCaption.of("height.height_limit"),
|
TranslatableCaption.of("height.height_limit"),
|
||||||
TagResolver.builder()
|
TagResolver.builder()
|
||||||
.tag("minheight", Tag.inserting(Component.text(minBuildHeight)))
|
.tag("minheight", Tag.inserting(Component.text(minBuildHeight)))
|
||||||
.tag("maxheight", Tag.inserting(Component.text(maxBuildHeight)))
|
.tag(
|
||||||
.build()
|
"maxheight",
|
||||||
|
Tag.inserting(Component.text(maxBuildHeight))
|
||||||
|
).build()
|
||||||
);
|
);
|
||||||
// Return true if "failed" as the method will always be inverted otherwise
|
// Return true if "failed" as the method will always be inverted otherwise
|
||||||
return true;
|
return true;
|
||||||
|
@ -37,7 +37,7 @@ import java.util.List;
|
|||||||
|
|
||||||
public class SinglePlotManager extends PlotManager {
|
public class SinglePlotManager extends PlotManager {
|
||||||
|
|
||||||
private static final int MAX_COORDINATE = 20000000;
|
private static final int MAX_COORDINATE = 30000000;
|
||||||
|
|
||||||
public SinglePlotManager(final @NonNull PlotArea plotArea) {
|
public SinglePlotManager(final @NonNull PlotArea plotArea) {
|
||||||
super(plotArea);
|
super(plotArea);
|
||||||
|
@ -22,7 +22,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = "com.intellectualsites.plotsquared"
|
group = "com.intellectualsites.plotsquared"
|
||||||
version = "7.3.9-SNAPSHOT"
|
version = "7.3.8-SNAPSHOT"
|
||||||
|
|
||||||
if (!File("$rootDir/.git").exists()) {
|
if (!File("$rootDir/.git").exists()) {
|
||||||
logger.lifecycle("""
|
logger.lifecycle("""
|
||||||
@ -94,7 +94,7 @@ subprojects {
|
|||||||
}
|
}
|
||||||
|
|
||||||
configurations.all {
|
configurations.all {
|
||||||
attributes.attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 21)
|
attributes.attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 17)
|
||||||
}
|
}
|
||||||
|
|
||||||
spotless {
|
spotless {
|
||||||
@ -118,7 +118,7 @@ subprojects {
|
|||||||
}
|
}
|
||||||
|
|
||||||
signing {
|
signing {
|
||||||
if (!project.hasProperty("skip.signing") && !version.toString().endsWith("-SNAPSHOT")) {
|
if (!version.toString().endsWith("-SNAPSHOT")) {
|
||||||
val signingKey: String? by project
|
val signingKey: String? by project
|
||||||
val signingPassword: String? by project
|
val signingPassword: String? by project
|
||||||
useInMemoryPgpKeys(signingKey, signingPassword)
|
useInMemoryPgpKeys(signingKey, signingPassword)
|
||||||
@ -209,11 +209,6 @@ subprojects {
|
|||||||
test {
|
test {
|
||||||
useJUnitPlatform()
|
useJUnitPlatform()
|
||||||
}
|
}
|
||||||
|
|
||||||
withType<AbstractArchiveTask>().configureEach {
|
|
||||||
isPreserveFileTimestamps = false
|
|
||||||
isReproducibleFileOrder = true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,19 +2,19 @@
|
|||||||
# Platform expectations
|
# Platform expectations
|
||||||
paper = "1.20.2-R0.1-SNAPSHOT"
|
paper = "1.20.2-R0.1-SNAPSHOT"
|
||||||
guice = "7.0.0"
|
guice = "7.0.0"
|
||||||
spotbugs = "4.8.5"
|
spotbugs = "4.8.4"
|
||||||
checkerqual = "3.43.0"
|
checkerqual = "3.42.0"
|
||||||
gson = "2.10"
|
gson = "2.10"
|
||||||
guava = "31.1-jre"
|
guava = "31.1-jre"
|
||||||
snakeyaml = "2.0"
|
snakeyaml = "2.0"
|
||||||
adventure = "4.17.0"
|
adventure = "4.16.0"
|
||||||
adventure-bukkit = "4.3.3"
|
adventure-bukkit = "4.3.2"
|
||||||
log4j = "2.19.0"
|
log4j = "2.19.0"
|
||||||
|
|
||||||
# Plugins
|
# Plugins
|
||||||
worldedit = "7.2.20"
|
worldedit = "7.2.20"
|
||||||
fawe = "2.10.0"
|
fawe = "2.9.2"
|
||||||
placeholderapi = "2.11.6"
|
placeholderapi = "2.11.5"
|
||||||
luckperms = "5.4"
|
luckperms = "5.4"
|
||||||
essentialsx = "2.20.1"
|
essentialsx = "2.20.1"
|
||||||
mvdwapi = "3.1.1"
|
mvdwapi = "3.1.1"
|
||||||
@ -23,21 +23,21 @@ mvdwapi = "3.1.1"
|
|||||||
prtree = "2.0.1"
|
prtree = "2.0.1"
|
||||||
aopalliance = "1.0"
|
aopalliance = "1.0"
|
||||||
cloud-services = "1.8.4"
|
cloud-services = "1.8.4"
|
||||||
arkitektonika = "2.1.3"
|
arkitektonika = "2.1.2"
|
||||||
squirrelid = "0.3.2"
|
squirrelid = "0.3.2"
|
||||||
paster = "1.1.6"
|
paster = "1.1.5"
|
||||||
bstats = "3.0.2"
|
bstats = "3.0.2"
|
||||||
paperlib = "1.0.8"
|
paperlib = "1.0.8"
|
||||||
informative-annotations = "1.5"
|
informative-annotations = "1.4"
|
||||||
vault = "1.7.1"
|
vault = "1.7.1"
|
||||||
serverlib = "2.3.6"
|
serverlib = "2.3.4"
|
||||||
|
|
||||||
# Gradle plugins
|
# Gradle plugins
|
||||||
shadow = "8.1.1"
|
shadow = "8.1.1"
|
||||||
grgit = "4.1.1"
|
grgit = "4.1.1"
|
||||||
spotless = "6.25.0"
|
spotless = "6.25.0"
|
||||||
nexus = "2.0.0"
|
nexus = "2.0.0"
|
||||||
runPaper = "2.3.0"
|
runPaper = "2.2.3"
|
||||||
|
|
||||||
[libraries]
|
[libraries]
|
||||||
# Platform expectations
|
# Platform expectations
|
||||||
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,6 +1,6 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
2
gradlew
vendored
2
gradlew
vendored
@ -55,7 +55,7 @@
|
|||||||
# Darwin, MinGW, and NonStop.
|
# Darwin, MinGW, and NonStop.
|
||||||
#
|
#
|
||||||
# (3) This script is generated from the Groovy template
|
# (3) This script is generated from the Groovy template
|
||||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||||
# within the Gradle project.
|
# within the Gradle project.
|
||||||
#
|
#
|
||||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||||
|
Reference in New Issue
Block a user