Skip to content

Commit

Permalink
Hide 3x3 when previewing in Crafting table
Browse files Browse the repository at this point in the history
  • Loading branch information
UselessBullets committed Nov 13, 2023
1 parent 63d3194 commit 870b0ef
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public LegacyContainerCrafting(InventoryPlayer inventoryplayer, World world, int
this.craftingSize = craftingSize;
this.inventoryPlayer = inventoryplayer;
}
public void craftingSlots() {
public void craftingSlots(boolean showCraftingPreview) {
this.addSlot(new SlotCrafting(this.inventoryPlayer.player, this.craftMatrix, this.craftResult, 0, 107, 127));
int baseIterator;
int subIterator;
Expand All @@ -82,7 +82,9 @@ public void craftingSlots() {
// 3x3 Crafting
for (baseIterator = 0; baseIterator < 3; ++baseIterator) {
for (subIterator = 0; subIterator < 3; ++subIterator) {
this.addSlot(new Slot(this.craftMatrix, subIterator + baseIterator * 3, 20 + subIterator * 18, 109 + baseIterator * 18));
int x = showCraftingPreview ? -5000 : 20 + subIterator * 18;
int y = showCraftingPreview ? -5000 : 109 + baseIterator * 18;
this.addSlot(new Slot(this.craftMatrix, subIterator + baseIterator * 3, x, y));
}
}
}
Expand Down Expand Up @@ -114,7 +116,7 @@ public void setRecipes(EntityPlayer player, StatFileWriter statWriter, boolean s
}
LegacyUI.LOGGER.debug("Category: " + category + " | slotId: " + currentSlotId + " | currentScroll: " + currentScrollAmount + " | craftPreview: " + showCraftingPreview);
this.inventorySlots.clear();
craftingSlots();
craftingSlots(showCraftingPreview);

RecipeGroup[] craftingGroups = category.getRecipeGroups(isInInventory);
boolean discovered;
Expand Down

0 comments on commit 870b0ef

Please # to comment.