Fix rendering bot player in gui
This commit is contained in:
@@ -42,4 +42,12 @@ public final class BotGuiInventory extends GuiInventory {
|
||||
mc.displayHeight = primary.displayHeight;
|
||||
super.setWorldAndResolution(mc, width, height);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
|
||||
final BotPlayer player = (BotPlayer) this.user.getPlayerContext().player();
|
||||
player.isUser = false;
|
||||
super.drawGuiContainerBackgroundLayer(partialTicks, mouseX, mouseY);
|
||||
player.isUser = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,11 +57,13 @@ public final class BotPlayer extends EntityPlayerSP {
|
||||
|
||||
private final IBaritoneUser user;
|
||||
private NetworkPlayerInfo playerInfo;
|
||||
public boolean isUser;
|
||||
|
||||
public BotPlayer(IBaritoneUser user, Minecraft mc, World world, NetHandlerPlayClient netHandlerPlayClient, StatisticsManager statisticsManager, RecipeBook recipeBook) {
|
||||
super(mc, world, netHandlerPlayClient, statisticsManager, recipeBook);
|
||||
this.user = user;
|
||||
this.movementInput = new PlayerMovementInput(this.user.getBaritone().getInputOverrideHandler());
|
||||
this.isUser = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -70,6 +72,12 @@ public final class BotPlayer extends EntityPlayerSP {
|
||||
super.onUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUser() {
|
||||
// Used by BotGuiInventory to fix player model rendering in the gui
|
||||
return this.isUser;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendStatusMessage(@Nonnull ITextComponent chatComponent, boolean actionBar) {
|
||||
// TODO: Custom message handling
|
||||
|
||||
Reference in New Issue
Block a user