mirror of
https://github.com/EternalCodeTeam/EternalCombat.git
synced 2026-11-05 01:00:11 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
786d480a11 | ||
|
|
6546694c7c | ||
|
|
e3508f3be6 |
No files matched your search
@@ -143,7 +143,7 @@ With Maven:
|
||||
With Gradle:
|
||||
|
||||
```kts
|
||||
compileOnly("com.eternalcode:eternalcombat-api:2.5.2")
|
||||
compileOnly("com.eternalcode:eternalcombat-api:2.6.0-SNAPSHOT")
|
||||
```
|
||||
|
||||
With Maven:
|
||||
@@ -153,7 +153,7 @@ With Maven:
|
||||
<dependency>
|
||||
<groupId>com.eternalcode</groupId>
|
||||
<artifactId>eternalcombat-api</artifactId>
|
||||
<version>2.5.2</version>
|
||||
<version>2.6.0-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
@@ -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"
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ plugins {
|
||||
}
|
||||
|
||||
group = "com.eternalcode"
|
||||
version = "2.5.2"
|
||||
version = "2.6.0-SNAPSHOT"
|
||||
|
||||
tasks.compileJava {
|
||||
options.compilerArgs = listOf("-Xlint:deprecation", "-parameters")
|
||||
|
||||
@@ -4,7 +4,7 @@ plugins {
|
||||
}
|
||||
|
||||
group = "com.eternalcode"
|
||||
version = "2.5.2"
|
||||
version = "2.6.0-SNAPSHOT"
|
||||
|
||||
java {
|
||||
withSourcesJar()
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
+18
-10
@@ -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());
|
||||
}
|
||||
|
||||
+2
-1
@@ -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
@@ -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
|
||||
|
||||
Reference in new issue
Block a user