Made anti-dumb wolf checks only apply to tamed wolves

This commit is contained in:
Wizjany 2011-06-08 23:55:07 -04:00
parent e35596b0fa
commit a2c21f8ceb

View File

@ -106,7 +106,7 @@ private void onEntityDamageByBlock(EntityDamageByBlockEvent event) {
ConfigurationManager cfg = plugin.getGlobalStateManager();
WorldConfiguration wcfg = cfg.get(defender.getWorld());
if (defender instanceof Wolf) {
if (defender instanceof Wolf && ((Wolf) defender).isTamed()) {
if (wcfg.antiWolfDumbness && !(type == DamageCause.VOID)) {
event.setCancelled(true);
return;
@ -313,7 +313,7 @@ public void onEntityDamage(EntityDamageEvent event) {
ConfigurationManager cfg = plugin.getGlobalStateManager();
WorldConfiguration wcfg = cfg.get(defender.getWorld());
if (defender instanceof Wolf) {
if (defender instanceof Wolf && ((Wolf) defender).isTamed()) {
if (wcfg.antiWolfDumbness) {
event.setCancelled(true);
return;