senseiwells / EssentialClient

EssentialClient is a client side mod originally forked from Carpet Client for 1.15.2 that implements new client side features
MIT License
77 stars 14 forks source link

Fix SwapSlot bug + add ClickSlot function + @ #34

Closed aria1th closed 2 years ago

aria1th commented 2 years ago

SwapSlot now works correctly (at least in 1.18.1 and 1.17) *NOTE : Vanilla does not swap items if stacks are mergable , so it should respect vanilla? ClickSlot works perfectly (player.clickSlot( int slotID(-999 or proper slot ID) , clickData (0 or 1, default to 0) , String slotActionType(pickup, swap, etc) ) InteractItem works good with items : bottle o'enchant , composable, etc but not foods GetSwappableHotbarSlot works

senseiwells commented 2 years ago

This is bad, pickup should not be used. The behaviour is completely different, and will damage some scripts. I intended for this to be SWAP because of item shadowing, changing this will break it. Also I would replace use with interact item I don't see point of having them both

aria1th commented 2 years ago

hmm yeah it will definitely break that behavior... but current code only works when first clicked slot is not air. It can be simply fixed by alternating 1/2 so I'll just make it swap again.

InteractItem is for some condition when you need to open chat / do something else, use is blocked while in those conditions but its pretty limited... it requires mixins to work properly with general items so its not really preferable.

senseiwells commented 2 years ago

cool looks good will merge tomorrow