Compare commits

...
2 Commits
Author SHA1 Message Date
Michał Wojtas 786d480a11 GH-446 Bump runpaper version to 26.3, fix wrong config instance in SpearService, update names for better readability (#446) 2026-10-21 22:20:41 +02:00
renovate[bot] 6546694c7c dependency: Update Gradle to v9.8.0 (#441)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-09-25 18:18:04 +02:00
7 changed files with 28 additions and 19 deletions

No files matched your search

+1 -1
View File
@@ -28,7 +28,7 @@ object Versions {
const val LANDS_API = "7.25.4"
const val GRIEF_PREVENTION = "16.18.7"
const val WORLDEDIT = "3ISh7ADm" //cannot use numeric version bc of duplicated version on modrinth
const val PACKETEVENTS = "2.13.0"
const val PACKETEVENTS = "2.14.0"
}
@@ -13,10 +13,10 @@ tasks {
languageVersion.set(JavaLanguageVersion.of(25))
})
minecraftVersion("26.2")
downloadPlugins.modrinth("WorldEdit", "7.4.6-beta-01")
downloadPlugins.modrinth("PacketEvents", "2.13.0+spigot")
downloadPlugins.modrinth("WorldGuard", "7.0.19")
minecraftVersion("26.3")
downloadPlugins.modrinth("WorldEdit", "7.4.6")
downloadPlugins.modrinth("PacketEvents", "2.14.0+spigot")
downloadPlugins.modrinth("WorldGuard", "7.0.20")
downloadPlugins.modrinth("LuckPerms", "v5.5.53-bukkit")
downloadPlugins.modrinth("GriefPrevention", Versions.GRIEF_PREVENTION)
}
+1 -1
View File
@@ -119,7 +119,7 @@ tasks {
}
runPaper.folia.registerTask {
minecraftVersion("1.21.11")
minecraftVersion("26.3")
downloadPlugins.modrinth("PacketEvents", "${Versions.PACKETEVENTS}+spigot")
}
@@ -221,7 +221,7 @@ public final class CombatPlugin extends JavaPlugin implements EternalCombatApi {
new KnockbackMountController(noticeService, this.regionProvider, this.fightManager).register(this);
new SpearLungeController(this, fightManager, spearService, pluginConfig.spear, noticeService);
new SpearLungeController(this, fightManager, spearService, pluginConfig, noticeService);
eventManager.subscribe(
PlayerDeathEvent.class,
@@ -1,5 +1,6 @@
package com.eternalcode.combat.fight.spear;
import com.eternalcode.combat.config.implementation.PluginConfig;
import com.eternalcode.combat.fight.FightManager;
import com.eternalcode.combat.notification.NoticeService;
import com.eternalcode.combat.util.DurationUtil;
@@ -22,7 +23,13 @@ public class SpearLungeController implements Listener {
private final SpearService spearService;
public SpearLungeController(Plugin plugin, FightManager fightManager, SpearService spearService, SpearSettings settings, NoticeService noticeService) {
public SpearLungeController(
Plugin plugin,
FightManager fightManager,
SpearService spearService,
PluginConfig config,
NoticeService noticeService
) {
this.spearService = spearService;
try {
@@ -37,7 +44,7 @@ public class SpearLungeController implements Listener {
this,
EventPriority.NORMAL,
(listener, event) -> {
if (!settings.lungeCooldown || !lungeEventClass.isInstance(event)) {
if (!config.spear.lungeCooldown || !lungeEventClass.isInstance(event)) {
return;
}
@@ -48,23 +55,24 @@ public class SpearLungeController implements Listener {
return;
}
UUID uuid = player.getUniqueId();
UUID playerId = player.getUniqueId();
if (settings.onlyForFight && !fightManager.isInCombat(uuid)) {
if (config.spear.onlyForFight && !fightManager.isInCombat(playerId)) {
return;
}
if (this.spearService.isOnCooldown(uuid)) {
if (this.spearService.isOnCooldown(playerId)) {
setCancelledHandle.invoke(event, true);
noticeService.create()
.player(uuid)
.notice(settings.lungeOnCooldown)
.placeholder("{TIME}", DurationUtil.format(spearService.getRemainingCooldown(uuid), !settings.useMillis))
.player(playerId)
.notice(config.spear.lungeOnCooldown)
.placeholder("{TIME}", DurationUtil.format(spearService.getRemainingCooldown(playerId), !config.spear.useMillis))
.send();
return;
return;
}
spearService.saveCooldown(uuid);
spearService.saveCooldown(playerId);
} catch (Throwable e) {
plugin.getLogger().warning("Failed to handle EntityLungeEvent: " + e.getMessage());
}
@@ -23,7 +23,8 @@ public class SpearSettings extends OkaeriConfig {
"# Notice sent to the players that try to use spears before cooldown ends.",
"# Placeholder: {TIME} - time left of cooldown"
})
public Notice lungeOnCooldown = Notice.builder().actionBar("<dark_red>Spear cannot be used for next <red>{TIME}</red></dark_red>")
public Notice lungeOnCooldown = Notice.builder()
.chat("<dark_red>Spear cannot be used for next <red>{TIME}</red></dark_red>")
.build();
}
+1 -1
View File
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.8.0-bin.zip
networkTimeout=10000
retries=0
retryBackOffMs=500