diff --git a/common/src/main/java/dev/dubhe/anvilcraft/client/gui/screen/inventory/RoyalAnvilScreen.java b/common/src/main/java/dev/dubhe/anvilcraft/client/gui/screen/inventory/RoyalAnvilScreen.java index 38c7e8ad0..3234a5711 100644 --- a/common/src/main/java/dev/dubhe/anvilcraft/client/gui/screen/inventory/RoyalAnvilScreen.java +++ b/common/src/main/java/dev/dubhe/anvilcraft/client/gui/screen/inventory/RoyalAnvilScreen.java @@ -34,7 +34,12 @@ public class RoyalAnvilScreen extends ItemCombinerScreen { public RoyalAnvilScreen(RoyalAnvilMenu menu, Inventory playerInventory, Component title) { super(menu, playerInventory, title, ANVIL_LOCATION); this.player = playerInventory.player; - this.titleLabelX = 60; + } + + @Override + protected void init() { + super.init(); + this.titleLabelX = (this.imageWidth - this.font.width(this.title)) / 2; } @Override diff --git a/common/src/main/java/dev/dubhe/anvilcraft/client/gui/screen/inventory/RoyalGrindstoneScreen.java b/common/src/main/java/dev/dubhe/anvilcraft/client/gui/screen/inventory/RoyalGrindstoneScreen.java index 3ddef3559..c002d67eb 100644 --- a/common/src/main/java/dev/dubhe/anvilcraft/client/gui/screen/inventory/RoyalGrindstoneScreen.java +++ b/common/src/main/java/dev/dubhe/anvilcraft/client/gui/screen/inventory/RoyalGrindstoneScreen.java @@ -19,6 +19,12 @@ public RoyalGrindstoneScreen( super(menu, playerInventory, Component.translatable("screen.anvilcraft.royal_grindstone.title")); } + @Override + protected void init() { + super.init(); + this.titleLabelX = (this.imageWidth - this.font.width(this.title)) / 2; + } + @Override public void render(@NotNull GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick) { this.renderBackground(guiGraphics); @@ -36,18 +42,18 @@ protected void renderBg(@NotNull GuiGraphics guiGraphics, float partialTick, int protected void renderLabels(GuiGraphics guiGraphics) { if (this.menu.getSlot(2).hasItem()) { - drawLabel((int) (92 + 4.5 - (this.font.width(Component.literal(this.menu.usedGold.toString())) / 2)), 37, - Component.literal(this.menu.usedGold.toString()), guiGraphics); + drawLabel((int) (92 + 4.5 - (this.font.width(Component.literal("" + this.menu.usedGold)) / 2)), 38, + Component.literal("" + this.menu.usedGold), guiGraphics); drawLabel(112, 19, Component.literal( Component.translatable("screen.anvilcraft.royal_grindstone.remove_curse_number") - .getString().replace("%i", this.menu.removeCurseNumber.toString())), guiGraphics); + .getString().replace("%i", "" + this.menu.removeCurseNumber)), guiGraphics); drawLabel(112, 58, Component.literal( Component.translatable("screen.anvilcraft.royal_grindstone.remove_repair_cost") - .getString().replace("%i", this.menu.removeRepairCostNumber.toString())), guiGraphics); + .getString().replace("%i", "" + this.menu.removeRepairCostNumber)), guiGraphics); } } - private void drawLabel(int x, int y, Component component, GuiGraphics guiGraphics) { + private void drawLabel(int x, int y, Component component, @NotNull GuiGraphics guiGraphics) { int i = (this.width - this.imageWidth - 2) / 2; int j = (this.height - this.imageHeight + 23) / 2; x = x + i; diff --git a/common/src/main/java/dev/dubhe/anvilcraft/client/gui/screen/inventory/RoyalSmithingScreen.java b/common/src/main/java/dev/dubhe/anvilcraft/client/gui/screen/inventory/RoyalSmithingScreen.java index 202b1a01e..a77d112c6 100644 --- a/common/src/main/java/dev/dubhe/anvilcraft/client/gui/screen/inventory/RoyalSmithingScreen.java +++ b/common/src/main/java/dev/dubhe/anvilcraft/client/gui/screen/inventory/RoyalSmithingScreen.java @@ -54,8 +54,12 @@ public class RoyalSmithingScreen extends ItemCombinerScreen { */ public RoyalSmithingScreen(RoyalSmithingMenu menu, Inventory playerInventory, Component title) { super(menu, playerInventory, title, SMITHING_LOCATION); - this.titleLabelX = 44; - this.titleLabelY = 15; + } + + @Override + protected void init() { + super.init(); + this.titleLabelX = (this.imageWidth - this.font.width(this.title)) / 2; } @Override diff --git a/common/src/main/java/dev/dubhe/anvilcraft/inventory/RoyalGrindstoneMenu.java b/common/src/main/java/dev/dubhe/anvilcraft/inventory/RoyalGrindstoneMenu.java index 93426b0e7..64d5081eb 100644 --- a/common/src/main/java/dev/dubhe/anvilcraft/inventory/RoyalGrindstoneMenu.java +++ b/common/src/main/java/dev/dubhe/anvilcraft/inventory/RoyalGrindstoneMenu.java @@ -31,9 +31,9 @@ public class RoyalGrindstoneMenu extends AbstractContainerMenu { private final Container resultMaterialSlots; private final ContainerLevelAccess access; - public Integer usedGold = 0; - public Integer removeRepairCostNumber = 0; - public Integer removeCurseNumber = 0; + public int usedGold = 0; + public int removeRepairCostNumber = 0; + public int removeCurseNumber = 0; public RoyalGrindstoneMenu(MenuType type, int containerId, Inventory playerInventory) { this(type, containerId, playerInventory, ContainerLevelAccess.NULL); @@ -94,7 +94,7 @@ public void onTake(@NotNull Player player, @NotNull ItemStack stack) { usedGold + resultMaterialSlots.getItem(2).getCount())); } }); - this.addSlot(new Slot(this.resultMaterialSlots, 2, 89, 48) { + this.addSlot(new Slot(this.resultMaterialSlots, 2, 89, 47) { public boolean mayPlace(@NotNull ItemStack stack) { return false; } diff --git a/common/src/main/resources/assets/anvilcraft/textures/gui/container/auto_crafter.png b/common/src/main/resources/assets/anvilcraft/textures/gui/container/auto_crafter.png index cd86a3852..e4d7d31b4 100644 Binary files a/common/src/main/resources/assets/anvilcraft/textures/gui/container/auto_crafter.png and b/common/src/main/resources/assets/anvilcraft/textures/gui/container/auto_crafter.png differ diff --git a/common/src/main/resources/assets/anvilcraft/textures/gui/container/chute.png b/common/src/main/resources/assets/anvilcraft/textures/gui/container/chute.png index 04874336a..05b4032a1 100644 Binary files a/common/src/main/resources/assets/anvilcraft/textures/gui/container/chute.png and b/common/src/main/resources/assets/anvilcraft/textures/gui/container/chute.png differ diff --git a/common/src/main/resources/assets/anvilcraft/textures/gui/container/royal_anvil.png b/common/src/main/resources/assets/anvilcraft/textures/gui/container/royal_anvil.png index 52a6aebc8..59062ba8e 100644 Binary files a/common/src/main/resources/assets/anvilcraft/textures/gui/container/royal_anvil.png and b/common/src/main/resources/assets/anvilcraft/textures/gui/container/royal_anvil.png differ diff --git a/common/src/main/resources/assets/anvilcraft/textures/gui/container/royal_grindstone.png b/common/src/main/resources/assets/anvilcraft/textures/gui/container/royal_grindstone.png index bc305bc3a..a9021529b 100644 Binary files a/common/src/main/resources/assets/anvilcraft/textures/gui/container/royal_grindstone.png and b/common/src/main/resources/assets/anvilcraft/textures/gui/container/royal_grindstone.png differ diff --git a/common/src/main/resources/assets/anvilcraft/textures/gui/container/royal_smithing_table.png b/common/src/main/resources/assets/anvilcraft/textures/gui/container/royal_smithing_table.png index c1471b65b..d534e2a77 100644 Binary files a/common/src/main/resources/assets/anvilcraft/textures/gui/container/royal_smithing_table.png and b/common/src/main/resources/assets/anvilcraft/textures/gui/container/royal_smithing_table.png differ diff --git a/common/src/main/resources/assets/anvilcraft/textures/gui/container/slider.png b/common/src/main/resources/assets/anvilcraft/textures/gui/container/slider.png new file mode 100644 index 000000000..777c181e3 Binary files /dev/null and b/common/src/main/resources/assets/anvilcraft/textures/gui/container/slider.png differ diff --git a/common/src/main/resources/assets/anvilcraft/textures/gui/container/slider_button_add.png b/common/src/main/resources/assets/anvilcraft/textures/gui/container/slider_button_add.png new file mode 100644 index 000000000..0ac649e09 Binary files /dev/null and b/common/src/main/resources/assets/anvilcraft/textures/gui/container/slider_button_add.png differ diff --git a/common/src/main/resources/assets/anvilcraft/textures/gui/container/slider_button_max.png b/common/src/main/resources/assets/anvilcraft/textures/gui/container/slider_button_max.png new file mode 100644 index 000000000..fb361d45a Binary files /dev/null and b/common/src/main/resources/assets/anvilcraft/textures/gui/container/slider_button_max.png differ diff --git a/common/src/main/resources/assets/anvilcraft/textures/gui/container/slider_button_min.png b/common/src/main/resources/assets/anvilcraft/textures/gui/container/slider_button_min.png new file mode 100644 index 000000000..e17b5f5c0 Binary files /dev/null and b/common/src/main/resources/assets/anvilcraft/textures/gui/container/slider_button_min.png differ diff --git a/common/src/main/resources/assets/anvilcraft/textures/gui/container/slider_button_minus.png b/common/src/main/resources/assets/anvilcraft/textures/gui/container/slider_button_minus.png new file mode 100644 index 000000000..39d081245 Binary files /dev/null and b/common/src/main/resources/assets/anvilcraft/textures/gui/container/slider_button_minus.png differ diff --git a/common/src/main/resources/assets/anvilcraft/textures/gui/container/slider_slider.png b/common/src/main/resources/assets/anvilcraft/textures/gui/container/slider_slider.png new file mode 100644 index 000000000..169013248 Binary files /dev/null and b/common/src/main/resources/assets/anvilcraft/textures/gui/container/slider_slider.png differ