Fix horse inventory not init synchronizer (#657) (#682)

and clear some space :p
This commit is contained in:
Yanang Pearce 2022-08-06 18:42:48 +08:00 committed by IzzelAliz
parent 51c94fc91c
commit ad5b8ce4e1

View File

@ -128,7 +128,7 @@ public abstract class ServerPlayerMixin extends PlayerMixin implements ServerPla
// @formatter:off
@Shadow @Final public MinecraftServer server;
@Shadow protected abstract int getCoprime(int p_205735_1_);
@Shadow protected abstract int getCoprime(int p_205735_1_);
@Shadow @Final public ServerPlayerGameMode gameMode;
@Shadow public ServerGamePacketListenerImpl connection;
@Shadow public abstract boolean isSpectator();
@ -162,6 +162,7 @@ public abstract class ServerPlayerMixin extends PlayerMixin implements ServerPla
@Shadow(remap = false) private Component tabListDisplayName;
@Shadow public abstract void resetFallDistance();
@Shadow public abstract void shadow$nextContainerCounter();
@Shadow public abstract void initMenu(AbstractContainerMenu p_143400_);
// @formatter:on
public String displayName;
@ -717,6 +718,7 @@ public abstract class ServerPlayerMixin extends PlayerMixin implements ServerPla
}
this.connection.send(new ClientboundHorseScreenOpenPacket(this.containerCounter, iinventory.getContainerSize(), entityhorseabstract.getId()));
this.containerMenu = container;
this.initMenu(this.containerMenu);
net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.player.PlayerContainerEvent.Open((ServerPlayer) (Object) this, this.containerMenu));
}