From 28e630573128195714abdc34ebd214336607912d Mon Sep 17 00:00:00 2001 From: P3pp3rF1y Date: Tue, 3 Dec 2024 17:46:56 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20Fixed=20decoration=20tabl?= =?UTF-8?q?e=20result=20slot=20to=20always=20update=20when=20a=20chest=20i?= =?UTF-8?q?s=20swapped=20for=20barrel=20in=20it=20which=20sometimes=20left?= =?UTF-8?q?=20the=20barrel=20result=20around=20and=20allowed=20player=20to?= =?UTF-8?q?=20pull=20it=20in=20exchange=20for=20the=20chest?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gradle.properties | 2 +- .../block/DecorationTableBlockEntity.java | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/gradle.properties b/gradle.properties index ecf1db4a..046ee2fc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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. diff --git a/src/main/java/net/p3pp3rf1y/sophisticatedstorage/block/DecorationTableBlockEntity.java b/src/main/java/net/p3pp3rf1y/sophisticatedstorage/block/DecorationTableBlockEntity.java index 4f346bd8..633131aa 100644 --- a/src/main/java/net/p3pp3rf1y/sophisticatedstorage/block/DecorationTableBlockEntity.java +++ b/src/main/java/net/p3pp3rf1y/sophisticatedstorage/block/DecorationTableBlockEntity.java @@ -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); @@ -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); @@ -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;