aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-vineflower-stripped/net/minecraft/world/item/SnowballItem.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-vineflower-stripped/net/minecraft/world/item/SnowballItem.java.patch')
-rw-r--r--patch-remap/mache-vineflower-stripped/net/minecraft/world/item/SnowballItem.java.patch41
1 files changed, 41 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower-stripped/net/minecraft/world/item/SnowballItem.java.patch b/patch-remap/mache-vineflower-stripped/net/minecraft/world/item/SnowballItem.java.patch
new file mode 100644
index 0000000000..84d40286bb
--- /dev/null
+++ b/patch-remap/mache-vineflower-stripped/net/minecraft/world/item/SnowballItem.java.patch
@@ -0,0 +1,41 @@
+--- a/net/minecraft/world/item/SnowballItem.java
++++ b/net/minecraft/world/item/SnowballItem.java
+@@ -15,28 +16,24 @@
+ }
+
+ @Override
+- public InteractionResultHolder<ItemStack> use(Level level, Player player, InteractionHand hand) {
+- ItemStack itemInHand = player.getItemInHand(hand);
+- level.playSound(
+- null,
+- player.getX(),
+- player.getY(),
+- player.getZ(),
+- SoundEvents.SNOWBALL_THROW,
+- SoundSource.NEUTRAL,
+- 0.5F,
+- 0.4F / (level.getRandom().nextFloat() * 0.4F + 0.8F)
+- );
++ public InteractionResultHolder<ItemStack> use(Level level, Player player, EnumHand hand) {
++ ItemStack itemstack = player.getItemInHand(hand);
++
++ // CraftBukkit - moved down
++ // world.playSound((EntityHuman) null, entityhuman.getX(), entityhuman.getY(), entityhuman.getZ(), SoundEffects.SNOWBALL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (world.getRandom().nextFloat() * 0.4F + 0.8F));
+ if (!level.isClientSide) {
+ Snowball snowball = new Snowball(level, player);
+ snowball.setItem(itemInHand);
+ snowball.shootFromRotation(player, player.getXRot(), player.getYRot(), 0.0F, 1.5F, 1.0F);
+ level.addFreshEntity(snowball);
+ }
++ // CraftBukkit end
+
+ player.awardStat(Stats.ITEM_USED.get(this));
+- if (!player.getAbilities().instabuild) {
+- itemInHand.shrink(1);
++ // CraftBukkit start - moved up
++ /*
++ if (!entityhuman.getAbilities().instabuild) {
++ itemstack.shrink(1);
+ }
+
+ return InteractionResultHolder.sidedSuccess(itemInHand, level.isClientSide());