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
ed95679953
Merge branch 'next-minor' into modern-world-support
2022-03-23 13:42:46 +00:00
Dylan K. Taylor
a9f2766a8b
Merge branch 'stable' into next-minor
2022-03-23 13:39:41 +00:00
Dylan K. Taylor
4e777572c9
fix CS
2022-03-23 13:28:21 +00:00
Dylan K. Taylor
90a8595a40
Check for mismatched inventory slot predictions in transactions
...
this should limit the problems caused by mismatched gameplay features that result in ghost items, such as #4896 .
2022-03-22 17:42:19 +00:00
Dylan K. Taylor
bf71eb448a
Reduce chaos in inventory classes
2022-03-22 17:19:55 +00:00
Dylan K. Taylor
2c29d272ad
BaseInventory: move setMaxStackSize() to a more sensible place
2022-03-22 17:11:48 +00:00
Dylan K. Taylor
98aa2b9ff9
Inventory: move removeItem() next to remove()
...
this should hopefully be more attention grabbing and a bit less misleading, since people will wonder why there are 'remove' and 'removeItem' both.
we really need to rename one of these...
2022-03-22 17:08:30 +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
9963fcf849
PluginManager: return the created RegisteredListener from registerEvent()
...
this allows the handler to be later unregistered when used with a plain closure instead of a magic `Listener`.
2022-03-22 16:20:37 +00:00
Dylan K. Taylor
ab93135b84
Merge branch 'stable' into next-minor
2022-03-22 15:49:58 +00:00
Dylan K. Taylor
4a94cb85a2
fix CS
2022-03-22 15:44:11 +00:00
Dylan K. Taylor
b7e6854189
RegistryTrait: enforce name validation rules on everything, not just enums
...
fixes #4916
2022-03-22 15:41:17 +00:00
Dylan K. Taylor
2b8a54f8ff
Entity: added a guard to prevent __construct() from running multiple times
...
this typically happens due to flawed logic in child classes in plugins which causes parent::__construct() to get called multiple times.
2022-03-22 15:33:31 +00:00
PJZ9n
f4f5c3128f
EnumTrait: fixed regex not accepting member names with 1 character
...
this also fixes EnumTrait accepting invalid non-numeric characters for the first character, such as @.
2022-03-19 16:47:36 +00:00
Dylan K. Taylor
fdd42fd15f
4.2.5 is next
2022-03-18 20:20:47 +00:00
Dylan K. Taylor
05a5e5eac1
Release 4.2.4
2022-03-18 20:20:32 +00:00
Dylan K. Taylor
c8e1cfcbee
TypeConverter: account for possible out-of-range meta in items
2022-03-18 19:34:51 +00:00
Dylan K. Taylor
05fdd94754
fix CS
2022-03-12 00:57:32 +00:00
Dylan K. Taylor
05792826bc
EntityFactory: use import aliases to improve readability slightly
2022-03-09 23:39:45 +00:00
Dylan K. Taylor
fbf7ad4295
4.2.4 is next
2022-03-09 22:52:42 +00:00
Dylan K. Taylor
6c1c0c867e
Release 4.2.3
2022-03-09 22:52:38 +00:00
Dylan K. Taylor
5c0eb92d81
Entity: harden setRotation(), setMotion(), addMotion() and teleport() against NaN/INF values
2022-03-09 22:36:44 +00:00
Dylan K. Taylor
1e88412a8f
Entity: harden constructor against dodgy locations containing NaN/INF components
2022-03-09 22:31:24 +00:00
Dylan K. Taylor
f97ce6afef
Harden APIs which accept Vector3/Position/Location in event namespace
2022-03-09 22:22:37 +00:00
Dylan K. Taylor
879476d8e0
ItemFrame: added missing bounds check for setItemDropChance()
2022-03-09 22:20:04 +00:00
Dylan K. Taylor
6d584cf008
EntityDataHelper: prevent INF/NaN being loaded from disk to come back and break things after the fact
2022-03-09 22:16:07 +00:00
Dylan K. Taylor
8efa299c65
phpstan 1.4.8
2022-03-09 18:30:54 +00:00
Dylan K. Taylor
5ef73ca9aa
Entity: Remove outdated comment
2022-03-09 18:02:57 +00:00
Dylan K. Taylor
856fd2a33b
fix PHPStan failures
2022-03-09 17:26:05 +00:00
Dylan K. Taylor
581bbfe255
DiskResourceProvider: add @var for type that PHPStan can't infer
2022-03-09 17:18:40 +00:00
Dylan K. Taylor
b4e1edaa64
CommandSender: provide more detailed types for getScreenLineHeight() and setScreenLineHeight()
2022-03-09 17:17:51 +00:00
Dylan K. Taylor
025f6407e2
Fire: fixed sticking to transparent top-sides of blocks
...
closes #4879
closes #2819
2022-03-09 16:59:26 +00:00
IvanCraft623
10c0d83fa5
ShulkerBox: Allow opening unless the lid is obstructed by a solid block ( #4885 )
...
fixes #4884
2022-03-09 16:37:23 +00:00
Dylan K. Taylor
5d970cf5bd
Fire: do not overwrite blocks during burning unless they were unchanged by onIncinerate()
...
onIncinerate() by custom blocks might produce custom results which aren't supposed to be burned away (e.g. wood could turn into charred wood, or something of that nature).
closes #4764
2022-03-03 19:19:59 +00:00
Leo Lee
6a39caa204
Fixed mycelium spreading onto coarse dirt ( #4816 )
2022-03-03 19:02:13 +00:00
ipad54
91f81d4c8e
Sweet Berry Bush now absorbs fall damage ( #4876 )
2022-03-03 19:00:44 +00:00
Dylan K. Taylor
2b81b53dfa
Merge branch 'stable' into next-minor
2022-03-03 18:50:12 +00:00
Dylan K. Taylor
dfd8c4e4b8
TaskScheduler: throw an exception if attempting to heartbeat a disabled scheduler
2022-03-03 18:49:17 +00:00
Dylan K. Taylor
c9c50e16ec
PluginManager: fixed mishandling of self-disabling plugins in enablePlugins()
...
this caused a leak of the plugin context, PluginEnableEvent to be called with a disabled plugin, and the plugin's scheduler to get ticked.
2022-03-03 18:48:52 +00:00
Dylan K. Taylor
eff856d8e5
Stop the server if any world listed by config fails to load or be generated during startup
...
closes #3162
this does not affect worlds loaded by plugins; they may continue to handle errors as they see fit
2022-03-03 18:40:11 +00:00
IvanCraft623
90a369f0b6
Humans can now do emotes ( #4610 )
...
added the following API methods:
- Human::emote()
2022-03-03 18:19:30 +00:00
Covered123
ba05b4f024
Whitelist command now kicks non-whitelisted online players ( #4774 )
...
closes #3868
2022-03-03 18:15:21 +00:00
Dylan K. Taylor
3e90c3072a
4.2.3 is next
2022-03-02 23:00:33 +00:00
Dylan K. Taylor
12946fbe46
Release 4.2.2
2022-03-02 23:00:29 +00:00
Dylan K. Taylor
70f923714c
Merge branch 'stable' into next-minor
2022-03-02 18:43:34 +00:00
Rush2929
d47a7f48bd
BrewingStand: avoid duplicate method call ( #4874 )
2022-03-02 17:32:56 +00:00
EndermanbugZJFC
f181c60209
Fixed typo (occured => occurred) ( #4873 )
...
[ci skip]
2022-03-02 16:28:02 +00:00
Dylan K. Taylor
03fa5387ac
StringToItemParser: recognize cod, raw_cod and cooked_cod
2022-03-01 21:49:36 +00:00
Dylan K. Taylor
1ea0b8a9df
VanillaBlocks generator now reverse-lookups ID constants instead of baking numeric IDs into the code
...
this makes it easier to spot errors.
similar treatment as VanillaItems received in the previous commit
2022-02-26 16:17:23 +00:00