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

Port Squid Improvements from GTNH BugTorch #508

Merged
merged 3 commits into from
Aug 21, 2024

Conversation

glowredman
Copy link

As suggested in jss2a98aj/BugTorch#34

@Roadhog360
Copy link
Owner

This is improper use of Asset Director. You can register just the sound events and skip the entire thing with the dynamic resource pack. That is only needed for cave sounds. Please check how other sounds are registered and used. Additionally, the downloading of the sound should not be conditional.

@Roadhog360
Copy link
Owner

Roadhog360 commented Aug 21, 2024

Actually, upon second review, it looks like the squid sounds are already in the mud. I'm not really sure what your code is doing there. So that entire block relating to sounds that you added can be removed because it's already in the mod.

And, of course, the ink cloud should be moved to another config because it's obviously not a sound. Let me think where it should go...

I think entities.cfg in the misc cat would do. Thank you for the contribution.

@Roadhog360
Copy link
Owner

  • Reference to MCAssetVer prefix in the ink shoot sfx is missing.
  • Sound is still tied to duplicate config option instead of the already existing one in the mixins config.

@Roadhog360
Copy link
Owner

Roadhog360 commented Aug 21, 2024

Oh and the cloud option should be in catmisc because it's not an entity toggle

@Roadhog360
Copy link
Owner

Looks fine, I'll do the last few tweaks I requested. Thank you

@Roadhog360 Roadhog360 merged commit bdc9d78 into Roadhog360:master Aug 21, 2024
1 check passed
@glowredman glowredman deleted the squid-improvements branch August 21, 2024 20:54
@Roadhog360
Copy link
Owner

@glowredman Just got around to testing this and I can't seem to get the squid particles to appear, any idea why?

@glowredman
Copy link
Author

Keep in mind that they don't appear all the time but only if

  1. Random.nextDouble() returns less than 0.15
  2. An entity is within a 3x3x3 box of the squid (always given because the attacked squid is there)
  3. Of all entities within that box, one is selected at random which must be neither null nor the attacked entity

So the resulting chance of particles appearing is 15% * (1 - 1/n) where n is the number of entities in that 3x3x3 box.

The code could be improved by adding around.remove(targetEntity); here (and consequently removing target != targetEntity further down). This would result in the second check turning into a potential early exit (the list is empty -> there is no other entity in that 3x3x3 box) and the the third check not lowering the effective chance.

Otherwise I found the code to be working, here is a test in SP where I removed the 15% random chance: https://youtu.be/xbhUH--G6X4

@Roadhog360
Copy link
Owner

Wasn't they're supposed to be particles, too? Also, I meant to say squids don't give blindness in vanilla, so this is something that will either be removed or put under tweaks.cfg.

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