summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2016-06-30 15:39:58 +1000
committermd_5 <git@md-5.net>2016-06-30 15:39:58 +1000
commit121dfc098a882c8fb157e8232001ce19c9846ccf (patch)
treeb0db941adc0269b556164459ec89a650a664d65d
parent6b843d995ffa4b1d5e50124bb67ea58289598596 (diff)
downloadcraftbukkit-121dfc098a882c8fb157e8232001ce19c9846ccf.tar
craftbukkit-121dfc098a882c8fb157e8232001ce19c9846ccf.tar.gz
craftbukkit-121dfc098a882c8fb157e8232001ce19c9846ccf.tar.lz
craftbukkit-121dfc098a882c8fb157e8232001ce19c9846ccf.tar.xz
craftbukkit-121dfc098a882c8fb157e8232001ce19c9846ccf.zip
SPIGOT-1288: Sounds played for cancelled BlockPlaceEvent
-rw-r--r--nms-patches/ItemBlock.patch11
-rw-r--r--nms-patches/ItemStack.patch18
2 files changed, 23 insertions, 6 deletions
diff --git a/nms-patches/ItemBlock.patch b/nms-patches/ItemBlock.patch
new file mode 100644
index 00000000..90aa56cb
--- /dev/null
+++ b/nms-patches/ItemBlock.patch
@@ -0,0 +1,11 @@
+--- a/net/minecraft/server/ItemBlock.java
++++ b/net/minecraft/server/ItemBlock.java
+@@ -36,7 +36,7 @@
+
+ SoundEffectType soundeffecttype = this.a.w();
+
+- world.a(entityhuman, blockposition, soundeffecttype.e(), SoundCategory.BLOCKS, (soundeffecttype.a() + 1.0F) / 2.0F, soundeffecttype.b() * 0.8F);
++ // world.a(entityhuman, blockposition, soundeffecttype.e(), SoundCategory.BLOCKS, (soundeffecttype.a() + 1.0F) / 2.0F, soundeffecttype.b() * 0.8F); // CraftBukkit - SPIGOT-1288
+ --itemstack.count;
+ }
+
diff --git a/nms-patches/ItemStack.patch b/nms-patches/ItemStack.patch
index 4101e906..e6cb7f25 100644
--- a/nms-patches/ItemStack.patch
+++ b/nms-patches/ItemStack.patch
@@ -44,7 +44,7 @@
}
-@@ -81,11 +104,131 @@
+@@ -81,11 +104,137 @@
}
public EnumInteractionResult placeItem(EntityHuman entityhuman, World world, BlockPosition blockposition, EnumHand enumhand, EnumDirection enumdirection, float f, float f1, float f2) {
@@ -168,6 +168,12 @@
+ }
+ }
+
++ // SPIGOT-1288 - play sound stripped from ItemBlock
++ if (this.getItem() instanceof ItemBlock) {
++ SoundEffectType soundeffecttype = ((ItemBlock) this.getItem()).d().w(); // PAIL: rename
++ world.a(entityhuman, blockposition, soundeffecttype.e(), SoundCategory.BLOCKS, (soundeffecttype.a() + 1.0F) / 2.0F, soundeffecttype.b() * 0.8F);
++ }
++
+ entityhuman.b(StatisticList.b(this.item));
+ }
}
@@ -177,7 +183,7 @@
return enuminteractionresult;
}
-@@ -110,7 +253,7 @@
+@@ -110,7 +259,7 @@
nbttagcompound.setByte("Count", (byte) this.count);
nbttagcompound.setShort("Damage", (short) this.damage);
if (this.tag != null) {
@@ -186,7 +192,7 @@
}
return nbttagcompound;
-@@ -119,13 +262,18 @@
+@@ -119,13 +268,18 @@
public void c(NBTTagCompound nbttagcompound) {
this.item = Item.d(nbttagcompound.getString("id"));
this.count = nbttagcompound.getByte("Count");
@@ -206,7 +212,7 @@
if (this.item != null) {
this.item.a(this.tag);
}
-@@ -162,11 +310,30 @@
+@@ -162,11 +316,30 @@
}
public void setData(int i) {
@@ -239,7 +245,7 @@
}
public int j() {
-@@ -214,6 +381,12 @@
+@@ -214,6 +387,12 @@
this.count = 0;
}
@@ -252,7 +258,7 @@
this.damage = 0;
}
-@@ -514,6 +687,7 @@
+@@ -514,6 +693,7 @@
@Deprecated
public void setItem(Item item) {
this.item = item;