Solved Bodyless methods?

Discussion in 'Plugin Development' started by Datdenkikniet, Feb 6, 2014.

Thread Status:
Not open for further replies.
  1. As you can see in the bukkit source, there are lots of methods which look like this:
    (I am using the player object for example: link)
    Code:java
    1. public String getDisplayName();

    And I was really wondering how it is possible, that it still returns the correct value, because my methods always look like this:
    Code:java
    1. public String myMethod(){
    2. return this.myMethodString;
    3. }
     
  2. Offline

    SuperOmegaCow

  3. SuperOmegaCow can you give me a link to an example class to that?
     
  4. Offline

    zeeveener

  5. Offline

    Sagacious_Zed Bukkit Docs

  6. Offline

    DarkBladee12

    Datdenkikniet The Player class is just an interface and is implemented by CraftPlayer where the real execution happens.
     
  7. Offline

    Stealth2800

    It's not a class, it's an interface. Interfaces are basically outlines for classes to fill with actual content. In this case, the 'Player' interface of Bukkit is implemented by the 'CraftPlayer' class in CraftBukkit.

    Bukkit is an API, CraftBukkit is an implementation of that API. That's why you have to run CraftBukkit when making a server.
     
Thread Status:
Not open for further replies.

Share This Page