浏览代码

Fixed ClassCastException with Taming

GJ 13 年之前
父节点
当前提交
4d99fe7230

+ 1 - 0
Changelog.txt

@@ -10,6 +10,7 @@ Key:
 Version 2.0.00-dev
  + Added Ocelots to Taming XP tables
  + Added ability to summon Ocelots with Call of the Wild
+ = Fixed ClassCastException from Taming preventDamage checks
 
 Version 1.3.02
  + Added in game guides for Mining, Excavation, and Acrobatics. Simply type /skillname ? to access them

+ 0 - 10
src/main/java/com/gmail/nossr50/Combat.java

@@ -167,16 +167,6 @@ public class Combat
 			Swords.counterAttackChecks(event);
 			Acrobatics.dodgeChecks(event);
 		}
-	
-		/*			 
-		 * DEFENSIVE CHECKS FOR WOLVES
-		 */
-		//else if(target instanceof Wolf)
-		//{
-		//	Wolf wolf = (Wolf) target;
-		//	if(wolf.isTamed() && (wolf.getOwner() instanceof Player))
-		//		Taming.preventDamage(event, pluginx);
-		//}
 	}
 	
 	public static void combatAbilityChecks(Player attacker, PlayerProfile PPa)

+ 4 - 5
src/main/java/com/gmail/nossr50/listeners/mcBlockListener.java

@@ -309,11 +309,10 @@ public class mcBlockListener implements Listener
     				WoodCutting.leafBlower(player, block);
     			}
     		}
-    		else{
-    			if(inhand.getTypeId() != 359){
-	    			event.setInstaBreak(true);
-	    			WoodCutting.leafBlower(player, block);
-    			}
+    		else if(inhand.getTypeId() != 359)
+    		{
+    			event.setInstaBreak(true);
+    			WoodCutting.leafBlower(player, block);
     		}
     		
     	}

+ 1 - 1
src/main/java/com/gmail/nossr50/listeners/mcEntityListener.java

@@ -124,7 +124,7 @@ public class mcEntityListener implements Listener
     		break;
     	case WOLF:
     		Wolf wolf = (Wolf) entity;
-    		if((!m.isInvincible(wolf, event)) && wolf.isTamed() && wolf.getOwner() != null)
+    		if((!m.isInvincible(wolf, event)) && wolf.isTamed() && (wolf.getOwner() instanceof Player))
     			Taming.preventDamage(event, plugin);
     		break;
     	}