mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-06 18:50:51 +01:00
6fcc9cce6d
By: md_5 <git@md-5.net>
25 lines
1.3 KiB
Diff
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) {
|