From 569079fed0f0c50ef6eb2c20d36056cc2d2d84f1 Mon Sep 17 00:00:00 2001 From: Glitchfinder Date: Thu, 6 Dec 2012 11:11:12 -0800 Subject: [PATCH] Fixing build issues caused by recent changes to CraftBukkit. --- pom.xml | 7 ----- .../nossr50/skills/gathering/Fishing.java | 26 ++++++++++++++++--- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/pom.xml b/pom.xml index e009a0400..73c0974a5 100755 --- a/pom.xml +++ b/pom.xml @@ -121,13 +121,6 @@ jar compile - - org.bukkit - craftbukkit - LATEST - jar - compile - org.getspout spoutpluginapi diff --git a/src/main/java/com/gmail/nossr50/skills/gathering/Fishing.java b/src/main/java/com/gmail/nossr50/skills/gathering/Fishing.java index 96ad412f5..858464fb5 100755 --- a/src/main/java/com/gmail/nossr50/skills/gathering/Fishing.java +++ b/src/main/java/com/gmail/nossr50/skills/gathering/Fishing.java @@ -1,5 +1,6 @@ package com.gmail.nossr50.skills.gathering; +import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -17,8 +18,6 @@ import org.bukkit.event.player.PlayerFishEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.material.Wool; -import org.bukkit.craftbukkit.entity.CraftSkeleton; - import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.TreasuresConfig; @@ -338,7 +337,28 @@ public class Fishing { break; case SKELETON: - if (((CraftSkeleton) le).getHandle().getSkeletonType() == 1) { + Object o; + Class c; + Method m; + + o = le; + c = o.getClass(); + + boolean isWitherSkeleton = false; + + try { + m = c.getDeclaredMethod("getHandle"); + o = m.invoke(o); + + c = o.getClass(); + m = c.getDeclaredMethod("getSkeletonType"); + o = m.invoke(o); + + if(o instanceof Integer) + isWitherSkeleton = (((Integer) o) == 1); + } catch(Exception e) {} + + if (isWitherSkeleton) { if (DROP_NUMBER > 95) { Misc.dropItem(location, new ItemStack(Material.SKULL_ITEM, 1, (short) 1)); } else if (DROP_NUMBER > 50) {