FallenMoonNetwork / CanaryMod

Server administration mod and API for Minecraft beta multiplayer server
http://canarymod.net
GNU Lesser General Public License v3.0
20 stars 14 forks source link

Pull up Canary methods as far as possible. #71

Open 14mRh4X0r opened 11 years ago

14mRh4X0r commented 11 years ago

Currently there are many methods in our classes that can be pulled up into superclasses. This would allow for more freedom for plugin developers while maintaining compatibility.

WWOL commented 11 years ago

Would this work without plugins needing a recompile? If so that's pretty awesome.

WWOL

14mRh4X0r commented 11 years ago

I'd need to check that, but I believe it would.

WWOL commented 11 years ago

Sounds awesome.

WWOL

BluXDragon commented 11 years ago

I take it this is like how addPotionEffect was for Player instead of LivingEntity, despite it working just fine? I'm happy to report things like that when I find/remember them. I've seen quite a few.

gregcarlin commented 11 years ago

Couldn't everything we currently have in Mob be in LivingEntity?

14mRh4X0r commented 11 years ago

Nope, setTarget for example, casts entity to OEntityCreature.

gregcarlin commented 11 years ago

So the constructor for Mob should really take OEntityCreature, not OEntityLiving, correct?

14mRh4X0r commented 11 years ago

Technically, it should, yeah. LivingEntity and Mob overlap, in that aspect.

BluXDragon commented 11 years ago

I would love getLocation() to be pulled up to BaseEntity. Pitch/Rot could be null for things that don't have such values?

gregcarlin commented 11 years ago

@14mRh4X0r OEntityGhast is not an instance of OEntityCreature.

14mRh4X0r commented 11 years ago

I know, that's why I said they overlap. setTarget doesn't work for ghasts, either. On another note, testing needs to be done to verify that this doesn't break plugins.

BluXDragon commented 11 years ago

I'll be doing that, h4X. I'm keeping pretty up-to-date on the dev builds.

BluXDragon commented 11 years ago

Plugins involving Mob.getItemInHand() have broken, as the method has changed to getItemStackInHand()

gregcarlin commented 11 years ago

This was expected. It was necessary for compatibility with the method in Player, and the only plugins it would break would be no more than a couple weeks old and likely still under active development.

On Dec 3, 2012, at 10:41 AM, BluXDragon notifications@github.com wrote:

Plugins involving Mob.getItemInHand() have broken, as the method has changed to getItemStackInHand()

— Reply to this email directly or view it on GitHubhttps://github.com/FallenMoonNetwork/CanaryMod/issues/71#issuecomment-10957890.

BluXDragon commented 11 years ago

Yup, I thought of all that, but I figure I'll mention every issue on this I find.

gregcarlin commented 11 years ago

That should be the only incompatibility... Unless someone used reflection for some reason. So if you find anything else, we don't know about it.

On Dec 3, 2012, at 2:59 PM, BluXDragon notifications@github.com wrote:

Yup, I thought of all that, but I figure I'll mention every issue on this I find.

— Reply to this email directly or view it on GitHubhttps://github.com/FallenMoonNetwork/CanaryMod/issues/71#issuecomment-10968853.