Add permission nodes for more gamemaster blocks.
I would like to suggest adding permissions for more of the gamemaster blocks that are included in Java Edition. The patch I created adds the following nodes:
• Structure Block ("minecraft.structureblock")
• Jigsaw Block ("minecraft.jigsawblock")
• Light Block ("minecraft.lightblock") Note: This controls whether or not players can change the light level by interacting with a Light Block with one in their hand.
• Lectern Block ("minecraft.lecternblock") Note: This permission node controls whether or not a lectern with NBT can be placed. Regular players can still place the block with no NBT.
• Test Block ("minecraft.testblock")
• Test Instance Block ("minecraft.testinstanceblock")
shouldn't be a feature patch, requireNonNull is dangerous, perm node names leave something to be desired
What do you think would be a better name for the permission nodes?
As for "requireNonNull", the IDE suggested that I add that to avoid a NullPointerException.
Its better to use Preconditions.checkState(x != null, “message”) than requireNonNull, its even outlined in the CONTRIBUTING.md file iirc
requireNonNull, works by throwing an exception if the value is null, as does the preconditions, we shouldn't be introducing throws to such a trivial state, validate it
yea that might be smarter, also what is the reason for the unnecessary assert? it should be removed if im seeing correctly
What do you mean by assert?
https://github.com/PaperMC/Paper/pull/9339 if we want to implement this, something along the line of this PR might be better. For now, I don't see much benefit in spamming permission checks for every game master block like that.