Dylan K. Taylor
42e14f749e
Do not blanket-ban all inventory transactions in spectator mode, fixes #2627
...
instead, we cancel the appropriate events before they are called, so that plugins can uncancel them if they choose.
2020-05-31 16:32:06 +01:00
Dylan K. Taylor
f5a49b6d55
LightUpdate: improve quality of property type info
2020-05-17 09:33:18 +01:00
Kevin
ad2a39bf13
Merge #3489 : fix spawn protection check for placement checking the wrong block, close #3488 , close #3489
2020-05-14 00:30:11 +01:00
Dylan K. Taylor
2f47597d75
BaseLevelProvider: stop crashing the server on invalid level.dat
...
broken userdata isn't a core bug, so it shouldn't be flooding our crash archives.
2020-05-11 15:34:53 +01:00
Dylan K. Taylor
d9b0e373bb
Populator: fix return type of populate()
2020-04-26 00:04:17 +01:00
Dylan K. Taylor
34a3e0d8b1
Level: fix sneaking use-item logic (thanks @95CivicSi)
...
inspired by, but closes #3403
fixes #3401
fixes #2539
fixes #1904
2020-04-19 15:38:12 +01:00
Dylan K. Taylor
ec949840b2
Do not crash on failure to decompress region chunks
...
this could happen when a chunk was partially overwritten with one of the same sector size.
2020-04-01 21:30:25 +01:00
Dylan K. Taylor
167492087f
Chunk: specify expected bounds for Y coordinates
2020-03-10 12:33:53 +00:00
Dylan K. Taylor
8ac7f7f11f
Level: fix type of randomTickBlocks and friends
2020-02-17 15:13:40 +00:00
Dylan K. Taylor
2bb497b716
Chunk: flag hasChanged when changing generated/populated/light-populated flags
2020-02-11 08:26:12 +00:00
Dylan K. Taylor
613bd40601
PopulationTask: move setPopulated() call to make it more obvious what is going on
2020-02-10 18:22:19 +00:00
Dylan K. Taylor
398b636759
PopulationTask: fixed chunks being generated empty in flat worlds
...
the flat generator just clones a pregenerated chunk instead of modifying the provided chunks, which means that the references that population task has would be the outdated ones.
2020-02-10 18:21:08 +00:00
Dylan K. Taylor
da3742b39e
Remove useless typecasts
2020-02-06 16:00:57 +00:00
Dylan K. Taylor
812424a619
GroundCover: drop useless variable in calculating startY
2020-02-06 14:26:03 +00:00
Dylan K. Taylor
1bdc61dd5f
Ore: do not destroy outer scope vars in for loops
2020-02-06 14:24:57 +00:00
Dylan K. Taylor
86fc33fe26
Level: add phpstan generics to getNearestEntity()
2020-02-06 14:20:19 +00:00
Dylan K. Taylor
1a5228e7a6
Fixed property types with missing null PhpDoc types
2020-02-05 20:55:03 +00:00
Dylan K. Taylor
495bfda044
Drop a bunch of invalid null defaults
...
phpstan doesn't report these out of the box, for reasons I'm not clear on. It's also not clear if having null defaults has any effect on nullability behaviour, so they are best removed. In addition, these would be problematic on 7.4.
2020-02-05 20:53:54 +00:00
Dylan K. Taylor
e1ddf90695
Chunk: remove useless instanceof checks
...
these are always CompoundTags, and if they aren't we have a bug somewhere else.
2020-02-05 20:44:27 +00:00
Dylan K. Taylor
25554f0d61
Level: remove useless code from unload()
2020-02-05 20:39:38 +00:00
Dylan K. Taylor
262728b091
PopulationTask: clean up overcomplicated garbage
2020-02-05 18:31:51 +00:00
Dylan K. Taylor
fa82cb26d8
added native types to closures (phpstan-strict-rules)
2020-02-05 16:35:10 +00:00
Dylan K. Taylor
e5a2cfb65f
avoid type juggling in conditions, always use explicit boolean conditions
2020-02-05 15:44:06 +00:00
Dylan K. Taylor
59cf8e95f0
Tree: fixed populator not growing trees any lower than y=2
...
this would only be a problem for custom generators, but nonetheless...
2020-02-05 13:17:09 +00:00
Dylan K. Taylor
99038c752c
Avoid usage of for-loop vars outside of for-loop context
...
these problems were reported by PHPStan strict rules. They aren't actually bugs, but they could become bugs in the future.
2020-02-05 13:16:09 +00:00
Dylan K. Taylor
3f7e7352fb
added SplFixedArray generics for phpstan 0.12.9
2020-02-05 11:57:37 +00:00
Dylan K. Taylor
0a566f8218
LevelProvider::generate() accepts class-string<Generator>, not any
...
string
2020-02-01 20:16:05 +00:00
Dylan K. Taylor
799183e13e
make use of phpstan class-string in some areas
2020-01-30 22:23:11 +00:00
Dylan K. Taylor
260ac47588
add some phpstan array types
2020-01-30 22:23:11 +00:00
Dylan K. Taylor
a5764b3ae9
populate missing array value types in level namespace
2020-01-30 21:01:59 +00:00
Dylan K. Taylor
64b3d02974
Chunk: remove useless condition from populateSkyLight()
...
this was detected by latest bleeding-edge PHPStan.
2020-01-29 16:42:42 +00:00
Dylan K. Taylor
f6611a38bc
Explosion: fix trailing whitespace in explodeA() phpdoc
2020-01-22 14:51:49 +00:00
Dylan K. Taylor
f624871b3f
strip extra blank lines (php-cs-fixer)
2020-01-22 14:50:29 +00:00
Dylan K. Taylor
9f44adf04a
pass 2, manual removal of incorrect non-nullable @param for nullable native types
2020-01-21 15:44:34 +00:00
Dylan K. Taylor
c4793241f5
Mass removal of useless @param/@return PHPDoc annotations, pass 1
2020-01-21 15:10:18 +00:00
Dylan K. Taylor
db734675d8
level: populate missing interface return types
2020-01-19 19:38:09 +00:00
Dylan K. Taylor
6ede56015d
level/biome: populate missing return type information
2020-01-19 19:37:08 +00:00
Dylan K. Taylor
5334099fbf
level/format: populate missing return type information
2020-01-19 19:36:34 +00:00
Dylan K. Taylor
82e9072223
level/format/io: populate missing return type information
2020-01-19 19:35:45 +00:00
Dylan K. Taylor
cd36af46bf
Level: populate missing type information
2020-01-19 18:44:41 +00:00
Dylan K. Taylor
aa7d55e21d
level/generator: populate missing return type information
2020-01-19 18:07:54 +00:00
Dylan K. Taylor
31e8efa6d1
level/light: populate missing return type information
2020-01-19 18:06:31 +00:00
Dylan K. Taylor
260869c0d5
Position: populate missing return type information for fromObject()
2020-01-18 17:44:14 +00:00
Dylan K. Taylor
d1e56c4611
Location: add missing return types for getYaw() and getPitch()
2020-01-14 15:34:40 +00:00
Dylan K. Taylor
5816ff85ba
don't depend on phpstan 0.12.4 phpdoc inheriting
...
this causes build failure because the parameter names are different to
the base class.
2020-01-11 22:08:16 +00:00
Dylan K. Taylor
17720041a3
phpdoc: populate missing parameter typeinfo
2020-01-11 21:53:24 +00:00
Dylan K. Taylor
c329ff7d4f
SubChunk: remove nonsensical reference from internal function
2020-01-11 21:49:33 +00:00
Dylan K. Taylor
8794292788
remove &$var reference notations in phpdoc
...
this isn't required by the spec and PHPStan chokes on it. I was previously having it ignore these errors, but it turns out that PHPStan is not making use of extended typeinfo provided if it can't parse the tag, which is problematic on level 6 and also a problem for array-of-type. Therefore, we are going to have to take the hit.
2020-01-11 21:20:55 +00:00
Dylan K. Taylor
3fff0a0656
BigTree: evict unmaintained dead code
...
phpstan whines about all this stuff, and everything left is private, so we can get rid of it. Sadly we can't ditch the class without breaking BC, so that sticks with 4.0.
2020-01-09 14:26:46 +00:00
Dylan K. Taylor
1eedac87b2
added missing @var property types (reported by phpstan)
2020-01-09 14:13:54 +00:00