Skip to content

Commit

Permalink
🐛 Crash fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Tiviacz1337 committed Aug 6, 2024
1 parent 4aa1d61 commit 55c5055
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@ public InventoryScreenMixin(PlayerScreenHandler screenHandler, PlayerInventory p
@Inject(at = @At(value = "TAIL"), method = "render")
public void render(DrawContext context, int mouseX, int mouseY, float delta, CallbackInfo ci)
{
if(!TravelersBackpackConfig.getConfig().client.showBackpackIconInInventory || TravelersBackpack.enableTrinkets()) return;
if(!TravelersBackpackConfig.getConfig().client.showBackpackIconInInventory) return;

PlayerEntity player = MinecraftClient.getInstance().player;
if(player == null) return;

if(ComponentUtils.isWearingBackpack(player))
{
if(TravelersBackpack.enableTrinkets()) return;

context.drawItem(ComponentUtils.getWearingBackpack(player), this.x + 77, this.y + 61 - 18);
//guiGraphics.renderItem(AttachmentUtils.getWearingBackpack(player), screen.getGuiLeft() + 59, screen.getGuiTop() + 7);
//guiGraphics.renderItem(AttachmentUtils.getWearingBackpack(player), screen.getGuiLeft() - 8 - 9, screen.getGuiTop() + 8 + 18);
Expand Down Expand Up @@ -70,6 +72,8 @@ public void mouseClicked(double mouseX, double mouseY, int button, CallbackInfoR

if(ComponentUtils.isWearingBackpack(player))
{
if(TravelersBackpack.enableTrinkets()) return;

if(mouseX >= this.x + 77 && mouseX < this.x + 77 + 16 && mouseY >= this.y + 61 - 18 && mouseY < this.y + 61 - 18 + 16)
{
if(InputUtil.isKeyPressed(MinecraftClient.getInstance().getWindow().getHandle(), GLFW.GLFW_KEY_LEFT_SHIFT) && button == GLFW.GLFW_MOUSE_BUTTON_1)
Expand Down

0 comments on commit 55c5055

Please sign in to comment.