mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +00:00
Fix op players automatically switching to creative/survival when set to spectator/adventure
Disable GUI gamemode switching, treat it as a cheat.
This commit is contained in:
parent
b1ce19856f
commit
43a36dba40
@ -2895,15 +2895,12 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
$this->dataPacket($pk);
|
||||
break;
|
||||
case ProtocolInfo::SET_PLAYER_GAME_TYPE_PACKET:
|
||||
if($packet->gamemode !== $this->gamemode){
|
||||
if(!$this->hasPermission("pocketmine.command.gamemode")){
|
||||
if($packet->gamemode !== ($this->gamemode & 0x01)){
|
||||
//GUI gamemode change, set it back to original for now (only possible through client bug or hack with current allowed client permissions)
|
||||
$pk = new SetPlayerGameTypePacket();
|
||||
$pk->gamemode = $this->gamemode & 0x01;
|
||||
$this->dataPacket($pk);
|
||||
$this->sendSettings();
|
||||
break;
|
||||
}
|
||||
$this->setGamemode($packet->gamemode, true);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
Loading…
x
Reference in New Issue
Block a user