minecraft - Java Bukkit: setFlySpeed() -
I am creating my own plugin in Java bookmark ... and I found a problem that I can not solve it . ..
I am setting the player's logic ... so I have to set the second speed (fly speed), then it must be converted from string to two. Now I am re-covering to float again ...: << p>
For one reason ... it's not right that the float turns into double.
  Player PlayerOutsTherePhillips = Buckettte.Get Player (Args [0]); String speed = args [1]; Double Speed Double = DoublePrSD Double (Speed); Float speed float = (float) speeddouble; PlayerToSetFlySpeed.setFlySpeed (SpeedFloat); Error in Minecraft Sayes: An error occurred while attampting to perform this command   and command looks like this: / setpeed (player) ( Amount_of_speed)  Im writing the amount of speed in the form of the string and it is double (it) and then converted into float.   I am working on  
 Please help me .. This is very important for my plugin ...: << / p>  
 
   
  
 A client sets the flying speed, the negative value indicates the opposite directions. Are there.  
 Parameter:  
 -   Price  New Speed -1 to -1   
 throws:  
 -  If the new speed is less than 1 or greater than 1    
 as seen from the log:  
  caused by: java.lang.IllegalArgumentException: 10.0 is very much on org.bukkit.craftbukkit.v1_7_R1.entity.CraftPlayer.validateSpeed ( Kraftplayrkjawa:ll58) ~ [Kraftbukkitkjar song -bukkit-1.7.2-R0k3-2-G85f5776-B3024jnks] Orgkbukkitkkraftbukkitkvl_7_rl.antitikkraftplayrksetflipeed (Kraftplayrkjawa: 1129) ~ on [craftbukkit.jar: Git-Bukkit-1.7. 2-R0.3-2-g85f5776-b3024jnks] on me.jimisdam.BukkitPlugins.Helper.Helper.onCommand (Helper.java:171) ~ [?] Org.bukkit.command.PluginCommand.execute (on PluginCommand. Java: 44) ~ [craftbukkit.jar: Git-Bukkit-1.7.2-R0.3-2-g85f5776-b3024jnks] ... 13 more  
  If you've been wronged use logic: 10 . 
  You must ensure that logic  setFlySpeed () : 
   {// ... is valid before calling = SpeedDouble (Float); If (speed> gt; 1 || speed & lt; -1) {commandSender.sendMessage ("you have specified an argument outside the range!"); Return; } PlayerToSetFlySpeed.setFlySpeed (speed); }  
  
 
  
 
  
Comments
Post a Comment