11204 Commits

Author SHA1 Message Date
Dylan K. Taylor
b40720749b ZippedResourcePack: improved exception error on invalid manifest contents 2020-11-28 18:29:13 +00:00
Dylan K. Taylor
c7961bfe90 Toss ServerOperator; PermissibleBase now tracks its own op status
as well as being simpler, this also allows some nice features, such as granting memory-only op state that goes away when the player quits the server.
2020-11-28 18:22:59 +00:00
Dylan K. Taylor
4439781124 Merge branch 'stable'
# Conflicts:
#	resources/vanilla
#	src/event/player/PlayerCreationEvent.php
2020-11-28 16:16:15 +00:00
Dylan K. Taylor
ef034f2d68 PermissionAttachment: better document the apparently nonsensical code responsible for making sure the entire permission system doesn't burn down 2020-11-28 16:05:16 +00:00
Dylan K. Taylor
8cf589eedd Strip some junk out of IPlayer
these methods have better pathways through Server directly.
Also, setBanned() does not allow customising the reason for banning or the duration, nor does isBanned() account for IP bans because the code is so old ... better to force dependence on a central code path to avoid these inconsistencies.
I want to do the same thing for OP, but that's a separate problem due to its effects on the permission system.
2020-11-28 15:36:46 +00:00
Dylan K. Taylor
70b0d83258 Removed Server->broadcast()
this method has an explicit dependency on permission subscriptions, which I plan to eradicate.
The method's functionality can be replaced using Server->broadcastMessage() with a custom recipients array.
2020-11-28 13:01:10 +00:00
Dylan K. Taylor
ecbc4e9433 Permission->getChildren() no longer returns by-ref 2020-11-27 20:31:59 +00:00
Dylan K. Taylor
aa67c4894f Permission: added removeChild()
this probably isn't useful at all, but it's best to provide alternatives for all the stuff that getChildren() could have been used for ...
2020-11-27 20:31:24 +00:00
Dylan K. Taylor
3849756993 Do not mutate the result of Permission->getChildren() 2020-11-27 20:28:36 +00:00
Dylan K. Taylor
f0e43a6b22 DefaultPermissions: remove ridiculous recursion
this line is totally useless since the recursion does exactly the same thing as if it wasn't there.
2020-11-27 19:59:49 +00:00
Dylan K. Taylor
1de486733a Permission: remove dead code
Bukkit CCC at its finest... what the fuck this was doing anyway I have no idea
an addChild() method would have made far more sense, especially considering that addParent() doesn't actually mutate the child.
2020-11-27 19:56:39 +00:00
Dylan K. Taylor
ab18332572 PermissionManager: fixed nonsensical PHPDoc type 2020-11-27 19:54:05 +00:00
Dylan K. Taylor
9969c928a8 Player: Improved hardcore death handling
it's now possible to cancel the banning by cancelling PlayerKickEvent.
In addition, the disconnect message will now properly explain why the player is banned instead of just saying 'You have been banned',
and also banned-players.txt will show 'Died in hardcore mode' as the reason instead of being completely blank (seriously, we couldn't tell the difference between real bans and hardcore bans????)
2020-11-27 18:37:42 +00:00
Dylan K. Taylor
5e44d5f75e Do not load playerdata from disk just to op/deop/whitelist/dewhitelist
this is an impressively dumb idea.
the playerdata is not used here in any capacity so it doesn't make sense to load it, especially considering that it takes a significant amount of time.
2020-11-27 18:12:45 +00:00
Dylan K. Taylor
5142281cfa [ci skip] Server: remove misleading comment 2020-11-27 17:57:52 +00:00
Dylan K. Taylor
0a7d81a2b0 FastChunkSerializer: retain emptyBlock on subchunks
I think we should probably get rid of this considering the potential for inconsistencies within a chunk, but not retaining this is a bug nonetheless, even though it doesn't have any effect in PM itself since we always use BlockLegacyIds << 4 as the empty block ID.

so, this is only really aiding (ab)use cases which weren't intended anyway ...
2020-11-27 13:41:35 +00:00
Dylan K. Taylor
4e94025b3b SubChunk: rename defaultBlock -> emptyBlockId
this better describes the purpose, which is to identify air.
though, it might make more sense to make air just always have zero as air's runtime ID, since this parameter is apparently making plugin devs think that this is suitable to fill a chunk with a specific block ...
2020-11-27 13:33:25 +00:00
Dylan K. Taylor
4d42f0c3db Timings: added timers for player data I/O 2020-11-27 00:02:34 +00:00
Dylan K. Taylor
0be60fe1eb NetworkSession: Force use of async compression during the login sequence when latency doesn't matter
closes #3907
this reduces the impact of compression on the login sequence by about 90%; however, since compression only accounted for about 30% of said overhead at most, it's not really a massive difference.
2020-11-26 23:39:19 +00:00
Dylan K. Taylor
4ea5401d72 World->getHighestBlockAt() now throws an exception instead of returning -1 in ungenerated terrain 2020-11-26 19:44:22 +00:00
Dylan K. Taylor
fd99445c5b World->getSafeSpawn() now throws if the target is in ungenerated terrain, instead of silently returning the default
this WILL cause crashes in some cases on slower machines (#2724), but it's
better than randomly spawning at the top of the map.
2020-11-26 19:36:37 +00:00
Dylan K. Taylor
4102205ba6 Enhance type information in PlayerCreationEvent 2020-11-24 16:28:36 +00:00
Dylan K. Taylor
af1fe7c293 Merge branch 'stable' 2020-11-21 21:13:48 +00:00
Dylan K. Taylor
bc208e11f4 phpstan 0.12.57 2020-11-21 18:07:14 +00:00
Dylan K. Taylor
9e85ee4a7a Fixed missing field on Persona skin encode 2020-11-21 18:01:56 +00:00
Dylan K. Taylor
23849b7f63 3.16.1 is next 2020-11-21 01:25:06 +00:00
Dylan K. Taylor
d2f68836c6 Release 3.16.0 2020-11-21 01:25:06 +00:00
Dylan K. Taylor
d19db5d2e4 fix phpstan warnings 2020-11-21 01:16:04 +00:00
Dylan K. Taylor
98cdc80d37 Protocol changes for 1.16.100 2020-11-21 01:07:25 +00:00
Dylan K. Taylor
f2bdbb0c35 TypeConverter: fix using singleton to get its own context
I guess this must have been refactored from some other class?...
2020-11-20 21:31:06 +00:00
Dylan K. Taylor
8273f789ee Backport SingletonTrait to PM3 2020-11-20 21:00:47 +00:00
Dylan K. Taylor
870d237260 BlockFactory::get() second parameter is now mandatory 2020-11-18 00:50:01 +00:00
Dylan K. Taylor
28335e3c45 Player: fixed self-defeating condition in item consuming
this was giving players infinite food and potions.
2020-11-17 20:33:20 +00:00
ipad54
6a1f551aab
[ci skip] update TileFactory TODOs (#3912) 2020-11-17 11:04:26 +00:00
Dylan K. Taylor
62b9d97060 Break circular dependency in Player->disconnect() usages
none of these usages require onPlayerDestroyed() to be fired since they are all being called during disconnects anyway.
2020-11-16 23:05:56 +00:00
Dylan K. Taylor
09b22c1e79 NetworkSession: drop @var doc comment referring to nonexisting variable 2020-11-16 22:51:03 +00:00
Dylan K. Taylor
c3c647d51e NetworkSession: remove useless disconnect() call
this can't execute here because of the disconnectGuard, so this call always does nothing.
2020-11-16 22:13:48 +00:00
Dylan K. Taylor
37299ab804 ChunkCache: explicitly check for requesting of unloaded chunk
NetworkSession will never do this, but other things might.
2020-11-16 19:45:46 +00:00
Dylan K. Taylor
1d27225553 Relocate cache-related classes to mcpe\cache namespace 2020-11-16 19:39:30 +00:00
Dylan K. Taylor
869c9dabf1 SetCommandsEnabledPacket: added ::create() 2020-11-16 19:11:10 +00:00
Dylan K. Taylor
ca6a892834 [ci skip] NetworkSession: added some extra TODOs 2020-11-16 19:10:27 +00:00
Dylan K. Taylor
16b71a265f Barrel: added missing function import 2020-11-16 19:09:59 +00:00
Dylan K. Taylor
a9faed7171 [ci skip] update BlockFactory TODOs 2020-11-16 18:23:01 +00:00
Dylan K. Taylor
563336cdc9 CoralType: remove unused magicNumber stuff 2020-11-16 18:12:38 +00:00
Dylan K. Taylor
1eee24f1fa Implemented coral blocks
there are some complications with coral plants due to the fact we're stuck with R12 worlds right now - and also coral fans are a major pain to implement due to how messed up the metadata is.
2020-11-16 18:05:39 +00:00
Dylan K. Taylor
55a9ce46b9 VanillaBlocks: added BARREL 2020-11-16 17:56:13 +00:00
Dylan K. Taylor
d7c6a20b34 Barrel: added @return $this to setOpen() 2020-11-16 17:29:24 +00:00
Aericio
b2765f32e9 Implemented Barrels, closes #3672 2020-11-16 17:26:07 +00:00
Dylan K. Taylor
1cf3a500f8 Clean up ChestInventory handling
longer term I want to rip this crap out completely, but right now this provides minor maintainability benefits, while also making it slightly less nasty to deal with other containers which animate their blocks, such as barrels and shulker boxes.
2020-11-16 16:59:19 +00:00
Dylan K. Taylor
4ade7b6225 added CoralType enum 2020-11-14 16:24:13 +00:00