Fix animal spawning ignoring limits. Fixes BUKKIT-4180

Minecraft 1.5.2 changed mob spawning by ignoring persistent mobs from the
mob count. In CraftBukkit all mobs that previously used a separate hard
coded persistence system were ported to instead use this one. This causes
all animals to be persistent by default and thus never be counted. To
correct this issue we consider if the mob would be considered persistent
in the hard coded system as well when deciding if a mob should count.

Remapped by Srg2Source from Bukkit/CraftBukkit@482c4c3d1ae8da07178139f95ca218f0be598f5b
Fix typo/logic error in previous commit

Remapped by Srg2Source from Bukkit/CraftBukkit@7d19b67e256b0356a2b7affd169ac672e422ae5f
Send block updates even when applyPhysics is false.  Fixes BUKKIT-3971 The CraftBlock class is setting bit 0x4 of the update flag when bit 0x2 should in fact be set here. Bit 0x2 means "do updates"; bit 0x4 means "don't do updates if the world is static, even when bit 0x2 is set".

Remapped by Srg2Source from Bukkit/CraftBukkit@b5455183db43b6614d7f6aa3fe2ca832055c96c0
Correct event handling for dispensing filled buckets. Fixes BUKKIT-4046

We only go through event creation and calling when dispensing filled buckets
if the bucket is able to place its liquid. However, the check for this is
incorrect so the event is not called when a block liquids can destroy is
in front of the dispenser. This commit fixes the check to match the checks
vanilla does when actually using the bucket.

Remapped by Srg2Source from Bukkit/CraftBukkit@33342ecc471d3923e3c7d2eec2a0444b5489b9f1
Pass correct block when dispensing empty buckets. Fixes BUKKIT-3668

Remapped by Srg2Source from Bukkit/CraftBukkit@d1e1c15310eb89775ef64f3d4465d8d79507f8d5