Target Player Help

Discussion in 'Plugin Development' started by mccrafter1212, Jul 12, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    mccrafter1212

    Alright I really hope I can get someone to help me out here. So I am developing a simple plugin. It's called Basics. Although targeting a player is stressing me out. I think I am making a mistake. Check out the little yellow line below. It is telling me to either add @SupressWarnings deprecation to Target Player or to onCommand. I have no clue how to fix this please help!
    upload_2015-7-12_15-42-38.png
     
  2. Offline

    ShadowLAX

    @mccrafter1212 The warning simply means that the method is deprecated. The use of #getPlayer(String) was deprecated when UUIDs were introduced with name changes. It is okay to use as long as you are not storing information about a player based on their name, otherwise you should use the new #getPlayer(UUID) method. Just add a @SupressWarnings annotation to the field like Eclipse is suggesting and the warning will go away.
     
  3. Offline

    mccrafter1212

    @ShadowLAX alright thanks although do I choose to do it to Target Player or onCommand???
     
  4. Just do if (args.length == 1) { try { Integer.parseInt(args) }catch }
     
Thread Status:
Not open for further replies.

Share This Page