Flan (Forge)

Flan (Forge)

85.5k Downloads

Please mix into World#canPlayerModifyAt to include a claim check

Technici4n opened this issue ยท 12 comments

commented

This will

  • fix MI wrenches ignoring claims,
  • allow other mods to add claim compat in a trivial manner.
commented

(Don't literally @Override it as other mods might edit it too :P)

commented

hmm the place of the check isnt actually the issue i see.
its cause i have a map of item -> permission and only items in that map are considered
i could make it so modpack maker can additionally specify a mapping via config though but otherwise see no better way to achieve this

commented

reason why i didnt is cause that place is not specific enough for a check. vanilla calls it at various places and you dont know what item is being used or if its a left or right click.
there is an api that other mods can use to check for claim permissions

commented

Yes but I don't want to depend on every single claim mod. Another solution is to move your UseItemCallback listener to an earlier event phase to at least cancel all interactions happening in the default phase (which is the case for MI wrenches).

commented

I guess you could check for the c:wrenches tag that defines wrench functionality?

commented

btw in what way are they ignoring claims? i tested the wrenches on machines, pistons or even plain blocks and the claims blocked them

commented

You should check shift + right-clicking an MI pipe with the MI wrench, some people reported to me that it bypassed claims on aof5 but I haven't checked myself.

commented

You should also check AE2's wrench, it might have the same issue. (Might also be dependent on mod load order, so I'd suggest testing in dev which makes it random).

commented

mi wrench is just a client desync. ae2 does break the blocks. not too sure how to solve the client desync though cause sending a blockupdate packet isnt doing anything.
i will prob just leave that like it since it doesnt actually have a big impact

commented

Did you move your event listener to an earlier phase? That should help. (addPhaseOrdering iirc)

commented

ae2 is handled. mi will just have the desync if cables are shift right clicked with a wrench

commented

Sounds reasonable, thanks for taking the time to go through this issue.