Compare commits

...

11 Commits
7.5.4 ... main

Author SHA1 Message Date
Leviaria
6fc25bc034 feat: Add support for Minecraft 1.21.8 (#4701)
* Update libs.versions.toml

* Update build.gradle.kts

* Update PlayerEventListener.java

* Update BukkitPlatform.java

* Update ReplicatingEntityWrapper.java

* Update ReplicatingEntityWrapper.java

* Update libs.versions.toml

* Update PlayerEventListener.java

* Update PlayerEventListener.java

* Update BukkitPlatform.java

* Update ReplicatingEntityWrapper.java

* Update BukkitPlatform.java

* Update ReplicatingEntityWrapper.java

* Update ReplicatingEntityWrapper.java

* Update PlayerEventListener.java
2025-07-25 17:55:28 +02:00
Pierre Maurice Schwang
1054018e1e fix: formatting of plot-title in placeholder (#4702) 2025-07-24 20:50:23 +02:00
Pierre Maurice Schwang
0508a7f6b6 fix/ci: update publish plugin (#4707) 2025-07-24 20:48:01 +02:00
Lion_King287
da0a57a48c fix: /plot grant add doesn't send success message reliably (#4683)
* fix: move success message to correct execution point in /plot grant add

* fix: send `grants.added` message even if player is offline

---------

Co-authored-by: Alexander Brandes <mc.cache@web.de>
2025-07-24 18:25:40 +00:00
Lion_King287
87859b002b fix: misleading grants.added message to indicate single plot grant (#4682)
* chore: correct 'grants.added' message to reflect single plot grant behavior

* chore: add total grants to `grants.added` message
2025-07-24 18:24:50 +00:00
renovate[bot]
4f4ba07bd2 Update dependency com.diffplug.spotless to v7.2.0 (#4705)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-21 02:51:48 +00:00
Pierre Maurice Schwang
53771a3ece fix: test case for adventure update (#4703)
and bump adventure
2025-07-20 21:23:47 +00:00
JvstinXz
f020a6c6da feat: Added missing music_discs from 1.21.6 & 1.21.7 (#4694)
Added missing music_discs from 1.21.6 & 1.21.7
2025-07-14 21:50:08 +02:00
Alexander Brandes
d7e158747e Fixes #4693
Signed-off-by: Alexander Brandes <mc.cache@web.de>
2025-07-11 16:08:25 +02:00
renovate[bot]
4d64ea83ec Update dependency com.diffplug.spotless to v7.1.0 (#4692)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-08 03:47:44 +00:00
Alexander Brandes
7ab334562c Back to snapshot for development
Signed-off-by: Alexander Brandes <mc.cache@web.de>
2025-07-06 17:53:36 +02:00
11 changed files with 54 additions and 31 deletions

View File

@@ -2,7 +2,8 @@
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended",
":semanticCommitsDisabled"
":semanticCommitsDisabled",
"schedule:earlyMondays"
],
"automerge": true,
"labels": [

View File

@@ -837,7 +837,8 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
case "HOPPER_MINECART":
case "MINECART_MOB_SPAWNER":
case "SPAWNER_MINECART":
case "ENDER_CRYSTAL":
case "END_CRYSTAL":
case "ENDER_CRYSTAL": // Backwards compatibility for 1.20.4
case "MINECART_TNT":
case "TNT_MINECART":
case "CHEST_BOAT":
@@ -955,6 +956,8 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
case "ENDERMITE":
case "ENDER_DRAGON":
case "GHAST":
case "HAPPY_GHAST": // 1.21.6+
case "GHASTLING": // 1.21.6+
case "GIANT":
case "GUARDIAN":
case "HORSE":

View File

@@ -115,7 +115,7 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
this.dataByte = getOrdinal(Boat.Type.values(), boat.getBoatType());
storeInventory(boat);
}
case "ARROW", "EGG", "ENDER_CRYSTAL", "ENDER_PEARL", "ENDER_SIGNAL", "EXPERIENCE_ORB", "FALLING_BLOCK", "FIREBALL",
case "ARROW", "EGG", "END_CRYSTAL", "ENDER_CRYSTAL", "ENDER_PEARL", "ENDER_SIGNAL", "EXPERIENCE_ORB", "FALLING_BLOCK", "FIREBALL",
"FIREWORK", "FISHING_HOOK", "LEASH_HITCH", "LIGHTNING", "MINECART", "MINECART_COMMAND", "MINECART_MOB_SPAWNER",
"MINECART_TNT", "PLAYER", "PRIMED_TNT", "SLIME", "SMALL_FIREBALL", "SNOWBALL", "MINECART_FURNACE", "SPLASH_POTION",
"THROWN_EXP_BOTTLE", "WITHER_SKULL", "UNKNOWN", "SPECTRAL_ARROW", "SHULKER_BULLET", "DRAGON_FIREBALL", "AREA_EFFECT_CLOUD",
@@ -272,7 +272,7 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
this.dataByte = (byte) entity1.getPhase().ordinal();
return;
}
case "SKELETON", "WITHER_SKELETON", "GUARDIAN", "ELDER_GUARDIAN", "GHAST", "MAGMA_CUBE", "SQUID", "PIG_ZOMBIE", "HOGLIN",
case "SKELETON", "WITHER_SKELETON", "GUARDIAN", "ELDER_GUARDIAN", "GHAST", "HAPPY_GHAST", "GHASTLING", "MAGMA_CUBE", "SQUID", "PIG_ZOMBIE", "HOGLIN",
"ZOMBIFIED_PIGLIN", "PIGLIN", "PIGLIN_BRUTE", "ZOMBIE", "WITHER", "WITCH", "SPIDER", "CAVE_SPIDER", "SILVERFISH",
"GIANT", "ENDERMAN", "CREEPER", "BLAZE", "SHULKER", "SNOWMAN", "SNOW_GOLEM" -> {
storeLiving((LivingEntity) entity);
@@ -511,7 +511,7 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
((Slime) entity).setSize(this.dataByte);
return entity;
} */
case "ARROW", "EGG", "ENDER_CRYSTAL", "ENDER_PEARL", "ENDER_SIGNAL", "DROPPED_ITEM", "EXPERIENCE_ORB", "FALLING_BLOCK",
case "ARROW", "EGG", "END_CRYSTAL", "ENDER_CRYSTAL", "ENDER_PEARL", "ENDER_SIGNAL", "DROPPED_ITEM", "EXPERIENCE_ORB", "FALLING_BLOCK",
"FIREBALL", "FIREWORK", "FISHING_HOOK", "LEASH_HITCH", "LIGHTNING", "MINECART", "MINECART_COMMAND",
"MINECART_MOB_SPAWNER", "MINECART_TNT", "PLAYER", "PRIMED_TNT", "SMALL_FIREBALL", "SNOWBALL",
"SPLASH_POTION", "THROWN_EXP_BOTTLE", "SPECTRAL_ARROW", "SHULKER_BULLET", "AREA_EFFECT_CLOUD",
@@ -676,7 +676,7 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
restoreLiving((LivingEntity) entity);
return entity;
}
case "ENDERMITE", "GHAST", "MAGMA_CUBE", "SQUID", "PIG_ZOMBIE", "HOGLIN", "PIGLIN", "ZOMBIFIED_PIGLIN", "PIGLIN_BRUTE", "ZOMBIE", "WITHER", "WITCH", "SPIDER", "CAVE_SPIDER", "SILVERFISH", "GIANT", "ENDERMAN", "CREEPER", "BLAZE", "SNOWMAN", "SHULKER", "GUARDIAN", "ELDER_GUARDIAN", "SKELETON", "WITHER_SKELETON" -> {
case "ENDERMITE", "GHAST", "HAPPY_GHAST", "GHASTLING", "MAGMA_CUBE", "SQUID", "PIG_ZOMBIE", "HOGLIN", "PIGLIN", "ZOMBIFIED_PIGLIN", "PIGLIN_BRUTE", "ZOMBIE", "WITHER", "WITCH", "SPIDER", "CAVE_SPIDER", "SILVERFISH", "GIANT", "ENDERMAN", "CREEPER", "BLAZE", "SNOWMAN", "SHULKER", "GUARDIAN", "ELDER_GUARDIAN", "SKELETON", "WITHER_SKELETON" -> {
restoreLiving((LivingEntity) entity);
return entity;
}

View File

@@ -79,6 +79,7 @@ import com.plotsquared.core.util.task.TaskManager;
import com.plotsquared.core.util.task.TaskTime;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.bukkit.BukkitAdapter;
import com.sk89q.worldedit.util.Enums;
import com.sk89q.worldedit.world.block.BlockType;
import com.sk89q.worldedit.world.block.BlockTypes;
import io.papermc.lib.PaperLib;
@@ -159,6 +160,7 @@ import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.UUID;
@@ -183,6 +185,15 @@ public class PlayerEventListener implements Listener {
Material.WRITABLE_BOOK,
Material.WRITTEN_BOOK
);
/**
* The correct EntityType for End Crystal, determined once at class loading time.
* Tries END_CRYSTAL first (1.21+), falls back to ENDER_CRYSTAL (1.20.4 and older).
*/
private static final EntityType END_CRYSTAL_ENTITY_TYPE = Objects.requireNonNull(
Enums.findByValue(EntityType.class, "END_CRYSTAL", "ENDER_CRYSTAL")
);
private static final Set<String> DYES;
static {
@@ -1317,8 +1328,8 @@ public class PlayerEventListener implements Listener {
// reset the player's hand item if spawning needs to be cancelled.
if (type == Material.ARMOR_STAND || type == Material.END_CRYSTAL) {
Plot plot = location.getOwnedPlotAbs();
if (BukkitEntityUtil.checkEntity(type == Material.ARMOR_STAND ? EntityType.ARMOR_STAND : EntityType.ENDER_CRYSTAL,
plot)) {
EntityType entityType = type == Material.ARMOR_STAND ? EntityType.ARMOR_STAND : END_CRYSTAL_ENTITY_TYPE;
if (BukkitEntityUtil.checkEntity(entityType, plot)) {
event.setCancelled(true);
break;
}

View File

@@ -101,6 +101,10 @@ public class Grant extends Command {
);
} else {
access.set(access.get().orElse(0) + 1);
player.sendMessage(
TranslatableCaption.of("grants.added"),
TagResolver.resolver("grants", Tag.inserting(Component.text(access.get().orElse(0))))
);
}
}
} else {

View File

@@ -57,7 +57,7 @@ public class Music extends SubCommand {
"music_disc_far", "music_disc_mall", "music_disc_mellohi", "music_disc_stal",
"music_disc_strad", "music_disc_ward", "music_disc_11", "music_disc_wait", "music_disc_otherside",
"music_disc_pigstep", "music_disc_5", "music_disc_relic", "music_disc_creator",
"music_disc_creator_music_box", "music_disc_precipice"
"music_disc_creator_music_box", "music_disc_precipice", "music_disc_tears", "music_disc_lava_chicken"
);
// make sure all discs and the bedrock ("cancel") fit into the inventory

View File

@@ -63,4 +63,18 @@ public class PlotTitle {
return subtitle;
}
/**
* Provides a string representation of this plot title value (used in placeholders).
*
* @return the plot title representation in the format {@code "<title>" "<subtitle>"}
* @since TODO
*/
@Override
public String toString() {
return "\"%s\" \"%s\"".formatted(
this.title != null ? this.title : "",
this.subtitle != null ? this.subtitle : ""
);
}
}

View File

@@ -456,7 +456,7 @@
"category.command_category_debug": "<gray>Debug</gray>",
"category.command_category_administration": "<gray>Admin</gray>",
"grants.granted_plots": "<prefix><gold>Result: <gray><amount> </gray>grants left.</gold>",
"grants.added": "<prefix><gold><grants></gold> <gray>grant(s) have been added.</gray>",
"grants.added": "<prefix><gold>1</gold> <gray>grant has been added. (<grants> total grants)</gray>",
"events.event_denied": "<prefix><gold><value> </gold><gray>Cancelled by external plugin.</gray>",
"backups.backup_impossible": "<prefix><red>Backups are not enabled for this plot: <plot>.</red>",
"backups.backup_save_success": "<prefix><gold>The backup was created successfully.</gold>",

View File

@@ -37,12 +37,7 @@ class ClickStripTransformTest {
void removeClickEvent() {
var commonAction = ClickEvent.Action.OPEN_FILE;
var transform = new ClickStripTransform(EnumSet.of(commonAction));
var component = Component.text("Hello")
.clickEvent(ClickEvent.clickEvent(
commonAction,
"World"
)
);
var component = Component.text("Hello").clickEvent(ClickEvent.openFile("World"));
var transformedComponent = transform.transform(component);
Assertions.assertNull(transformedComponent.clickEvent());
}
@@ -52,10 +47,7 @@ class ClickStripTransformTest {
void ignoreClickEvent() {
var actionToRemove = ClickEvent.Action.SUGGEST_COMMAND;
var transform = new ClickStripTransform(EnumSet.of(actionToRemove));
var originalClickEvent = ClickEvent.clickEvent(
ClickEvent.Action.CHANGE_PAGE,
"World"
);
var originalClickEvent = ClickEvent.changePage(1337);
var component = Component.text("Hello")
.clickEvent(originalClickEvent);
var transformedComponent = transform.transform(component);
@@ -76,12 +68,12 @@ class ClickStripTransformTest {
.insertion("DEF");
var component = Component.text("Hello ")
.append(
inner.clickEvent(ClickEvent.clickEvent(ClickEvent.Action.OPEN_URL, "https://example.org"))
inner.clickEvent(ClickEvent.openUrl("https://example.org"))
);
var transformedComponent = transform.transform(component);
Assertions.assertFalse(transformedComponent.children().isEmpty()); // child still exists
Assertions.assertEquals(inner, transformedComponent.children().get(0)); // only the click event has changed
Assertions.assertNull(transformedComponent.children().get(0).clickEvent());
Assertions.assertEquals(inner, transformedComponent.children().getFirst()); // only the click event has changed
Assertions.assertNull(transformedComponent.children().getFirst().clickEvent());
}
}

View File

@@ -1,9 +1,7 @@
import com.diffplug.gradle.spotless.SpotlessPlugin
import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin
import com.vanniktech.maven.publish.SonatypeHost
import groovy.json.JsonSlurper
import xyz.jpenilla.runpaper.task.RunServer
import java.net.URI
plugins {
java
@@ -22,7 +20,7 @@ plugins {
}
group = "com.intellectualsites.plotsquared"
version = "7.5.4"
version = "7.5.5-SNAPSHOT"
if (!File("$rootDir/.git").exists()) {
logger.lifecycle("""
@@ -172,7 +170,7 @@ subprojects {
url.set("https://github.com/IntellectualSites/PlotSquared/issues")
}
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
publishToMavenCentral()
}
}
@@ -206,7 +204,7 @@ tasks.getByName<Jar>("jar") {
enabled = false
}
val supportedVersions = listOf("1.19.4", "1.20.6", "1.21.1", "1.21.3", "1.21.4", "1.21.5")
val supportedVersions = listOf("1.19.4", "1.20.6", "1.21.1", "1.21.3", "1.21.4", "1.21.5", "1.21.6", "1.21.7", "1.21.8")
tasks {
register("cacheLatestFaweArtifact") {
val lastSuccessfulBuildUrl = uri("https://ci.athion.net/job/FastAsyncWorldEdit/lastSuccessfulBuild/api/json").toURL()

View File

@@ -7,7 +7,7 @@ checkerqual = "3.49.5"
gson = "2.10"
guava = "31.1-jre"
snakeyaml = "2.0"
adventure = "4.21.0"
adventure = "4.23.0"
adventure-bukkit = "4.4.0"
log4j = "2.19.0"
@@ -35,8 +35,8 @@ serverlib = "2.3.7"
# Gradle plugins
shadow = "8.3.8"
grgit = "4.1.1"
spotless = "7.0.4"
publish = "0.33.0"
spotless = "7.2.0"
publish = "0.34.0"
runPaper = "2.3.1"
[libraries]