Add options to control mob cap implementation#880
Open
Alexandra-Myers wants to merge 23 commits intosmartcmd:mainfrom
Open
Add options to control mob cap implementation#880Alexandra-Myers wants to merge 23 commits intosmartcmd:mainfrom
Alexandra-Myers wants to merge 23 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. |
Author
|
Okay, PR ready. |
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 remove the mob cap.
This PR introduces 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
By default, it uses the same logic as existed before this version, however there is now an option to turn off mob caps, when true it is as follows:
Does NOT remove the mob cap for spawning, 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, though I edited it to keep the max count the same when one player is on) 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 0x40000000.Added
no-mob-capto server.properties to control it on the dedicated server.Added a checkbox to
UIScene_LaunchMoreOptionsMenufor modifying the mob cap setting.Inside of
Level::canCreateMore, added a check for ifeGameHostOption_NoMobCapis enabled, returning true early if so.Removed the
maxPerLevelparameter from theMobCategoryconstructor, instead attaching default values statically withinMobCategory::staticCtor()(later can become user controlled with a better config system, ideally).Inside of
MobSpawner::tick, references tomobCategory->getMaxInstancesPerLevel()were moved to their own variable, as now ifeGameHostOption_NoMobCapis enabled, the max instances will be updated to instead use Java's math, as so:Inside of
MobCategory, added a fieldm_eJavaBase, which is used instead ofm_eBasewheneGameHostOption_NoMobCapis enabled, and is in most cases the same asm_eBaseexcept for the creature category, which has eTYPE_ANIMAL set instead, allowing wolves, chickens, and mooshrooms to be included.Biome::getMobswill now return the fieldall_friendlies(of type std::vector<Biome::MobSpawnerData *>) added toBiomewheneGameHostOption_NoMobCapis enabled, and if it was empty before, fillsall_friendlieswith values offriendlies,friendies_chicken,friendlies_wolf, andfriendlies_mushroomcow(unless there is no contents inside of these).AI Use Disclosure
No AI was used in the making of this Pull Request.
Related Issues