Quark

Quark

143M Downloads

[1.20.1] Variant Selector turns entire item stack into one block

DJBaphomet opened this issue ยท 2 comments

commented

Versions

  • Quark 4.0-435
  • Zeta 1.0-13

Issue

Issue happens when having auto-conversion enabled with Variant Selector, but allowing other methods of obtaining variant blocks
If you throw a stack of block variants onto the ground one-at-a-time, it works fine and they all convert as normal. But, if you throw the entire stack at once, the full stack of however-many blocks will get turned into a single block of whatever the base block is

commented

Heres the method, note that clone.setCount(stack.getCount()) is not called

@PlayEvent
public void addEntityToWorld(ZEntityJoinLevel event) {
Entity entity = event.getEntity();
if(convertVariantItems && entity instanceof ItemEntity ie) {
ItemStack stack = ie.getItem();
if(stack.getItem() instanceof BlockItem bi) {
Block block = bi.getBlock();
Block otherBlock = variants.getOriginalBlock(block);
if(otherBlock != block) {
ItemStack clone = new ItemStack(otherBlock.asItem());
clone.setTag(stack.getTag());
ie.setItem(clone);
}
}
}
}

Obviously the behavior when players drop items (or when you break a chest containing items) is broken, but I wonder if this is intended behavior for double-slabs, because you should only get 1 block and not 2

commented

Fuck it we ball