Commit Graph

93 Commits

Author SHA1 Message Date
f799cfaba6 Implemented sound when equipping armor (#6303) 2024-03-25 14:15:54 +00:00
920341668f Implemented working Name tag (#5209) 2024-02-19 18:46:48 +00:00
5ec3f4655f EntityDamageByEntityEvent: added APIs to get and set vertical knockback limits
this was requested and PR'd as far back as 2020 (see #3782).
Since no issue was filed about this, it became forgotten until #5946.
However, #5946 overcomplicates the solution to the problem, and breaks BC without an obvious reason.
2023-07-28 12:52:15 +01:00
a45763328b Added constants for default knockback force and vertical limit 2023-07-28 12:36:46 +01:00
3afe3b7f44 Merge branch 'stable' into minor-next 2023-07-24 12:02:24 +01:00
24d979bd08 Fixed /kill not properly killing the player under certain conditions, closes #4680 (#5919)
This occurs if the player had very high levels of Health Boost or other weird modifications.

It doesn't really make sense to apply damage modifiers to suicide anyway.

Really I'm doubtful that suicide should even be considered a damage type (perhaps we should add an EntitySuicideEvent), but that's a discussion for another time.
2023-07-19 16:33:16 +01:00
fba51e3bf9 Merge branch 'stable' into minor-next 2023-07-19 13:22:07 +01:00
4637aae621 Living: do not apply noDamageTicks to suicide damage
suicide damage is a voluntary damage source, which noDamageTicks is intended to prevent getting damaged while the player gets their bearings after (re)spawning.
2023-07-19 11:43:09 +01:00
6fbc133e5d Merge branch 'stable' into minor-next 2023-07-18 22:22:37 +01:00
c053742f5d Living: avoid updates of non-armor slots and armor slots which took no damage
this was also updating empty slots ...
2023-07-18 13:04:11 +01:00
0051b34797 Living: fixed turtle helmet being non-removable and spamming inventory updates
closes #5786
2023-07-18 12:58:07 +01:00
259cc305df Implement 1.20.10 short sneaking (#5892) 2023-07-13 13:36:53 +01:00
bea878e9e9 Implement anvil fall damage (#5312) 2023-03-27 20:17:08 +01:00
abd4ef01eb Merge branch 'minor-next' into major-next 2023-03-15 23:02:41 +00:00
cc8660629b First look at shared EntityEventBroadcaster,
this improves performance in PvP servers and other areas where lots of players or entities exist in one space.

fixes #5622
2023-03-15 18:22:56 +00:00
9b4b960eb2 Remove deprecated methods 2023-01-08 17:07:22 +00:00
6e2685cbbb Merge branch 'next-minor' into next-major 2022-12-18 22:25:32 +00:00
bf44edd179 Constify a bunch of NBT keys, pass 1 2022-12-18 22:12:15 +00:00
4d79aced07 Merge branch 'next-minor' into next-major 2022-12-15 19:50:27 +00:00
1d4b6dc66e Only reduce durability when armor reduced damage. (#5444)
https://minecraft.fandom.com/wiki/Durability#Armor_durability
2022-12-05 21:10:36 +00:00
28d8526d8d Merge branch 'next-minor' into next-major 2022-11-30 20:05:30 +00:00
d476a4c1aa Implement a Living::getDisplayName() (#5384) 2022-11-27 19:48:55 +00:00
8dc0d506f4 Merge branch 'next-minor' into next-major 2022-10-11 22:29:21 +01:00
6ae7cb288e Merge remote-tracking branch 'origin/stable' into next-minor 2022-10-11 21:59:40 +01:00
1c6a2b66f7 Merge remote-tracking branch 'origin/next-minor' into next-major 2022-09-29 22:38:26 +01:00
cd4bb91676 Living: alter eye height so the player doesn't drown on the surface of water when swimming
fixes #4989
2022-09-29 00:15:07 +01:00
1366a43c22 Implement Turtle Shell (#5235) 2022-09-28 18:19:15 +01:00
bda0ca23b4 Living: deprecated hasLineOfSight() 2022-09-28 17:34:51 +01:00
a6cc611e9f Merge branch 'next-minor' into next-major 2022-09-28 01:06:11 +01:00
5e5661de75 Play burp sound when consuming a FoodSource (#5158) 2022-09-27 17:21:55 +01:00
1ff69136a3 Merge branch 'next-major' into modern-world-support 2022-06-07 20:01:40 +01:00
aa9f8781ff Merge branch 'next-minor' into next-major 2022-06-07 19:56:26 +01:00
d2613039ed Replace BlockLegacyIds usages with BlockTypeIds where possible 2022-06-05 21:17:10 +01:00
38d6284671 Use PHP-CS-Fixer to enforce file header presence 2022-06-04 17:34:49 +01:00
7b8eeb42f6 Use typed properties in src/entity package
[bc break]
2022-06-01 21:19:02 +01:00
b7e2b3e94a Entity: Require declaration of gravity and drag via abstract methods
this guarantees that subclasses will actually declare them.

[bc break]
2022-06-01 20:51:18 +01:00
39b8daeeec Living: fixed a usage of hardcoded numeric ID 2022-05-25 22:23:14 +01:00
fc53f3721a Avoid direct mutations of Entity->location 2022-01-20 21:49:14 +00:00
8f525ab399 Replace disallowed operators in src/entity/ 2022-01-20 19:14:28 +00:00
d41f933e7b Implement swimming/gliding including AABB recalculation (#4446)
- The following events have been added:
  - PlayerToggleGlideEvent
  - PlayerToggleSwimEvent
- The following API methods have been added:
  - Entity->getSize()
  - Living->isSwimming()
  - Living->setSwimming()
  - Living->isGliding()
  - Living->setSwimming()
  - Player->toggleSwim()
  - Player->toggleGlide()
2021-12-19 17:10:41 +00:00
b9b1ba9526 Include eye height in Living->lookAt() calculation (#4440) 2021-09-08 21:54:32 +01:00
ded778f422 Implemented bed bouncing 2021-09-05 20:11:49 +01:00
d4d00a9b80 Living: added calculateFallDamage()
to clean up the way that fall damage is handled for flying players; also, onHitGround() isn't only doing fall damage things these days.
2021-09-05 14:36:58 +01:00
6b7e671794 Living: use Vector3->down() instead of subtract(). 2021-09-05 14:12:04 +01:00
17dfd2cc52 Living: Trigger fall sounds on the nearest collidable block below
we can't have landed on it unless it actually has a collision box - otherwise, we only landed _in_ it.
This assumes, of course, that no blocks have bounding boxes >= 2 blocks tall, which currently none do.
2021-09-05 14:10:54 +01:00
8be1f34736 Entity: Rename fall() to onHitGround(), and make it protected
this had no business being exposed to public API in the first place.
2021-09-05 13:36:40 +01:00
6ecad153ea Entity: remove fallDistance parameter from fall() 2021-09-05 13:34:43 +01:00
77138c5c06 Living: changed bad parameter name 2021-07-22 15:46:08 +01:00
e803ca0e06 Living: Limit vertical knockback to 0.4 by default
this will break non-standard use cases with large forces, but they only have to stick a 'null' at the end of the parameter list.
Since this function should be primarily used for vanilla knockback, it makes more sense to keep the default as vanilla, but allow people to change it if they want to.

closes #4106 (this is close to #4106 anyway, but small enough that it was easier to recreate it than pull and modify it)
closes #2707
2021-07-22 14:27:20 +01:00
2312511be6 Living: remove unnecessary double CompoundTag::getTag() call 2021-06-29 23:54:52 +01:00