PaperMC/paper-server/patches/sources/net/minecraft/world/item/DebugStickItem.java.patch
CraftBukkit/Spigot 6fcc9cce6d Add creative mode NBT permissions
By: md_5 <git@md-5.net>
2019-02-25 19:26:56 +11:00

25 lines
1.3 KiB
Diff

--- a/net/minecraft/world/item/DebugStickItem.java
+++ b/net/minecraft/world/item/DebugStickItem.java
@@ -1,3 +1,4 @@
+// mc-dev import
package net.minecraft.world.item;
import java.util.Collection;
@@ -52,7 +53,7 @@
}
public boolean handleInteraction(Player player, BlockState state, LevelAccessor world, BlockPos pos, boolean update, ItemStack stack) {
- if (!player.canUseGameMasterBlocks()) {
+ if (!player.canUseGameMasterBlocks() && !(player.getAbilities().instabuild && player.getBukkitEntity().hasPermission("minecraft.debugstick")) && !player.getBukkitEntity().hasPermission("minecraft.debugstick.always")) { // Spigot
return false;
} else {
Holder<Block> holder = state.getBlockHolder();
@@ -92,7 +93,7 @@
}
private static <T extends Comparable<T>> BlockState cycleState(BlockState state, Property<T> property, boolean inverse) {
- return (BlockState) state.setValue(property, (Comparable) DebugStickItem.getRelative(property.getPossibleValues(), state.getValue(property), inverse));
+ return (BlockState) state.setValue(property, DebugStickItem.getRelative(property.getPossibleValues(), state.getValue(property), inverse)); // CraftBukkit - decompile error
}
private static <T> T getRelative(Iterable<T> elements, @Nullable T current, boolean inverse) {