Solved Problem with incompatible return types (int V.S double) with custom entity

Discussion in 'Plugin Development' started by Jogy34, Sep 22, 2013.

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

    Jogy34

    First off, this isn't the typical "I'm having a problem trying to use the new methods"

    In one of my plugins, I'm creating custom player NPCs by extending EntityPlayer from NMS code. Since it extends that it still hold the same craft player object so I've run into the problem where if I iterate through all of the players in a world to teleport them, it includes my custom entities so it ends up teleporting them when I don't want them to. To fix this I tried extending CraftPlayer in another class and overwriting the teleport methods to make them do nothing. However, when I tried this I keep getting the error where there are incompatible return types for the health altering methods and when I try to run it with just ignoring these, it throws an error when my plugin starts up and then most of it just stops working.

    In my own plugin, I know I can retrieve the NMS entity and not teleport it if it's one of my own custom entities but that gets messy to do all of the place and then other plugins might still end up teleporting them.

    Does anyone know how bukkit gets around this or how I can get around this? I can post code if it's needed.
     
  2. Offline

    Cybermaxke

    I had the same problem for my plugin, so I made a fork were I removed the overmapping. I can now easily update the project after every update so it's not much work.
     
  3. Offline

    Jogy34

    If you mean that you made a fork of bukkit, I'd really prefer not to have to do that as my plugin isn't a private plugin.
     
  4. Offline

    Cybermaxke

    No, you only need to use a fork to build your project.
     
  5. Offline

    Janmm14

    Jogy34
    you could use Citizens api for player npcs
     
  6. Offline

    Jogy34

    My own player NPC's work fine, bukkit just can't distinguish between them and actual players.

    How does building with a modified version of bukkit make it work with the actual bukkit version?
     
  7. Offline

    Cybermaxke

    You don't need to use the duplicate health methods that are using ints are basically removed but they are remapped into craftbukkit to keep old plugins compitable. ;)
     
  8. Offline

    Jogy34

    I made a fork but I'm confused at what I have to do now. Do I just have to remove everything in the maps.yml or what?
     
  9. Offline

    Cybermaxke

  10. Offline

    Jogy34

  11. Offline

    Cybermaxke

    You can't use a normal compiler like with eclipse, it's a maven project so you will need to use maven to build the project.
     
  12. Offline

    Jogy34

    I've never used maven before and I'm trying to build it through eclipse with a maven plugin. Every time I try to build it I get this error:
    Code:
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project craftbukkit: Compilation failure
    [ERROR] Unable to locate the Javac Compiler in:
    [ERROR] C:\Program Files\Java\jre7\..\lib\tools.jar
    [ERROR] Please ensure you are using JDK 1.4 or above and
    [ERROR] not a JRE (the com.sun.tools.javac.Main class is required).
    [ERROR] In most cases you can change the location of your Java
    [ERROR] installation by setting the JAVA_HOME environment variable.
    [ERROR] -> [Help 1]
    
     
  13. Offline

    Cybermaxke

  14. Offline

    Jogy34

  15. Offline

    Cybermaxke

    Ah ok
     
  16. Offline

    Jogy34

    Thanks, so much, for all of your help, that seemed to have fixed my problem.
     
Thread Status:
Not open for further replies.

Share This Page