Permalink
Browse files

[2.5.4] Added bats to animal spawning rules

  • Loading branch information...
1 parent 0a893af commit 19ea5b2aea1f9c4187cdcbb2e489c6c3318ccf08 @Meaglin committed Nov 30, 2012
View
@@ -60,7 +60,7 @@
<exclude name="META-INF/*" />
</zipfileset> -->
</jar>
- <zip destfile="../Zones-2.5.3.zip" >
+ <zip destfile="../Zones-2.5.4.zip" >
<fileset dir=".." includes="Zones.jar" />
<zipfileset dir="${src}/com/zones/config/" >
<include name="*.properties" />
View
@@ -1,6 +1,6 @@
name: Zones
main: com.zones.Zones
-version: 2.5.3
+version: 2.5.4
authors: [ 'Meaglin', 'Mysteryman', 'GunterDW' ]
softdepend: [ 'EasyBind' ]
website: https://github.com/Meaglin/0xFFFF
@@ -230,7 +230,7 @@ public void onPaintingPlace(HangingPlaceEvent event) {
@EventHandler(ignoreCancelled = true)
public void onPaintingBreak(HangingBreakByEntityEvent event) {
if(!(event instanceof HangingBreakByEntityEvent)) return;
- Entity entity = ((HangingBreakByEntityEvent)event).getRemover();
+ Entity entity = event.getRemover();
if(entity == null) return;
if(!(entity instanceof Player)) return;
@@ -11,6 +11,7 @@
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
+import org.bukkit.entity.Ambient;
import org.bukkit.entity.Animals;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
@@ -550,7 +551,7 @@ public boolean canReceiveSpecificDamage(Player player, DamageCause cause) {
}
public boolean canSpawn(Entity entity, EntityType type) {
- if(entity instanceof Animals) {
+ if(entity instanceof Animals || entity instanceof Ambient) {
return this.ANIMAL_SPAWNING_ENABLED && (!this.ALLOWED_ANIMALS_ENABLED || this.ALLOWED_ANIMALS.contains(type));
} else if(entity instanceof Monster || entity instanceof Flying || entity instanceof Slime) {
return this.MOB_SPAWNING_ENABLED && (!this.ALLOWED_MOBS_ENABLED || this.ALLOWED_MOBS.contains(type));
@@ -2,6 +2,7 @@
import java.util.List;
+import org.bukkit.entity.Ambient;
import org.bukkit.entity.Animals;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
@@ -17,7 +18,7 @@
@Override
public boolean isAllowed(ZoneBase zone, Entity entity, EntityType type) {
- if(entity instanceof Animals) {
+ if(entity instanceof Animals || entity instanceof Ambient) {
if(zone.getFlag(ZoneVar.ANIMALS)) {
Object obj = zone.getSetting(ZoneVar.ALLOWED_ANIMALS);
if(obj != null) {

0 comments on commit 19ea5b2

Please sign in to comment.