Repository navigation
Conversation
Comment on lines
43
to
+58
| World world = event.getPlayer().getWorld(); | ||
| world.setGameRule(GameRules.PLAYERS_SLEEPING_PERCENTAGE, getPercentage(world.getPlayers().size() + 1)); | ||
| world.setGameRule(GameRules.PLAYERS_SLEEPING_PERCENTAGE, getPercentage(world.getPlayers())); | ||
| } | ||
|
|
||
| @EventHandler | ||
| public void onQuit(PlayerQuitEvent event) { | ||
| World world = event.getPlayer().getWorld(); | ||
| world.setGameRule(GameRules.PLAYERS_SLEEPING_PERCENTAGE, getPercentage(world.getPlayers().size() - 1)); | ||
| world.setGameRule(GameRules.PLAYERS_SLEEPING_PERCENTAGE, getPercentage(world.getPlayers())); | ||
| } | ||
|
|
||
| @EventHandler | ||
| public void onChangeWorld(PlayerChangedWorldEvent event) { | ||
| World oldWorld = event.getFrom(); | ||
| World newWorld = event.getPlayer().getWorld(); | ||
| oldWorld.setGameRule(GameRules.PLAYERS_SLEEPING_PERCENTAGE, getPercentage(oldWorld.getPlayers().size())); | ||
| newWorld.setGameRule(GameRules.PLAYERS_SLEEPING_PERCENTAGE, getPercentage(newWorld.getPlayers().size())); | ||
| oldWorld.setGameRule(GameRules.PLAYERS_SLEEPING_PERCENTAGE, getPercentage(oldWorld.getPlayers())); | ||
| newWorld.setGameRule(GameRules.PLAYERS_SLEEPING_PERCENTAGE, getPercentage(newWorld.getPlayers())); |
Member
There was a problem hiding this comment.
les size + 1 et - 1 c'est fait exprès faut les laisser, car les getPlayers return pas les joueurs qui join ou les joueurs qui leave
Member
|
ah et aussi faudrait check si le monde de halloween compte les joueurs comme joueurs qui doivent dormir |
Member
Author
La gamerule est appliquée par monde et ouais j'ai zappé de remettre les +1 et -1 |
Member
mais les joueurs dans d'autres mondes où ils peuvent dormir n'affectent pas le taux de dodos ? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Petit résumé de la PR:
Étape nécessaire afin que la PR soit fini (si PR en draft)
Decrivez vos changements