Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
DJBaphomet opened this issue Feb 10, 2024 · 2 comments
Closed

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

DJBaphomet opened this issue Feb 10, 2024 · 2 comments

Comments

@DJBaphomet
Copy link

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

@quat1024
Copy link
Collaborator

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

@quat1024
Copy link
Collaborator

Fuck it we ball

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants