Dylan K. Taylor
8b73549355
Use JSON_THROW_ON_ERROR for json_encode() and json_decode()
2021-12-08 19:14:07 +00:00
Dylan K. Taylor
1d14c8cb6b
Merge branch 'stable' into next-minor
2021-12-07 00:41:48 +00:00
Rush2929
8f2ca92f02
Implement dropped item merging ( #4419 )
...
- The following classes have been added:
- `ItemMergeEvent`
- `ItemEntityStackSizeChangeAnimation`
- The following API methods have been added:
- `ItemEntity->isMergeable()`
- `ItemEntity->tryMergeInto()`
- `ItemEntity->setStackSize()`
2021-12-06 22:23:18 +00:00
Dylan K. Taylor
6e4b73c183
FallingBlock: fixed crash when block is unable to be determined
2021-12-06 16:40:47 +00:00
Dylan K. Taylor
5c7125f190
Improved error handling for loading broken entity / tile data
2021-11-23 17:41:26 +00:00
Rush2929
b34e6f53eb
Changed visibility of Projectile->move to Protected. ( #4585 )
2021-11-19 23:21:10 +00:00
Dylan K. Taylor
c3ec9c0948
Effect default duration is once again NOT hardcoded, like PM3
...
I have no fucking idea why I hardcoded this to begin with. Not one of my better ideas ...
2021-11-09 01:52:47 +00:00
Dylan K. Taylor
eb9012401b
Merge branch 'stable'
2021-11-08 19:53:56 +00:00
Dylan K. Taylor
19a3efe893
.......
2021-11-08 18:57:14 +00:00
Dylan K. Taylor
a1ecdc27e5
Removed Vanilla*::fromString()
...
these were misbegotten and should never have existed.
If someone really needs these for some reason, they can use getAll()[name].
2021-11-08 18:52:14 +00:00
Dylan K. Taylor
f93b5be789
Added new dynamic StringToEffectParser
2021-11-08 18:49:28 +00:00
Dylan K. Taylor
c6c992a1f0
Preparations for negative Y support
2021-11-08 17:28:22 +00:00
Dylan K. Taylor
579ef63663
EntityDataHelper: accept FloatTag for vector3 as well as Double
...
MCPE uses Float for entity positions.
2021-11-04 20:46:34 +00:00
Dylan K. Taylor
54f287feb6
Merge branch 'stable'
2021-11-04 19:27:41 +00:00
Dylan K. Taylor
e34364412b
Replace InvalidStateException usages with InvalidArgument or LogicException
2021-11-02 16:05:54 +00:00
Dylan K. Taylor
f827a555d5
Merge branch 'stable'
2021-11-01 18:13:24 +00:00
Dylan K. Taylor
6175b03433
Merge commit 69952ae2aff244715b986d35c3ed041863fb39ef
2021-11-01 17:36:34 +00:00
Dylan K. Taylor
a78248a19c
Merge commit '71f2a34616961d6328f06fd911b6d4450a61643e'
2021-11-01 17:33:02 +00:00
Dylan K. Taylor
08f3c18de9
Arrow: do not add pickups to creative players' inventories
...
closes #2932
2021-10-30 17:16:46 +01:00
Dylan K. Taylor
8a2ecfe1d4
Merge branch 'stable'
2021-10-29 19:04:01 +01:00
Dylan K. Taylor
32a34d2494
Location: change order of constructor parameters
...
to be consistent with Position::__construct() and Location::fromObject() (although Location::fromObject() has no choice, thanks to the anti-feature known as late static binding ...)
2021-10-29 15:43:09 +01:00
Dylan K. Taylor
ee9f5e0044
Location: make __construct() parameters mandatory
...
I did consider allowing yaw/pitch to remain optional, but considering the implicit immutability of Location, it really doesn't make any sense to create a Location with default yaw/pitch - just create a Position in that case instead.
2021-10-29 15:40:58 +01:00
Dylan K. Taylor
04aedc6494
Updated BedrockProtocol
2021-10-23 23:54:49 +01:00
Dylan K. Taylor
c77829f4ad
Migrate packet creation to use ::create() methods in all but one case
...
MovePlayerPacket doesn't yet have a ::create() due to a complication with fields that aren't always present.
2021-10-23 01:46:01 +01:00
Dylan K. Taylor
c773e43eda
Updated BedrockProtocol to pmmp/BedrockProtocol@97fa88e9ef
2021-10-23 01:16:45 +01:00
Dylan K. Taylor
c70b80c273
ItemEntity: implement partial itemstack pickups in the dumbest way possible
...
Given the various limitations and flexibilities posed by EntityItemPickupEvent, I settled on this as the simplest way to deal with the problem.
- EntityItemPickupEvent may have its destination inventory changed, so we can't cache the result of getAddableItemQuantity() to use after the event.
- The item itself may have changed, so even if we thought we could add some items before the change, we might not be able to afterwards.
Considering the above facts, it's better to just give the whole itemstack to EntityItemPickupEvent, and let plugins use getAddableItemQuantity() on their own to decide if their chosen inventory can accommodate the item or not.
If it can't, then we'll just drop it on the ground.
This also fixes a potential issue where plugins changing the item to a custom one might end up with their items and the actual items both just vanishing if the target inventory was full.
closes #4499
2021-10-17 22:37:49 +01:00
Dylan K. Taylor
aa53dc6709
Entity: fixed network properties not updating when fireTicks changes
...
another bug that LBSG knew about, but didn't report. :/
2021-10-09 23:57:37 +01:00
Dylan K. Taylor
0ad663ff50
Merge remote-tracking branch 'origin/stable'
2021-10-05 01:17:59 +01:00
Dylan T
4111d92b98
Stop hardcoding chunk dimensions everywhere ( #4443 )
2021-09-10 16:13:25 +01:00
marshall
b9b1ba9526
Include eye height in Living->lookAt() calculation ( #4440 )
2021-09-08 21:54:32 +01:00
Dylan K. Taylor
931c3ed77d
Entity: fixed current movement not being accounted for in fall height
...
this caused incorrect damage when falling from heights, as well as a bug in #4434 .
2021-09-06 12:53:52 +01:00
Dylan K. Taylor
956780c6a6
Entity: add getters and setters for fallDistance
2021-09-05 23:59:04 +01:00
Dylan K. Taylor
ded778f422
Implemented bed bouncing
2021-09-05 20:11:49 +01:00
Dylan K. Taylor
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
Dylan K. Taylor
6b7e671794
Living: use Vector3->down() instead of subtract().
2021-09-05 14:12:04 +01:00
Dylan K. Taylor
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
Dylan K. Taylor
d329bfb25d
Entity: rename movX/movY/movZ to wantedX/wantedY/wantedZ
...
this makes the code much easier to understand.
2021-09-05 14:06:53 +01:00
Dylan K. Taylor
73cc841d0b
Entity: rename checkBlockCollisions() to checkBlockIntersections()
2021-09-05 14:00:27 +01:00
Dylan K. Taylor
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
Dylan K. Taylor
6ecad153ea
Entity: remove fallDistance parameter from fall()
2021-09-05 13:34:43 +01:00
Dylan K. Taylor
7e82cafdeb
Entity: remove a bunch of commented code that no one cares about
2021-09-05 13:27:48 +01:00
Dylan K. Taylor
7d5b9295cb
PoisonEffect should accept Translatable|string, like its parent
...
this doesn't really break anything, but someone will likely whine about consistency if it's not fixed now.
2021-09-03 21:33:55 +01:00
Dylan K. Taylor
0404298c74
Effect: get rid of runtimeIDs
2021-09-03 21:25:06 +01:00
Dylan K. Taylor
665f2473e1
Effect: stop using hardcoded translation keys for names
2021-09-03 20:39:02 +01:00
Dylan K. Taylor
8e58beef7f
Effect: use promoted properties
2021-09-03 20:32:13 +01:00
Rush2929
c2558573e2
Fix offhand pickup ( #4412 )
2021-08-29 12:45:23 +01:00
marshall
6e68e99ec0
Added PlayerEntityInteractEvent ( #4374 )
2021-08-24 11:56:10 +01:00
SalmonDE
7fd712c1ff
Refactor Block & Tile: getPos() to getPosition() ( #4395 )
...
this also changes the name of the class property 'pos' to 'position' as well as Block->getPosOffset() to Block->getPositionOffset()
2021-08-23 14:01:32 +01:00
Dylan K. Taylor
270ee5c085
Simplify registry method generation
2021-08-22 23:02:36 +01:00
Rush2929
1ce9474fce
Picked up items can now be added to offhand slots. ( #4360 )
2021-08-22 20:36:12 +01:00