GlowstoneMC / Glowstone

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

Fine tune ender pearl #853

Closed XuZhen86 closed 6 years ago

XuZhen86 commented 6 years ago

This pull request tries to fine tune the details of the ender pearl.

Observed behavior:

  1. Ender pearl trajectory is weird, can't travel very far.
  2. No endermite spawn after using ender pearl
  3. The 1 second cool down is broken
  4. Ender pearl does not have a bonding box, causing it never collides with entities.

Expected behavior:

  1. Ender pearl should have little friction when traveling in the air
  2. Endermite has a 5% chance spawning
  3. Player can only use ender pearl once per 1 second
  4. Ender pearl does have a 0.250.25 bonding box. The data is found in Entity, "Types of entities" section, "Width Height" column.

I previously submitted https://github.com/GlowstoneMC/Glowstone/pull/822, but later I found out the actual code merged is different from the one I submitted. The resulted bug is also fixed in this pull request. https://github.com/GlowstoneMC/Glowstone/commit/9c3fce2b20a642eddf816b44437e345c5f3e4bbd did not fix the player's orientation problem because https://github.com/GlowstoneMC/Glowstone/blob/9c3fce2b20a642eddf816b44437e345c5f3e4bbd/src/main/java/net/glowstone/entity/projectile/GlowEnderPearl.java#L58 should be

    entity.teleport(location, PlayerTeleportEvent.TeleportCause.ENDER_PEARL);
mastercoms commented 6 years ago

Looks great to me, nice work! Thank you for your contribution to Glowstone.