GitBrincie212 / Apel-Mod

Apel is a library that brings particle animations to the table with flexible behaviour and a clean developer interface. It promises also lots of predefined shapes & paths to help the developer on their particle scene
Other
2 stars 1 forks source link

Fix two NPEs and ignore our test file #2

Closed DarthSharkie closed 5 months ago

DarthSharkie commented 5 months ago

Ignore the DebugParticleAnim1.java file. We use that for testing, no need to pollute history with that file.

Fix the setRotation NPE by extracting the normalization logic for reuse.

Fix another NPE in beforeChildRender metadata. This one might need a quick discussion, since I have it requiring an explicit true value to render. If that key is unset in the EnumMap, it will not draw by default. I suspect previous testing was setting that in the interceptor being defined. Let me know if we should default to drawing if unset; it's a simple fix.

This actually raises a larger question on how we treat that metadata. By mapping, there are messy casts required, null checks before auto-unboxing, and a generally unappealing interface. I propose we switch to nested classes: they can use the same names, but have clearly typed/named fields. The updates can be done in-place on the metadata, and we can limit setters for fields (like the ServerWorld) that shouldn't change. Vector3fs already have a bunch of in-place methods, so it should be reasonably expected these *Data classes would do the same. If you'd like to see what this looks like, I'll put together another PR in the next day or two.

DarthSharkie commented 5 months ago

Bah, I have to fix how the debug stuff is ignored. Will do that tomorrow. Removing the DebugParticleAnim1 breaks ModItems; removing ModItems breaks Apel. Sigh.

DarthSharkie commented 5 months ago

For now, I've removed the .gitignore bits. Need more thought on how to ignore those file/files.

GitBrincie212 commented 5 months ago

Seems good to me

GitBrincie212 commented 5 months ago

i think i should merge it