Commit Graph

331 Commits

Author SHA1 Message Date
Artem Turov
93e661aa4e Removed useless @inheritDoc (#5399) 2022-11-09 13:40:35 +00:00
Dylan K. Taylor
db7cee6f22 Player: check if the item meaningfully changed before discarding it in creative
fixes #5220
2022-10-11 22:06:03 +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 T
41970feb57 Entity: Fire EntitySpawnEvent/ItemSpawnEvent on the first entity tick, instead of in the constructor (#5314)
This allows plugins to modify the entity via setters in EntitySpawnEvent without their changes getting overwritten by setter calls directly after the 'new YourEntity' statement.

As well as benefiting plugins, this also clears a path for a BC-breaking change in PM5 (to have the programmer use addEntity() to spawn entities, instead of the constructor doing it, which will improve on a number of data handling aspects).

fixes #4973

This targets next-minor because it has some side effects on plugins that depended on the old behaviour, such as VanillaHopper, so it's not suitable for a patch release.
2022-09-29 22:30:12 +01:00
Dylan K. Taylor
9295afe8b9 Merge branch 'next-minor' into next-major 2022-09-24 18:12:38 +01:00
Dylan K. Taylor
a7dfa0907c Merge branch 'stable' into next-minor 2022-09-24 18:07:56 +01:00
Dylan K. Taylor
f6a9949942 Remove PlayerCommandPreprocessEvent
closes #4284
2022-09-24 15:35:49 +01:00
famima65536
e4fc523251 Introduce Player::sendToastNotification() (#5102) 2022-09-23 11:37:08 +01:00
Dylan K. Taylor
7804172846 Player: added API documentation for some functions 2022-09-21 14:46:04 +01:00
Dylan K. Taylor
7d29ac8293 Merge branch 'stable' into next-minor 2022-09-21 14:21:27 +01:00
Dylan K. Taylor
d1c75da14b Player: lock flight state in spectator mode
players should not be able to stop flying in spectator mode
2022-09-20 21:53:51 +01:00
Dylan K. Taylor
1ecb10acba Merge branch 'next-minor' into next-major 2022-08-21 19:19:07 +01:00
Dylan K. Taylor
ad2d59923c Merge branch 'stable' into next-minor 2022-08-18 17:06:15 +01:00
Dylan K. Taylor
792c1b62b7 Introduce and use TransactionBuilder for inventory evacuations 2022-08-18 17:04:12 +01:00
NoClip
2f4a9469b6 Player: spectator shouldn't able to pick blocks they don't have (#5111)
Jury is out on whether they should be able to pick blocks at all, or be considered to have infinite resources, but this solution has been used in a few other places already anyway, so it can be cleaned up another time.
2022-08-15 16:48:37 +01:00
Dylan K. Taylor
c8a8e33fc1 Merge branch 'next-minor' into next-major 2022-07-24 21:24:08 +01:00
Dylan K. Taylor
608c6ed6db Improved suboptimal code in Player::handleMovement() 2022-07-24 20:51:28 +01:00
Dylan K. Taylor
b3f8b5ff37 Fix CS 2022-07-16 20:01:29 +01:00
Dylan K. Taylor
d0ff6d2e36 Enable various types of interaction to return items to the player, without needing to have a bunch of boilerplate creative mode and held item checks
it became glaringly obvious that this was needed because of #4827 and #4868.

this is further needed with the addition of cauldrons.
2022-07-16 19:50:33 +01:00
Dylan K. Taylor
dea0207e4e Merge branch 'next-minor' into next-major 2022-07-13 17:06:04 +01:00
Dylan K. Taylor
06655bee78 Updated to 1.19.10 2022-07-13 00:59:49 +01:00
Dylan K. Taylor
68cbe46600 Exterminate legacy item IDs 2022-07-05 15:12:55 +01:00
Dylan K. Taylor
d9544b5d0e Added soul fire 2022-07-04 22:32:35 +01:00
Dylan K. Taylor
04b855235a Merge branch 'next-major' into modern-world-support 2022-06-24 01:35:46 +01:00
Dylan K. Taylor
72d8b54188 Merge branch 'next-minor' into next-major 2022-06-24 01:33:15 +01:00
Dylan K. Taylor
bb5b52d998 Player: fix terrain getting redrawn when moving in noclip mode 2022-06-09 13:48:29 +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
812d5c3f58 Merge branch 'stable' into next-minor 2022-05-24 14:17:53 +01:00
Dylan K. Taylor
38d75f3aab Player: Be more explicit about not parsing chat messages when messageCounter is zero
the length check technically accounts for this, but future readers might not realize this
2022-05-22 16:46:53 +01:00
Dylan K. Taylor
179cac45f5 Merge branch 'stable' into next-minor 2022-05-22 16:21:05 +01:00
Dylan K. Taylor
c82dfef9b0 Player: fix weird behaviour when teleporting sleeping players
closes #4672
2022-05-21 20:08:12 +01:00
Dylan K. Taylor
1181b13b5d Player: call InventoryCloseEvent after doing the necessary business
closes #4626

this does change the behaviour of getCurrentWindow() during InventoryCloseEvent, but no one should be using that anyway, since InventoryCloseEvent->getInventory() exists.
2022-05-21 19:23:59 +01:00
TheNewHEROBRINEX
02cf6ae46c Added PlayerDeathEvent->setKeepXp(), closes #4002 (#4015) 2022-05-21 16:41:14 +01:00
Dylan K. Taylor
86efa0aae6 Merge remote-tracking branch 'origin/stable' into next-minor 2022-05-20 17:49:04 +01:00
Dylan K. Taylor
554f96bc24 InventoryManager: Defer opening new windows to the client until the window close handshake has been completed
fixes #5021 and probably a bunch of other inventory related glitches

When the server initiates a window close, it does so by sending a ContainerClose to the client, which causes the
client to behave as if it initiated the close itself. It responds by sending a ContainerClose back to the server,
which the server is then expected to respond to.

Sending the client a new window before sending this final response creates buggy behaviour on the client, which
is problematic when switching windows. Therefore, we defer sending any new windows until after the client
responds to our window close instruction, so that we can complete the window handshake correctly.

This is a pile of complicated garbage that only exists because Mojang overengineered the process of opening and
closing inventory windows.
2022-05-20 16:54:15 +01:00
Duo Incure
89cc449808 Update exhaustion values for 1.18.30 (#5034) 2022-05-17 18:28:19 +01:00
Dylan T
8b8560a701 Added PlayerPostChunkSendEvent (#4937)
this is primarily useful for debugging plugins, but could also be useful for other things, such as spawning fake blocks, particles, etc.
2022-05-17 15:40:01 +01:00
Dylan K. Taylor
937bb4c6ce Merge branch 'stable' into next-minor 2022-04-28 21:00:23 +01:00
ねらひかだ
27056b6c37 Player: creative players should not be damaged by the void (#4978) 2022-04-21 16:39:36 +01:00
Dylan K. Taylor
df33e179e5 Player: fixed chat newlines denial-of-service vulnerability
irresponsibly reported in #4974

closes #4974
2022-04-20 13:01:05 +01:00
Dylan K. Taylor
7d1464f0a1 Merge branch 'stable' into next-minor 2022-03-28 17:18:54 +01:00
Dylan K. Taylor
901449b0b1 Player: simplify PlayerItemHeldEvent calling on content change
the second parameter to this callback is the OLD slots, not the changed slots. This means that ALL slots are included, including empty and unchanged slots.
2022-03-23 13:47:01 +00:00
Dylan K. Taylor
a9f2766a8b Merge branch 'stable' into next-minor 2022-03-23 13:39:41 +00:00
Dylan K. Taylor
ea33a04d00 Player: ensure that PlayerItemHeldEvent is called when the contents of the held slot changes
in PM3, this was done by implicitly relying on the client to send a MobEquipmentPacket selecting the same hotbar slot when the slot contents changes.
In PM4, we avoid relying on this, and fire the event directly when the listener detects a held slot change.
This ensures that the behaviour remains consistent regardless of what the client starts doing in the future.

closes #4905
2022-03-22 16:53:02 +00:00
Dylan K. Taylor
ab93135b84 Merge branch 'stable' into next-minor 2022-03-22 15:49:58 +00:00
Dylan K. Taylor
856fd2a33b fix PHPStan failures 2022-03-09 17:26:05 +00:00