Skip to content

Ajout d'un cooldown de téléportation lors d'un combat#1340

Draft
ar1hurgit wants to merge 1 commit into
ServerOpenMC:masterfrom
ar1hurgit:issue-1035-pvp-cooldown-run-dev-server
Draft

Ajout d'un cooldown de téléportation lors d'un combat#1340
ar1hurgit wants to merge 1 commit into
ServerOpenMC:masterfrom
ar1hurgit:issue-1035-pvp-cooldown-run-dev-server

Conversation

@ar1hurgit

Copy link
Copy Markdown

Petit résumé de la PR

Ajout d'un cooldown de combat qui bloque les téléportations tant que le joueur est encore en combat, et ajout d'une task Gradle
unDevServer pour lancer un serveur Paper local avec le plugin compilé.

Ce que ça rajoute

  • Blocage des téléportations via /spawn, /home, /city warp et /tpa pendant le cooldown de combat.
  • Message de feedback quand le joueur essaie de se téléporter pendant le combat.
  • Enregistrement du listener de combat dans le gestionnaire des listeners.
  • Task
    unDevServer pour lancer un serveur Paper local et copier le jar du plugin dans
    un/plugins.
  • Mise à jour des textes de traduction pour le message de cooldown.

Issue liée

Validation avant merge

  • Suivre le Code de Conduite
  • Enlever tous les imports non utilisés
  • Bien documenter la feature
  • Fournir un profileur (si besoin/demandé par un admin)
  • Avoir une milestone associée à la PR
  • Valider tous les checks
  • Tester et valider la feature/changement

Notes de test

  • ./gradlew test compile, mais la suite contient des échecs existants hors périmètre de cette PR.

@iambibi iambibi changed the title [FEAT] Ajoute pvp cooldown + task runDevServer (+ v0.0.1) Ajoute d'un cooldown de téléportation lors d'un combat Jul 10, 2026
@iambibi iambibi added this to the 2.5.0-beta-1 milestone Jul 10, 2026
@iambibi iambibi added the 📦 Feature Ajout d'une fonctionnalité label Jul 10, 2026

@iambibi iambibi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beaucoup de choses à changer et à justifier
Si ta PR est prete a etre review d'ailleurs mets la ouverte et pas en draft

Comment on lines +118 to +120
if (!PlayerUtils.sendFadeTitleTeleport(player, loc)) {
return;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!PlayerUtils.sendFadeTitleTeleport(player, loc)) {
return;
}
if (!PlayerUtils.sendFadeTitleTeleport(player, loc)) return;

Comment on lines +34 to +36
if (!PlayerUtils.sendFadeTitleTeleport(player, spawnLocation)) {
return;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!PlayerUtils.sendFadeTitleTeleport(player, spawnLocation)) {
return;
}
if (!PlayerUtils.sendFadeTitleTeleport(player, spawnLocation)) return;

Comment on lines +41 to +43
if (!PlayerUtils.sendFadeTitleTeleport(target, spawnLocation)) {
return;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!PlayerUtils.sendFadeTitleTeleport(target, spawnLocation)) {
return;
}
if (!PlayerUtils.sendFadeTitleTeleport(target, spawnLocation)) return;

Comment on lines +14 to +16
if (!(event.getEntity() instanceof Player player)) {
return;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!(event.getEntity() instanceof Player player)) {
return;
}
if (!(event.getEntity() instanceof Player player)) return;

Comment on lines +18 to +20
if (!(event.getDamager() instanceof Player)) {
return;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!(event.getDamager() instanceof Player)) {
return;
}
if (!(event.getDamager() instanceof Player)) return;

public static void sendFadeTitleTeleport(Player player, Location location) {
if (PlayerSettingsManager.getPlayerSettings(player.getUniqueId()).getSetting(SettingType.TELEPORT_TITLE_FADE)) {

private static final long TELEPORT_DELAY_TICKS = 14L;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pourquoi faire une constante pour ça? enleve ça

Comment on lines +42 to +45
Duration.ofMillis(1000),
Duration.ofMillis(500),
Duration.ofMillis(500)
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pourquoi mettre des entiers difficiles a composer au lieu d'avant

Comment on lines +32 to +34
if (!canTeleport(player)) {
return false;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!canTeleport(player)) {
return false;
}
if (!canTeleport(player)) return false;

Comment on lines +64 to +66
if (remainingSeconds == 0) {
return true;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (remainingSeconds == 0) {
return true;
}
if (remainingSeconds == 0) return true;

Comment thread build.gradle
Comment on lines +136 to +198
def serverJar = file("run/paper.jar")
def paperUrl = "https://fill-data.papermc.io/v1/objects/8600cc3b91ea38d7e836d562550b31d0fa3ed785d14dffc1a6d9dc1d36c21fa5/paper-26.2-56.jar"

tasks.register("runDevServer") {
dependsOn shadowJar

doLast {
mkdir("run")
mkdir("run/plugins")

if (!serverJar.exists()) {
println("Téléchargement de Paper...")

new URL(paperUrl).withInputStream { input ->
serverJar.withOutputStream { output ->
output << input
}
}
}

copy {
from shadowJar.archiveFile
into "run/plugins"
rename { "OpenMC.jar" }
}

def javaExe = javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}.get().executablePath.asFile.absolutePath

def process = new ProcessBuilder(
javaExe,
"-Xms2G",
"-Xmx2G",
"-jar",
serverJar.name,
"--nogui"
)
.directory(file("run"))
.redirectErrorStream(true)
.start()

Thread.start {
process.inputStream.eachLine {
println(it)
}
}

Thread.start {
def writer = new BufferedWriter(new OutputStreamWriter(process.outputStream))
System.in.withReader { reader ->
String line
while ((line = reader.readLine()) != null) {
writer.write(line)
writer.newLine()
writer.flush()
}
}
}

process.waitFor()
}
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

finalement enleve ça c'est dégeu

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fait toi une task personnelle

@iambibi

iambibi commented Jul 11, 2026

Copy link
Copy Markdown
Member

Ici tu as pas encore fais les changements

@ar1hurgit

Copy link
Copy Markdown
Author

okok oe je vois

@iambibi iambibi changed the title Ajoute d'un cooldown de téléportation lors d'un combat Ajout d'un cooldown de téléportation lors d'un combat Jul 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📦 Feature Ajout d'une fonctionnalité

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] Ajout d'un Combat Cooldown

2 participants