Add options to control mob cap implementation#880
Draft
Alexandra-Myers wants to merge 7 commits intosmartcmd:mainfrom
Draft
Add options to control mob cap implementation#880Alexandra-Myers wants to merge 7 commits intosmartcmd:mainfrom
Alexandra-Myers wants to merge 7 commits intosmartcmd:mainfrom
Conversation
Author
|
does anyone have any suggested software for dealing with swf files? |
Author
Author
Author
I know what they are, however I don't know how to use them. |
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.



Description
This is more or less an expansion of #789, preserving LCE functionality by default whilst letting the user expand the mob cap themselves.
This PR also allows for the removal of the mob cap, with the introduction of per-chunk caps based on Java Edition 1.8.8, as well as 4J's comments on what they changed from Java.
Changes
Previous Behavior
Previously, the limits for certain mob groups in their count was unchangeable, and the limits were enforced level wide rather than per chunk.
Root Cause
This was not erroneous, but was rather a design decision to allow for better performance on the devices it ran on.
New Behavior
NOTE: I have yet to implement the UI changes for world options as of writing this. It should be done before this PR gets merged.
There is now an option for the world to control the limits. By default, it uses the same logic as existed before this version, however there is four options:
Small/0 (Existing mob caps, default logic)
Medium/1 (Mob caps as of #789)
Large/2 (A custom largely expanded version of the mob caps, 100 Monsters, 100 Animals, 40 Ambient, 15 Squid, 24 Wolves, 24 Chickens, 16 Mooshrooms, 32 Snow Golems, 32 Iron Golems, 3 Bosses, 100 Villagers from Breeding, and all other caps are derived from the base ones.)
Unlimited/3 (Does NOT remove a mob cap, rather, breeding, spawn eggs, and construction are all unlimited, and spawning works exactly like in Java, with the base size per chunk for the mob category (leftover in original LCE code) being scaled by the amount of loaded chunks and then scaled back down by a magic number (it is literally called MAGIC_NUMBER in official mappings for the modern game), which is then used as the mob cap for that category, effectively acting as the mob caps used in LCE, except more dynamic.)
Fix Implementation
Stores
eGameHostOption_WorldMobCaponto game host options using the bitmask 0xC0000000.Added
MobCategory::updateMobCapswhich updates the mob cap fields (this will not happen if it is set to unlimited), which are no longer constants. This function is called inUIScene_CreateWorldMenu::CreateGame,UIScene_LoadMenu::tick, andMinecraftServer::initServer.Added
world-mob-capto server.properties to control it on the dedicated server.Added a slider to
UIScene_LaunchMoreOptionsMenufor modifying the mob cap setting.Inside of
Level::canCreateMore, added a check for ifeGameHostOption_WorldMobCapis set to Unlimited (3), returning true early if so.Removed the
maxPerLevelparameter from theMobCategoryconstructor, instead attaching default values statically usingMobCategory::updateMobCaps.Inside of
MobSpawner::tick, references tomobCategory->getMaxInstancesPerLevel()were moved to their own variable, as now ifeGameHostOption_WorldMobCapis Unlimited, the max instances will be updated to instead use Java's math, as so:AI Use Disclosure
No AI was used in the making of this Pull Request.
Related Issues