RubilaxXxx / ArsMagica2-5

Ars Magica 2.5
5 stars 1 forks source link

Spell particles are fucked up for blocks #7

Closed AirBurn0 closed 1 month ago

AirBurn0 commented 1 month ago

Ever wonder why no AM2 block-only spells have particle effects on block? Why they all have like empty spawnParticles method? Well, that's cuz they fucked up a little. Mithion decided, that when you hit Entity, method will receive (..., target.posX, target.posY + target.getEyeHeight(), target.posZ, ...) fully qualified Entity position with height, but when you hit Block, you just get (..., blockX, blockY, blockZ, ...) raw block int coords, and that's look just gross (I tried), cuz particles spawns on one of the down vertices of the cube instead of cube center. Is there some way to distinct if entity or block was targeted, and then do + 0.5D to position? Nope. Nothing indicates about that except StackTrace, but I'm not Emoniph to write code that cracked.

Simple fix? Yep, just change this line:

component.spawnParticles(world, blockX, blockY, blockZ, caster, caster, world.rand, color);

to look like this:

component.spawnParticles(world, blockX + 0.5D, blockY + 0.5D, blockZ + 0.5D, caster, caster, world.rand, color);

AM2PG does that using ASM, and everything looks nice.