Fix crash with mek fake player
This commit is contained in:
parent
66feec6cf2
commit
aae03a229f
|
@ -122,6 +122,7 @@ public abstract class PlayerEntityMixin extends LivingEntityMixin implements Pla
|
||||||
@Shadow protected EnderChestInventory enterChestInventory;
|
@Shadow protected EnderChestInventory enterChestInventory;
|
||||||
@Shadow public abstract Either<PlayerEntity.SleepResult, Unit> trySleep(BlockPos at);
|
@Shadow public abstract Either<PlayerEntity.SleepResult, Unit> trySleep(BlockPos at);
|
||||||
@Shadow public int sleepTimer;
|
@Shadow public int sleepTimer;
|
||||||
|
@Shadow public abstract GameProfile getGameProfile();
|
||||||
// @formatter:on
|
// @formatter:on
|
||||||
|
|
||||||
public boolean fauxSleeping;
|
public boolean fauxSleeping;
|
||||||
|
|
|
@ -189,7 +189,7 @@ public abstract class ServerPlayerEntityMixin extends PlayerEntityMixin implemen
|
||||||
|
|
||||||
@Inject(method = "<init>", at = @At("RETURN"))
|
@Inject(method = "<init>", at = @At("RETURN"))
|
||||||
public void arclight$init(CallbackInfo ci) {
|
public void arclight$init(CallbackInfo ci) {
|
||||||
this.displayName = getScoreboardName();
|
this.displayName = this.getGameProfile() != null ? getScoreboardName() : "~FakePlayer~";
|
||||||
this.canPickUpLoot = true;
|
this.canPickUpLoot = true;
|
||||||
this.maxHealthCache = this.getMaxHealth();
|
this.maxHealthCache = this.getMaxHealth();
|
||||||
this.arclight$initialized = true;
|
this.arclight$initialized = true;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user