tweaked stackable shulkerboxes for 1.17 fixes #989
This commit is contained in:
1 parent
c9b8511e1b
commit
181bfb34bf
2 files changed
+7
-2
No files matched your search
@@ -192,7 +192,7 @@ public class CarpetSettings
|
|||||||
|
|
||||||
@Rule(
|
@Rule(
|
||||||
desc = "Empty shulker boxes can stack to 64 when dropped on the ground",
|
desc = "Empty shulker boxes can stack to 64 when dropped on the ground",
|
||||||
extra = "To move them around between inventories, use shift click to move entire stacks",
|
extra = ".. or when manipulated inside the inventories",
|
||||||
category = {SURVIVAL, FEATURE}
|
category = {SURVIVAL, FEATURE}
|
||||||
)
|
)
|
||||||
public static boolean stackableShulkerBoxes = false;
|
public static boolean stackableShulkerBoxes = false;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package carpet.mixins;
|
package carpet.mixins;
|
||||||
|
|
||||||
import carpet.CarpetSettings;
|
import carpet.CarpetSettings;
|
||||||
|
import carpet.helpers.InventoryHelper;
|
||||||
import net.minecraft.block.ShulkerBoxBlock;
|
import net.minecraft.block.ShulkerBoxBlock;
|
||||||
import net.minecraft.item.BlockItem;
|
import net.minecraft.item.BlockItem;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
@@ -17,7 +18,11 @@ public class Slot_stackableSBoxesMixin {
|
|||||||
))
|
))
|
||||||
private int getMaxCountForSboxes(Slot slot, ItemStack stack)
|
private int getMaxCountForSboxes(Slot slot, ItemStack stack)
|
||||||
{
|
{
|
||||||
if (CarpetSettings.stackableShulkerBoxes && stack.getItem() instanceof BlockItem && ((BlockItem)stack.getItem()).getBlock() instanceof ShulkerBoxBlock)
|
if (CarpetSettings.stackableShulkerBoxes &&
|
||||||
|
stack.getItem() instanceof BlockItem &&
|
||||||
|
((BlockItem)stack.getItem()).getBlock() instanceof ShulkerBoxBlock &&
|
||||||
|
!InventoryHelper.shulkerBoxHasItems(stack)
|
||||||
|
)
|
||||||
{
|
{
|
||||||
return CarpetSettings.SHULKER_STACK_SIZE;
|
return CarpetSettings.SHULKER_STACK_SIZE;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user