Fabrication

Fabrication

305k Downloads

Setting Shulker Boxes to invincible on item despawn rules prevents fabric-carpet's stackableShulkerBoxes

Infinidoge opened this issue ยท 3 comments

commented

When the item despawn rules are enabled and with the following section:

[@tags.minecraft:]
shulker_boxes=invincible

The stackable shulker boxes rule from gnembon/fabric-carpet fails to stack shulker boxes that are on the ground.
Disabling the item despawn rules allows the stackable shulker boxes to work properly again.

I assume this is caused by how Fabrication modifies NBT tags on the present items, but I'm unsure what would cause them to not stack with others under the relevant rule. Does the mod mess with the item itself in any way other than NBT tags?

If there is nothing that can be changed about this from Fabrication's side, I can go ahead and open an issue on the Fabric Carpet repository.

commented

Fabrication does not modify NBT for any of the item despawn effects. The extent of what item_despawn does is add new fields to the item entity; one for "extra" time that ticks down before the item's "age" does, and one that determines whether or not the item is invincible. The item invincibility flag doesn't do anything silly like cancel remove() calls - it just teleports the item out of the void in tick() and prevents damage.

Even after reading Carpet's shulker stacking mixin, I'm unsure why this doesn't work.

commented

Caused by fabrication setting age = -32768;
might be vanilla code at work here

    private boolean canMerge() {
        ItemStack itemStack = this.getStack();
        return this.isAlive() && this.pickupDelay != 32767 && this.age != -32768 && this.age < 6000 && itemStack.getCount() < itemStack.getMaxCount();
    }
commented

...Really?

Thanks, vanilla. :/

I'll add a "fabrication$forceStackable" field.