Closed Sleepylux closed 1 year ago
Could you tell me how they can steal it? I don't have enough info
Looking through your code, It may not be as simple to fix as I thought Anywho they can just open the supply chest/barrel and take items out
Ah right. For that you want to add some extra mod. For example some claim mod (like Get Off My Lawn ReServed) or chest locking mod (like Hey Thats Mine).
Ah alright, It would be cool if it was added in the mod itself, I dont think it would be that hard just store all the shop containers positions in an array like new int[][]{{x,y,z}, {x,y,z}}
and on PlayerBlockBreakEvents.BEFORE register an event to check if its any of those positions above and if it is return false otherwise return true, That should stop it from being broken and you can basically the same thing on UseBlockCallback but returning ActionResult.PASS as true and ActionResult.FAIL as false, (you could store it as a JsonArray or something in a file or just remake the array with all currently existing tradeshops if the mod restarts or something for persistence)
or better idea, Add an NBT tag to the container and when a block is broken with an NBT tag then just cancel the break
You still be better just using alternative methods, as this mod is compatible with them
Users can steal for the supply container/storage, Its yeah just that- Shouldnt be that hard to fix If I know the fabric api correctly-