Skip to content

Commit

Permalink
VERY annoying GUI bug thingy. aaaaaaaaaaaaaaaaaaaaaa
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfieboy09 committed Nov 7, 2024
1 parent 42521a2 commit ba363f6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ public void tick() {

// If progress reaches 100%, complete the crafting
if (this.progress >= 100) {
// Consume energy and input items
// this.energyStorage.removeEnergy(this.recipe.energyCost()); // Extract energy here upon successful crafting
// Consume input items
consumeInputItems();

// Place result in output slot
Expand Down Expand Up @@ -213,14 +212,14 @@ public ItemStackHandler getInventoryHandler() {
public SimpleContainer getInputContainer() {
SimpleContainer container = new SimpleContainer(7);
for (int i = 0; i < 7; i++) {
container.setItem(i, inventory.getStackInSlot(i));
container.setItem(i, this.inventory.getStackInSlot(i));
}
return container;
}

public SimpleContainer getOutputContainer() {
SimpleContainer container = new SimpleContainer(1);
container.setItem(0, inventory.getStackInSlot(inventory.getSlots() - 1));
container.setItem(0, this.inventory.getStackInSlot(this.inventory.getSlots() - 1));
return container;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,12 @@ public class DiskAssemblerMenu extends AbstractEnergyContainerMenu {
private static final int VANILLA_SLOT_COUNT = HOTBAR_SLOT_COUNT + PLAYER_INVENTORY_SLOT_COUNT;
private static final int VANILLA_FIRST_SLOT_INDEX = 0;
private static final int TE_INVENTORY_FIRST_SLOT_INDEX = VANILLA_FIRST_SLOT_INDEX + VANILLA_SLOT_COUNT;
private static final int TE_INVENTORY_ROW_COUNT = 2;
private static final int TE_INVENTORY_COLUMN_COUNT = 3;

public DiskAssemblerMenu(int id, BlockPos pos, Inventory playerInventory, Player playerIn) {
this(id, pos, playerInventory, playerIn, new SimpleContainerData(4));
}

public DiskAssemblerMenu(int id, BlockPos pos, Inventory playerInventory, Player player, ContainerData containerData) {
public DiskAssemblerMenu(int id, BlockPos pos, Inventory playerInventory, @NotNull Player player, ContainerData containerData) {
super(QSMenuTypes.DISK_ASSEMBLER.get(), id);
addDataSlots(containerData);
this.level = player.level();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ protected void renderLabels(@NotNull GuiGraphics graphics, int mouseX, int mouse
int progress = this.menu.getCurrentProgress();
int recipeTotalProgress = this.menu.getTotalProgress();

graphics.blit(BACKGROUND_LOCATION, 52, 25, 176, 0, progress * 30 / 100, 35);
graphics.blit(BACKGROUND_LOCATION, 52, 25, 176, 0, (progress * 30) / 100, 35);

graphics.blit(BACKGROUND_LOCATION, 95, 25, 176, 36, progress * 21 / 100, 32);
graphics.blit(BACKGROUND_LOCATION, 95, 25, 176, 36, (progress * 21) / 100, 32);
}

@Override
Expand Down

0 comments on commit ba363f6

Please sign in to comment.