Compare commits

..

1 Commits

Author SHA1 Message Date
504a4a9247 fix: Restore ability to use PlaceholderAPI in greeting and farewell
Fixes #3465
2022-02-05 00:07:12 +01:00
25 changed files with 161 additions and 280 deletions

View File

@ -12,7 +12,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@v3.0.0 uses: actions/setup-java@v2.5.0
with: with:
distribution: temurin distribution: temurin
java-version: 17 java-version: 17

View File

@ -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

20
.github/workflows/rebase.yml vendored Normal file
View File

@ -0,0 +1,20 @@
name: Rebase Pull Request
on:
issue_comment:
types: [created]
jobs:
rebase:
name: Rebase
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase') && github.event.comment.author_association == 'MEMBER'
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2.4.0
with:
token: ${{ secrets.REBASE_TOKEN }}
fetch-depth: 0
- name: Automatic Rebase
uses: cirrus-actions/rebase@1.5
env:
GITHUB_TOKEN: ${{ secrets.REBASE_TOKEN }}

View File

@ -14,6 +14,6 @@ jobs:
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }} 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.17.6
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -74,7 +74,6 @@ 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;
@ -279,7 +277,7 @@ 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);
@ -364,7 +362,7 @@ public class BlockEventListener implements Listener {
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);
@ -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;
}
}
}
} }

View File

@ -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;
@ -192,32 +191,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());
} }
} }

View File

@ -83,31 +83,34 @@ public class BukkitWorld implements World<org.bukkit.World> {
return this.world.getName(); return this.world.getName();
} }
@Override
public boolean equals(final Object o) { public boolean equals(final Object o) {
if (this == o) { if (o == this) {
return true; return true;
} }
if (o == null || getClass() != o.getClass()) { if (!(o instanceof final BukkitWorld other)) {
return false; return false;
} }
final BukkitWorld that = (BukkitWorld) o; if (!other.canEqual(this)) {
return world.equals(that.world); return false;
}
if (!Objects.equals(this.world, other.world)) {
return false;
}
return true;
} }
@Override
public int hashCode() {
return world.hashCode();
}
/**
* @deprecated This method is not meant to be invoked or overridden, with no replacement.
*/
@Deprecated(forRemoval = true, since = "TODO")
protected boolean canEqual(final Object other) { protected boolean canEqual(final Object other) {
return other instanceof BukkitWorld; return other instanceof BukkitWorld;
} }
public int hashCode() {
final int PRIME = 59;
int result = 1;
final Object $world = this.world;
result = result * PRIME + ($world == null ? 43 : $world.hashCode());
return result;
}
public String toString() { public String toString() {
return "BukkitWorld(world=" + this.world + ")"; return "BukkitWorld(world=" + this.world + ")";
} }

View File

@ -28,7 +28,6 @@ package com.plotsquared.core.command;
import com.plotsquared.core.configuration.caption.Caption; import com.plotsquared.core.configuration.caption.Caption;
import com.plotsquared.core.configuration.caption.LocaleHolder; import com.plotsquared.core.configuration.caption.LocaleHolder;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.player.PlotPlayer;
import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.NonNull;
/** /**
@ -96,16 +95,4 @@ public enum CommandCategory implements Caption {
public String getComponent(@NonNull LocaleHolder localeHolder) { public String getComponent(@NonNull LocaleHolder localeHolder) {
return this.caption.getComponent(localeHolder); return this.caption.getComponent(localeHolder);
} }
/**
* Checks if a player has access to this command category
*
* @param player The player to check against
* @return {@code true} if at least one command of this category can be executed by the player, {@code false} otherwise
* @since 6.5.0
*/
boolean canAccess(PlotPlayer<?> player) {
return !MainCommand.getInstance().getCommands(this, player).isEmpty();
}
} }

View File

@ -37,11 +37,11 @@ import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.TextComponent; import net.kyori.adventure.text.TextComponent;
import net.kyori.adventure.text.minimessage.Template; import net.kyori.adventure.text.minimessage.Template;
import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@CommandDeclaration(command = "help", @CommandDeclaration(command = "help",
aliases = "?", aliases = "?",
@ -119,9 +119,6 @@ public class Help extends Command {
TextComponent.Builder builder = Component.text(); TextComponent.Builder builder = Component.text();
builder.append(MINI_MESSAGE.parse(TranslatableCaption.of("help.help_header").getComponent(player))); builder.append(MINI_MESSAGE.parse(TranslatableCaption.of("help.help_header").getComponent(player)));
for (CommandCategory c : CommandCategory.values()) { for (CommandCategory c : CommandCategory.values()) {
if (!c.canAccess(player)) {
continue;
}
builder.append(Component.newline()).append(MINI_MESSAGE builder.append(Component.newline()).append(MINI_MESSAGE
.parse( .parse(
TranslatableCaption.of("help.help_info_item").getComponent(player), TranslatableCaption.of("help.help_info_item").getComponent(player),
@ -155,26 +152,12 @@ public class Help extends Command {
@Override @Override
public Collection<Command> tab(PlotPlayer<?> player, String[] args, boolean space) { public Collection<Command> tab(PlotPlayer<?> player, String[] args, boolean space) {
final String argument = args[0].toLowerCase(Locale.ENGLISH); return Stream.of("claiming", "teleport", "settings", "chat", "schematic", "appearance", "info", "debug",
List<Command> result = new ArrayList<>(); "administration", "all"
)
for (final CommandCategory category : CommandCategory.values()) { .filter(value -> value.startsWith(args[0].toLowerCase(Locale.ENGLISH)))
if (!category.canAccess(player)) { .map(value -> new Command(null, false, value, "", RequiredType.NONE, null) {
continue; }).collect(Collectors.toList());
}
String name = category.name().toLowerCase();
if (!name.startsWith(argument)) {
continue;
}
result.add(new Command(null, false, name, "", RequiredType.NONE, null) {
});
}
// add the category "all"
if ("all".startsWith(argument)) {
result.add(new Command(null, false, "all", "", RequiredType.NONE, null) {
});
}
return result;
} }
} }

View File

@ -128,7 +128,7 @@ public class ComponentPresetManager {
0, 0,
"", "",
"<rainbow:2>Disco Floor</rainbow>", "<rainbow:2>Disco Floor</rainbow>",
List.of("<gold>Spice up your plot floor</gold>"), Arrays.asList("<gold>Spice up your plot floor</gold>"),
ItemTypes.YELLOW_WOOL ItemTypes.YELLOW_WOOL
)); ));
yamlConfiguration.set("presets", defaultPreset.stream().map(ComponentPreset::serialize).collect(Collectors.toList())); yamlConfiguration.set("presets", defaultPreset.stream().map(ComponentPreset::serialize).collect(Collectors.toList()));
@ -181,10 +181,6 @@ public class ComponentPresetManager {
} }
allowedPresets.add(componentPreset); allowedPresets.add(componentPreset);
} }
if (allowedPresets.isEmpty()) {
player.sendMessage(TranslatableCaption.of("preset.empty"));
return null;
}
final int size = (int) Math.ceil((double) allowedPresets.size() / 9.0D); final int size = (int) Math.ceil((double) allowedPresets.size() / 9.0D);
final PlotInventory plotInventory = new PlotInventory(this.inventoryUtil, player, size, final PlotInventory plotInventory = new PlotInventory(this.inventoryUtil, player, size,
TranslatableCaption.of("preset.title").getComponent(player)) { TranslatableCaption.of("preset.title").getComponent(player)) {
@ -214,13 +210,7 @@ public class ComponentPresetManager {
return false; return false;
} }
if (componentPreset.getCost() > 0.0D) { if (componentPreset.getCost() > 0.0D && econHandler.isEnabled(plot.getArea())) {
if (!econHandler.isEnabled(plot.getArea())) {
getPlayer().sendMessage(
TranslatableCaption.of("preset.economy_disabled"),
Template.of("preset", componentPreset.getDisplayName()));
return false;
}
if (econHandler.getMoney(getPlayer()) < componentPreset.getCost()) { if (econHandler.getMoney(getPlayer()) < componentPreset.getCost()) {
getPlayer().sendMessage(TranslatableCaption.of("preset.preset_cannot_afford")); getPlayer().sendMessage(TranslatableCaption.of("preset.preset_cannot_afford"));
return false; return false;
@ -256,16 +246,11 @@ public class ComponentPresetManager {
for (int i = 0; i < allowedPresets.size(); i++) { for (int i = 0; i < allowedPresets.size(); i++) {
final ComponentPreset preset = allowedPresets.get(i); final ComponentPreset preset = allowedPresets.get(i);
final List<String> lore = new ArrayList<>(); final List<String> lore = new ArrayList<>();
if (preset.getCost() > 0) { if (preset.getCost() > 0 && this.econHandler.isEnabled(plot.getArea())) {
if (!this.econHandler.isEnabled(plot.getArea())) { lore.add(MINI_MESSAGE.serialize(MINI_MESSAGE.parse(
lore.add(MINI_MESSAGE.serialize(MINI_MESSAGE.parse( TranslatableCaption.of("preset.preset_lore_cost").getComponent(player),
TranslatableCaption.of("preset.preset_lore_economy_disabled").getComponent(player)))); Template.of("cost", String.format("%.2f", preset.getCost()))
} else { )));
lore.add(MINI_MESSAGE.serialize(MINI_MESSAGE.parse(
TranslatableCaption.of("preset.preset_lore_cost").getComponent(player),
Template.of("cost", String.format("%.2f", preset.getCost()))
)));
}
} }
lore.add(MINI_MESSAGE.serialize(MINI_MESSAGE.parse( lore.add(MINI_MESSAGE.serialize(MINI_MESSAGE.parse(
TranslatableCaption.of("preset.preset_lore_component").getComponent(player), TranslatableCaption.of("preset.preset_lore_component").getComponent(player),

View File

@ -121,7 +121,7 @@ public class PlotInventory {
* @param item the item to place * @param item the item to place
* @return {@code true} if the item could be placed, otherwise {@code false} * @return {@code true} if the item could be placed, otherwise {@code false}
* @see InventoryUtil#setItemChecked(PlotInventory, int, PlotItemStack) * @see InventoryUtil#setItemChecked(PlotInventory, int, PlotItemStack)
* @since 6.5.0 * @since TODO
*/ */
public boolean setItemChecked(int index, PlotItemStack item) { public boolean setItemChecked(int index, PlotItemStack item) {
if (!this.inventoryUtil.setItemChecked(this, index, item)) { if (!this.inventoryUtil.setItemChecked(this, index, item)) {

View File

@ -54,7 +54,7 @@ public class PlotItemStack {
* @param amount Amount of items in the stack * @param amount Amount of items in the stack
* @param name The display name of the item stack * @param name The display name of the item stack
* @param lore The item stack lore * @param lore The item stack lore
* @since 6.5.0 * @since TODO
*/ */
public PlotItemStack( public PlotItemStack(
final ItemType type, final int amount, final String name, final ItemType type, final int amount, final String name,

View File

@ -105,29 +105,31 @@ public abstract class PlotWorld {
return this.world; return this.world;
} }
@Override
public boolean equals(final Object o) { public boolean equals(final Object o) {
if (this == o) { if (o == this) {
return true; return true;
} }
if (o == null || getClass() != o.getClass()) { if (!(o instanceof final PlotWorld other)) {
return false; return false;
} }
final PlotWorld plotWorld = (PlotWorld) o; if (!other.canEqual(this)) {
return world.equals(plotWorld.world); return false;
}
final Object this$world = this.getWorld();
final Object other$world = other.getWorld();
return Objects.equals(this$world, other$world);
} }
@Override
public int hashCode() {
return world.hashCode();
}
/**
* @deprecated This method is not meant to be invoked or overridden, with no replacement.
*/
@Deprecated(forRemoval = true, since = "TODO")
protected boolean canEqual(final Object other) { protected boolean canEqual(final Object other) {
return other instanceof PlotWorld; return other instanceof PlotWorld;
} }
public int hashCode() {
final int PRIME = 59;
int result = 1;
final Object $world = this.getWorld();
result = result * PRIME + ($world == null ? 43 : $world.hashCode());
return result;
}
} }

View File

@ -136,18 +136,18 @@ public class ExpireManager {
} }
public void confirmExpiry(final PlotPlayer<?> pp) { public void confirmExpiry(final PlotPlayer<?> pp) {
TaskManager.runTask(() -> { try (final MetaDataAccess<Boolean> metaDataAccess = pp.accessTemporaryMetaData(
try (final MetaDataAccess<Boolean> metaDataAccess = pp.accessTemporaryMetaData( PlayerMetaDataKeys.TEMPORARY_IGNORE_EXPIRE_TASK)) {
PlayerMetaDataKeys.TEMPORARY_IGNORE_EXPIRE_TASK)) { if (metaDataAccess.isPresent()) {
if (metaDataAccess.isPresent()) { return;
return; }
} if (plotsToDelete != null && !plotsToDelete.isEmpty() && pp.hasPermission("plots.admin.command.autoclear")) {
if (plotsToDelete != null && !plotsToDelete.isEmpty() && pp.hasPermission("plots.admin.command.autoclear")) { final int num = plotsToDelete.size();
final int num = plotsToDelete.size(); while (!plotsToDelete.isEmpty()) {
while (!plotsToDelete.isEmpty()) { Iterator<Plot> iter = plotsToDelete.iterator();
Iterator<Plot> iter = plotsToDelete.iterator(); final Plot current = iter.next();
final Plot current = iter.next(); if (!isExpired(new ArrayDeque<>(tasks), current).isEmpty()) {
if (!isExpired(new ArrayDeque<>(tasks), current).isEmpty()) { TaskManager.runTask(() -> {
metaDataAccess.set(true); metaDataAccess.set(true);
current.getCenter(pp::teleport); current.getCenter(pp::teleport);
metaDataAccess.remove(); metaDataAccess.remove();
@ -171,15 +171,15 @@ public class ExpireManager {
cmd_keep, cmd_keep,
cmd_no_show_expir cmd_no_show_expir
); );
return; });
} else { return;
iter.remove(); } else {
} iter.remove();
} }
plotsToDelete.clear();
} }
plotsToDelete.clear();
} }
}); }
} }
@ -307,7 +307,6 @@ public class ExpireManager {
this.running = 2; this.running = 2;
TaskManager.runTaskAsync(new Runnable() { TaskManager.runTaskAsync(new Runnable() {
private ConcurrentLinkedDeque<Plot> plots = null; private ConcurrentLinkedDeque<Plot> plots = null;
@Override @Override
public void run() { public void run() {
final Runnable task = this; final Runnable task = this;

View File

@ -371,31 +371,33 @@ public class FlagContainer {
} }
} }
@Override
public boolean equals(final Object o) { public boolean equals(final Object o) {
if (this == o) { if (o == this) {
return true; return true;
} }
if (o == null || getClass() != o.getClass()) { if (!(o instanceof final FlagContainer other)) {
return false; return false;
} }
final FlagContainer that = (FlagContainer) o; if (!other.canEqual(this)) {
return flagMap.equals(that.flagMap); return false;
}
final Object this$flagMap = this.getFlagMap();
final Object other$flagMap = other.getFlagMap();
return Objects.equals(this$flagMap, other$flagMap);
} }
@Override
public int hashCode() {
return flagMap.hashCode();
}
/**
* @deprecated This method is not meant to be invoked or overridden, with no replacement.
*/
@Deprecated(forRemoval = true, since = "TODO")
protected boolean canEqual(final Object other) { protected boolean canEqual(final Object other) {
return other instanceof FlagContainer; return other instanceof FlagContainer;
} }
public int hashCode() {
final int PRIME = 59;
int result = 1;
final Object $flagMap = this.getFlagMap();
result = result * PRIME + ($flagMap == null ? 43 : $flagMap.hashCode());
return result;
}
/** /**
* Update event types used in {@link PlotFlagUpdateHandler}. * Update event types used in {@link PlotFlagUpdateHandler}.
*/ */

View File

@ -31,7 +31,6 @@ import org.checkerframework.checker.nullness.qual.NonNull;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.Objects;
/** /**
* A plot flag is any property that can be assigned * A plot flag is any property that can be assigned
@ -201,30 +200,34 @@ public abstract class PlotFlag<T, F extends PlotFlag<T, F>> {
return Collections.emptyList(); return Collections.emptyList();
} }
@Override
public boolean equals(final Object o) { public boolean equals(final Object o) {
if (this == o) { if (o == this) {
return true; return true;
} }
if (o == null || getClass() != o.getClass()) { if (!(o instanceof final PlotFlag<?, ?> other)) {
return false; return false;
} }
final PlotFlag<?, ?> plotFlag = (PlotFlag<?, ?>) o; if (!other.canEqual(this)) {
return value.equals(plotFlag.value); return false;
}
final Object this$value = this.getValue();
final Object other$value = other.getValue();
if (this$value == null ? other$value != null : !this$value.equals(other$value)) {
return false;
}
return true;
} }
@Override
public int hashCode() {
return value.hashCode();
}
/**
* @deprecated This method is not meant to be invoked or overridden, with no replacement.
*/
@Deprecated(forRemoval = true, since = "TODO")
protected boolean canEqual(final Object other) { protected boolean canEqual(final Object other) {
return other instanceof PlotFlag; return other instanceof PlotFlag;
} }
public int hashCode() {
final int PRIME = 59;
int result = 1;
final Object $value = this.getValue();
result = result * PRIME + ($value == null ? 43 : $value.hashCode());
return result;
}
} }

View File

@ -45,7 +45,7 @@ public abstract class InventoryUtil {
* @param index The index where to place the item * @param index The index where to place the item
* @param item The item to place into the inventory * @param item The item to place into the inventory
* @return {@code true} if the item could be placed, {@code false} otherwise (e.g. item not available in current version) * @return {@code true} if the item could be placed, {@code false} otherwise (e.g. item not available in current version)
* @since 6.5.0 * @since TODO
*/ */
public abstract boolean setItemChecked( public abstract boolean setItemChecked(
final PlotInventory plotInventory, final int index, final PlotInventory plotInventory, final int index,

View File

@ -52,7 +52,8 @@ public class HelpMenu {
} }
public HelpMenu getCommands() { public HelpMenu getCommands() {
this.commands = MainCommand.getInstance().getCommands(this.commandCategory, this.commandCaller); this.commands =
MainCommand.getInstance().getCommands(this.commandCategory, this.commandCaller);
return this; return this;
} }

View File

@ -51,29 +51,38 @@ public class UUIDMapping {
return this.uuid; return this.uuid;
} }
@Override
public boolean equals(final Object o) { public boolean equals(final Object o) {
if (this == o) { if (o == this) {
return true; return true;
} }
if (o == null || getClass() != o.getClass()) { if (!(o instanceof final UUIDMapping other)) {
return false; return false;
} }
final UUIDMapping that = (UUIDMapping) o; if (!other.canEqual(this)) {
return uuid.equals(that.uuid) && username.equals(that.username); return false;
}
final Object this$uuid = this.getUuid();
final Object other$uuid = other.getUuid();
if (!Objects.equals(this$uuid, other$uuid)) {
return false;
}
final Object this$username = this.getUsername();
final Object other$username = other.getUsername();
return Objects.equals(this$username, other$username);
} }
@Override
public int hashCode() {
return Objects.hash(uuid, username);
}
/**
* @deprecated This method is not meant to be invoked or overridden, with no replacement.
*/
@Deprecated(forRemoval = true, since = "TODO")
protected boolean canEqual(final Object other) { protected boolean canEqual(final Object other) {
return other instanceof UUIDMapping; return other instanceof UUIDMapping;
} }
public int hashCode() {
final int PRIME = 59;
int result = 1;
final Object $uuid = this.getUuid();
result = result * PRIME + $uuid.hashCode();
final Object $username = this.getUsername();
result = result * PRIME + $username.hashCode();
return result;
}
} }

View File

@ -460,12 +460,9 @@
"backups.backup_automatic_failure": "<prefix><red>The automatic backup process failed. Your pending action has been canceled. Reason: </red><gray><reason></gray>", "backups.backup_automatic_failure": "<prefix><red>The automatic backup process failed. Your pending action has been canceled. Reason: </red><gray><reason></gray>",
"preset.preset_cannot_afford": "<prefix><red>You cannot afford that preset.</red>", "preset.preset_cannot_afford": "<prefix><red>You cannot afford that preset.</red>",
"preset.preset_invalid": "<prefix><red>Could not generate a pattern from that preset.</red>", "preset.preset_invalid": "<prefix><red>Could not generate a pattern from that preset.</red>",
"preset.preset_lore_cost": "<gray>Cost: </gray><gold><cost></gold>", "preset.preset_lore_cost": "<prefix><gray>Cost: </gray><gold><cost></gold>",
"preset.preset_lore_economy_disabled": "<gray>Cost: </gray><red>Economy is disabled</red>",
"preset.preset_lore_component": "<gray>Component: </gray><gold><component></gold>", "preset.preset_lore_component": "<gray>Component: </gray><gold><component></gold>",
"preset.title": "Plot Components", "preset.title": "Plot Components",
"preset.empty": "<prefix><red>No plot component presets available.</red>",
"preset.economy_disabled": "<prefix><red>The component preset '<preset>' has a price set but economy is disabled.</red>",
"generic.generic_other": "<gray>other</gray>", "generic.generic_other": "<gray>other</gray>",
"generic.generic_merged": "<gray>merged</gray>", "generic.generic_merged": "<gray>merged</gray>",
"generic.generic_unowned": "<gray>unowned</gray>", "generic.generic_unowned": "<gray>unowned</gray>",

View File

@ -18,7 +18,7 @@ plugins {
idea idea
} }
version = "6.5.2-SNAPSHOT" version = "6.4.1-SNAPSHOT"
allprojects { allprojects {
group = "com.plotsquared" group = "com.plotsquared"

View File

@ -6,7 +6,7 @@ guava = "31.0.1-jre" # Version set by Minecraft
# Platform expectations # Platform expectations
paper = "1.18.1-R0.1-SNAPSHOT" paper = "1.18.1-R0.1-SNAPSHOT"
checker-qual = "3.21.2" checker-qual = "3.21.1"
guice = "5.1.0" guice = "5.1.0"
findbugs = "3.0.1" findbugs = "3.0.1"
snakeyaml = "1.30" # Version set by Bukkit snakeyaml = "1.30" # Version set by Bukkit
@ -21,14 +21,14 @@ worldedit = "7.2.9"
fawe = "2.0.1" fawe = "2.0.1"
vault = "1.7.1" vault = "1.7.1"
placeholderapi = "2.11.1" placeholderapi = "2.11.1"
luckperms = "5.4" luckperms = "5.3"
essentialsx = "2.19.2" essentialsx = "2.19.2"
mvdwapi = "3.1.1" mvdwapi = "3.1.1"
# Third party # Third party
prtree = "2.0.0" prtree = "2.0.0"
aopalliance = "1.0" aopalliance = "1.0"
cloud-services = "1.6.2" cloud-services = "1.6.1"
arkitektonika = "2.1.1" arkitektonika = "2.1.1"
paster = "1.1.4" paster = "1.1.4"
bstats = "3.0.0" bstats = "3.0.0"

Binary file not shown.

View File

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

View File

@ -5,4 +5,5 @@ include("Core", "Bukkit")
project(":Core").name = "PlotSquared-Core" project(":Core").name = "PlotSquared-Core"
project(":Bukkit").name = "PlotSquared-Bukkit" project(":Bukkit").name = "PlotSquared-Bukkit"
enableFeaturePreview("VERSION_CATALOGS")
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")