#853: Implement Player#breakBlock()

By: Parker Hawke <hawkeboyz2@hotmail.com>
This commit is contained in:
CraftBukkit/Spigot 2021-06-12 08:30:34 +10:00
parent 0e95cf49fe
commit 8198d062f3

View file

@ -90,6 +90,7 @@ import org.bukkit.Particle;
import org.bukkit.Sound;
import org.bukkit.Statistic;
import org.bukkit.WeatherType;
import org.bukkit.block.Block;
import org.bukkit.block.data.BlockData;
import org.bukkit.configuration.serialization.DelegateDeserialization;
import org.bukkit.conversations.Conversation;
@ -533,6 +534,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
playEffect(loc, effect, datavalue);
}
@Override
public boolean breakBlock(Block block) {
return getHandle().gameMode.breakBlock(new BlockPosition(block.getX(), block.getY(), block.getZ()));
}
@Override
public void sendBlockChange(Location loc, Material material, byte data) {
if (getHandle().connection == null) return;