Skip to content

Commit

Permalink
Garden plot fixes (#1126)
Browse files Browse the repository at this point in the history
  • Loading branch information
viciscat authored Jan 9, 2025
1 parent c18bfb0 commit 55f911e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ protected void renderWidget(DrawContext context, int mouseX, int mouseY, float d
if (hovered) {
context.fill(slotX + 1, slotY + 1, slotX + 17, slotY + 17, 0xAA_FF_FF_FF);
matrices.push();
matrices.translate(slotX, slotY, 100.f);
matrices.translate(slotX, slotY, 50.f);
matrices.scale(1.125f, 1.125f, 1.125f);
context.drawItem(item, 0, 0);
matrices.pop();
Expand All @@ -221,7 +221,10 @@ protected void renderWidget(DrawContext context, int mouseX, int mouseY, float d

boolean infested = infectedPlots.contains(i);
if (infested && (timeMillis & 512) != 0) {
matrices.push();
matrices.translate(0, 0, 200.f);
context.drawBorder(slotX + 1, slotY + 1, 16, 16, 0xFF_FF0000);
matrices.pop();
}

// tooltip
Expand Down Expand Up @@ -281,7 +284,7 @@ public void onClick(double mouseX, double mouseY) {
if (SkyblockerConfigManager.get().farming.garden.closeScreenOnPlotClick && MinecraftClient.getInstance().currentScreen != null)
MinecraftClient.getInstance().currentScreen.close();

if (hoveredSlot == 12) MessageScheduler.INSTANCE.sendMessageAfterCooldown("/warp garden", true);
if (hoveredSlot == 12) MessageScheduler.INSTANCE.sendMessageAfterCooldown("/plottp barn", true);
else MessageScheduler.INSTANCE.sendMessageAfterCooldown("/plottp " + gardenPlots[hoveredSlot].name, true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public boolean mouseClicked(double mouseX, double mouseY, int button) {
@Override
public boolean keyPressed(int keyCode, int scanCode, int modifiers) {
var client = MinecraftClient.getInstance();
if (client.isWindowFocused()) {
if (client.isWindowFocused() && currentTab != null) {
var mouse = client.mouse;
var window = client.getWindow();
var mouseX = (mouse.getX() * ((double) window.getScaledWidth() / (double) window.getWidth()));
Expand Down

0 comments on commit 55f911e

Please sign in to comment.