Skip to content

Commit

Permalink
Existing nbt permission should allow default nbt
Browse files Browse the repository at this point in the history
  • Loading branch information
dordsor21 committed Jan 5, 2025
1 parent dba5fea commit 5119ba6
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -607,14 +607,17 @@ private <T extends BlockStateHolder> T validate(ParserContext context, T holder)
}
CompoundTag nbt = holder.getNbtData();
if (nbt != null) {
if (actor.hasPermission("worldedit.anyblock.nbt")) {
return holder;
}
if (nbt.equals(holder.getBlockType().getDefaultState().getNbtData())) {
if (!actor.hasPermission("worldedit.anyblock.default-nbt")) {
throw new DisallowedUsageException(Caption.of(
"fawe.error.nbt.forbidden",
TextComponent.of("worldedit.anyblock.default-nbt")
));
}
} else if (!actor.hasPermission("worldedit.anyblock.nbt")) {
} else {
throw new DisallowedUsageException(Caption.of(
"fawe.error.nbt.forbidden",
TextComponent.of("worldedit.anyblock.nbt")
Expand Down

0 comments on commit 5119ba6

Please sign in to comment.