kumpelblase2 / Remote-Entities

A library that enables you to control entities in minecraft.
Other
31 stars 28 forks source link

EnderDragon not moving in the "world" #76

Closed mastergberry closed 10 years ago

mastergberry commented 10 years ago

Seem to be having an issue with making my EnderDragon move in "world" (not the end). I am using the latest snapshot which I happened to stumble across and saw there was a commit recently about EnderDragons which I was trying to work with anyways.

Just tried something very basic and have not had any luck:

EntityManager manager = RemoteEntities.createManager(this.plugin);
RemoteEntity entity = manager.createEntity(RemoteEntityType.EnderDragon, new Location(this.plugin.getServer().getWorld("world"), 0, 100, 0), true);
entity.setStationary(false);
RemoteEnderDragon dragon = (RemoteEnderDragon) entity;
dragon.shouldDestroyBlocks(false);
dragon.shouldNormallyFly(true);
// I added this line after shouldNormallyFly() didn't do anything, this line didn't do anything either
dragon.move(new Location(this.plugin.getServer().getWorld("world"), 50, 100, 50));

Feel like I am probably missing something basic to make it so the EnderDragon works. My goal is to just have to EnderDragon flying around lets say 500, 500 on the map instead of flying around 0, 0 which is probably what it does in The End.

Thanks.

kumpelblase2 commented 10 years ago

When setting the dragon to normally fly, it will fly normally and ignore the directions you give him. So shouldNormallyFly needs to be false: dragon.shouldNormallyFly(false);

mastergberry commented 10 years ago

Well I was originally trying to just make it fly normally, but had no luck doing that (I didn't have the last line at first). I then added the last line and changed it to false like you mentioned and now I can force the Dragon to fly to a certain location.

At first this wasn't working, but now it seems to be...weird.

My end goal is to have it fly like it does in the end around the coordinates 0,0 (but in this case I want to change the coordinates it defaults to to like 300, 300 a bit away from the middle of the map). Is there anyway to do this with your API at the moment? I was digging around in the NMS a bit and i found the move() references but I'm afraid with all the code obfuscated I don't have a clue what is going on.

kumpelblase2 commented 10 years ago

Currently not no. I haven't been able to do much with flying entities and their pathfinding or their movement in general (for example, I only recently did the movement to a specific coordinate for the dragon).

mastergberry commented 10 years ago

Do you have any resources that you would be willing to share to help me deobfuscate the code and I can try playing around with it if I have a better idea of what's going on?

kumpelblase2 commented 10 years ago

Well, I don't really have any resources that I can share, because I sadly can't share my whole brain, but apart from that I only look at the mc-dev repo (but because it is not updated I look at the decompiled craftbukkit jar).

mastergberry commented 10 years ago

Is the decompiled craftbukkit.jar any different from the source code on github?

kumpelblase2 commented 10 years ago

It depends on the decompiler, but I use a decompiler which produces about the same code. Reason being is that I already know which method does what most of the time. So it's way easier for me to see the obfuscated method than a normal one, because i'd need to see the obfuscated name anyway in order to use it.

mastergberry commented 10 years ago

Ok well I'm going to see if I can't figure it out now that I got your plugin to compile :) I will submit a PR if I am successful.

kumpelblase2 commented 10 years ago

Sounds good. I will close this as the original issue is gone.