Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change GUI slot placeholder method & add more GUI slot placeholders #48

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import io.github.cottonmc.cotton.gui.widget.WGridPanel;
import io.github.cottonmc.cotton.gui.widget.WItemSlot;
import io.github.cottonmc.cotton.gui.widget.WSprite;
import io.github.cottonmc.cotton.gui.widget.icon.ItemIcon;
import io.github.cottonmc.cotton.gui.widget.icon.TextureIcon;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.SimpleInventory;
Expand Down Expand Up @@ -39,41 +41,17 @@ public boolean isValid(final int slot, final ItemStack stack) {
AoAHandlers.addInventory(panel, this);
AoAHandlers.addBigOutput(panel, WItemSlot.outputOf(this.blockInventory, 3));

// Paper Icon
panel.add(
new WSprite(new Identifier("minecraft", "textures/item/paper.png")),
(2 * AoAHandlers.BASIS) + 7 + 1,
(2 * AoAHandlers.BASIS) + 4 + 1,
16,
16
);

// Paper Slot
panel.add(WItemSlot.of(this.blockInventory, 0), (2 * AoAHandlers.BASIS) + 7, (2 * AoAHandlers.BASIS) + 4);

// Ink Icon
panel.add(
new WSprite(new Identifier("minecraft", "textures/item/ink_sac.png")),
(4 * AoAHandlers.BASIS) + 7 + 1,
AoAHandlers.BASIS + 1,
16,
16
);

// Ink Slot
panel.add(WItemSlot.of(this.blockInventory, 1), (4 * AoAHandlers.BASIS) + 7, AoAHandlers.BASIS);
WItemSlot paperSlot = WItemSlot.of(this.blockInventory, 0);
paperSlot.setIcon(new ItemIcon(Items.PAPER));
panel.add(paperSlot, (2 * AoAHandlers.BASIS) + 7, (2 * AoAHandlers.BASIS) + 4);

// Target Icon
panel.add(
new WSprite(new Identifier(ArtOfAlchemy.MOD_ID, "textures/gui/target.png")),
(4 * AoAHandlers.BASIS) + 7 + 1,
(3 * AoAHandlers.BASIS) + 8 + 1,
AoAHandlers.BASIS,
AoAHandlers.BASIS
);
WItemSlot inkSlot = WItemSlot.of(this.blockInventory, 1);
inkSlot.setIcon(new ItemIcon(Items.INK_SAC));
panel.add(inkSlot, (4 * AoAHandlers.BASIS) + 7, AoAHandlers.BASIS);

// Target Slot
panel.add(WItemSlot.of(this.blockInventory, 2), (4 * AoAHandlers.BASIS) + 7, (3 * AoAHandlers.BASIS) + 8);
WItemSlot targetSlot = WItemSlot.of(this.blockInventory, 2);
targetSlot.setIcon(new TextureIcon(new Identifier(ArtOfAlchemy.MOD_ID, "textures/gui/target.png")));
panel.add(targetSlot, (4 * AoAHandlers.BASIS) + 7, (3 * AoAHandlers.BASIS) + 8);

// Progress Bar
panel.add(
Expand Down