Commit Graph

470 Commits

Author SHA1 Message Date
92f380bb9c Merge branch 'stable' into sync-minor-next 2024-08-17 11:17:48 -05:00
8c3cf7a687 Use VISIBLE_MOB_EFFECTS actor metadata property to send effect bubbles (#6414)
Close #6402
2024-08-14 22:48:10 -05:00
d6c48fd3a2 Implement new 1.21 paintings (#6393) 2024-07-12 13:24:43 +01:00
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
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
d5919dc094 ... 2024-03-25 17:24:52 +00:00
09904dc519 workaround for callback-validator not understanding arrow functions 2024-03-25 14:58:21 +00:00
f799cfaba6 Implemented sound when equipping armor (#6303) 2024-03-25 14:15:54 +00:00
ba48f258f3 Support for 1.20.70 2024-03-13 14:53:27 +00:00
920341668f Implemented working Name tag (#5209) 2024-02-19 18:46:48 +00:00
fbcf4649eb Avoid unnecessary Entity::getWorld() calls in loops 2023-11-17 13:58:41 +00:00
c7a358a56f World: extract getBlockCollisionBoxes() from getCollisionBoxes()
closes #6104

This function has been a footgun for anyone using it, since it also returns entity AABBs by default.
In all core use cases, this functionality was disabled, and we were paying a needless (admittedly micro) performance penalty for passing the extra useless argument and useless condition check.
2023-10-19 12:52:24 +01:00
3c614b505d Merge branch 'stable' into minor-next 2023-10-16 21:28:59 +01:00
94a17f59d2 fix(Entity): broadcastSound() not firing WorldSoundEvent (#6069) 2023-10-08 19:25:19 +01:00
94d98fb5c4 Migrate all but two remaining legacy enums to native PHP 8.1 enums 2023-09-07 19:32:45 +01:00
1504fdca24 Use 'enchanting' terminology
'enchant' just didn't feel right, being a verb.
All these things pertain to the act of enchanting.

This is now also consistent with CraftingTransaction etc. The ship already sailed on EnchantInventory, which will have to be renamed at a later datte. However, that was already inconsistent with 'enchanting table', so that's the odd one out here.
2023-08-23 16:14:17 +01:00
bf668c0f6c Rename EnchantHelper related stuff
Perhaps this and EnchantOption should be called EnchantingHelper and EnchantingOption respectively. The terminology used is rather inconsistent, but 'enchantment' definitely isn't the right word here.
2023-08-23 16:07:02 +01:00
d942748203 Move enchanting seed generation to EnchantmentHelper 2023-08-23 15:52:49 +01:00
d03e4d17ec Use hasHandlers() for events in player movement processing pathway
this should offer a minor performance improvement.
2023-08-23 14:26:17 +01:00
39867b97c5 Implement enchanting using enchanting tables (#5953)
Co-authored-by: Dylan K. Taylor <dktapps@pmmp.io>
2023-08-15 17:28:26 +01:00
9b2a7b43c2 ItemEntity: fixed O(n^2) performance issue when many of the same unstackable item are in the same place
this produced a 40% performance improvement in a simulation with 800 item entities.

If the items were all different, then this would still be a problem. However, many of the same unstackable items occupying the same space is a problem for SkyBlock farms, so this should improve performance for SkyBlock quite a bit.
2023-07-28 16:06:29 +01: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
763241b11f Fixed burning animations for fireproof entities
creative players are not technically fireproof; they just don't take any damage from fire
2023-07-19 12:32:00 +01:00
8414c78969 Fixed netherite items burning in lava 2023-07-19 11:49:52 +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
8c8794ec71 Allow use ConsumingItemAnimation with Living entities (#5897) 2023-07-14 17:41:46 +01:00
259cc305df Implement 1.20.10 short sneaking (#5892) 2023-07-13 13:36:53 +01:00
35fc9abacf Merge branch 'legacy/pm4' into stable 2023-06-09 01:34:33 +01:00
9a04481bec Entity: broadcast teleports as regular movements
fixes #5810

probably fixes #4986

#5810 was caused by the workaround for #4394, which broke in 1.20 for reasons I'm still unclear on.

As FLAG_TELEPORT does not work at all for non-player entities, and causes bugs with player entities, sending the teleport movement without the flag is the least buggy way to solve all of these issues. Having the client interpolate teleport movements is not ideal, but there doesn't seem to be a way to reliably prevent it without causing even more bugs, so this will have to do.
2023-06-09 01:24:57 +01:00
f5a1a0c9cb ÂInsert PM data version into blockstates, chunks, entities, tiles and level.dat
this information will allow us to correct for any bugs introduced by past versions.

however, we still need to propagate this information to permit actually using it when loading data.
2023-05-29 16:32:24 +01:00
edafe9d21f Entity: Rename and document isImmobile() and friends
while I could implement server-side ability to disable entity movement, I don't think that's particularly useful. However, the intended function of this (disabling client sided AI) is useful, so it makes more sense to rename it to match its functionality, rather than changing its functionality to match the name.

closes #3130
2023-05-26 14:01:21 +01:00
926f68d8c5 Move SkinAdapter under TypeConverter, remove SkinAdapterSingleton
this is legacy cruft from PM3, which didn't have TypeConverter or SingletonTrait.
2023-05-06 17:53:24 +01:00
ed11fd5a83 CS again... 2023-05-06 17:51:00 +01:00
e0a6ec0c24 Start deglobalizing TypeConverter
there's a bunch of places we can't reach with this right now:

- particles
- sounds
- tile NBT
- entity metadata
- crafting data cache
- chunk encoding
- world block update encoding

this is a work in progress, but ultimately we want to get rid of these singletons entirely.
2023-05-06 17:47:09 +01:00
289ede669d BlockTranslator: use less ambiguous function names 2023-05-05 14:47:23 +01:00
01f340985a Centralize all conversion-related stuff under TypeConverter
instead of having singletons for everything, which are a nightmare to manage for multi version
2023-05-03 16:33:17 +01:00
6beb80b8fe Fixed usages of BlockDataUpgrader which weren't accounting for thrown exceptions 2023-05-02 17:13:31 +01:00
c878bd8289 Merge remote-tracking branch 'origin/minor-next' into major-next 2023-04-20 00:18:19 +01:00
71b78b02d3 Merge remote-tracking branch 'origin/stable' into minor-next 2023-04-19 23:57:26 +01:00
9561ae5af7 Entity: micro optimisation for checkBlockIntersections() 2023-04-16 17:57:51 +01:00
56fbd45dd5 Entity: avoid double-checking block intersections for moving entities
fixes #1824
2023-04-16 17:38:26 +01:00
499b29b53a Merge branch 'minor-next' into major-next 2023-04-12 21:04:08 +01:00
0336394098 Human: remove useless NameTag tag
this is not written anywhere, so this code never does anything.
2023-04-12 16:44:10 +01:00