Skip to content

add Default GameRules #279

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Dec 10, 2024
Merged

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
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