Skip to content

Commit

Permalink
Merge pull request #234 from P3pp3rF1y/1.20.x-dev
Browse files Browse the repository at this point in the history
Release merge
  • Loading branch information
P3pp3rF1y authored Apr 27, 2024
2 parents 1a8c03b + b09b492 commit 1866ab5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ org.gradle.daemon=false

mod_id=sophisticatedcore
mod_group_id=sophisticatedcore
mod_version=0.6.18
mod_version=0.6.21
sonar_project_key=sophisticatedcore:SophisticatedCore
github_package_url=https://maven.pkg.github.com/P3pp3rF1y/SophisticatedCore

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public abstract class StorageContainerMenuBase<S extends IStorageWrapper> extend

private boolean slotsChangedSinceStartOfClick = false;
private boolean tryingToMergeUpgrade = false;
private boolean initialBroadcast = true;

protected StorageContainerMenuBase(MenuType<?> pMenuType, int pContainerId, Player player, S storageWrapper, IStorageWrapper parentStorageWrapper, int storageItemSlotIndex, boolean shouldLockStorageItemSlot) {
super(pMenuType, pContainerId);
Expand Down Expand Up @@ -385,9 +386,9 @@ public void clicked(int slotId, int dragType, ClickType clickType, Player player
int k2 = dragType == 0 ? Math.min(slotStack.getCount(), slotStack.getMaxStackSize()) : Math.min(slotStack.getMaxStackSize() + 1, slotStack.getCount() + 1) / 2;
IUpgradeItem<?> upgradeItem = (IUpgradeItem<?>) slotStack.getItem();
int columnsTaken = upgradeItem.getInventoryColumnsTaken();
slot.wasEmpty = false; // slot was not empty when this was reached and need to force onTake below to trigger slot position recalculation if slots are refreshed when columns taken changes
if (clickType == ClickType.QUICK_MOVE) {
quickMoveStack(player, slotId);
slot.wasEmpty = false; // slot was not empty when this was reached and need to force onTake below to trigger slot position recalculation if slots are refreshed when columns taken changes
} else {
setCarried(upgradeItem.getCleanedUpgradeStack(slot.remove(k2)));
}
Expand Down Expand Up @@ -797,7 +798,7 @@ protected void triggerSlotListeners(int stackIndex, ItemStack slotStack, Supplie
}
}

if (isUpgradeSettingsSlot(slot.index)) {
if (!initialBroadcast && isUpgradeSettingsSlot(slot.index)) {
slot.setChanged(); //updating slots in upgrade tabs to trigger related logic like updating recipe result on another player's screen
}
}
Expand Down Expand Up @@ -1431,6 +1432,8 @@ public void broadcastChanges() {
sendStorageSettingsToClient();
refreshInventorySlotsIfNeeded();
}

initialBroadcast = false;
}


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package net.p3pp3rf1y.sophisticatedcore.upgrades.cooking;

import net.p3pp3rf1y.sophisticatedcore.upgrades.IUpgradeCountLimitConfig;
import net.p3pp3rf1y.sophisticatedcore.upgrades.UpgradeGroup;
import net.p3pp3rf1y.sophisticatedcore.upgrades.UpgradeItemBase;
import net.p3pp3rf1y.sophisticatedcore.upgrades.UpgradeType;

Expand Down Expand Up @@ -29,4 +30,9 @@ public List<UpgradeConflictDefinition> getUpgradeConflicts() {
public AutoCookingUpgradeConfig getAutoCookingUpgradeConfig() {
return autoSmokingUpgradeConfig;
}

@Override
public UpgradeGroup getUpgradeGroup() {
return ICookingUpgrade.UPGRADE_GROUP;
}
}

0 comments on commit 1866ab5

Please sign in to comment.