Skip to content

Conversation

@WaitingIdly
Copy link
Collaborator

changes in this PR:

  • add the ability to set the default GameRules. can be done one-by-one or en-mass.
  • when a gamerule that doesnt exist tries to be added, log a warning unless the user has run gameRule.setWarnNewGameRule(false).
  • add a command /gs applyDefaultGameRules to apply these in-game.
  • add examples for this
  • the default gamerules are applied when WorldEvent.CreateSpawnPosition is fired - as far as i can tell, it is only fired once, when the world is created. other places that do similar things listen to FMLServerStartingEvent (applies on every load), WorldEvent.Load (applies on every load), and a particularly daring one did EntityJoinWorldEvent.
    • i tested WorldEvent.CreateSpawnPosition on both client and server, and it only runs if the level.dat does not exist (something which tripped me up on the server for a bit due to always terminating the run instead of stopping the server).
  • fix the server using the run/examples folder instead of examples when groovyscript.use_examples_folder is set to true. bug only affects us.

@WaitingIdly WaitingIdly added the enhancement New feature or request label Dec 5, 2024
Copy link
Member

@brachy84 brachy84 left a comment

Choose a reason for hiding this comment

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

epic

# Conflicts:
#	examples/postInit/custom/vanilla.groovy
#	src/main/java/com/cleanroommc/groovyscript/compat/vanilla/VanillaModule.java
@brachy84 brachy84 merged commit 2de715d into CleanroomMC:master Dec 10, 2024
@WaitingIdly WaitingIdly deleted the default-gamerules branch August 28, 2025 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants