-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Add permission nodes for more gamemaster blocks. #13295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
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 |
|
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? |
| BlockEntity blockEntity = level.getBlockEntity(pos); | ||
| - if (blockEntity instanceof JigsawBlockEntity && player.canUseGameMasterBlocks()) { | ||
| + if (blockEntity instanceof JigsawBlockEntity && player.canUseGameMasterBlocks() || (player.isCreative() && player.getBukkitEntity().hasPermission("minecraft.jigsawblock"))) { | ||
| + assert blockEntity instanceof net.minecraft.world.level.block.entity.JigsawBlockEntity; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i mean this
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")