Compare commits

..
1 Commits
Author SHA1 Message Date
Martin Sulikowski 3dd3ae9012 Fix head drop logic 2026-09-22 01:11:08 +02:00
8 changed files with 21 additions and 30 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.14.0"
const val PACKETEVENTS = "2.13.0"
}
@@ -13,10 +13,10 @@ tasks {
languageVersion.set(JavaLanguageVersion.of(25))
})
minecraftVersion("26.3")
downloadPlugins.modrinth("WorldEdit", "7.4.6")
downloadPlugins.modrinth("PacketEvents", "2.14.0+spigot")
downloadPlugins.modrinth("WorldGuard", "7.0.20")
minecraftVersion("26.2")
downloadPlugins.modrinth("WorldEdit", "7.4.6-beta-01")
downloadPlugins.modrinth("PacketEvents", "2.13.0+spigot")
downloadPlugins.modrinth("WorldGuard", "7.0.19")
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("26.3")
minecraftVersion("1.21.11")
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, noticeService);
new SpearLungeController(this, fightManager, spearService, pluginConfig.spear, noticeService);
eventManager.subscribe(
PlayerDeathEvent.class,
@@ -85,8 +85,8 @@ public class DropController implements DynamicListener<PlayerDeathEvent> {
return false;
}
if (this.dropSettings.headDropOnlyInCombat && inCombat) {
return true;
if (this.dropSettings.headDropOnlyInCombat) {
return inCombat;
}
if (this.dropSettings.headDropChance <= 0.0) {
@@ -1,6 +1,5 @@
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;
@@ -23,13 +22,7 @@ public class SpearLungeController implements Listener {
private final SpearService spearService;
public SpearLungeController(
Plugin plugin,
FightManager fightManager,
SpearService spearService,
PluginConfig config,
NoticeService noticeService
) {
public SpearLungeController(Plugin plugin, FightManager fightManager, SpearService spearService, SpearSettings settings, NoticeService noticeService) {
this.spearService = spearService;
try {
@@ -44,7 +37,7 @@ public class SpearLungeController implements Listener {
this,
EventPriority.NORMAL,
(listener, event) -> {
if (!config.spear.lungeCooldown || !lungeEventClass.isInstance(event)) {
if (!settings.lungeCooldown || !lungeEventClass.isInstance(event)) {
return;
}
@@ -55,24 +48,23 @@ public class SpearLungeController implements Listener {
return;
}
UUID playerId = player.getUniqueId();
UUID uuid = player.getUniqueId();
if (config.spear.onlyForFight && !fightManager.isInCombat(playerId)) {
if (settings.onlyForFight && !fightManager.isInCombat(uuid)) {
return;
}
if (this.spearService.isOnCooldown(playerId)) {
if (this.spearService.isOnCooldown(uuid)) {
setCancelledHandle.invoke(event, true);
noticeService.create()
.player(playerId)
.notice(config.spear.lungeOnCooldown)
.placeholder("{TIME}", DurationUtil.format(spearService.getRemainingCooldown(playerId), !config.spear.useMillis))
.player(uuid)
.notice(settings.lungeOnCooldown)
.placeholder("{TIME}", DurationUtil.format(spearService.getRemainingCooldown(uuid), !settings.useMillis))
.send();
return;
return;
}
spearService.saveCooldown(playerId);
spearService.saveCooldown(uuid);
} catch (Throwable e) {
plugin.getLogger().warning("Failed to handle EntityLungeEvent: " + e.getMessage());
}
@@ -23,8 +23,7 @@ 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()
.chat("<dark_red>Spear cannot be used for next <red>{TIME}</red></dark_red>")
public Notice lungeOnCooldown = Notice.builder().actionBar("<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.8.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.1-bin.zip
networkTimeout=10000
retries=0
retryBackOffMs=500