Skip to content

Commit 0835d2a

Browse files
committed
Added Custom GUI for Campfire and Furnace and Moved Slots Accordingly.
1 parent 08dad40 commit 0835d2a

4 files changed

Lines changed: 11 additions & 12 deletions

File tree

src/client/java/com/tcm/MineTale/block/workbenches/screen/CampfireWorkbenchScreen.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.tcm.MineTale.block.workbenches.screen;
22

3+
import com.tcm.MineTale.MineTale;
34
import com.tcm.MineTale.block.workbenches.menu.CampfireWorkbenchMenu;
45

56
import net.minecraft.client.gui.GuiGraphics;
@@ -11,9 +12,7 @@
1112

1213
public class CampfireWorkbenchScreen extends AbstractContainerScreen<CampfireWorkbenchMenu> {
1314
private static final Identifier TEXTURE =
14-
// Identifier.fromNamespaceAndPath(MineTale.MOD_ID, "textures/gui/container/furnace_workbench.png");
15-
Identifier.withDefaultNamespace("textures/gui/container/furnace.png");
16-
15+
Identifier.fromNamespaceAndPath(MineTale.MOD_ID, "textures/gui/container/furnace_workbench.png");
1716
/**
1817
* Creates a campfire workbench screen for the provided menu, player inventory, and title.
1918
*

src/client/java/com/tcm/MineTale/block/workbenches/screen/FurnaceWorkbenchScreen.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.tcm.MineTale.block.workbenches.screen;
22

3+
import com.tcm.MineTale.MineTale;
34
import com.tcm.MineTale.block.workbenches.menu.FurnaceWorkbenchMenu;
45

56
import net.minecraft.client.gui.GuiGraphics;
@@ -11,8 +12,7 @@
1112

1213
public class FurnaceWorkbenchScreen extends AbstractContainerScreen<FurnaceWorkbenchMenu> {
1314
private static final Identifier TEXTURE =
14-
// Identifier.fromNamespaceAndPath(MineTale.MOD_ID, "textures/gui/container/furnace_workbench.png");
15-
Identifier.withDefaultNamespace("textures/gui/container/furnace.png");
15+
Identifier.fromNamespaceAndPath(MineTale.MOD_ID, "textures/gui/container/furnace_workbench.png");
1616

1717
/**
1818
* Creates a new furnace workbench screen for the given menu, player inventory, and title.

src/main/java/com/tcm/MineTale/block/workbenches/menu/AbstractWorkbenchContainerMenu.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public AbstractWorkbenchContainerMenu(@Nullable MenuType<?> menuType, int syncId
4343
container.startOpen(playerInventory.player);
4444

4545
// 1. Fuel Slot (Center-ish bottom)
46-
this.addSlot(new Slot(container, Constants.FUEL_SLOT, 80, 53) {
46+
this.addSlot(new Slot(container, Constants.FUEL_SLOT, 44, 53) {
4747
/**
4848
* Determines whether the given item stack is allowed in the fuel slot.
4949
*
@@ -57,14 +57,14 @@ public boolean mayPlace(ItemStack stack) {
5757
});
5858

5959
// 2. Two Input Slots (Stacked on the left)
60-
this.addSlot(new Slot(container, Constants.INPUT_1, 44, 17));
61-
this.addSlot(new Slot(container, Constants.INPUT_2, 44, 35));
60+
this.addSlot(new Slot(container, Constants.INPUT_1, 35, 17)); //LEFT
61+
this.addSlot(new Slot(container, Constants.INPUT_2, 53, 17)); //RIGHT
6262

6363
// 3. Four Output Slots (2x2 Grid on the right)
64-
this.addSlot(new FurnaceResultSlot(playerInventory.player, container, Constants.OUTPUT_START, 116, 21));
65-
this.addSlot(new FurnaceResultSlot(playerInventory.player, container, Constants.OUTPUT_START + 1, 134, 21));
66-
this.addSlot(new FurnaceResultSlot(playerInventory.player, container, Constants.OUTPUT_END - 1, 116, 39));
67-
this.addSlot(new FurnaceResultSlot(playerInventory.player, container, Constants.OUTPUT_END, 134, 39));
64+
this.addSlot(new FurnaceResultSlot(playerInventory.player, container, Constants.OUTPUT_START, 107, 26)); //TOP LEFT
65+
this.addSlot(new FurnaceResultSlot(playerInventory.player, container, Constants.OUTPUT_START + 1, 125, 26)); //TOP RIGHT
66+
this.addSlot(new FurnaceResultSlot(playerInventory.player, container, Constants.OUTPUT_END - 1, 107, 44)); //BOTTOM LEFT
67+
this.addSlot(new FurnaceResultSlot(playerInventory.player, container, Constants.OUTPUT_END, 125, 44)); //BOTTOM RIGHT
6868

6969
// --- PLAYER INVENTORY ---
7070
addPlayerInventory(playerInventory);
2.95 KB
Loading

0 commit comments

Comments
 (0)