浏览代码

Merge pull request #269 from Glitchfinder/master

Finished adding skill checks for Emerald Ore and Cocoa.
Grant 12 年之前
父节点
当前提交
43fe92fe3f

+ 7 - 2
src/main/java/com/gmail/nossr50/skills/gathering/Herbalism.java

@@ -193,7 +193,7 @@ public class Herbalism {
             break;
             
         case COCOA:
-            if (data == (byte) 0x2) {
+            if ((((byte) data) & 0x8) == 0x8) {
                 mat = Material.COCOA;
                 xp = Config.getInstance().getHerbalismXPCocoa();
             }
@@ -218,7 +218,12 @@ public class Herbalism {
                 is = new ItemStack(ModChecks.getCustomBlock(block).getItemDrop());
             }
             else {
-                is = new ItemStack(mat);
+                if (mat == Material.COCOA) {
+                    is = new ItemStack(Material.INK_SACK, 1, (short) 3);
+                }
+                else {
+                    is = new ItemStack(mat);
+                }
             }
 
             if (herbLevel > MAX_BONUS_LEVEL || random.nextInt(randomChance) <= herbLevel) {

+ 5 - 0
src/main/java/com/gmail/nossr50/util/BlockChecks.java

@@ -52,6 +52,8 @@ public class BlockChecks {
         case VINE:
         case WATER_LILY:
         case YELLOW_FLOWER:
+        case COCOA:
+        case EMERALD_ORE:
             return true;
 
         default:
@@ -123,6 +125,7 @@ public class BlockChecks {
         case IRON_ORE:
         case LAPIS_ORE:
         case REDSTONE_ORE:
+        case EMERALD_ORE:
             return true;
 
         default:
@@ -175,6 +178,7 @@ public class BlockChecks {
         case VINE:
         case WATER_LILY:
         case YELLOW_FLOWER:
+        case COCOA:
             return true;
 
         case CROPS:
@@ -217,6 +221,7 @@ public class BlockChecks {
         case REDSTONE_ORE:
         case SANDSTONE:
         case STONE:
+        case EMERALD_ORE:
             return true;
 
         default: