Commit Graph

948 Commits

Author SHA1 Message Date
b5469dede2 Flowable blocks now can't be placed inside liquid (#5392) 2024-11-15 00:10:43 +00:00
ab5176baf9 Merge branch 'minor-next' into major-next 2024-11-14 23:16:44 +00:00
33a7b46329 Use reflection to locate BlockTypeIds and ItemTypeIds for VanillaBlocks/VanillaItems (#6498)
Use reflection to locate BlockTypeIds and ItemTypeIds for VanillaBlocks/VanillaItems

Since BlockTypeIds and ItemTypeIds are derived from VanillaBlocks and VanillaItems respectively anyway (they only exist to allow identifying blocks/items without having to create instances of them), this hack is probably OK, and reduces the chances of mistakes.
Previously it was explored to have these IDs generated by auto-incrementing in VanillaBlocks/Items and have the constants generated that way, but this proved to be too problematic because of unstable diffs no matter how we chose to sort the elements. See #6313 for previous research on the subject.

This is obviously not a desirable hack to keep long-term. In the future it will probably make sense to redesign VanillaBlocks like so:

enum VanillaBlocks { ... }
VanillaBlocks::STONE (the type ID)
VanillaBlocks::STONE->new() (to create a block)

However, more research is needed on this, as I'd prefer not to make block creation any more verbose.
2024-11-14 17:32:22 +00:00
ef6fce4091 Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/11824307499
2024-11-13 19:21:19 +00:00
f3cc4a28e1 Easy wins for PHPStan 2.0 support 2024-11-12 22:12:54 +00:00
85de28d6c3 Merge branch 'minor-next' into major-next 2024-11-03 14:02:06 +00:00
7e343617b9 Rename ICopper to CopperMaterial (#6470) 2024-10-23 11:34:42 +01:00
1ef854f2d1 Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/11392123557
2024-10-17 19:59:15 +00:00
4e6b34f573 Implement new 1.21 copper blocks (#6366)
Added the following new blocks:
- All types of Copper Bulb
- All types of Copper Door
- All types of Copper Trapdoor
- All types of Chiseled Copper
- All types of Copper Grate
2024-09-24 21:25:10 -05:00
83a91634c3 Merge branch 'minor-next' into sync-major-next 2024-09-22 21:44:31 -05:00
a4a07a8e5a Merge 'stable' into 'minor-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/10986731877
2024-09-23 02:36:00 +00:00
8cb2e577a1 Implement missing last interacted slot property in chiseled bookshelf (#6440) 2024-09-02 18:02:06 -05:00
9381fc4172 Blue Ice: No longer emits light & it's now dropped when mined with a tool with silk touch enchantment (#6438) 2024-08-31 22:33:11 -06:00
6c5ae634fd Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/10373700926
2024-08-13 16:37:46 +00:00
994fa5f792 Merge 'stable' into 'minor-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/10373700926
2024-08-13 16:37:45 +00:00
585dc835e7 Fixed anvil placing rotation. (#6375)
Co-authored-by: IvanCraft623 <57236932+IvanCraft623@users.noreply.github.com>
2024-08-13 16:19:07 +01:00
13f5cc9f87 ChiseledBookshelf: fixed function visibility (#6421) 2024-08-13 16:11:22 +01:00
c9e8d382c5 Merge branch 'minor-next' of github.com:pmmp/PocketMine-MP into major-next 2024-08-09 13:33:07 +01:00
787afb6b00 Implement all new 1.21 tuff blocks (#6391) 2024-07-23 11:34:46 -05:00
ef9791eaed Merge pull request #6397 from pmmp/stable
Merge branch 'stable' into minor-next
2024-07-10 18:56:52 +01:00
accaa0acce Implement ICopper interface for blocks with common properties (#6390) 2024-07-10 11:15:06 -05:00
68d2e2915e Bells always drops themselves (#4802) 2024-07-07 15:20:45 -05:00
2ffc38c835 Implement campfire & soul campfire (#4696) 2024-07-07 15:01:34 -05:00
b342c497d1 Added 1.21 banner patterns. 2024-06-23 13:27:52 +03:00
f772bb7384 WoodenStairs can be a fuel (#6345) 2024-05-13 09:34:18 +01:00
12179aa03a Merge branch 'minor-next' into major-next 2024-05-06 15:42:49 +01:00
dad9a7e6cd Merge branch 'stable' into minor-next 2024-04-02 16:35:31 +01:00
2584314202 NetherRoots: fix placement on soul soil (#6299) 2024-03-25 10:53:16 +00:00
337e462c8f Added new banner patterns (#6298) 2024-03-25 10:52:21 +00:00
b680a1693c Added sound when picking sweet berries (#6287) 2024-03-19 10:18:30 +00:00
644693ffee Merge branch 'minor-next' into major-next 2024-02-12 11:55:36 +00:00
d211392b67 Merge remote-tracking branch 'origin/stable' into minor-next 2024-02-12 11:46:48 +00:00
fe06bfcda0 Import alias cleanup courtesy of newest php-cs-fixer 2024-02-07 12:50:37 +00:00
f207d1bbf2 Make CocoaBlock Flowable (#6218) 2024-02-05 12:36:09 +00:00
a459e3c1a9 Block: improve some documentation 2024-01-09 13:35:36 +00:00
288bd4018b Block: deprecate isSolid()
As discussed many years ago in #2551, no one actually knows what this property actually means. It definitely isn't the conventionally expected definition of 'solid' found in the real world, as signs are solid but flower pots are not.
2024-01-09 13:35:10 +00:00
6b66cbfb1c Merge branch 'minor-next' into major-next 2023-12-20 15:26:57 +00:00
c51b1b2812 Create LightableTrait and remove repetitive code (#6111) 2023-12-20 15:21:11 +00:00
944dd7d3e4 BaseBanner: remove unnecessary array_filter() usage 2023-12-15 15:19:44 +00:00
4d337add7c Merge branch 'minor-next' into major-next 2023-12-14 14:03:09 +00:00
ace
d596dc571d Fix pitcher pod wrongly registered as a block (#6162) 2023-11-27 14:46:20 +00:00
519784460f Merge branch 'stable' into minor-next 2023-11-17 12:04:10 +00:00
ace
89fbb3fd0d Fix loading of Item Frame item rotation (#6123) 2023-11-16 10:16:29 +00:00
dd98e4aaed block: clean up unnecessary getter usages
with the assistance of a custom phpstan rule
this inconsistent mess has been bothering me for a long time
2023-11-14 12:47:33 +00:00
9d75c45bf5 Merge branch 'minor-next' into major-next 2023-11-09 18:06:06 +00:00
50592dc269 Merge branch 'stable' into minor-next 2023-11-09 18:05:38 +00:00
ace
c1ed182112 Fix loading of sign text from vanilla world (#6122) 2023-11-09 14:22:37 +00:00
d09af2e30d World: don't assume that random Vector3 are int vectors
we can safely assume this for blocks (though the type info doesn't reflect it) but this is not safe to assume for random APIs that might be used by plugins.
2023-11-06 17:15:17 +00:00
bbe66e8e09 Block: Improve performance of encodeFullState()
if there's no state data to encode, we can avoid useless calls and object allocations.
For the best cases (blocks which don't use state data at all) this improves the performance of getStateId() by more than 10x.
Blocks which use one or the other benefit by a smaller but still significant margin.
2023-11-06 17:04:39 +00:00
457660235e Crops must have access to a light level of at least 9 2023-11-06 16:02:57 +00:00