Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/main/java/fr/ph1lou/werewolfplugin/configs/GroupAlgo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package fr.ph1lou.werewolfplugin.configs;

import fr.ph1lou.werewolfapi.annotations.Configuration;
import fr.ph1lou.werewolfapi.annotations.ConfigurationBasic;
import fr.ph1lou.werewolfapi.basekeys.ConfigBase;

@Configuration(config = @ConfigurationBasic(key = "werewolf.configurations.group_algo.name", loreKey = "werewolf.configurations.group_algo.description",
Copy link
Owner

Choose a reason for hiding this comment

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

dans key: utilisez une constante à définir dans ConfigBase dans werewolfapi

appearInMenu = false))
Copy link
Owner

Choose a reason for hiding this comment

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

une raison particulière pour ne pas le faire apparaitre dans le menu ?

public class GroupAlgo {
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package fr.ph1lou.werewolfplugin.listeners;

import fr.ph1lou.werewolfapi.basekeys.ConfigBase;
import fr.ph1lou.werewolfapi.basekeys.Prefix;
import fr.ph1lou.werewolfapi.basekeys.TimerBase;
import fr.ph1lou.werewolfapi.enums.Day;
Expand Down Expand Up @@ -41,7 +42,9 @@ public void onDay(DayEvent event) {

Bukkit.broadcastMessage(game.translate(Prefix.ORANGE, "werewolf.announcement.day",
Formatter.number(event.getNumber())));
groupSizeChange();
if(game.getConfig().isConfigActive("werewolf.configurations.group_algo.name")){
Copy link
Owner

Choose a reason for hiding this comment

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

la clef doit être mise en constante dans la classe ConfigBase dans Werewolfapi

Copy link
Author

Choose a reason for hiding this comment

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

J'ai pull request sur l'api

Copy link
Owner

Choose a reason for hiding this comment

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

@Sterll mais du coup la constante que tu as créé tu l'utilise ms pas dans l'annotation ?

Copy link
Author

Choose a reason for hiding this comment

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

C'est pck j'attendais que tu acceptais la pull request de l'api

Copy link
Owner

Choose a reason for hiding this comment

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

ok tu vas le changer bientot ?

groupSizeChange();
}


long duration = game.getConfig().getTimerValue(TimerBase.POWER_DURATION);
Expand Down Expand Up @@ -76,7 +79,9 @@ public void onNight(NightEvent event) {

Bukkit.broadcastMessage(game.translate(Prefix.YELLOW, "werewolf.announcement.night",
Formatter.number(event.getNumber())));
groupSizeChange();
if(game.getConfig().isConfigActive("werewolf.configurations.group_algo.name")){
Copy link
Owner

Choose a reason for hiding this comment

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

idem utilisez la constante définie plus haut

groupSizeChange();
}

if (duration > 0) {
BukkitUtils.scheduleSyncDelayedTask(game, () -> Bukkit.getPluginManager().callEvent(new DayWillComeEvent()), duration * 20);
Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/fr_FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -1746,6 +1746,10 @@
"troll_lover": {
"name": "Troll Saint Valentin"
},
"group_algo": {
"name": "Algorithme de Groupe",
"description": "Permet de désactiver l'algorithme des groupes de base"
},
"hidden_roles": {
"name": "Rôles Masqués",
"description": "permet d’activer le système de Rôles masqués sans avoir de Prêtresse dans la composition. \nUn joueur du Village est alors choisi aléatoirement au début de la partie sans qu'il le sache",
Expand Down
17 changes: 17 additions & 0 deletions werewolfplugin.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="4">
Copy link
Owner

Choose a reason for hiding this comment

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

il ne faut pas commit ce fichier à supprimer

<component name="FacetManager">
<facet type="minecraft" name="Minecraft">
<configuration>
<autoDetectTypes>
<platformType>MCP</platformType>
<platformType>SPIGOT</platformType>
</autoDetectTypes>
<projectReimportVersion>1</projectReimportVersion>
</configuration>
</facet>
</component>
<component name="McpModuleSettings">
<option name="srgType" value="SRG" />
</component>
</module>