Fix snowball throwing (#705)
This commit is contained in:
parent
9442c1f987
commit
6bb2d703ee
|
@ -35,12 +35,12 @@ public class SnowballItemMixin extends Item {
|
||||||
if (!worldIn.isClientSide) {
|
if (!worldIn.isClientSide) {
|
||||||
Snowball snowballentity = new Snowball(worldIn, playerIn);
|
Snowball snowballentity = new Snowball(worldIn, playerIn);
|
||||||
snowballentity.setItem(itemstack);
|
snowballentity.setItem(itemstack);
|
||||||
|
snowballentity.shootFromRotation(playerIn, playerIn.getXRot(), playerIn.getYRot(), 0.0F, 1.5F, 1.0F);
|
||||||
if (worldIn.addFreshEntity(snowballentity)) {
|
if (worldIn.addFreshEntity(snowballentity)) {
|
||||||
if (!playerIn.getAbilities().instabuild) {
|
if (!playerIn.getAbilities().instabuild) {
|
||||||
itemstack.shrink(1);
|
itemstack.shrink(1);
|
||||||
}
|
}
|
||||||
worldIn.playSound(null, playerIn.getX(), playerIn.getY(), playerIn.getZ(), SoundEvents.SNOWBALL_THROW, SoundSource.NEUTRAL, 0.5F, 0.4F / (worldIn.getRandom().nextFloat() * 0.4F + 0.8F));
|
worldIn.playSound(null, playerIn.getX(), playerIn.getY(), playerIn.getZ(), SoundEvents.SNOWBALL_THROW, SoundSource.NEUTRAL, 0.5F, 0.4F / (worldIn.getRandom().nextFloat() * 0.4F + 0.8F));
|
||||||
snowballentity.shootFromRotation(playerIn, playerIn.getXRot(), playerIn.getYRot(), 0.0F, 1.5F, 1.0F);
|
|
||||||
} else if (playerIn instanceof ServerPlayer) {
|
} else if (playerIn instanceof ServerPlayer) {
|
||||||
((ServerPlayerEntityBridge) playerIn).bridge$getBukkitEntity().updateInventory();
|
((ServerPlayerEntityBridge) playerIn).bridge$getBukkitEntity().updateInventory();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user