Commit Graph

59 Commits

Author SHA1 Message Date
6fb364b16f Store ender chest viewer count on the tile, instead of relying on the inventory's viewer count (#4238)
Fixes #4021
2021-06-13 14:37:09 +01:00
b2e806e2fa World: Harden chunk loading against bad data in entity/tile NBT 2021-05-12 12:26:41 +01:00
7b2c6c5ceb Avoid more $this refs on long-life closures 2021-05-06 14:27:56 +01:00
4ca5558ec1 Merge remote-tracking branch 'origin/stable' 2021-05-05 11:14:01 +01:00
b33bf1f433 Unfuck banners ... 2021-04-28 18:44:21 +01:00
d5e5a81cff Don't explode when data contains invalid dye colour IDs 2021-04-28 13:39:03 +01:00
a44203a3d4 Separate BannerPatternLayer from BannerPatternType 2021-04-28 12:47:42 +01:00
d5e1b4bd39 Furnace: Separate light/extinguish code into onStartSmelting() and onStopSmelting() hooks
this is a preparation for other kinds of furnaces which might not be plain old Furnaces.
2021-04-17 01:36:16 +01:00
a9f8afa077 Banner: remove Deque usages
originally I introduced this to make it easier to implement the various APIs addPattern removePattern etc, but those were later removed in favour of simple getPatterns() and setPatterns(), allowing plugin developers to use ext-ds APIs to manipulate patterns.
However, ds poses a number of headaches because of mutability combined with by-ref semantics, which make it a pain to use these on the APIs because we can't guarantee that they won't be modified.
As much as arrays suck, they have two significant advantages over ext-ds: 1) they have copy-on-write semantics, and 2) they support PHP 8.0 without any extra work from me.
2021-01-15 00:17:56 +00:00
9228f006d4 Merge remote-tracking branch 'origin/stable'
# Conflicts:
#	composer.json
#	composer.lock
#	resources/vanilla
#	src/CrashDump.php
#	src/PocketMine.php
#	src/pocketmine/Server.php
#	src/pocketmine/item/Bucket.php
#	src/pocketmine/item/Item.php
#	src/pocketmine/level/format/Chunk.php
#	src/pocketmine/level/format/io/leveldb/LevelDB.php
#	src/pocketmine/level/format/io/region/McRegion.php
#	src/pocketmine/network/mcpe/protocol/BatchPacket.php
#	src/pocketmine/tile/Furnace.php
#	src/pocketmine/utils/UUID.php
#	src/utils/ServerKiller.php
2020-12-20 20:54:13 +00:00
6a1f551aab [ci skip] update TileFactory TODOs (#3912) 2020-11-17 11:04:26 +00:00
b2765f32e9 Implemented Barrels, closes #3672 2020-11-16 17:26:07 +00:00
8e0cba56b8 Merge remote-tracking branch 'origin/stable'
# Conflicts:
#	resources/vanilla
#	src/pocketmine/entity/Entity.php
#	src/pocketmine/tile/Tile.php
#	tests/phpstan/configs/check-explicit-mixed-baseline.neon
#	tests/phpstan/configs/l7-baseline.neon
2020-11-12 22:10:47 +00:00
df7bafe2bc TileFactory: fixed missing Beacon tile registration
I had this locally but forgot to commit it ...
2020-10-07 15:16:27 +01:00
e39d2c4621 Beacon: fixed crash in PC worlds 2020-10-06 13:40:49 +01:00
7f9c4355f0 Revert back to floor/wall banner variants
this code largely duplicates the same code in FloorSign/WallSign and needs to be de-duplicated.
2020-10-04 19:05:43 +01:00
d3a3a41d2b Revert back to separated floor/wall sign
the conditionally useless properties are problematic.
2020-10-04 17:52:23 +01:00
5807a385cc Added stub classes for Beacon
this doesn't do anything yet, it's intended solely to prevent further loss of data.
2020-10-02 00:59:53 +01:00
ff2a3baa8e Implemented Jukebox & Records (#3742)
Co-authored-by: Dylan K. Taylor <odigiman@gmail.com>
2020-08-07 21:07:58 +01:00
62815f6c9b Furnace: get rid of entirely unnecessary ItemFactory usage 2020-07-10 21:38:29 +01:00
279abb871d Remove all usages of CompoundTag->hasTag()
in pretty much every case, these usages really wanted to read the tag's contents anyway, which can be combined with a getTag() and instanceof call for more concise and static analysis friendly code.
In the few cases where the tag contents wasn't needed, it still wanted to check the type, which, again, can be done in a more static analysis friendly way by just using getTag() and instanceof.
2020-07-10 21:01:43 +01:00
68c408268c Separate dye colour ID management from DyeColor enum 2020-07-05 19:04:22 +01:00
670ad9eb9d Position: rename getWorldNonNull() to getWorld(), remove original getWorld() 2020-06-29 21:19:46 +01:00
e61a08a56b Make SignText immutable 2020-06-29 20:18:10 +01:00
7e391a8123 Tile: use phpstan-friendly way to pass block NBT
fixes 1 level 8 error
2020-06-27 13:09:05 +01:00
9484220bd5 ContainerTrait: use a static-analysis-friendly way to read NBT, fixes 4 phpstan level 8 errors 2020-06-27 13:09:05 +01:00
1ef6e5e17b TileFactory now only manages loading tiles from NBT, not direct creation
my objective is to make this use proper constructors like entities, but there's a couple of obstacles to get around first.
2020-06-21 00:47:02 +01:00
017afead3b extract FurnaceRecipeManager unit from CraftingManager
I'd like to have this directly provided to Furnace, but I don't know how to short of making into a singleton. Since I want to have per-furnace recipe managers (e.g. for stuff like blast furnace vs regular furnace etc), a singleton isn't really an option.
2020-06-03 18:59:59 +01:00
337addf1de Eradicate remaining usages of public Position->world field
and as an added bonus, ditch a bunch of extra phpstan errors
2020-05-19 19:14:56 +01:00
8a8b1b0b97 Remove Position->setWorld() 2020-05-19 18:33:16 +01:00
4437756987 Inventory: reduce API duplication by using a Set for viewers 2020-05-14 14:13:28 +01:00
81f982a8d9 remove hardcoded legacy entity type ID mapping, load from resources instead 2020-05-04 13:47:39 +01:00
0eec536f97 Spawnable: remove unused field 2020-05-04 13:10:23 +01:00
a73c54bdd0 making tile spawn compound cache use CacheableNbt instead of strings 2020-05-04 12:35:13 +01:00
a97cafd4f6 moving serializers into protocol namespace 2020-04-27 13:54:39 +01:00
ac5cf2443e convert TileFactory to singleton 2020-04-26 01:11:30 +01:00
6dd31cc3f5 break cycle between block and inventory packages 2020-04-24 23:53:49 +01:00
4fbf4dcdc6 Rename InventoryChangeListener -> InventoryListener 2020-04-24 23:44:38 +01:00
5a94af40e2 Convert ItemFactory to singleton 2020-04-24 00:18:31 +01:00
13d784cd0c Convert BlockFactory to singleton 2020-04-23 23:45:13 +01:00
86e051b7bf Merge commit 'a2543ff80d2906bccda1a4e2fdbd9d8e7d147fb3' 2020-04-18 17:33:05 +01:00
995309424e updated pocketmine/nbt dependency
this is going to need work on exception handling, but right now it's so inconsistent that it doesn't matter anyway.
2020-03-04 17:53:37 +00:00
7c2741e4f5 Inventory: eliminate remaining $send parameters 2020-02-23 21:59:51 +00:00
89c6da13ac phpstan: use more class-string 2020-01-31 22:05:33 +00:00
f65bf76fd8 Merge commit '799183e13e61e89cc6820ad3132a4147454017c6'
# Conflicts:
#	resources/vanilla
#	src/Server.php
#	src/pocketmine/entity/Entity.php
#	src/pocketmine/level/format/io/LevelProviderManager.php
#	src/pocketmine/tile/Tile.php
#	src/world/generator/GeneratorManager.php
2020-01-31 21:26:40 +00:00
1ae7960fc4 Merge commit '92a752053df598e5fe9366601bef070d967374fc'
# Conflicts:
#	resources/vanilla
#	src/pocketmine/tile/Banner.php
#	src/pocketmine/tile/Sign.php
#	src/pocketmine/tile/Tile.php
2020-01-31 19:50:33 +00:00
42014311c5 BrewingStand: added missing void return type 2020-01-27 18:08:08 +00:00
5955ff5393 fix phpdoc spacing screwed up by phpstorm 2020-01-22 15:20:50 +00:00
055b13a6cf strip extra blank lines (php-cs-fixer) 2020-01-22 15:14:10 +00:00
67bcc1c0fb phpdoc armageddon for master, pass 1 2020-01-22 11:55:03 +00:00