diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index cb16465..624cc17 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -43,7 +43,7 @@ _Put an `x` in the boxes that apply. You can also fill these out after creating them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code._ -- [ ] I have read the CONTRIBUTING.md +- [ ] I have read the [CONTRIBUTING.md](https://github.com/OneLiteFeatherNET/.github/blob/main/CONTRIBUTING.md) - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have added necessary documentation (if appropriate) diff --git a/build.gradle.kts b/build.gradle.kts index df96fa2..b59d19a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -26,7 +26,7 @@ if (!File("$rootDir/.git").exists()) { } group = "net.onelitefeather" -version = "1.2.0" +version = "1.2.1" val supportedMinecraftVersions = listOf( "1.19.4", "1.20.6", diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index e644113..a4b76b9 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a441313..df97d72 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index b740cf1..f5feea6 100755 --- a/gradlew +++ b/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -84,7 +86,8 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum diff --git a/gradlew.bat b/gradlew.bat index 7101f8e..9b42019 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## diff --git a/settings.gradle.kts b/settings.gradle.kts index b48fda6..73cc6e6 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -21,11 +21,11 @@ dependencyResolutionManagement { version("modrinth", "2.+") version("hangar", "0.1.2") version("paper.yml", "0.6.0") - version("paper.run", "2.3.0") + version("paper.run", "2.3.1") version("shadowJar", "8.1.1") version("paper", "1.20.6-R0.1-SNAPSHOT") - version("bstats", "3.0.2") + version("bstats", "3.1.0") version("cloudcommand", "2.0.0-SNAPSHOT") @@ -34,14 +34,14 @@ dependencyResolutionManagement { // WorldGuard version("wgv6", "6.2") - version("wgv7", "7.0.10") + version("wgv7", "7.0.12") library("wg6", "com.sk89q.worldguard", "worldguard-legacy").versionRef("wgv6") library("wg7", "com.sk89q.worldguard", "worldguard-bukkit").versionRef("wgv7") // PlotSquared version("psv4", "4.453") - version("psv6", "1.46") - version("psv7", "1.46") + version("psv6", "1.51") + version("psv7", "1.51") library("psv4.core", "com.github.IntellectualSites.PlotSquared","Core").versionRef("psv4") library("psv4.bukkit", "com.github.IntellectualSites.PlotSquared","Bukkit").versionRef("psv4") diff --git a/src/main/java/net/onelitefeather/antiredstoneclockremastered/commands/DisplayActiveClocksCommand.java b/src/main/java/net/onelitefeather/antiredstoneclockremastered/commands/DisplayActiveClocksCommand.java index 29987ca..e91ae7f 100644 --- a/src/main/java/net/onelitefeather/antiredstoneclockremastered/commands/DisplayActiveClocksCommand.java +++ b/src/main/java/net/onelitefeather/antiredstoneclockremastered/commands/DisplayActiveClocksCommand.java @@ -54,10 +54,10 @@ private Component mapClockToMessage(RedstoneClock redstoneClock) { return Component.empty().hoverEvent(Component.translatable("antiredstoneclockremastered.command.display.clock.hover").asHoverEvent()).append( Component.translatable("antiredstoneclockremastered.command.display.clock.text") .arguments( + TranslationArgument.numeric(redstoneClock.getTriggerCount()), TranslationArgument.numeric(location.getBlockX()), TranslationArgument.numeric(location.getBlockY()), TranslationArgument.numeric(location.getBlockZ()), - TranslationArgument.numeric(redstoneClock.getTriggerCount()), Component.empty() .clickEvent(ClickEvent.callback(audience -> { if (audience instanceof final Player executor) { diff --git a/src/main/java/net/onelitefeather/antiredstoneclockremastered/service/RedstoneClockService.java b/src/main/java/net/onelitefeather/antiredstoneclockremastered/service/RedstoneClockService.java index ebab693..18ca5d1 100644 --- a/src/main/java/net/onelitefeather/antiredstoneclockremastered/service/RedstoneClockService.java +++ b/src/main/java/net/onelitefeather/antiredstoneclockremastered/service/RedstoneClockService.java @@ -10,7 +10,9 @@ import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; +import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -33,6 +35,7 @@ public final class RedstoneClockService { private List ignoredWorlds; private final ConcurrentHashMap activeClockTesters = new ConcurrentHashMap<>(); + private final ItemStack SILK_TOUCH_PICKAXE = new ItemStack(Material.DIAMOND_PICKAXE); public RedstoneClockService(@NotNull AntiRedstoneClockRemastered antiRedstoneClockRemastered) { this.antiRedstoneClockRemastered = antiRedstoneClockRemastered; @@ -43,6 +46,7 @@ public RedstoneClockService(@NotNull AntiRedstoneClockRemastered antiRedstoneClo this.notifyConsole = antiRedstoneClockRemastered.getConfig().getBoolean("clock.notifyConsole", true); this.dropItems = antiRedstoneClockRemastered.getConfig().getBoolean("clock.drop", false); this.ignoredWorlds = antiRedstoneClockRemastered.getConfig().getStringList("check.ignoredWorlds"); + SILK_TOUCH_PICKAXE.addEnchantment(Enchantment.SILK_TOUCH, 1); } public void checkAndUpdateClockStateWithActiveManual(@NotNull Location location, boolean state) { @@ -169,7 +173,7 @@ private void sendNotification(final Player player, final Location location) { private void breakBlock(@NotNull Location location) { Block block = location.getBlock(); if (this.dropItems) { - var drops = block.getDrops(); + var drops = block.getDrops(SILK_TOUCH_PICKAXE); drops.forEach(itemStack -> block.getWorld().dropItem(location, itemStack)); } Runnable removeTask = () -> block.setType(Material.AIR, true); diff --git a/src/main/java/net/onelitefeather/antiredstoneclockremastered/service/UpdateService.java b/src/main/java/net/onelitefeather/antiredstoneclockremastered/service/UpdateService.java index df88263..cfb603e 100644 --- a/src/main/java/net/onelitefeather/antiredstoneclockremastered/service/UpdateService.java +++ b/src/main/java/net/onelitefeather/antiredstoneclockremastered/service/UpdateService.java @@ -44,7 +44,7 @@ public void run() { } public void notifyConsole(ComponentLogger logger) { - if (this.remoteVersion.isHigherThan(this.localVersion)) { + if (this.remoteVersion != null && this.remoteVersion.isHigherThan(this.localVersion)) { logger.warn(Component.translatable("antiredstoneclockremastered.notify.update.console") .arguments(Component.text(localVersion.toString()), Component.text(remoteVersion.toString()), @@ -55,7 +55,7 @@ public void notifyConsole(ComponentLogger logger) { public void notifyPlayer(Player player) { - if (this.remoteVersion.isHigherThan(this.localVersion)) { + if (this.remoteVersion != null && this.remoteVersion.isHigherThan(this.localVersion)) { notifyPlayer(this.localVersion, this.remoteVersion, player); } } diff --git a/src/main/resources/antiredstoneclockremasterd.properties b/src/main/resources/antiredstoneclockremasterd.properties index cb600d9..8ba0cbd 100644 --- a/src/main/resources/antiredstoneclockremasterd.properties +++ b/src/main/resources/antiredstoneclockremasterd.properties @@ -1,8 +1,7 @@ service.notify.detected.clock= Redstone Clock detected at: X,Y,Z(,,) antiredstoneclockremastered.command.reload.success= The configuration has been reloaded. A server restart is still recommended instead of just reloads antiredstoneclockremastered.command.reload.description=Reloads the AntiRedstone Clock Remastered -antiredstoneclockremastered.command.display.clock.text=Clock(,,) was triggered -antiredstoneclockremastered.command.display.clock.title= Cached clocks \: +antiredstoneclockremastered.command.display.clock.text=Clock(,,) was triggered antiredstoneclockremastered.command.display.clock.hover=Click me to teleport antiredstoneclockremastered.command.display.description=Shows you all active cached Cocks antiredstoneclockremastered.command.feature.check.toggle.enabled= The function is now: Enabled diff --git a/src/main/resources/antiredstoneclockremasterd_de_DE.properties b/src/main/resources/antiredstoneclockremasterd_de_DE.properties index f94d36b..72ca57b 100644 --- a/src/main/resources/antiredstoneclockremasterd_de_DE.properties +++ b/src/main/resources/antiredstoneclockremasterd_de_DE.properties @@ -1,8 +1,7 @@ service.notify.detected.clock= Redstone-Clock erkannt\: X,Y,Z(,,) antiredstoneclockremastered.command.reload.success= Die Konfiguration wurde neu geladen. Ein Serverneustart wird immer noch empfohlen statt nur neu zu laden antiredstoneclockremastered.command.reload.description=Lade die AntiRedstone Clock Remastered neu -antiredstoneclockremastered.command.display.clock.text=Clock(,,) wurde ausgelöst -antiredstoneclockremastered.command.display.clock.title= Zwischengespeicherte-Clocks \: +antiredstoneclockremastered.command.display.clock.text=Clock(,,) was triggered antiredstoneclockremastered.command.display.clock.hover=Klicke mich, um dich zu teleportieren antiredstoneclockremastered.command.display.description=Zeigt alle aktiven Zwischengespeichert-Clocks antiredstoneclockremastered.command.feature.check.toggle.enabled= Die Funktion ist jetzt\: aktiviert diff --git a/src/main/resources/antiredstoneclockremasterd_fr_FR.properties b/src/main/resources/antiredstoneclockremasterd_fr_FR.properties index 937b6af..84c5ca2 100644 --- a/src/main/resources/antiredstoneclockremasterd_fr_FR.properties +++ b/src/main/resources/antiredstoneclockremasterd_fr_FR.properties @@ -1,33 +1,32 @@ -service.notify.detected.clock= Redstone Clock detected at\: X,Y,Z(,,) -antiredstoneclockremastered.command.reload.success= The configuration has been reloaded. A server restart is still recommended instead of just reloads -antiredstoneclockremastered.command.reload.description=Reloads the AntiRedstone Clock Remastered -antiredstoneclockremastered.command.display.clock.text=Clock(,,) was triggered -antiredstoneclockremastered.command.display.clock.title= Cached clocks \: -antiredstoneclockremastered.command.display.clock.hover=Click me to teleport -antiredstoneclockremastered.command.display.description=Shows you all active cached Cocks -antiredstoneclockremastered.command.feature.check.toggle.enabled= The function is now\: Enabled -antiredstoneclockremastered.command.feature.check.toggle.disabled= The function is now\: Disabled -antiredstoneclockremastered.command.feature.check.toggle.observer.description=Turn the detection function of obeservers on or off -antiredstoneclockremastered.command.feature.check.toggle.piston.description=Turn the detection function of pistons on or off -antiredstoneclockremastered.command.feature.check.toggle.comparator.description=Turn the detection function of comparators on or off -antiredstoneclockremastered.command.feature.check.toggle.sculk.description=Turn the detection function of sculks on or off -antiredstoneclockremastered.command.feature.check.toggle.redstone_and_repeater.description=Turn the detection function of redstone and repeaters on or off -antiredstoneclockremastered.command.feature.check.world.add= The world '' has been added to the ignored worlds list -antiredstoneclockremastered.command.feature.check.world.remove= The world '' has been removed from the ignored worlds list -antiredstoneclockremastered.command.feature.check.world.add.description=This command adds a world to the ignored worlds list -antiredstoneclockremastered.command.feature.check.world.remove.description=This command removes a world from the ignored worlds list -antiredstoneclockremastered.command.feature.check.region.add= The region '' has been added to the ignored regions list -antiredstoneclockremastered.command.feature.check.region.remove= The region '' has been removed from the ignored regions list -antiredstoneclockremastered.command.feature.check.region.add.description=This command adds a region to the ignored regions list -antiredstoneclockremastered.command.feature.check.region.remove.description=This command removes a region from the ignored regions list -antiredstoneclockremastered.command.feature.clock.set= The value of this function is now\: -antiredstoneclockremastered.command.feature.clock.toggle.autoBreak.description=Turn the function of auto break on or off -antiredstoneclockremastered.command.feature.clock.toggle.notifyAdmins.description=Turn the function of admin notifications on or off -antiredstoneclockremastered.command.feature.clock.toggle.notifyConsole.description=Turn the function of console notifications on or off -antiredstoneclockremastered.command.feature.clock.toggle.drop.description=Turn the function of drop items on or off -antiredstoneclockremastered.command.feature.clock.set.delay.description=Sets the desired value for the function -antiredstoneclockremastered.command.feature.clock.set.maxCount.description=Sets the desired value for the function -antiredstoneclockremastered.notify.donation.console=To keep the project alive, we ask for donations to our https\://opencollective.com/onelitefeather/projects/antiredstoneclock-remastered -antiredstoneclockremastered.notify.donation.player= To keep the project alive, we ask for donations to our OpenCollective -antiredstoneclockremastered.notify.update.player= Your version() is older than our latest published version (). Please update as soon as possible to get continued support. Or click me to get on the download page\! -antiredstoneclockremastered.notify.update.console=Your version() is older than our latest published version (). Please update as soon as possible to get continued support. Or click use this link \ No newline at end of file +service.notify.detected.clock= Horloge de redstone détectée en \: X,Y,Z(,,) +antiredstoneclockremastered.command.reload.success= La configuration a été rechargée. Un redémarrage du serveur est toujours recommandé au lieu de simples rechargements +antiredstoneclockremastered.command.reload.description=Recharger l'horloge AntiRedstone remastérisée +antiredstoneclockremastered.command.display.clock.text=L'horloge(,,) a été activée +antiredstoneclockremastered.command.display.clock.hover=Cliquez sur moi pour vous téléporter +antiredstoneclockremastered.command.display.description=Vous montre toutes les horloges actives en cache +antiredstoneclockremastered.command.feature.check.toggle.enabled= La fonction est maintenant \: Activée +antiredstoneclockremastered.command.feature.check.toggle.disabled= La fonction est maintenant \: Désactivée +antiredstoneclockremastered.command.feature.check.toggle.observer.description=Active ou désactive la fonction de détection des observers +antiredstoneclockremastered.command.feature.check.toggle.piston.description=Active ou désactive la fonction de détection des pistons +antiredstoneclockremastered.command.feature.check.toggle.comparator.description=Active ou désactive la fonction de détection des comparateurs +antiredstoneclockremastered.command.feature.check.toggle.sculk.description=Active ou désactive la fonction de détection des sculks +antiredstoneclockremastered.command.feature.check.toggle.redstone_and_repeater.description=Active ou désactive la fonction de détection de la redstone et des répéteurs +antiredstoneclockremastered.command.feature.check.world.add= Le monde '' a été ajouté à la liste des mondes ignorés +antiredstoneclockremastered.command.feature.check.world.remove= Le monde '' a été supprimé de la liste des mondes ignorés +antiredstoneclockremastered.command.feature.check.world.add.description=Cette commande ajoute un monde à la liste des mondes ignorés +antiredstoneclockremastered.command.feature.check.world.remove.description=Cette commande supprime un monde de la liste des mondes ignorés +antiredstoneclockremastered.command.feature.check.region.add= La région '' a été ajoutée à la liste des régions ignorées +antiredstoneclockremastered.command.feature.check.region.remove= La région '' a été retirée de la liste des régions ignorées +antiredstoneclockremastered.command.feature.check.region.add.description=Cette commande ajoute une région à la liste des régions ignorées +antiredstoneclockremastered.command.feature.check.region.remove.description=Cette commande supprime une région de la liste des régions ignorées +antiredstoneclockremastered.command.feature.clock.set= La valeur de cette fonction est maintenant \: +antiredstoneclockremastered.command.feature.clock.toggle.autoBreak.description=Active ou désactive la fonction de cassage automatique +antiredstoneclockremastered.command.feature.clock.toggle.notifyAdmins.description=Active ou désactive la fonction des notifications d'administration +antiredstoneclockremastered.command.feature.clock.toggle.notifyConsole.description=Active ou désactive la fonction des notifications de la console +antiredstoneclockremastered.command.feature.clock.toggle.drop.description=Active ou désactive la fonction de drop d'items +antiredstoneclockremastered.command.feature.clock.set.delay.description=Définit la valeur souhaitée pour la fonction +antiredstoneclockremastered.command.feature.clock.set.maxCount.description=Définit la valeur souhaitée pour la fonction +antiredstoneclockremastered.notify.donation.console=Pour assurer la continuité du projet, nous sollicitons des dons sur https\://opencollective.com/onelitefeather/projects/antiredstoneclock-remastered +antiredstoneclockremastered.notify.donation.player= Pour assurer la continuité du projet, nous sollicitons des dons sur notre OpenCollective +antiredstoneclockremastered.notify.update.player= Votre version () est plus ancienne que notre dernière version publiée (). Veuillez mettre à jour dès que possible pour continuer à bénéficier du support. Ou cliquez sur moi pour accéder à la page de téléchargement \! +antiredstoneclockremastered.notify.update.console=Votre version () est plus ancienne que notre dernière version publiée (). Veuillez mettre à jour dès que possible pour continuer à bénéficier du support. Ou cliquez sur ce lien \ No newline at end of file diff --git a/src/main/resources/antiredstoneclockremasterd_zh_CN.properties b/src/main/resources/antiredstoneclockremasterd_zh_CN.properties new file mode 100644 index 0000000..6991a53 --- /dev/null +++ b/src/main/resources/antiredstoneclockremasterd_zh_CN.properties @@ -0,0 +1,32 @@ +service.notify.detected.clock= 检测到此位置存在高频红石: X,Y,Z(,,) +antiredstoneclockremastered.command.reload.success= 配置文件已重载. 部分功能可能需要重启后才会生效 +antiredstoneclockremastered.command.reload.description=重载 AntiRedstone Clock Remastered +antiredstoneclockremastered.command.display.clock.text=高频红石(,,) 触发了 +antiredstoneclockremastered.command.display.clock.hover=点此传送 +antiredstoneclockremastered.command.display.description=显示所有已激活的缓存时钟 +antiredstoneclockremastered.command.feature.check.toggle.enabled= 功能: 启用 +antiredstoneclockremastered.command.feature.check.toggle.disabled= 功能: 禁用 +antiredstoneclockremastered.command.feature.check.toggle.observer.description=启用或禁用检测侦测器高频 +antiredstoneclockremastered.command.feature.check.toggle.piston.description=启用或禁用检测活塞高频 +antiredstoneclockremastered.command.feature.check.toggle.comparator.description=启用或禁用比较器高频 +antiredstoneclockremastered.command.feature.check.toggle.sculk.description=启用或禁用幽匿感测体高频 +antiredstoneclockremastered.command.feature.check.toggle.redstone_and_repeater.description=启用或禁用红石中继器高频 +antiredstoneclockremastered.command.feature.check.world.add= 世界 '' 已被添加至忽略列表 +antiredstoneclockremastered.command.feature.check.world.remove= 世界 '' 已从忽略列表中移除 +antiredstoneclockremastered.command.feature.check.world.add.description=将指定世界添加至忽略列表 +antiredstoneclockremastered.command.feature.check.world.remove.description=将指定世界从忽略表中移除 +antiredstoneclockremastered.command.feature.check.region.add= 区域'' 已被添加至忽略列表 +antiredstoneclockremastered.command.feature.check.region.remove= 区域 '' 已从忽略列表中移除 +antiredstoneclockremastered.command.feature.check.region.add.description=将指定区域添加至忽略列表 +antiredstoneclockremastered.command.feature.check.region.remove.description=将指定区域从忽略表中移除 +antiredstoneclockremastered.command.feature.clock.set= 该功能的值已设置为: +antiredstoneclockremastered.command.feature.clock.toggle.autoBreak.description=启用或禁用自动破坏功能 +antiredstoneclockremastered.command.feature.clock.toggle.notifyAdmins.description=启用或禁用管理员提醒功能 +antiredstoneclockremastered.command.feature.clock.toggle.notifyConsole.description=启用或禁用控制台提醒功能 +antiredstoneclockremastered.command.feature.clock.toggle.drop.description=启用或禁用掉落物品功能 +antiredstoneclockremastered.command.feature.clock.set.delay.description=为功能设置对应的延迟 +antiredstoneclockremastered.command.feature.clock.set.maxCount.description=为功能设置对应的最大数量 +antiredstoneclockremastered.notify.donation.console=为了维护计划, 请考虑通过 https://opencollective.com/onelitefeather/projects/antiredstoneclock-remastered 捐赠支持我们 +antiredstoneclockremastered.notify.donation.player= 为了维护计划, 请考虑向 OpenCollective 捐赠 +antiredstoneclockremastered.notify.update.player= 你的版本() 已旧于新版 (). 请尽快更新以获得支持. 或点此进入下载页! +antiredstoneclockremastered.notify.update.console=你的版本() 旧于发布的新版 (). 请尽快更新以获得支持, 或通过链接进行更新