Snownee / Lychee

Minecraft data-driven in-world crafting mod.
https://www.curseforge.com/minecraft/mc-mods/lychee
28 stars 3 forks source link

Click Machine sneak not being detected #46

Closed Electrolyte220 closed 1 year ago

Electrolyte220 commented 1 year ago

Mod loader

Forge

Minecraft version

1.19.2

Mod version

3.10.1

Modloader version

Forge 43.2.0

Modpack info

No response

If bug:

If bug: The latest.log file

No response

Issue description

Due how click machine sets up their fake player, the way Lychee detects the player shifting is not applicable. All that's needed to fix this is a check for isShiftKeyDown(), as that's how click machine assigns sneaking to their fake player.

800020h commented 1 year ago

it can't only check for isShiftKeyDown() because not everyone sneaks with shift

Electrolyte220 commented 1 year ago

True, so instead you can have a check for either: return ctx.getParam(LootContextParams.THIS_ENTITY).isCrouching() || ctx.getParam(LootContextParams.THIS_ENTITY).isShiftKeyDown() ? times : 0; instead of just return ctx.getParam(LootContextParams.THIS_ENTITY).isCrouching() ? times : 0; and that seemed to fix it when I tested it.