mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-06 08:17:44 +01:00
#1305: Don't allow Player removal via Entity#remove
By: DerFrZocker <derrieple@gmail.com>
This commit is contained in:
parent
95e4221adf
commit
dd57b4aec5
@ -206,6 +206,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
return getHandle().getGameProfile();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove() {
|
||||
// Will lead to an inconsistent player state if we remove the player as any other entity.
|
||||
throw new UnsupportedOperationException(String.format("Cannot remove player %s, use Player#kickPlayer(String) instead.", getName()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOp() {
|
||||
return server.getHandle().isOp(getProfile());
|
||||
|
Loading…
Reference in New Issue
Block a user