[SPIGOT-1926] ArmorStand.setGravity Side-Effects Created: 14/Mar/16 Updated: 11/Dec/17 Resolved: 14/Mar/16 |
|
Status: | Closed |
Project: | Spigot |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Bug | Priority: | Minor |
Reporter: | Nathan Wolf | Assignee: | Unassigned |
Resolution: | Won't Fix | Votes: | 0 |
Labels: | 1.9 | ||
Environment: |
Mac OS, Spigot 1.9 |
Description |
I recently switched to using the ArmorStand API rather than NMS calls, and noticed some odd behavior with setGravity. Why is it toggling the "noclip" property of the ArmorStand? This prevents me from applying velocity to the AS (from what I can tell) and seems like an odd side-effect. I've gone back to NMS for now, but it feels dirty and mainly I'm curious what the reasoning is here. Thank you |
Comments |
Comment by Nathan Wolf [ 14/Mar/16 ] |
And sorry it looks like I can't close my own issues- but if this is the intended behavior, I think this can be closed. Thank you for the explanation! |
Comment by Nathan Wolf [ 14/Mar/16 ] |
Ah, I see- well that makes sense for consistency. I was scanning through uses of "noclip" and can't actually see why it would be causing my issue. It'd actually be fine for the entity to not collide, but it seems completely immobile in noclip mode (I am calling setVelocity to move it around). If it's intended behavior on Mojang's part then I suppose I can't argue. I'll do some more investigating to see if there's a better work-around for what I'm trying to do it, it seems unstable for me to be relying on some half-state that's not really valid (no gravity + clipping). |
Comment by md_5 [ 14/Mar/16 ] |
Constructor of EntityArmorStand: public EntityArmorStand(World world) { super(world); this.bw = new ItemStack[2]; this.bx = new ItemStack[4]; this.headPose = EntityArmorStand.bp; this.bodyPose = EntityArmorStand.bq; this.leftArmPose = EntityArmorStand.br; this.rightArmPose = EntityArmorStand.bs; this.leftLegPose = EntityArmorStand.bt; this.rightLegPose = EntityArmorStand.bu; this.noclip = this.hasGravity(); this.setSize(0.5F, 1.975F); } Note the this.noclip = this.hasGravity |
Comment by Nathan Wolf [ 14/Mar/16 ] |
Thanks- I don't see any mention of the why, but I guess it was a 1.9 thing? It certainly changes the behavior, at least in regards to trying to apply velocity. The ArmorStand basically won't move at all anymore without gravity applied, it seems. If I just use the NMS setGravity directly, it works as expected and as it did in 1.8. |
Comment by Black Hole [ 14/Mar/16 ] |
This 1.9 patch added that md_5 |