847 Commits

Author SHA1 Message Date
Dylan K. Taylor
537e194161
ChorusPlant: make use of StaticSupportTrait 2023-09-08 17:33:32 +01:00
Dylan K. Taylor
f7f5af607c
Merge branch 'stable' into minor-next 2023-09-08 17:20:45 +01:00
Dylan T
b293d7bf1f
Static support trait (#6044)
Added StaticSupportTrait for blocks which require unconditional support

dynamic support requirements, such as those presented by item frames and torches, are not included.

in addition, double blocks, such as tallgrass, small dripleaf and doors, do not cooperate well with this, so they are also not included.

some blocks which could be migrated (such as chorus plant) were skipped due to unresolved problems.
2023-09-08 17:19:06 +01:00
Dylan K. Taylor
efafc2c6ca
DeadBush: updated support requirements
since 1.20 they can now be placed on grass and mud.
2023-09-08 16:41:06 +01:00
Dylan K. Taylor
093b1e1b18
Merge branch 'stable' into minor-next 2023-09-08 12:48:40 +01:00
Dylan K. Taylor
d7f69c5e24
CaveVines: fixed incorrect support condition 2023-09-08 12:47:46 +01:00
ShockedPlot7560
d60fca0a1c
Age blocks logic moved into dedicated trait (#5962) 2023-09-08 12:25:26 +01:00
Dylan K. Taylor
0e87ee1e0e
ÂHangingRoots: fixed incorrect support face 2023-09-08 12:22:00 +01:00
Dylan K. Taylor
03ecc98a24
HangingRoots: fixed support conditions 2023-09-08 12:16:45 +01:00
Dylan K. Taylor
d3ab516ba4
CS 2023-09-08 11:26:58 +01:00
Dylan K. Taylor
aa916b2c49
WoodLikeBlockIdHelper: reduce obnoxious code 2023-09-08 11:17:47 +01:00
Dylan K. Taylor
7ce33d9375
Migrate final remaining EnumTrait users to native enums 2023-09-08 10:34:12 +01:00
Dylan T
7dcd2592d4
RuntimeDataDescriber: Support dynamically describing arbitrary enums (#6039)
Previously, we were using codegen to support describing a fixed set of enums.

Instead, we implement an enum() function, allowing any native PHP enum to be described.
All enums used in runtime data have been migrated to native PHP 8.1 enums in minor-next to facilitate this.

This implementation:

- is faster (in extreme cases by 40x, such as with PotionType)
- requires way less code
- does not require a build step
- is way more flexible

This fixes #5877, increasing the range of stuff that plugins are now able to do.

EnumTrait enums are not supported, as it's easier and cleaner to just support native enums. Most core EnumTrait enums have been migrated to native enums by now to facilitate this.
2023-09-07 20:07:14 +01:00
Dylan K. Taylor
b50efbc15a
Fix CS 2023-09-07 19:38:29 +01:00
Dylan K. Taylor
94d98fb5c4
Migrate all but two remaining legacy enums to native PHP 8.1 enums 2023-09-07 19:32:45 +01:00
Dylan K. Taylor
ae564e445d
Start migrating EnumTrait enums to PHP 8.1 native enums 2023-09-07 17:20:52 +01:00
Dylan K. Taylor
fe94379a93
Fixed connection requirements for fences, glass, bars and walls
these connect to the back faces of stairs and to glass, for example.
2023-09-06 12:56:47 +01:00
Dylan K. Taylor
5a010e8213
Merge branch 'minor-next' into stable 2023-09-06 12:06:15 +01:00
Jonathan B
ce04478395
Fix SmithingTableInventory size (#6035)
Since 1.20 SmithingTable has a new Template slot, size is now 3

Fix debug error from InventoryManager
2023-09-06 08:15:27 +01:00
Dylan K. Taylor
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
Dylan K. Taylor
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
Dylan K. Taylor
cd6abbe0bb
BaseSign: remove redundant condition 2023-08-21 16:30:16 +01:00
Dylan K. Taylor
22778583cf
Sign: implement waxing using honeycomb 2023-08-21 16:28:17 +01:00
Dylan K. Taylor
d44e0e87d0
BaseSign: implement sign editing
this was originally submitted by #6000, but considering the overcomplicated PR and the triviality of the feature, I figured it would be quicker to do it myself instead of having a bunch of back-and-forth bikeshedding over it.
2023-08-21 16:14:43 +01:00
Dylan T
e323c5dd76
Implement pressure plate activation logic and events (#5991)
closes #5936

This implements all of the basic activation logic for pressure plates.
It also introduces a PressurePlateUpdateEvent, which is called in pulses when entities are standing on top of the plate and when it deactivates. Deactivation can be detected by checking if the list of activating entities is empty.

---------

Co-authored-by: Javier León <58715544+JavierLeon9966@users.noreply.github.com>
2023-08-16 13:00:23 +01:00
Dylan K. Taylor
b330cbe8e2
Merge remote-tracking branch 'origin/stable' into minor-next 2023-08-15 17:41:41 +01:00
S3v3Nice
39867b97c5
Implement enchanting using enchanting tables (#5953)
Co-authored-by: Dylan K. Taylor <dktapps@pmmp.io>
2023-08-15 17:28:26 +01:00
ipad54
af9ae445fc
Fix cake drops (#5985)
closes #5984
2023-08-10 17:42:32 +01:00
Dylan K. Taylor
91d5a3ddfe
PotionCauldron: fixed setPotionItem() not validating the given item
we should probably remove this API and have enums for potion container and type tbh... this API was a mistake
2023-08-10 16:06:41 +01:00
Dylan K. Taylor
7826e0a11e
Merge branch 'stable' into minor-next 2023-08-09 16:14:05 +01:00
Dylan K. Taylor
447f061566
Use Event::hasHandlers() for a few more hot events 2023-08-09 15:46:20 +01:00
Dylan K. Taylor
78f5fbddf3
Merge branch 'legacy/pm4' into stable 2023-08-09 13:58:14 +01:00
Hugo_
a5d8ef7a6c
Add FarmlandHydrationChangeEvent (#5916) 2023-08-09 12:33:25 +01:00
Dylan K. Taylor
735d9a5bf4
CandleTrait: allow candle to be lit by fire charges 2023-08-09 12:04:02 +01:00
Dylan K. Taylor
f4a06605b1
Cake: only accept candle when no slices have been taken
otherwise, cake slices can be regenerated using candle
2023-08-09 11:42:08 +01:00
ipad54
77dfbc4e23
Implemented pink petals (#5940) 2023-08-09 11:33:33 +01:00
Dylan K. Taylor
9f14901820
Merge branch 'stable' into minor-next 2023-08-08 17:48:12 +01:00
ipad54
35a28300f6
Podzol should be affected by silk touch (#5969) 2023-08-07 11:47:29 +01:00
Dylan K. Taylor
6ac45526f9
Use new features in pocketmine/math 1.0.0 2023-08-03 16:46:16 +01:00
Dylan K. Taylor
d88c3d8ced
Fixed coral block killing itself when calling getDropsForCompatibleTool()
this might be called by plugins without actually breaking the block, in which case the block will glitch.
2023-08-02 13:43:36 +01:00
Dylan K. Taylor
82f87cc2da
Reduce repeated block-change-event related code
the new helper code reveals even more repetition, but this is at least consistent now.
2023-08-02 13:40:12 +01:00
Dylan K. Taylor
bb0e648276
Fixed BlockDeathEvent usages showing an oldState which is already dead 2023-08-02 13:36:54 +01:00
Dylan K. Taylor
0a90a5928a
Added TallGrassTrait, remove weirdly specific logic from FortuneDropHelper
this needs to be dealt with before release otherwise we'll be stuck with FortuneDropHelper::grass()
this is the obvious solution and should have been done some time ago - stuff like flammability was already a problem for double tall grass anyway
2023-08-01 12:33:36 +01:00
dohwi
4eb9dacd3c
Remove unnecessary HorizontalFacingTrait (#5930)
FacingOppositePlacingPlayerTrait already includes HorizontalFacingTrait, so we don't need to include it twice.
2023-07-24 12:16:56 +01:00
Dylan K. Taylor
3afe3b7f44
Merge branch 'stable' into minor-next 2023-07-24 12:02:24 +01:00
Dylan K. Taylor
2779f92828
Bell: clean up code 2023-07-21 15:29:33 +01:00
Dylan K. Taylor
5899f2fc1d
Block: introduce new methods to reduce support type boilerplate checks
this switches from a 'can be supported by' concept to a 'can stay at this position' paradigm, which requires way less boilerplate code.

there may be further improvements we can make from here, such as adding traits, but this is a good first step.
2023-07-21 15:02:25 +01:00
Dylan K. Taylor
9ef835c82d
Merge remote-tracking branch 'origin/legacy/pm4' into stable 2023-07-21 11:07:32 +01:00
Dylan K. Taylor
4bdd6410db
Fire: fixed support requirements
closes #5599
2023-07-20 17:00:32 +01:00
Dylan K. Taylor
6ea7fd7d6b
ShulkerBox: do not offer support for other blocks 2023-07-20 16:36:25 +01:00