GlowstoneMC / Glowstone

A fast, customizable and compatible open source server for Minecraft: Java Edition
https://glowstone.net
Other
1.89k stars 271 forks source link

Fire EntityTeleportEvent (fixes part of #922) #944

Closed jhg023 closed 6 years ago

jhg023 commented 6 years ago

The EntityTeleportEvent is now fired when a GlowEntity that is not a GlowPlayer attempts to teleport, as stated by its documentation.

This has not been tested, as Enderman teleportation has not yet been implemented, but a TODO comment has been added for whenever that occurs.

Thanks!

Pr0methean commented 6 years ago

Looks good, but needs to pass on CircleCI.

Pr0methean commented 6 years ago

@momothereal This currently fires an EntityTeleportEvent inside each entity's constructor. Is that the correct behavior?

jhg023 commented 6 years ago

I think this event should be excluded from the entity's constructor. Assuming some user wants to disable Enderman teleportation, cancelling this event would lead to the Enderman never spawning in the first place, right?