diff options
Diffstat (limited to 'nms-patches/ItemSnowball.patch')
-rw-r--r-- | nms-patches/ItemSnowball.patch | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/nms-patches/ItemSnowball.patch b/nms-patches/ItemSnowball.patch index e2a91644..64293dcc 100644 --- a/nms-patches/ItemSnowball.patch +++ b/nms-patches/ItemSnowball.patch @@ -1,16 +1,16 @@ --- a/net/minecraft/server/ItemSnowball.java +++ b/net/minecraft/server/ItemSnowball.java -@@ -8,17 +8,28 @@ - } +@@ -10,17 +10,29 @@ + public InteractionResultWrapper<ItemStack> a(World world, EntityHuman entityhuman, EnumHand enumhand) { + ItemStack itemstack = entityhuman.b(enumhand); - public InteractionResultWrapper<ItemStack> a(ItemStack itemstack, World world, EntityHuman entityhuman, EnumHand enumhand) { -- if (!entityhuman.abilities.canInstantlyBuild) { + // CraftBukkit start - moved down -+ /*if (!entityhuman.abilities.canInstantlyBuild) { - --itemstack.count; ++ /* + if (!entityhuman.abilities.canInstantlyBuild) { + itemstack.subtract(1); } - world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.fS, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemSnowball.j.nextFloat() * 0.4F + 0.8F)); + world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.go, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemSnowball.j.nextFloat() * 0.4F + 0.8F)); + */ if (!world.isClientSide) { EntitySnowball entitysnowball = new EntitySnowball(world, entityhuman); @@ -19,10 +19,10 @@ - world.addEntity(entitysnowball); + if (world.addEntity(entitysnowball)) { + if (!entityhuman.abilities.canInstantlyBuild) { -+ --itemstack.count; ++ itemstack.subtract(1); + } + -+ world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.fS, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemSnowball.j.nextFloat() * 0.4F + 0.8F)); ++ world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.go, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemSnowball.j.nextFloat() * 0.4F + 0.8F)); + } else if (entityhuman instanceof EntityPlayer) { + ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); + } |