OvercastNetwork / SportBukkit

CraftBukkit and Bukkit modifications that improve stability and add new features
99 stars 84 forks source link

Allow custom underwater arrow distances #175

Open ShinyDialga opened 9 years ago

ShinyDialga commented 9 years ago

As of 1.8, arrows have been severely nerfed underwater. They can only go about 7 blocks in water compared to 1.7 being about 20 blocks. This patch allows you to change the float that determines how far the arrow goes underwater. The default setting in the bukkit.yml is 0.6, as is the default in vanilla. The variable in the config appears as arrow-water-distance: 0.6 I found 0.86 (I found the value of cos(pi/6) to be very similar (0.86602540378) but I'm not sure if there's a correlation) to be very replicative of 1.7's arrow behavior of 20 blocks maximum. There is also code (thanks to @jedediah's moving TNT patch) that sends velocity and teleport packets to the client to show the true location of the arrow, as it appears to be a little off without it.

I attempted something at this patch before, but didn't really care enough until this thread came out: https://oc.tc/forums/topics/55d1f8475f35b9034600069d

Here's a youtube video showing 1.8 arrow behavior vs actions with the patch: https://www.youtube.com/watch?v=EhLiampr_kw