[LIB] [1.7] Remote entities - Next generation NPC library [No support]

Discussion in 'Resources' started by kumpelblase2, Nov 10, 2012.

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

    DevRosemberg

    kumpelblase2 Kump, when do you think the code will be running smoothly again?
     
  2. Offline

    Kainzo

    Sucks that this has been unusable on the latest versions.

    I have quite a few projects in the pipe depending on this and we may have to write our own custom implementation.
     
  3. Offline

    Jumla

    kumpelblase2 has seemed to disappear, we've begun to write our own custom implementations as well. Bummer. Kumpel, we'd appreciate some form of update if it's possible. We all rely on this library, and we don't want to branch off and make 10 duplicates.
     
  4. Offline

    kumpelblase2

    I'm sorry that I wasn't active in the last week(s). University has taken over most of my time, went through a breakup and I spent the remaining spare time doing something to relax and chill out a bit. Since my first test results look promising, I'll take a bit off from doing things for uni and continue here. However, I would more look forward to the 1.7.2 update so I can actually do something, since currently it's just looking around trying to find the one single bit which doesn't work, but the bukkit team seems to take years to update it (I can see why it takes so long, but I still don't like it). Even more, I'd like to see how netty was used and how they structured it inside the server.

    To be honest, I would actually like to have some duplicates. Reason being that they will all have at least one different thing and I'd like to see if that is actually a good difference or a bad one. I can then see if it would fit properly in the library, which in the end would also make it better. -> everyone is happy.

    As a small look beyond the horizon, I'd like to remake some stuff after I updated the lib to 1.7.2 so I hope to make it even more dynamic and if possible, even completely, version independent (I have an idea how I can achieve this, but some people might not like what could be done using this technique), but no promises on that. Nonetheless you can expect at least some changes to let it feel better.
     
    Kainzo and Ultimate_n00b like this.
  5. Offline

    CaptainBern Retired Staff

    kumpelblase2 If you need some help then I would love to, as for the version independancy I would suggest cglib or reflection. (Creating a new package for each version is also an option but will increase the size of the library massively)
    Also the new packet system look promising ^*^.
     
  6. Offline

    kumpelblase2

    I mentioned this some times already, I need help.

    I will use neither (reflection here and there of cause), Javassist will do the job for me.
     
  7. Offline

    CaptainBern Retired Staff

    kumpelblase2 Oh okay, I never worked with Javassist so I wouldn't know how to work with it. As for helping you, as soon as you set up one type of npc, I can create the others. (I need to know what your code style is, how it all works etc..(I do know almost everything about the protocol + nms but I just need to know how you're going to set it up))
     
  8. Offline

    kumpelblase2

    Ok, with the latest snapshot RE is now back to a point where you could call it "useable" but it's not completely fixed yet (players still won't move). The issue lied in incorrect attribute speed and setting the Y-motion after an e(double, double) call causing the navigation to fail always. I would've never expected the second one to be such an issue. Since this was completely my fault and had nothing to do with minecraft updating, I'm honestly really sorry that this issue came up and took me so long to fix. I will do my best that such issues won't occur in the future anymore. But I can't change the past and it sadly did happen.
    For the time being though, I will go to bed now and try to fix the player tomorrow as I'm really tired and I start to lose my concentration. Have a nice day!
     
    Micius and Cirno like this.
  9. Offline

    Jumla

    Thank you so much. The Wynncraft team has sent you a donation for your hard work.
     
    Waffletastic and Ultimate_n00b like this.
  10. Offline

    kumpelblase2

    About 7 hours after the bukkit commit and RE has its first snapshot for 1.7.2! Seems like this is the fastest update I've ever done. Keep in mind, as bukkit is not finished and might still do nasty things, RE might do the same. Like I mentioned in the commit, this JUST compiles. I have no idea if all the changes I made are correct and some things are even disabled (Players won't work at all I think, but I have no idea).

    Even though I'd like to have a remade RE with version independence and a lot of other fancy stuff in it, it wasn't possible until now and will take more time. Might not even be in this year, I don't know, time will tell.

    Apart from that, have a nice day!
     
    Cirno, Diemex and Micius like this.
  11. Offline

    Quaro

    Ocelot is running away, instead of following me :(
    Code:java
    1.  
    2. RemoteEntity entity = Main.NPCManager().createNamedEntity(RemoteEntityType.Ocelot, EVENT.getPlayer().getLocation(), "test");
    3. TamingFeature feature = new RemoteTamingFeature(entity);
    4. feature.tame(EVENT.getPlayer());
    5. entity.getFeatures().addFeature(feature);
    6. entity.getMind().addMovementDesire(new DesireFollowTamer(entity, 5, 15), entity.getMind().getHighestMovementPriority() + 1);
    7.  
     
  12. Offline

    Diemex

    Thanks for the speedy update! Great job.

    Offtopic question:
    How do you even know what every method does? Or how did you figure out which methods changed.
     
  13. Offline

    CaptainBern Retired Staff

    Diemex It's not that hard to read obfuscated code :/
     
  14. Offline

    kumpelblase2

    Diemex I don't always know what each method does exactly. I just get the gist of what it is supposed to do and from time to time I just remember what they do.
     
  15. Offline

    hallowhead1

    i am sorry i am a bit confused, is this safe to use with 1.6.4?

    But not yet safe to use with 1.7.2?
     
  16. Offline

    kumpelblase2

    hallowhead1 Since bukkit has its nms update policy I can currently only provide support for one minecraft version. That means, every new update only supports a specific version and won't run on older nor on newer minecraft versions. Currently, I had an issues with 1.6.4 which delayed it a lot and is not completely done in this point in time either, but is useable to a certain extend. Because it wasn't finished either, I started updating it to 1.7.2 so I can finally be update to date and push out a working release.
     
  17. Offline

    scarabcoder

    Please update this for 1.6.4! I really need it :'(
     
  18. Offline

    Garris0n

    What?
     
  19. Offline

    scarabcoder

    This API library doesn't work for 1.6.4... It gives me an error
     
  20. Offline

    Garris0n

    Try using an older version as the current one is (kinda) for 1.7.2?
     
  21. Offline

    scarabcoder

    Can you give me a link to the version (download) list?
    Or at least give me the link for 1.6.4 download for Remote Entities?
     
  22. Offline

    confuserr

    You won't find a working version for 1.6.4 I'm afraid. None of the navigation for the entities were working in older versions.
     
  23. Offline

    hallowhead1

    Would you guys say that this library is in working order again to use for 1.7? What i am trying to ask what are the things currently still not working?
     
  24. Offline

    Monckey100

    I have downloaded 1.7 and it doesn't seem like any of the API works, I tried the example zombie stare but no dice.
    I tried to download the latest 1.8 and that LITERALLY crashes my minecraft (first time I had a plugin crash my minecraft before). I've tried using the latest dev build of craftbukkit and recommended but it doesn't seem to make a difference, am I doing something wrong here?
    Code:java
    1. org.bukkit.Location loc = player.getLocation();
    2. //event.getEntity().remove();
    3. //World w = loc.getWorld();
    4. //w.spawnEntity(loc, org.bukkit.entity.EntityType.ZOMBIE);
    5. EntityManager manager = RemoteEntities.createManager(this);
    6. RemoteEntity Zentity = manager.createEntity(RemoteEntityType.Human, loc, false);
    7. Zentity.setStationary(true);
    8. Zentity.getMind().addMovementDesire(new DesireLookAtNearest(Zentity, Player.class, 8F), 1);
    9. Zentity.getMind().addBehaviour(new InteractBehavior(Zentity)
    10. {
    11. @Override
    12. public void onInteract(Player inPlayer)
    13. {
    14. inPlayer.sendMessage("Hello " + inPlayer.getName() + "!");
    15. }
    16. });
     
  25. Offline

    travelingdp

    kumpelblase2 Could you please change the title of this thread. It clearly says "1.6.4 Compatible" yet it is clearly NOT 1.6.4 compatible.

    EDIT: I only say this because fund this resource, and, as it's something I've been needing for a big project I'm working on, I decided to use it. I spent about 16 hours today working only to find out in the end that all my work was pointless, which could have been avoided without that misleading title.

    EDIT: Although, you can get a 1.6.4 version from Jenkins, but it's not perfect, but still usable depending on what you need it for.
     
  26. Offline

    BungeeTheCookie

    kumpelblase2
    This is beautiful. Is it no longer broken and does it completely work for 1.7.2? I didn't want to go through 22 pages of posts to find out :p.
     
  27. Offline

    Bart

    BungeeTheCookie I wrote something with it today after talking with the developer who very kindly pushed out 3 fixes to the library to make it work. It should work but the occasional thing might not so the best way is to try it out yourself :p
     
  28. Offline

    rcth

    I'm adding this api to my plugin (1.7.2). I spawned them (using signs). In another class I have an event EntityDamageByEntityEvent. If I damage the entity with a stick, it should be removed. First I tried it with the human (Player) entity, which isn't working too. Anyone can help?

    Event in class for spawning the entities: http://pastebin.com/9edf96Ze
    Event in class for despawning entity player: http://pastebin.com/mpxfP2ra
     
  29. Offline

    bobacadodl

    For some reason, everytime I relog, a duplicate of every NPC appears :( No errors or anything
    My code:
    Code:
    public void createNPC(CallInfo call) {
            String npcName = ChatColor.translateAlternateColorCodes('&',call.getArg(0).replaceAll("_"," "));
     
            String typeString = call.getArg(1);
            RemoteEntityType closest = null;
            int closestDistance = Integer.MAX_VALUE;
            for(RemoteEntityType type:RemoteEntityType.values()){
                int distance = StringUtils.getLevenshteinDistance(typeString,type.toString());
                if(distance<closestDistance){
                    closestDistance=distance;
                    closest=type;
                }
            }
     
            RemoteEntity remoteEntity = core.npcManager.createNamedEntity(closest,call.getPlayer().getLocation(),npcName);
            remoteEntity.getMind().clearMovementDesires();
            remoteEntity.getMind().clearTargetingDesires();
            if(remoteEntity.getFeatures().hasFeature(TradingFeature.class)){
                remoteEntity.getFeatures().removeFeature(TradingFeature.class);
            }
            remoteEntity.getMind().clearBehaviours();
            remoteEntity.getMind().addBehaviour(new InteractBehavior(remoteEntity) {
                @Override
                public void onInteract(Player player) {
                    player.sendMessage("hi!");
                }
            });
            remoteEntity.setPushable(false);
            remoteEntity.setStationary(true);
        }
     
  30. Offline

    rcth

    Anyone?
     
Thread Status:
Not open for further replies.

Share This Page