Skip to content

Commit

Permalink
feat: Increase waystone screen size so it can fit the same slot layou…
Browse files Browse the repository at this point in the history
…t as warp plates
  • Loading branch information
BlayTheNinth committed Dec 21, 2023
1 parent a92f48d commit 4a67ad9
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ public void serverTick() {

if (attunementTicks >= getMaxAttunementTicks()) {
attunementTicks = 0;
craft(recipe);
//craft(recipe);
}
} else {
attunementTicks = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public class WaystoneScreen extends AbstractContainerScreen<WaystoneMenu> {

public WaystoneScreen(WaystoneMenu container, Inventory playerInventory, Component title) {
super(container, playerInventory, title);
imageHeight = 196;
inventoryLabelY = 93;
imageHeight = 222;
inventoryLabelY = imageHeight - 94;
}

@Override
Expand Down Expand Up @@ -116,28 +116,10 @@ protected void renderBg(GuiGraphics guiGraphics, float partialTicks, int mouseX,
guiGraphics.setColor(1f, 1f, 1f, 1f);
guiGraphics.blit(WAYSTONE_GUI_TEXTURES, leftPos, topPos, 0, 0, imageWidth, imageHeight);

guiGraphics.blit(WAYSTONE_GUI_TEXTURES,
leftPos + 107 - (int) (10 * menu.getAttunementProgress()),
topPos + 54,
176,
0,
(int) (10 * menu.getAttunementProgress()),
4);
guiGraphics.blit(WAYSTONE_GUI_TEXTURES, leftPos + 69, topPos + 54, 176, 0, (int) (10 * menu.getAttunementProgress()), 4);
guiGraphics.blit(WAYSTONE_GUI_TEXTURES,
leftPos + 72,
topPos + 68 - (int) (10 * menu.getAttunementProgress()),
176,
4,
4,
(int) (10 * menu.getAttunementProgress()));
guiGraphics.blit(WAYSTONE_GUI_TEXTURES,
leftPos + 100,
topPos + 68 - (int) (10 * menu.getAttunementProgress()),
176,
4,
4,
(int) (10 * menu.getAttunementProgress()));
guiGraphics.blit(WAYSTONE_GUI_TEXTURES, leftPos + 86, topPos + 65, 176, 4, 4, (int) (10 * menu.getAttunementProgress()));
guiGraphics.blit(WAYSTONE_GUI_TEXTURES, leftPos + 107 - (int) (10 * menu.getAttunementProgress()), topPos + 82, 176, 0, (int) (10 * menu.getAttunementProgress()), 4);
guiGraphics.blit(WAYSTONE_GUI_TEXTURES, leftPos + 86, topPos + 103 - (int) (10 * menu.getAttunementProgress()), 176, 4, 4, (int) (10 * menu.getAttunementProgress()));
guiGraphics.blit(WAYSTONE_GUI_TEXTURES, leftPos + 69, topPos + 82, 176, 0, (int) (10 * menu.getAttunementProgress()), 4);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
package net.blay09.mods.waystones.menu;

import net.blay09.mods.waystones.block.entity.WarpPlateBlockEntity;
import net.blay09.mods.waystones.tag.ModItemTags;
import net.blay09.mods.waystones.block.entity.WaystoneBlockEntityBase;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.inventory.Slot;
import net.minecraft.world.item.ItemStack;

public class WarpPlateAttunementSlot extends Slot {
private final WarpPlateBlockEntity warpPlate;
private final WaystoneBlockEntityBase blockEntity;

public WarpPlateAttunementSlot(WarpPlateBlockEntity container, int slot, int x, int y) {
super(container, slot, x, y);
warpPlate = container;
public WarpPlateAttunementSlot(WaystoneBlockEntityBase blockEntity, int slot, int x, int y) {
super(blockEntity, slot, x, y);
this.blockEntity = blockEntity;
}

@Override
public boolean mayPickup(Player player) {
return warpPlate.isCompletedFirstAttunement() && super.mayPickup(player);
return blockEntity.isCompletedFirstAttunement() && super.mayPickup(player);
}

@Override
Expand All @@ -26,4 +25,5 @@ public int getMaxStackSize(ItemStack stack) {
}
return stack.getMaxStackSize();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,20 @@ public WaystoneMenu(int windowId, IWaystone waystone, WaystoneBlockEntityBase bl

checkContainerDataCount(containerData, 1);

addSlot(new Slot(blockEntity, 0, 80, 48));
addSlot(new Slot(blockEntity, 1, 52, 48));
addSlot(new Slot(blockEntity, 2, 66, 69));
addSlot(new Slot(blockEntity, 3, 94, 69));
addSlot(new Slot(blockEntity, 4, 108, 48));
addSlot(new WarpPlateAttunementSlot(blockEntity, 0, 80, 76));
addSlot(new WarpPlateAttunementSlot(blockEntity, 1, 80, 48));
addSlot(new WarpPlateAttunementSlot(blockEntity, 2, 108, 76));
addSlot(new WarpPlateAttunementSlot(blockEntity, 3, 80, 104));
addSlot(new WarpPlateAttunementSlot(blockEntity, 4, 52, 76));

for (int i = 0; i < 3; ++i) {
for (int j = 0; j < 9; ++j) {
addSlot(new Slot(playerInventory, j + i * 9 + 9, 8 + j * 18, 104 + i * 18));
addSlot(new Slot(playerInventory, j + i * 9 + 9, 8 + j * 18, 140 + i * 18));
}
}

for (int j = 0; j < 9; ++j) {
addSlot(new Slot(playerInventory, j, 8 + j * 18, 162));
addSlot(new Slot(playerInventory, j, 8 + j * 18, 198));
}

addDataSlots(containerData);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4a67ad9

Please sign in to comment.