Commit Graph

11705 Commits

Author SHA1 Message Date
Dylan K. Taylor
7c1f0ecb8b Fixed getAxis()/setAxis() not being seen by static analysers for some blocks
when using VanillaBlocks::CHISELED_QUARTZ(), VanillaBlocks::PURPUR_PILLAR() or VanillaBlocks::QUARTZ_PILLAR(), static analysis was unable to detect getAxis() and setAxis(), because these blocks were implemented using anonymous classes.
2021-02-06 20:39:23 +00:00
Dylan K. Taylor
9887138ac1 Get rid of anonymous classes for infested stone 2021-02-06 20:30:25 +00:00
Dylan K. Taylor
21bafd9f07 PluginBase: add void return typehints to onLoad(), onEnable() and onDisable() 2021-02-06 20:20:36 +00:00
Dylan K. Taylor
82bb83211f CocoaBlock: deduplicate attachment condition checking 2021-02-06 19:34:52 +00:00
Dylan K. Taylor
9ab3c57789 RedstoneRepeater: added getDelay() and setDelay() 2021-02-06 19:03:33 +00:00
Dylan K. Taylor
233616aa6a RedstoneLamp now uses PoweredByRedstoneTrait 2021-02-06 19:02:13 +00:00
Dylan K. Taylor
5be03c3196 Make more use of PoweredByRedstoneTrait 2021-02-06 18:43:33 +00:00
Dylan K. Taylor
48ef8771cd Added AnalogRedstoneSignalEmitterTrait 2021-02-06 18:33:14 +00:00
Dylan K. Taylor
02b0036cbe DaylightSensor: refactor power -> signalStrength 2021-02-06 17:47:29 +00:00
Dylan K. Taylor
4fc3bc53f7 Clean up hierarchy of rails
detector rail has fundamentally different functionality than activator and powered rails, so it's misleading to present the same APIs for both.
detector rail's 'powered' state is better referred to as 'activated', since it means the detector rail is actually _producing_ power, and not _receiving_ power.
2021-02-05 22:00:17 +00:00
Dylan K. Taylor
78a62a8b27 Remember and verify player XUIDs (controlled by player.verify-xuid in pocketmine.yml) 2021-02-05 14:42:57 +00:00
Dylan K. Taylor
6ccfe21d57 Block: improved accuracy of isFullCube() 2021-02-04 23:10:13 +00:00
Dylan K. Taylor
169650dc5b MainLogger: accept timezone as a constructor parameter
this makes it easier to unit-test, as well as making it independent of Timezone.
2021-02-04 21:50:06 +00:00
Dylan K. Taylor
54d9342ed9 AsyncPool: Always collect workers, even if the task queue is empty
because of the way async tasks are processed, we might collect results from a task before it's able to be collected by collect(). Therefore, the queue might be empty, even though there are still tasks to be collected.
2021-02-04 21:43:53 +00:00
Dylan K. Taylor
27b1951df7 MainLogger: accept main thread name as a constructor parameter 2021-02-04 20:55:50 +00:00
Dylan K. Taylor
709b4154d7 MainLogger: Require useFormattingCodes as a constructor parameter
this avoids needing to call Terminal::init() before starting a MainLogger. Since it inits the formatting codes anyway when log messages are first recorded, it shouldn't be necessary to pre-initialize it.
2021-02-04 19:16:22 +00:00
Dylan K. Taylor
6d64fb9af8 MainLogger: remove obsolete logFile field 2021-02-04 16:51:02 +00:00
Dylan K. Taylor
7684dc03fa Merge remote-tracking branch 'origin/stable' 2021-02-04 16:45:34 +00:00
Dylan K. Taylor
7e3e63f342 Fixed race condition in MainLogger shutdown
this resulted in a deadlock in https://github.com/pmmp/PocketMine-MP/runs/1831812620?check_suite_focus=true because the notify() arrived while writeLogStream() was executing.
This ensures that either:
- the notification will occur before the sleep, and therefore no sleeping will occur (this->shutdown = true before the wait)
- the notification will arrive during the sleep.
2021-02-04 16:40:10 +00:00
Dylan K. Taylor
ae75d73f48 Extract MainLoggerThread unit from MainLogger
MainLogger is no longer a Thread, as per the recent changes to pocketmine/log-pthreads.
2021-02-04 16:28:49 +00:00
Dylan K. Taylor
4b9639f6c9 Merge branch 'stable' 2021-02-04 15:55:39 +00:00
Dylan K. Taylor
8ef1e54e20 MainLogger: fixing CPU waste on logger thread
this doesn't need to keep spinning every 25ms; it can just wake up when there's actually log messages to write into the buffer.
2021-02-04 15:07:40 +00:00
Dylan K. Taylor
eaf3a86981 MainLogger: fixed UB in writeLogStream()
notify() has to be used inside a synchronized block.
2021-02-04 15:03:14 +00:00
Dylan K. Taylor
317a48d9b0 ItemStackRequest: expose filterStrings 2021-02-03 23:40:34 +00:00
Dylan K. Taylor
bc14660e55 Added missing ItemStackRequest protocol changes 2021-02-03 23:37:41 +00:00
Dylan K. Taylor
561fc62232 Merge remote-tracking branch 'origin/stable'
# Conflicts:
#	.github/workflows/main.yml
#	resources/vanilla
#	src/pocketmine/VersionInfo.php
#	src/world/format/io/region/RegionLoader.php
2021-02-03 17:32:47 +00:00
Dylan K. Taylor
079e794339 Armor: fixed item disappearing when switching two of the same armour pieces
Player->useHeldItem() assumes that if the old item == the new item, we want to set the item back into the inventory if it's modified in-place. Therefore, we don't modify the item in-place to bypass the problem.

closes #4022
2021-02-03 17:05:16 +00:00
Dylan K. Taylor
4771e3dc28 3.17.5 is next 2021-02-02 14:04:51 +00:00
Dylan K. Taylor
2e9117d102 Release 3.17.4 2021-02-02 14:04:50 +00:00
Dylan K. Taylor
06493da7d9 Imports cleanup 2021-02-02 13:58:07 +00:00
Dylan K. Taylor
3e1ac66abf Merge branch 'stable' 2021-02-02 13:46:29 +00:00
Dylan K. Taylor
bd303b1062 RegionLoader: fixed flaky region header validation since 3.17.3 2021-02-02 13:43:52 +00:00
Dylan K. Taylor
1a24afc6d1 InventoryTransaction: Fixed indexes persisting from balance calculation in crafting input/outputs
fixes #4019
the order of the actual items may not be the same across runs, but index 0 will at least be sure to exist.
2021-02-02 00:13:58 +00:00
yuko fuyutsuki
37e8dd6444 Fix PHP 8 optional before required parameters deprecation warnings (#4016) 2021-01-31 12:08:47 +00:00
Dylan K. Taylor
02a4f0a170 Mark metadata as nullable in resource pack manifest data
if the metadata isn't provided, it won't be initialized during decoding.
2021-01-27 22:05:43 +00:00
Dylan K. Taylor
5a1131d72d Populator: require dependencies explicitly, don't make bad assumptions about fields
this also leaks ChunkManagers on the worker threads because the generator context is long-lived.
2021-01-27 21:08:46 +00:00
Dylan K. Taylor
bbae02264d Merge branch 'stable' 2021-01-27 20:04:13 +00:00
Dylan K. Taylor
16fa958416 phpstan: better hack for any-callable parameters
variadics are a bad fit for this because what we really need is to accept callable with any number of arguments. LSP requires that the provided number of arguments must be >= than the required number of arguments.
2021-01-27 19:25:28 +00:00
Dylan K. Taylor
bac57c159f Player: fix bridging, towering and various other fast building bugs
clickPos is relative to the base block position, so if you keep aiming at the same spot on the block and jump, it thinks you're still spamming.
closes #2730
2021-01-27 00:11:14 +00:00
Dylan K. Taylor
38b2d83799 MemoryManager: fixed protected properties being dumped multiple times
we don't need to scan the parent classes for anything other than private properties, because protected and public properties will appear on the main reflection as if they were declared directly as such.
2021-01-26 20:32:23 +00:00
Dylan K. Taylor
5384e2ba9d Revert "MemoryDump: fixed duplicated properties, reduce useless noise"
This reverts commit efd67a132e.
2021-01-26 20:26:35 +00:00
Dylan K. Taylor
269a389a97 BlockTransaction: added phpstan return type info for getBlocks() 2021-01-25 18:04:42 +00:00
Dylan K. Taylor
62deafda48 CommandReader: removed readline support
readline has been borked for a long time and it's not thread safe.
2021-01-25 17:53:25 +00:00
Dylan K. Taylor
31b6df4376 3.17.4 is next 2021-01-25 17:15:43 +00:00
Dylan K. Taylor
b296ae1b87 Release 3.17.3 2021-01-25 17:15:31 +00:00
Dylan K. Taylor
34c1d455a7 phpstan: enable checkMissingCallableSignature 2021-01-24 20:27:53 +00:00
Dylan K. Taylor
2064b411f2 fix build 2021-01-20 22:53:51 +00:00
Dylan K. Taylor
69a829db91 Merge remote-tracking branch 'origin/stable' 2021-01-20 22:16:44 +00:00
SalmonDE
3fb4b30742 InventoryPickupItemEvent: rename item to itemEntity (#4007) 2021-01-20 21:09:59 +00:00
Dylan K. Taylor
e8ffab1787 RegionLoader: avoid hitting the disk twice during chunk reads
this provides some performance improvement (although it's difficult to measure because of cache).
this does mean that we read some garbage data during chunk reads, but it's less costly than hitting the disk twice.
2021-01-20 21:05:44 +00:00