Hex Casting

Hex Casting

6M Downloads

Place Block requires a block in the offhand rather than pulling from inv/hotbar

Robotgiggle opened this issue · 3 comments

commented

Modloader

Fabric

Minecraft version

1.20.1

Hex Casting version

0.11.1-7-pre-634

Modloader version

Fabric: loader 0.15.9, api 0.92.1+1.20.1

Modpack info

HexxyTest (https://github.com/walksanatora/HexxyTestPack)

Issue description

In the past, Place Block would select a block to place based on the options available in your hotbar, as described in the Working With Items section of the book. Now, however, Place Block only seems to be able to place from your offhand. Attempting to cast it without a placeable block in your offhand fails, along with providing a badly formatted mishap message. This makes complex block placement essentially impossible without some way to change what's in your offhand mid-cast.

Steps to reproduce

  1. Attempt to cast Place Block without a placeable item in your offhand
  2. Observe that the spell fails, and produces the following mishap message
    image

Other information

No response

commented

Function was changed here: c29bccb#diff-a4dffb0980d911147ef92ff5eb4cfe1568f96fc86d858d0c9b9a831f3a7c9baaL63

That function was apparently removed here: e37d08d#diff-87c88fde241e5936b7112ca8a021568863e2aa2802c7d4bad332697d8e9608f5L153

I think the new equivalent would be queryForMatchingStack?

public ItemStack queryForMatchingStack(Predicate<ItemStack> stackOk) {
var stacks = this.getUsableStacks(StackDiscoveryMode.QUERY);
for (ItemStack stack : stacks) {
if (stackOk.test(stack)) {
return stack;
}
}
return null;
}

commented

Just found this amazing mod and was hit by this bug. Nice to see that there are people working on this mod and fixing bugs <3

commented

Not a big deal but the current behavior is still different to what the book says I think. The book says:

  • First, the spell will search for the first valid item in my hotbar to the right of my staff, wrapping around at the right-hand side, and starting at the first slot if my staff is in my off-hand.

  • Second, the spell will draw that item from as far back in my inventory as possible, prioritizing the main inventory over the hotbar.

It kind of ignores the second part. Not a big deal but one or the other should be changed probably