Skip to content

Commit 8137962

Browse files
committed
Merge remote-tracking branch 'fork/feat/grants.added-placeholder' into feat/grants.added-placeholder
2 parents a1defc5 + 964275a commit 8137962

6 files changed

Lines changed: 61 additions & 25 deletions

File tree

.github/renovate.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
33
"extends": [
44
"config:recommended",
5-
":semanticCommitsDisabled"
5+
":semanticCommitsDisabled",
6+
"schedule:earlyMondays"
67
],
78
"automerge": true,
89
"labels": [

Bukkit/src/main/java/com/plotsquared/bukkit/listener/PlayerEventListener.java

Lines changed: 51 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,11 @@
6464
import com.plotsquared.core.plot.flag.implementations.TamedInteractFlag;
6565
import com.plotsquared.core.plot.flag.implementations.TileDropFlag;
6666
import com.plotsquared.core.plot.flag.implementations.UntrustedVisitFlag;
67+
import com.plotsquared.core.plot.flag.implementations.UseFlag;
6768
import com.plotsquared.core.plot.flag.implementations.VehicleBreakFlag;
6869
import com.plotsquared.core.plot.flag.implementations.VehicleUseFlag;
6970
import com.plotsquared.core.plot.flag.implementations.VillagerInteractFlag;
71+
import com.plotsquared.core.plot.flag.types.BlockTypeWrapper;
7072
import com.plotsquared.core.plot.world.PlotAreaManager;
7173
import com.plotsquared.core.util.EventDispatcher;
7274
import com.plotsquared.core.util.MathMan;
@@ -78,6 +80,7 @@
7880
import com.sk89q.worldedit.WorldEdit;
7981
import com.sk89q.worldedit.bukkit.BukkitAdapter;
8082
import com.sk89q.worldedit.world.block.BlockType;
83+
import com.sk89q.worldedit.world.block.BlockTypes;
8184
import io.papermc.lib.PaperLib;
8285
import net.kyori.adventure.text.Component;
8386
import net.kyori.adventure.text.minimessage.MiniMessage;
@@ -152,9 +155,11 @@
152155
import org.checkerframework.checker.nullness.qual.NonNull;
153156

154157
import java.lang.reflect.Field;
158+
import java.util.Collections;
155159
import java.util.HashSet;
156160
import java.util.List;
157161
import java.util.Locale;
162+
import java.util.Optional;
158163
import java.util.Set;
159164
import java.util.UUID;
160165

@@ -179,6 +184,7 @@ public class PlayerEventListener implements Listener {
179184
Material.WRITTEN_BOOK
180185
);
181186
private static final Set<String> DYES;
187+
182188
static {
183189
Set<String> mutableDyes = new HashSet<>(Set.of(
184190
"WHITE_DYE",
@@ -213,7 +219,7 @@ public class PlayerEventListener implements Listener {
213219
// "temporary" fix for https://hub.spigotmc.org/jira/browse/SPIGOT-7813
214220
// can (and should) be removed when 1.21 support is dropped
215221
// List of all interactable 1.21 materials
216-
INTERACTABLE_MATERIALS = Material.CHEST.isInteractable() ? null : Set.of(
222+
INTERACTABLE_MATERIALS = Material.CHEST.isInteractable() ? null : Set.of(
217223
"REDSTONE_ORE", "DEEPSLATE_REDSTONE_ORE", "CHISELED_BOOKSHELF", "DECORATED_POT", "CHEST", "CRAFTING_TABLE",
218224
"FURNACE", "JUKEBOX", "OAK_FENCE", "SPRUCE_FENCE", "BIRCH_FENCE", "JUNGLE_FENCE", "ACACIA_FENCE", "CHERRY_FENCE",
219225
"DARK_OAK_FENCE", "MANGROVE_FENCE", "BAMBOO_FENCE", "CRIMSON_FENCE", "WARPED_FENCE", "PUMPKIN",
@@ -531,12 +537,14 @@ public void onConnect(PlayerJoinEvent event) {
531537
// Delayed
532538

533539
// Async
534-
TaskManager.runTaskLaterAsync(() -> {
535-
if (!player.hasPlayedBefore() && player.isOnline()) {
536-
player.saveData();
537-
}
538-
this.eventDispatcher.doJoinTask(pp);
539-
}, TaskTime.seconds(1L));
540+
TaskManager.runTaskLaterAsync(
541+
() -> {
542+
if (!player.hasPlayedBefore() && player.isOnline()) {
543+
player.saveData();
544+
}
545+
this.eventDispatcher.doJoinTask(pp);
546+
}, TaskTime.seconds(1L)
547+
);
540548

541549
if (pp.hasPermission(Permission.PERMISSION_ADMIN_UPDATE_NOTIFICATION.toString()) && Settings.Enabled_Components.UPDATE_NOTIFICATIONS
542550
&& PremiumVerification.isPremium() && UpdateUtility.hasUpdate) {
@@ -597,7 +605,9 @@ public void onTeleport(PlayerTeleportEvent event) {
597605
// to is identical to the plot's home location, and untrusted-visit is true
598606
// i.e. untrusted-visit can override deny-teleport
599607
// this is acceptable, because otherwise it wouldn't make sense to have both flags set
600-
if (result || (plot.getFlag(UntrustedVisitFlag.class) && plot.getHomeSynchronous().equals(BukkitUtil.adaptComplete(to)))) {
608+
if (result || (plot.getFlag(UntrustedVisitFlag.class) && plot
609+
.getHomeSynchronous()
610+
.equals(BukkitUtil.adaptComplete(to)))) {
601611
// returns false if the player is not allowed to enter the plot (if they are denied, for example)
602612
// don't let the move event cancel the entry after teleport, but rather catch and cancel early (#4647)
603613
if (!plotListener.plotEntry(pp, plot)) {
@@ -941,12 +951,15 @@ public void onChat(AsyncPlayerChatEvent event) {
941951
builder.tag("plot_id", Tag.inserting(Component.text(id.toString())));
942952
builder.tag("sender", Tag.inserting(Component.text(sender)));
943953
if (plotPlayer.hasPermission("plots.chat.color")) {
944-
builder.tag("msg", Tag.inserting(MiniMessage.miniMessage().deserialize(
945-
message,
946-
TagResolver.resolver(StandardTags.color(), StandardTags.gradient(),
947-
StandardTags.rainbow(), StandardTags.decorations()
948-
)
949-
)));
954+
builder.tag(
955+
"msg", Tag.inserting(MiniMessage.miniMessage().deserialize(
956+
message,
957+
TagResolver.resolver(
958+
StandardTags.color(), StandardTags.gradient(),
959+
StandardTags.rainbow(), StandardTags.decorations()
960+
)
961+
))
962+
);
950963
} else {
951964
builder.tag("msg", Tag.inserting(Component.text(message)));
952965
}
@@ -1255,7 +1268,9 @@ public void onInteract(PlayerInteractEvent event) {
12551268
eventType = PlayerBlockEventType.INTERACT_BLOCK;
12561269
blocktype1 = BukkitAdapter.asBlockType(block.getType());
12571270

1258-
if (INTERACTABLE_MATERIALS != null ? INTERACTABLE_MATERIALS.contains(blockType.name()) : blockType.isInteractable()) {
1271+
if (INTERACTABLE_MATERIALS != null
1272+
? INTERACTABLE_MATERIALS.contains(blockType.name())
1273+
: blockType.isInteractable()) {
12591274
if (!player.isSneaking()) {
12601275
break;
12611276
}
@@ -1273,7 +1288,7 @@ public void onInteract(PlayerInteractEvent event) {
12731288
// in the following, lb needs to have the material of the item in hand i.e. type
12741289
switch (type.toString()) {
12751290
case "REDSTONE", "STRING", "PUMPKIN_SEEDS", "MELON_SEEDS", "COCOA_BEANS", "WHEAT_SEEDS", "BEETROOT_SEEDS",
1276-
"SWEET_BERRIES", "GLOW_BERRIES" -> {
1291+
"SWEET_BERRIES", "GLOW_BERRIES" -> {
12771292
return;
12781293
}
12791294
default -> {
@@ -1391,6 +1406,16 @@ public void onBucketEmpty(PlayerBucketEmptyEvent event) {
13911406
}
13921407
BukkitPlayer pp = BukkitUtil.adapt(event.getPlayer());
13931408
Plot plot = area.getPlot(location);
1409+
final List<BlockTypeWrapper> use =
1410+
Optional.ofNullable(plot).map(p -> p.getFlag(UseFlag.class)).orElse(area.isRoadFlags() ?
1411+
area.getFlag(UseFlag.class) : Collections.emptyList());
1412+
BlockType type = BukkitAdapter.asBlockType(block.getType());
1413+
for (final BlockTypeWrapper blockTypeWrapper : use) {
1414+
if (blockTypeWrapper.accepts(BlockTypes.AIR) || blockTypeWrapper
1415+
.accepts(type)) {
1416+
return;
1417+
}
1418+
}
13941419
if (plot == null) {
13951420
if (pp.hasPermission(Permission.PERMISSION_ADMIN_BUILD_ROAD)) {
13961421
return;
@@ -1462,6 +1487,16 @@ public void onBucketFill(PlayerBucketFillEvent event) {
14621487
Player player = event.getPlayer();
14631488
BukkitPlayer plotPlayer = BukkitUtil.adapt(player);
14641489
Plot plot = area.getPlot(location);
1490+
final List<BlockTypeWrapper> use =
1491+
Optional.ofNullable(plot).map(p -> p.getFlag(UseFlag.class)).orElse(area.isRoadFlags() ?
1492+
area.getFlag(UseFlag.class) : Collections.emptyList());
1493+
BlockType type = BukkitAdapter.asBlockType(blockClicked.getType());
1494+
for (final BlockTypeWrapper blockTypeWrapper : use) {
1495+
if (blockTypeWrapper.accepts(BlockTypes.AIR) || blockTypeWrapper
1496+
.accepts(type)) {
1497+
return;
1498+
}
1499+
}
14651500
if (plot == null) {
14661501
if (plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_BUILD_ROAD)) {
14671502
return;

Core/src/main/java/com/plotsquared/core/configuration/caption/Caption.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public interface Caption {
5151
* @param localeHolder Local holder
5252
* @param tagResolvers custom tag resolvers to replace placeholders / parameters
5353
* @return {@link ComponentLike}
54-
* @since TODO
54+
* @since 7.5.4
5555
*/
5656
@NonNull Component toComponent(@NonNull LocaleHolder localeHolder, @NonNull TagResolver @NonNull... tagResolvers);
5757

build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ plugins {
2222
}
2323

2424
group = "com.intellectualsites.plotsquared"
25-
version = "7.5.4-SNAPSHOT"
25+
version = "7.5.5-SNAPSHOT"
2626

2727
if (!File("$rootDir/.git").exists()) {
2828
logger.lifecycle("""
@@ -69,8 +69,8 @@ subprojects {
6969

7070
dependencies {
7171
// Tests
72-
testImplementation("org.junit.jupiter:junit-jupiter:5.13.2")
73-
testRuntimeOnly("org.junit.platform:junit-platform-launcher:1.13.2")
72+
testImplementation("org.junit.jupiter:junit-jupiter:5.13.3")
73+
testRuntimeOnly("org.junit.platform:junit-platform-launcher:1.13.3")
7474
}
7575

7676
plugins.withId("java") {

gradle/libs.versions.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
paper = "1.20.4-R0.1-SNAPSHOT"
44
guice = "7.0.0"
55
spotbugs = "4.9.3"
6-
checkerqual = "3.49.4"
6+
checkerqual = "3.49.5"
77
gson = "2.10"
88
guava = "31.1-jre"
99
snakeyaml = "2.0"
@@ -33,9 +33,9 @@ vault = "1.7.1"
3333
serverlib = "2.3.7"
3434

3535
# Gradle plugins
36-
shadow = "8.3.7"
36+
shadow = "8.3.8"
3737
grgit = "4.1.1"
38-
spotless = "7.0.4"
38+
spotless = "7.1.0"
3939
publish = "0.33.0"
4040
runPaper = "2.3.1"
4141

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

0 commit comments

Comments
 (0)