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

Litematica mixin interferes with Litematica’s pick block behavior #177

Open
2 of 6 tasks
xane256 opened this issue Sep 20, 2023 · 1 comment
Open
2 of 6 tasks
Labels
bug Something isn't working

Comments

@xane256
Copy link

xane256 commented Sep 20, 2023

Version information

itemswapper-fabric-0.5.3-mc1.20.1.jar

Other relevant installed mods

malilib 1.20.1-0.16.2, Litematica 1.20.1-0.15.3

Expected Behavior

  1. In survival, pick-block on a schematic block that is either Correct or Missing does not obey Litematica’s pickBlockableSlots setting, even when pickBlockAvoidTools is set to False. In other words filling the hotbar with tools is not the reason pickBlockableSlots is ignored. I suspect the reason is because ItemSwapper has its own pick block behavior in the Litematica mixin.
  2. In creative, pick block on a Missing schematic block does not give you the item, but if you have the item in "survival inventory" (in creative mode) then the item does get swapped to hotbar.

Actual Behavior

  1. The item should be swapped to the hotbar into a slot that obeys Litematica’s pickBlockableSlots setting. This is the observed behavior when ItemSwapper is not installed.
  2. The item should be given to the player in creative if necessary, similar to what Litematica does when ItemSwapper is not installed.

Reproduction Steps

  1. In survival:
  • Load a schematic containing stone blocks
  • set litematicas pickBlockableSlots to 4,5,6,7
  • put swords in slots 1,2,3
  • Fill hotbar with dirt
  • put stone in inventory
  • do pick block on the ghost stone while holding a sword. Notice that the sword is replaced with stone instead of the stone going into one of the dirt slots.
  1. in creative:
  • load a schematic of stone blocks
  • do /clear
  • pick block the stone
  • Notice that you dont get any stone

Render engine

  • Vanilla
  • Sodium(optionally with Iris)
  • Optifine
  • VulkanMod
  • Canvas
  • Other

Additional information

private static void doSchematicWorldPickBlockHook(boolean closest, Minecraft mc, CallbackInfoReturnable<Boolean> ci) {

@xane256 xane256 added the bug Something isn't working label Sep 20, 2023
@tr7zw
Copy link
Owner

tr7zw commented Oct 11, 2023

I had to fully overwrite Litematicas pickblock logic since there is no way to hook it otherwise(it runs+canceles before any vanilla logic I could hook). Will have to look into how far I can simulate that behavior/hook further down in litematica.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants