102 Commits

Author SHA1 Message Date
Dylan T.
6578d65cd8
Merge branch 'major-next' into inventory-rework 2024-12-06 12:58:03 +00:00
IvanCraft623
f1a3b42620
Implement frost walker enchantment (#5497)
Co-authored-by: Dylan T. <dktapps@pmmp.io>
2024-12-01 19:46:38 +00:00
Akmal Fairuz
269effcecf
Introduce Utils::getRandomFloat() (#6532)
Drop-in replacement for lcg_value() for PHP 8.4
2024-11-26 11:33:29 +00:00
Dylan K. Taylor
45a4282e8b
First look: Split up Inventory & InventoryWindow
this unblocks a variety of changes, such as positionless tiles, enhanced APIs on Blocks for inventories, and also eliminates a bunch of cyclic references within the core code.

linked to #5033
2024-11-24 21:40:47 +00:00
IvanCraft623
8c3cf7a687
Use VISIBLE_MOB_EFFECTS actor metadata property to send effect bubbles (#6414)
Close #6402
2024-08-14 22:48:10 -05:00
Dylan K. Taylor
d70a7d34a7
Living: don't knockback or do hurt FX when attacked during cooldown
players were switching from a weaker tool to a stronger one to get double knockback in PvP.
while it's intended that we don't cancel the second attack during hit cooldown if the damage is
higher (the first damage is subtracted to prevent doubling up), we don't want them to get double
knockback.
this behaviour now matches vanilla to the best of my observations.

Come at me PvP community... I know some people are going to hate this change
2024-04-29 15:51:43 +01:00
Dylan K. Taylor
37322e0d50
Armor: only make sound when the item was equipped by player action
this ensures the greatest amount of consistency with vanilla.

in order to prevent the sounds being broadcasted on armor damage with the old method, we'd also have to sacrifice the sound when replacing one leather helmet with another, for example.
this approach minimizes the gameplay impact at the possible expense of plugins.

closes #6325
2024-04-08 14:05:47 +01:00
Dylan T
d5919dc094
... 2024-03-25 17:24:52 +00:00
Dylan T
09904dc519
workaround for callback-validator not understanding arrow functions 2024-03-25 14:58:21 +00:00
ipad54
f799cfaba6
Implemented sound when equipping armor (#6303) 2024-03-25 14:15:54 +00:00
IvanCraft623
920341668f
Implemented working Name tag (#5209) 2024-02-19 18:46:48 +00:00
Dylan K. Taylor
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
Dylan K. Taylor
a45763328b
Added constants for default knockback force and vertical limit 2023-07-28 12:36:46 +01:00
Dylan K. Taylor
3afe3b7f44
Merge branch 'stable' into minor-next 2023-07-24 12:02:24 +01:00
Dylan T
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
Dylan K. Taylor
fba51e3bf9
Merge branch 'stable' into minor-next 2023-07-19 13:22:07 +01:00
Dylan K. Taylor
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
Dylan K. Taylor
6fbc133e5d
Merge branch 'stable' into minor-next 2023-07-18 22:22:37 +01:00
Dylan K. Taylor
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
Dylan K. Taylor
0051b34797
Living: fixed turtle helmet being non-removable and spamming inventory updates
closes #5786
2023-07-18 12:58:07 +01:00
jasonw_4331
259cc305df
Implement 1.20.10 short sneaking (#5892) 2023-07-13 13:36:53 +01:00
IvanCraft623
bea878e9e9
Implement anvil fall damage (#5312) 2023-03-27 20:17:08 +01:00
Dylan K. Taylor
abd4ef01eb
Merge branch 'minor-next' into major-next 2023-03-15 23:02:41 +00:00
Dylan K. Taylor
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
Dylan K. Taylor
9b4b960eb2
Remove deprecated methods 2023-01-08 17:07:22 +00:00
Dylan K. Taylor
6e2685cbbb
Merge branch 'next-minor' into next-major 2022-12-18 22:25:32 +00:00
Dylan K. Taylor
bf44edd179
Constify a bunch of NBT keys, pass 1 2022-12-18 22:12:15 +00:00
Dylan K. Taylor
4d79aced07
Merge branch 'next-minor' into next-major 2022-12-15 19:50:27 +00:00
Rush2929
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
Dylan K. Taylor
28d8526d8d
Merge branch 'next-minor' into next-major 2022-11-30 20:05:30 +00:00
IvanCraft623
d476a4c1aa
Implement a Living::getDisplayName() (#5384) 2022-11-27 19:48:55 +00:00
Dylan K. Taylor
8dc0d506f4
Merge branch 'next-minor' into next-major 2022-10-11 22:29:21 +01:00
Dylan K. Taylor
6ae7cb288e
Merge remote-tracking branch 'origin/stable' into next-minor 2022-10-11 21:59:40 +01:00
Dylan K. Taylor
1c6a2b66f7
Merge remote-tracking branch 'origin/next-minor' into next-major 2022-09-29 22:38:26 +01:00
Dylan K. Taylor
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
IvanCraft623
1366a43c22
Implement Turtle Shell (#5235) 2022-09-28 18:19:15 +01:00
Dylan K. Taylor
bda0ca23b4
Living: deprecated hasLineOfSight() 2022-09-28 17:34:51 +01:00
Dylan K. Taylor
a6cc611e9f
Merge branch 'next-minor' into next-major 2022-09-28 01:06:11 +01:00
IvanCraft623
5e5661de75
Play burp sound when consuming a FoodSource (#5158) 2022-09-27 17:21:55 +01:00
Dylan K. Taylor
1ff69136a3
Merge branch 'next-major' into modern-world-support 2022-06-07 20:01:40 +01:00
Dylan K. Taylor
aa9f8781ff
Merge branch 'next-minor' into next-major 2022-06-07 19:56:26 +01:00
Dylan K. Taylor
d2613039ed
Replace BlockLegacyIds usages with BlockTypeIds where possible 2022-06-05 21:17:10 +01:00
Dylan K. Taylor
38d6284671
Use PHP-CS-Fixer to enforce file header presence 2022-06-04 17:34:49 +01:00
Dylan K. Taylor
7b8eeb42f6
Use typed properties in src/entity package
[bc break]
2022-06-01 21:19:02 +01:00
Dylan K. Taylor
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
Dylan K. Taylor
39b8daeeec
Living: fixed a usage of hardcoded numeric ID 2022-05-25 22:23:14 +01:00
Dylan K. Taylor
fc53f3721a
Avoid direct mutations of Entity->location 2022-01-20 21:49:14 +00:00
Dylan K. Taylor
8f525ab399
Replace disallowed operators in src/entity/ 2022-01-20 19:14:28 +00:00
XenialDan
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
marshall
b9b1ba9526
Include eye height in Living->lookAt() calculation (#4440) 2021-09-08 21:54:32 +01:00