Fix rendering bot player in gui

This commit is contained in:
Brady
2023-06-27 23:37:47 -05:00
parent 5878c255e2
commit d24cd263bf
2 changed files with 16 additions and 0 deletions

View File

@@ -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;
}
}

View File

@@ -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