Signpost

Signpost

8M Downloads

Signpost TP costs nothing with matching class in inventory, not matching item

Gaelmare opened this issue · 2 comments

commented

The two checks in canPay:

if(now != null && now.getItem() !=null && now.getItem().getClass() == ClientConfigStorage.INSTANCE.getCost().getClass()){

and doPay:

player.inventory.clearMatchingItems(ClientConfigStorage.INSTANCE.getCost(), 0, stackSize, null);

Are not the same if the items are different only in an internal class map, e.g. TFC Powders:
https://github.com/TerraFirmaCraft/TerraFirmaCraft/blob/1.12.x/src/main/java/net/dries007/tfc/objects/items/ItemPowder.java

So canPay finds lapis powder in the inventory, but the payment item configured is "tfc:powder/kaolinite", so doPay finds nothing to clear, and the TP costs nothing.

Is Signpost still supported in 1.12?

commented

Well, only version 1 of the mod is available for 1.12 (which is of course greatly inferior to version 2 😅) and I'm a bit reluctant to update version 1 anymore. I guess I'll fix it, but I don't know when I'll find the time, so it could take a while.

My original plan was to downport version 2 to 1.12, but that's a tedious (and of course time consuming) task, so 🤷

commented

Why wouldn't just comparing the Item work?