Skip to content

Commit

Permalink
fix: add additional storage controller gui cache refresh case
Browse files Browse the repository at this point in the history
  • Loading branch information
klikli-dev committed Jan 25, 2024
1 parent d01f460 commit 3dd390b
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public abstract class StorageControllerGuiBase<T extends StorageControllerContai
"textures/gui/storage_controller_droparea.png");
protected static final ResourceLocation BUTTONS = new ResourceLocation(Occultism.MODID, "textures/gui/buttons.png");
protected static final String TRANSLATION_KEY_BASE = "gui." + Occultism.MODID + ".storage_controller";
public int lastStacksCount;
public List<ItemStack> stacks;
public List<MachineReference> linkedMachines;
public IStorageControllerContainer storageControllerContainer;
Expand Down Expand Up @@ -546,7 +547,10 @@ protected void drawItems(GuiGraphics guiGraphics, float partialTicks, int mouseX
var changedStacksToDisplay = this.lastCachedStacksToDisplayCount != stacksToDisplay.size();
this.lastCachedStacksToDisplayCount = stacksToDisplay.size();

if(changedPage || changedStacksToDisplay){
var changedStacks = this.lastStacksCount != this.stacks.size();
this.lastStacksCount = this.stacks.size();

if(changedPage || changedStacksToDisplay || changedStacks){
this.sortItemStacks(stacksToDisplay);
this.buildPage(stacksToDisplay);
this.buildItemSlots(stacksToDisplay);
Expand Down

0 comments on commit 3dd390b

Please sign in to comment.