@@ -158,7 +158,8 @@
|
||||
+ // CraftBukkit start - fire BlockBreakEvent
|
||||
+ org.bukkit.block.Block bblock = CraftBlock.at(level, blockposition);
|
||||
+ BlockBreakEvent event = null;
|
||||
+
|
||||
|
||||
- if (!this.player.getMainHandItem().getItem().canAttackBlock(iblockdata, this.level, blockposition, this.player)) {
|
||||
+ if (this.player instanceof EntityPlayer) {
|
||||
+ // Sword + Creative mode pre-cancel
|
||||
+ boolean isSwordNoBreak = !this.player.getMainHandItem().getItem().canAttackBlock(iblockdata, this.level, blockposition, this.player);
|
||||
@@ -193,8 +194,7 @@
|
||||
+ }
|
||||
+ // Let the client know the block still exists
|
||||
+ this.player.connection.send(new PacketPlayOutBlockChange(this.level, blockposition));
|
||||
|
||||
- if (!this.player.getMainHandItem().getItem().canAttackBlock(iblockdata, this.level, blockposition, this.player)) {
|
||||
+
|
||||
+ // Brute force all possible updates
|
||||
+ for (EnumDirection dir : EnumDirection.values()) {
|
||||
+ this.player.connection.send(new PacketPlayOutBlockChange(level, blockposition.relative(dir)));
|
||||
@@ -252,13 +252,13 @@
|
||||
+ // CraftBukkit start
|
||||
+ if (event.isDropItems()) {
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockDropItemEvent(bblock, state, this.player, level.captureDrops);
|
||||
}
|
||||
+ }
|
||||
+ level.captureDrops = null;
|
||||
+
|
||||
+ // Drop event experience
|
||||
+ if (flag && event != null) {
|
||||
+ iblockdata.getBlock().popExperience(this.level, blockposition, event.getExpToDrop());
|
||||
+ }
|
||||
}
|
||||
+
|
||||
+ return true;
|
||||
+ // CraftBukkit end
|
||||
|
||||
Reference in New Issue
Block a user