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

Fix piglin brutes spawning in air #1769

Merged
merged 2 commits into from
Jul 26, 2023
Merged

Fix piglin brutes spawning in air #1769

merged 2 commits into from
Jul 26, 2023

Conversation

aria1th
Copy link
Contributor

@aria1th aria1th commented Jul 24, 2023

Fixes #1546

The core cause was Piglin Brutes not having spawn condition, allowing it to pass every check except 'damage'.

This patch registers spawn condition check for piglin brutes.

This does not mean they will spawn in overworld / elsewhere, since spawn requires mob list entry first.

@altrisi
Copy link
Collaborator

altrisi commented Jul 24, 2023

No rule checks there, does this affect vanilla behaviour? Or does this only run with the rule on?

Also throw something (like new AssertionError) on static shadows please (unless I'm confusing them with something else).

@aria1th
Copy link
Contributor Author

aria1th commented Jul 24, 2023

@altrisi for normal cases, it should not be affected, but there might be some cases that could be inconsistent

  1. If some mods are already trying to make piglin brutes naturally spawnable then 😨
  2. Initial Structure mob spawns could be affected by this. (if it uses same SpawnPlacements, it means it was already spawning in air which can make newly generated piglin brutes far less than before).

I'll do some check in 24 hours.

@aria1th
Copy link
Contributor Author

aria1th commented Jul 24, 2023

Some inspections:
to NOT register static value and prevent some exceptions, instead of current code, the code should be modified as:

inject getHeightmapType, checkSpawnRules function instead.

@aria1th
Copy link
Contributor Author

aria1th commented Jul 25, 2023

This was the minimal change required to prevent piglin brutes spawning in air - but it may prevent some new chunk piglin brute generation... but rule itself is already changing the behavior so it shouldn't matter, right?
@altrisi

@altrisi
Copy link
Collaborator

altrisi commented Jul 25, 2023

As long as it only affects behaviour when the rule is on, and with it on it doesn't like severely like reduce base structure spawns (changes significantly "how it feels" (?) going normally through a bastion) or something it's fine for me.

@altrisi altrisi merged commit dd902fd into gnembon:master Jul 26, 2023
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.

Piglin Brutes spawn in air when piglinsSpawningInBastions is turned on
2 participants