Force option for Fireball#setDirection(Vector)

    • Type: New Feature
    • Resolution: Fixed
    • Priority: Minor
    • None
    • Affects Version/s: None
    • Environment:

      N/A

    • CraftBukkit version 3475-Spigot-ffceeae-b5559f8 (MC: 1.18.2) (Implementing API version 1.18.2-R0.1-SNAPSHOT)
    • Yes

      The setDirection method in the Fireball class does not allow you to change the magnitude of the vector (i.e. the fireball's speed) because of the underlying vanilla normalization.

      I would like an additional option to force set the power values on the fireball to arbitrary values, especially as this is already possible with the vanilla /data command. This could be also be used to freeze fireballs in place.

          [SPIGOT-6993] Force option for Fireball#setDirection(Vector)

          Made a PR for this, with the limitations mentioned in my previous comment: craftbukkit#1396

          You can test it with BuildTools:

          java -jar BuildTools.jar --rev 4148 --compile spigot --pr craftbukkit:1396 --pr bukkit:1006 

          Marvin Rieple added a comment - Made a PR for this, with the limitations mentioned in my previous comment: craftbukkit#1396 You can test it with BuildTools: java -jar BuildTools.jar --rev 4148 --compile spigot --pr craftbukkit:1396 --pr bukkit:1006

          The client will always normalize the power value, if it is not 0, so even if we allow setting the power via #setVelocity to random values, it will cause client stutter, since the client will wrongly predict the location of the fireball.

          Also see MC-80142

          Marvin Rieple added a comment - The client will always normalize the power value, if it is not 0, so even if we allow setting the power via #setVelocity to random values, it will cause client stutter, since the client will wrongly predict the location of the fireball. Also see MC-80142

          Arti_Creep added a comment -

          The feature should be implemented regardless in my opinion.

          Arti_Creep added a comment - The feature should be implemented regardless in my opinion.

          TrollyLoki added a comment -

          That seems reasonable to me.

          TrollyLoki added a comment - That seems reasonable to me.

          md_5 added a comment -

          Wouldn't changing setVelocity to be an unnormalized setDirection ok?

          md_5 added a comment - Wouldn't changing setVelocity to be an unnormalized setDirection ok?

          TrollyLoki added a comment -

          The JavaDocs explicitly state that fireballs "do not take setVelocity(...) well."

          TrollyLoki added a comment - The JavaDocs explicitly state that fireballs "do not take setVelocity(...) well."

          But is the speed not set with the setVelocity method ? 
          You should try that

          FreeSoccerHDX added a comment - But is the speed not set with the setVelocity method ?  You should try that

          TrollyLoki added a comment -

          There is vanilla code that normalizes the vector passed to that method, which currently cannot be bypassed without nms.

          TrollyLoki added a comment - There is vanilla code that normalizes the vector passed to that method, which currently cannot be bypassed without nms.

          Not rly sure what you want.... but did you try #setVelocity(Vector) ?

          FreeSoccerHDX added a comment - Not rly sure what you want.... but did you try #setVelocity(Vector) ?

            Assignee:
            Unassigned
            Reporter:
            TrollyLoki
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: