Fire BlockPlaceEvent for Half Slab Completion

Fixes BUKKIT-5390
This commit is contained in:
Aikar 2014-02-09 19:02:00 +11:00 committed by md_5
parent d504751f12
commit ee9d8c7590

View File

@ -0,0 +1,36 @@
From d6fd41ea6e11a575f1b60478f52667f41c73646f Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 7 Feb 2014 23:21:16 -0500
Subject: [PATCH] Fire BlockPlaceEvent for Half Slab Completion
Fixes BUKKIT-5390
diff --git a/src/main/java/net/minecraft/server/ItemStep.java b/src/main/java/net/minecraft/server/ItemStep.java
index 6448f35..59bada2 100644
--- a/src/main/java/net/minecraft/server/ItemStep.java
+++ b/src/main/java/net/minecraft/server/ItemStep.java
@@ -54,6 +54,7 @@ public class ItemStep extends ItemBlock {
}
private boolean a(ItemStack itemstack, EntityHuman entityhuman, World world, int i, int j, int k, int l) {
+ final int clickedX = i, clickedY = j, clickedZ = k; // CraftBukkit
if (l == 0) {
--j;
}
@@ -83,8 +84,11 @@ public class ItemStep extends ItemBlock {
int j1 = i1 & 7;
if (block == this.c && j1 == itemstack.getData()) {
- if (world.b(this.d.a(world, i, j, k)) && world.setTypeAndData(i, j, k, this.d, j1, 3)) {
- world.makeSound((double) ((float) i + 0.5F), (double) ((float) j + 0.5F), (double) ((float) k + 0.5F), this.d.stepSound.getPlaceSound(), (this.d.stepSound.getVolume1() + 1.0F) / 2.0F, this.d.stepSound.getVolume2() * 0.8F);
+ // CraftBukkit start - world.setTypeIdAndData -> processBlockPlace()
+ //if (world.b(this.d.a(world, i, j, k)) && world.setTypeAndData(i, j, k, this.d, j1, 3)) {
+ if (world.b(this.d.a(world, i, j, k)) && processBlockPlace(world, entityhuman, null, i, j, k, this.d, j1, clickedX, clickedY, clickedZ)) {
+ //world.makeSound((double) ((float) i + 0.5F), (double) ((float) j + 0.5F), (double) ((float) k + 0.5F), this.d.stepSound.getPlaceSound(), (this.d.stepSound.getVolume1() + 1.0F) / 2.0F, this.d.stepSound.getVolume2() * 0.8F);
+ // CraftBukkit end
--itemstack.count;
}
--
1.8.3.2