Ajout d'un cooldown de téléportation lors d'un combat#1340
Conversation
iambibi
left a comment
There was a problem hiding this comment.
Beaucoup de choses à changer et à justifier
Si ta PR est prete a etre review d'ailleurs mets la ouverte et pas en draft
| if (!PlayerUtils.sendFadeTitleTeleport(player, loc)) { | ||
| return; | ||
| } |
There was a problem hiding this comment.
| if (!PlayerUtils.sendFadeTitleTeleport(player, loc)) { | |
| return; | |
| } | |
| if (!PlayerUtils.sendFadeTitleTeleport(player, loc)) return; |
| if (!PlayerUtils.sendFadeTitleTeleport(player, spawnLocation)) { | ||
| return; | ||
| } |
There was a problem hiding this comment.
| if (!PlayerUtils.sendFadeTitleTeleport(player, spawnLocation)) { | |
| return; | |
| } | |
| if (!PlayerUtils.sendFadeTitleTeleport(player, spawnLocation)) return; |
| if (!PlayerUtils.sendFadeTitleTeleport(target, spawnLocation)) { | ||
| return; | ||
| } |
There was a problem hiding this comment.
| if (!PlayerUtils.sendFadeTitleTeleport(target, spawnLocation)) { | |
| return; | |
| } | |
| if (!PlayerUtils.sendFadeTitleTeleport(target, spawnLocation)) return; |
| if (!(event.getEntity() instanceof Player player)) { | ||
| return; | ||
| } |
There was a problem hiding this comment.
| if (!(event.getEntity() instanceof Player player)) { | |
| return; | |
| } | |
| if (!(event.getEntity() instanceof Player player)) return; |
| if (!(event.getDamager() instanceof Player)) { | ||
| return; | ||
| } |
There was a problem hiding this comment.
| 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; |
There was a problem hiding this comment.
pourquoi faire une constante pour ça? enleve ça
| Duration.ofMillis(1000), | ||
| Duration.ofMillis(500), | ||
| Duration.ofMillis(500) | ||
| ) |
There was a problem hiding this comment.
pourquoi mettre des entiers difficiles a composer au lieu d'avant
| if (!canTeleport(player)) { | ||
| return false; | ||
| } |
There was a problem hiding this comment.
| if (!canTeleport(player)) { | |
| return false; | |
| } | |
| if (!canTeleport(player)) return false; |
| if (remainingSeconds == 0) { | ||
| return true; | ||
| } |
There was a problem hiding this comment.
| if (remainingSeconds == 0) { | |
| return true; | |
| } | |
| if (remainingSeconds == 0) return true; |
| 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() | ||
| } | ||
| } |
There was a problem hiding this comment.
finalement enleve ça c'est dégeu
|
Ici tu as pas encore fais les changements |
|
okok oe je vois |
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
unDevServer pour lancer un serveur Paper local et copier le jar du plugin dans
un/plugins.
Issue liée
Validation avant merge
Notes de test