Fake player fix (#80)

This commit is contained in:
IzzelAliz 2020-11-26 19:45:40 +08:00
parent 7d71a47c49
commit 96457372d7
2 changed files with 4 additions and 2 deletions

View File

@ -6,7 +6,7 @@ A Bukkit server implementation utilizing Mixin.
| Minecraft | Forge | Status | Build | | Minecraft | Forge | Status | Build |
| :----: | :----: | :---: | :---: | | :----: | :----: | :---: | :---: |
| 1.16.x | 35.1.0 | ACTIVE | [![1.16 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-16?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-16) | | 1.16.x | 35.1.4 | ACTIVE | [![1.16 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-16?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-16) |
| 1.15.x | 31.2.45 | ACTIVE | [![1.15 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-15?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-15) | | 1.15.x | 31.2.45 | ACTIVE | [![1.15 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-15?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-15) |
| 1.14.x | 28.2.0 | [LEGACY](https://github.com/IzzelAliz/Arclight/releases/tag/1.0.6) | [![1.14 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight) | | 1.14.x | 28.2.0 | [LEGACY](https://github.com/IzzelAliz/Arclight/releases/tag/1.0.6) | [![1.14 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight) |

View File

@ -1,5 +1,6 @@
package io.izzel.arclight.common.mod.server.entity; package io.izzel.arclight.common.mod.server.entity;
import com.mojang.authlib.GameProfile;
import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.entity.player.ServerPlayerEntity;
import org.bukkit.craftbukkit.v.CraftServer; import org.bukkit.craftbukkit.v.CraftServer;
import org.bukkit.craftbukkit.v.entity.CraftPlayer; import org.bukkit.craftbukkit.v.entity.CraftPlayer;
@ -12,7 +13,8 @@ public class ArclightFakePlayer extends CraftPlayer {
@Override @Override
public boolean isOp() { public boolean isOp() {
return this.getHandle().getGameProfile().getId() != null && super.isOp(); GameProfile profile = this.getHandle().getGameProfile();
return profile != null && profile.getId() != null && super.isOp();
} }
@Override @Override