Create

Create

86M Downloads

Unbreakable glue cannot be used

IThundxr opened this issue ยท 3 comments

commented

Triage Note: Occurs on forge aswell & cloned from fabric repo Fabricators-of-Create#460

Describe the Bug

basically i wanted to make a cool windmill with some glue in it so i craft it up and then when i try to use it it says not enough glue
this might be a feature and if so how do i use the glue and sorry for reporting it unnecarily

Reproduction Steps

1.have glue in survival
2.attempt to glue 2 blocks with the box selecting thing
3.
...

Expected Result

an error message above your hotbar saying "not enough glue in inventory" the selection box
however placing the glue in the offhand and placing 1 by 1 does work
only the mass selection doesent

Screenshots and Videos

2022-07-25_17 44 22

Crash Report or Log

No response

Operating System

windows 11

Mod Version

0.5.0

Minecraft Version

1.18.2

Other Mods

No response

Additional Context

the server hosting service was dedicated mc if that matters

commented

image
Confirmed not working on 1.20.1 Forge

commented

So the issue is because the code checks if the item is damageable and if it isn't, it ignores it

A revised version of the code would be :

simulated ?
Yes
Iterate through every items, if a super glue that either is unbreakable or has -1 max durability (so not damageable) is found, return true
No
Check the current item and remove durability if applicable, if you still need more glue, then check the entire inventory, every glue found should be put in a list, if a glue is found to be unbreakable, just return and flush down the list, otherwise, iterate through the glue list and remove durability until it is all clear

Unfortunately it does mean complexifying the glue function, but it would remove the bug and also prevent glue from getting consumed when an unbreakable glue is in the inventory (except for the main/off hand since those should take priority)

commented

(Oh and the function is collectGlueInInventory() or smth like that)