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

Variant Selector pick block does not reset variant type when picking original block #5042

Open
copygirl opened this issue Sep 4, 2024 · 1 comment
Labels
version: 1.20 Version: Minecraft 1.20.x

Comments

@copygirl
Copy link

copygirl commented Sep 4, 2024

Minecraft: 1.20.1
NeoForge: 47.1.106
Quark: 4.0-460

Reproduction

  • Put two different planks types in your inventory that have a slab and stair variant.
  • Place one of each planks, slab and stair in the world.
  • Middle click slabs and stairs.
    • The planks correctly get moved to and selected in the hotbar.
    • Slab and stair variant is correctly selected when they are picked.
  • Middle click planks.
    • The planks correctly get moved to and selected in the hotbar.
    • However, current variant is not reset – the previous variant (slab or stair) stays selected.

Thoughts

Browsing through the code a little, could this be because the original item is not considered a variant, and thus the following code does not reset the currently selected variant?

String variantKey = variants.getVariantOfBlock(baseBlock, pickedBlock);
if (variantKey != null) {
setClientVariant(variantKey, true);
}

The variant might also need to be reset if (baseBlock == pickedBlock).

@github-actions github-actions bot added the version: 1.20 Version: Minecraft 1.20.x label Sep 4, 2024
@copygirl
Copy link
Author

copygirl commented Sep 4, 2024

Relatedly, the inventory check should be skipped in creative mode, for variant picking to work in creative when you don't already have the original item in your inventory. Otherwise, the variant block is picked and put in the hotbar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
version: 1.20 Version: Minecraft 1.20.x
Projects
None yet
Development

No branches or pull requests

1 participant