Skip to content
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

Add Compact Machines tweak to properly control mob spawn checks #540

Merged
merged 4 commits into from
Aug 24, 2024

Conversation

jchung01
Copy link
Contributor

Checks for natural mob spawns can be rather expensive in the Compact Machines (CM) dimension as there is no place for them to spawn. This can have a noticeable impact on server TPS, scaling further based on the number of players loading chunks in the dimension (example Spark report). CM actually has config settings that are seemingly related, allowHostileSpawns and allowPeacefulSpawns, but they only control forced spawns that occur through the machine's actual tile entity updates.

This PR registers the necessary properties for the CM dimension to properly respect its config values to disable both types of mob spawns, potentially improving server performance. I would like to emphasize that this tweak only enhances existing config values in the CM config, so the aforementioned config values also must be disabled for any perceivable change in performance. Disabling both results in the best performance, but that is up to the user to configure.

Also added BedPatch to the obsolete mods, with some comments on the relevant Forge PRs.

Copy link

what-the-diff bot commented Aug 24, 2024

PR Summary

  • Enhancement to the Compact Machines section in the README
    An update to the README.md file has been made which adds a reference to the "Allowed Spawns Improvement" feature in the Compact Machines section.

  • Toggle switch for the new feature in Compact Machines
    In the UTConfigMods.java file, a new boolean switch has been introduced. This allows for turning on or off the "Allowed Spawns Improvement" feature in the Compact Machines category.

  • Code Integration for the new feature
    The file UTMixinLoader.java now includes a mixin for "Allowed Spawns Improvement" specific to the Compact Machines mod.

  • Changes to file organization
    Some files have been reorganised to improve structure and readability. Specifically, UTCubeToolsMixin.java has been moved to mods/compactmachines/render/mixin/, and new files UTChunkGeneratorMachinesMixin.java and UTWorldProviderMachinesMixin.java have been added to mods/compactmachines/spawns/mixin/ for better modularization of code.

  • Comments on the Obsolete Mods
    Noteworthy comments on the obsolete mods have been updated in UTObsoleteModsHandler.java, indicating that the fix for the "bedpatch" mod has now been incorporated into Forge.

  • Revised naming convention for mixin files
    The mixin file previously named mixins.mods.compactmachines.json is now mixins.mods.compactmachines.render.json, reflecting its specific role in rendering. In addition, a new mixins.mods.compactmachines.spawns.json has been added, demonstrating differentiation of responsibilities for different aspects of the mod.

@ACGaming ACGaming merged commit eba7fbd into ACGaming:main Aug 24, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants