aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorRime <81419447+Emirlol@users.noreply.github.com>2024-11-26 06:49:31 +0300
committerGitHub <noreply@github.com>2024-11-25 22:49:31 -0500
commitb64ad459921d1710ac9eb8022ccc3cad36745523 (patch)
tree39bcb55fb24675644d5946e939b6a0112a0d49c8 /src/main/java
parentb3916c4631af94bb81514c2c9cfb086f46c5f7ba (diff)
downloadSkyblocker-b64ad459921d1710ac9eb8022ccc3cad36745523.tar.gz
Skyblocker-b64ad459921d1710ac9eb8022ccc3cad36745523.tar.bz2
Skyblocker-b64ad459921d1710ac9eb8022ccc3cad36745523.zip
Tweak texture positions for quick craft (#1031)
* Tweak texture positions * Move the quicknav overlay into the crafting table container * Fix position and texture stuff after rebase * Wtf formatting
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/de/hysky/skyblocker/skyblock/item/SkyblockCraftingTableScreen.java18
-rw-r--r--src/main/java/de/hysky/skyblocker/skyblock/item/SkyblockCraftingTableScreenHandler.java2
2 files changed, 10 insertions, 10 deletions
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/SkyblockCraftingTableScreen.java b/src/main/java/de/hysky/skyblocker/skyblock/item/SkyblockCraftingTableScreen.java
index b8e42fcc..780d851e 100644
--- a/src/main/java/de/hysky/skyblocker/skyblock/item/SkyblockCraftingTableScreen.java
+++ b/src/main/java/de/hysky/skyblocker/skyblock/item/SkyblockCraftingTableScreen.java
@@ -1,7 +1,5 @@
package de.hysky.skyblocker.skyblock.item;
-import java.time.Duration;
-
import de.hysky.skyblocker.SkyblockerMod;
import de.hysky.skyblocker.skyblock.itemlist.recipebook.SkyblockRecipeBookWidget;
import net.minecraft.client.gui.DrawContext;
@@ -19,6 +17,8 @@ import net.minecraft.screen.slot.SlotActionType;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
+import java.time.Duration;
+
public class SkyblockCraftingTableScreen extends HandledScreen<SkyblockCraftingTableScreenHandler> {
private static final Identifier TEXTURE = Identifier.ofVanilla("textures/gui/container/crafting_table.png");
protected static final ButtonTextures MORE_CRAFTS_TEXTURES = new ButtonTextures(
@@ -27,14 +27,13 @@ public class SkyblockCraftingTableScreen extends HandledScreen<SkyblockCraftingT
Identifier.of(SkyblockerMod.NAMESPACE, "quick_craft/more_button_highlighted")
);
- protected static final Identifier QUICK_CRAFT = Identifier.of(SkyblockerMod.NAMESPACE, "quick_craft/quick_craft_overlay");
+ protected static final Identifier QUICK_CRAFT = Identifier.of(SkyblockerMod.NAMESPACE, "textures/gui/sprites/quick_craft/quick_craft_overlay.png");
private final SkyblockRecipeBookWidget recipeBook = new SkyblockRecipeBookWidget(handler);
private boolean narrow;
private TexturedButtonWidget moreCraftsButton;
public SkyblockCraftingTableScreen(SkyblockCraftingTableScreenHandler handler, PlayerInventory inventory, Text title) {
super(handler, inventory, title);
- this.backgroundWidth += 22;
}
@Override
@@ -42,15 +41,15 @@ public class SkyblockCraftingTableScreen extends HandledScreen<SkyblockCraftingT
super.init();
this.narrow = this.width < 379;
this.recipeBook.initialize(this.width, this.height, this.client, this.narrow);
- this.x = this.recipeBook.findLeftEdge(this.width, this.backgroundWidth) + 11;
+ this.x = this.recipeBook.findLeftEdge(this.width, this.backgroundWidth);
this.addDrawableChild(new TexturedButtonWidget(this.x + 5, this.height / 2 - 49, 20, 18, RecipeBookWidget.BUTTON_TEXTURES, button -> {
this.recipeBook.toggleOpen();
- this.x = this.recipeBook.findLeftEdge(this.width, this.backgroundWidth) + 11;
+ this.x = this.recipeBook.findLeftEdge(this.width, this.backgroundWidth);
button.setPosition(this.x + 5, this.height / 2 - 49);
- if (moreCraftsButton != null) moreCraftsButton.setPosition(this.x + 174, this.y + 62);
+ if (moreCraftsButton != null) moreCraftsButton.setPosition(this.x + 152, this.y + 63);
}));
if (!handler.mirrorverse) {
- moreCraftsButton = new TexturedButtonWidget(this.x + 174, y + 62, 16, 16, MORE_CRAFTS_TEXTURES,
+ moreCraftsButton = new TexturedButtonWidget(this.x + 152, y + 63, 16, 16, MORE_CRAFTS_TEXTURES,
button -> this.onMouseClick(handler.slots.get(26), handler.slots.get(26).id, 0, SlotActionType.PICKUP));
moreCraftsButton.setTooltipDelay(Duration.ofMillis(250L));
moreCraftsButton.setTooltip(Tooltip.of(Text.literal("More Crafts")));
@@ -97,7 +96,8 @@ public class SkyblockCraftingTableScreen extends HandledScreen<SkyblockCraftingT
int i = this.x;
int j = (this.height - this.backgroundHeight) / 2;
context.drawTexture(RenderLayer::getGuiTextured, TEXTURE, i, j, 0, 0, this.backgroundWidth, this.backgroundHeight, 256, 256);
- if (!handler.mirrorverse) context.drawGuiTexture(RenderLayer::getGuiTextured, QUICK_CRAFT, i + 173, j, 25, 84);
+ //4 px of margin to allow some space for custom resource packs that have size differences on the crafting table/inventory textures
+ if (!handler.mirrorverse) context.drawTexture(RenderLayer::getGuiTextured, QUICK_CRAFT, i + 143, j - 3, 0, 0, 37, 90, 37, 90);
}
@Override
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/SkyblockCraftingTableScreenHandler.java b/src/main/java/de/hysky/skyblocker/skyblock/item/SkyblockCraftingTableScreenHandler.java
index c3704d8c..159fe634 100644
--- a/src/main/java/de/hysky/skyblocker/skyblock/item/SkyblockCraftingTableScreenHandler.java
+++ b/src/main/java/de/hysky/skyblocker/skyblock/item/SkyblockCraftingTableScreenHandler.java
@@ -66,7 +66,7 @@ public class SkyblockCraftingTableScreenHandler extends GenericContainerScreenHa
if (slot == 23) return new int[]{124, 35};
if (slot == 16 || slot == 25 || slot == 34) {
int y = (slot / 9 - 1) * 18 + 8;
- return new int[]{174, y};
+ return new int[]{152, y};
}
int gridX = slot % 9 - 1;
int gridY = slot / 9 - 1;