Skip to content

Commit

Permalink
fix: šŸ› Fixed decoration table result slot to always update when a cheā€¦
Browse files Browse the repository at this point in the history
ā€¦st is swapped for barrel in it which sometimes left the barrel result around and allowed player to pull it in exchange for the chest
  • Loading branch information
P3pp3rF1y committed Dec 3, 2024
1 parent 330166e commit 28e6305
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ loader_version_range=[4,)
mod_id=sophisticatedstorage
mod_name=Sophisticated Storage
mod_license=GNU General Public License v3.0
mod_version=0.11.0
mod_version=0.11.1
mod_group_id=sophisticatedstorage
mod_authors=P3pp3rF1y, Ridanisaurus
mod_description=Fancy and functional storage containers.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ protected void onContentsChanged(int slot) {

@Override
public boolean isItemValid(int slot, ItemStack stack) {
return switch(slot) {
return switch (slot) {
case RED_DYE_SLOT -> stack.is(Tags.Items.DYES_RED);
case GREEN_DYE_SLOT -> stack.is(Tags.Items.DYES_GREEN);
case BLUE_DYE_SLOT -> stack.is(Tags.Items.DYES_BLUE);
Expand Down Expand Up @@ -116,11 +116,15 @@ private void updateResult() {
missingDyes.clear();

ItemStack storage = storageBlock.getStackInSlot(0);
if (storage.isEmpty() || ((InventoryHelper.isEmpty(decorativeBlocks) || isTintedStorage(storage)) && colorsTransparentOrSameAs(storage))) { //TODO once dyes and materials can be combined make sure to create combined result here
if (storage.isEmpty() || (
(InventoryHelper.isEmpty(decorativeBlocks)
|| !(storage.getItem() instanceof BarrelBlockItem)
|| isTintedStorage(storage)
) && colorsTransparentOrSameAs(storage))) { //TODO once dyes and materials can be combined make sure to create combined result here
result = ItemStack.EMPTY;
return;
}
if (InventoryHelper.isEmpty(decorativeBlocks) || isTintedStorage(storage)) {
if (!(storage.getItem() instanceof BarrelBlockItem) || InventoryHelper.isEmpty(decorativeBlocks) || isTintedStorage(storage)) {
result = storage.copy();
result.setCount(1);

Expand All @@ -136,10 +140,6 @@ private void updateResult() {
return;
}

if (!(storage.getItem() instanceof BarrelBlockItem)) {
return;
}

//TODO remove the check for tinted barrel here once barrel model can support combination of tinted and material
if (InventoryHelper.isEmpty(decorativeBlocks)) {
result = ItemStack.EMPTY;
Expand Down

0 comments on commit 28e6305

Please sign in to comment.