-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Add Mob burnInDaylight API #13491
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
base: main
Are you sure you want to change the base?
Add Mob burnInDaylight API #13491
Conversation
|
This PR has pivoted a bit, since what mobs burn in daylight is now dependent on a tag and no longer hardcoded, I've opted to move the methods to the Mob interface and use TriStates. Because of that this now also covers zombie nautili and zombie horses, and allows entities that normally don't burn in daylight to do so. |
|
|
||
| @Override | ||
| public boolean burnsInDaylight() { | ||
| return this.getHandle().burnInDaylightOverride.toBooleanOrElse(this.getHandle().getType().is(EntityTypeTags.BURN_IN_DAYLIGHT)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this method take the monsters burn environment into account?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe another method for consider that? (in any case this need to be mention in docs?)
or a separate PR for checks environment values and refer to that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's fine as long as it's documented. There's already an upcoming environment attribute api for later. Maybe the method should be named canBurnsInDaylight or something too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed it to also check the environment attribute now, in my eyes this method is supposed to reliably answer "would this mob normally burn if it was exposed to daylight" which relies on the attribute as well.
I do like the current name already, canBurnsInDaylight sounds a bit too similar to isBedWorks for my liking.
This was likely broken in 1.21.11 with the addition of the burn_in_daylight entity tag, isSunSensitive is now unused by vanilla. This PR overrides the isSunBurnTick similar to how it's done for phantoms and skeletons already.