浏览代码

Change isHerbalismDrop to use strings.. this method still needs more work

nossr50 2 年之前
父节点
当前提交
cd96bc79d8
共有 2 个文件被更改,包括 28 次插入25 次删除
  1. 1 0
      Changelog.txt
  2. 27 25
      src/main/java/com/gmail/nossr50/util/ItemUtils.java

+ 1 - 0
Changelog.txt

@@ -16,6 +16,7 @@ Version 2.1.219
     Added 'Stripped_Cherry_Log' to woodcutting experience in experience.yml
     Added 'Stripped_Cherry_Log' to woodcutting experience in experience.yml
     Added 'Stripped_Cherry_Wood' to woodcutting experience in experience.yml
     Added 'Stripped_Cherry_Wood' to woodcutting experience in experience.yml
     Added 'Skills.Mining.BlastMining.Bonus_Drops.Enabled' to advanced.yml to enable/disable bonus drops from Blast Mining
     Added 'Skills.Mining.BlastMining.Bonus_Drops.Enabled' to advanced.yml to enable/disable bonus drops from Blast Mining
+    NOTE: There are plans to add experience for discovering items via the new brushing mechanic, but this will have to wait for new Spigot API to become available
 
 
 Version 2.1.218
 Version 2.1.218
     Fixed locale pt_BR type (thanks MrPowerGamerBR)
     Fixed locale pt_BR type (thanks MrPowerGamerBR)

+ 27 - 25
src/main/java/com/gmail/nossr50/util/ItemUtils.java

@@ -22,6 +22,7 @@ import org.jetbrains.annotations.Nullable;
 
 
 import java.util.Collections;
 import java.util.Collections;
 import java.util.List;
 import java.util.List;
+import java.util.Locale;
 
 
 public final class ItemUtils {
 public final class ItemUtils {
     /**
     /**
@@ -413,31 +414,31 @@ public final class ItemUtils {
      */
      */
     public static boolean isHerbalismDrop(ItemStack item) {
     public static boolean isHerbalismDrop(ItemStack item) {
         //TODO: 1.14 This needs to be updated
         //TODO: 1.14 This needs to be updated
-        switch (item.getType()) {
-            case WHEAT:
-            case WHEAT_SEEDS:
-            case CARROT:
-            case CHORUS_FRUIT:
-            case CHORUS_FLOWER:
-            case POTATO:
-            case BEETROOT:
-            case BEETROOTS:
-            case BEETROOT_SEEDS:
-            case NETHER_WART:
-            case BROWN_MUSHROOM:
-            case RED_MUSHROOM:
-            case ROSE_BUSH:
-            case DANDELION:
-            case CACTUS:
-            case SUGAR_CANE:
-            case MELON:
-            case MELON_SEEDS:
-            case PUMPKIN:
-            case PUMPKIN_SEEDS:
-            case LILY_PAD:
-            case VINE:
-            case TALL_GRASS:
-            case COCOA_BEANS:
+        switch (item.getType().getKey().getKey().toLowerCase()) {
+            case "wheat":
+            case "wheat_seeds":
+            case "carrot":
+            case "chorus_fruit":
+            case "chorus_flower":
+            case "potato":
+            case "beetroot":
+            case "beetroots":
+            case "beetroot_seeds":
+            case "nether_wart":
+            case "brown_mushroom":
+            case "red_mushroom":
+            case "rose_bush":
+            case "dandelion":
+            case "cactus":
+            case "sugar_cane":
+            case "melon":
+            case "melon_seeds":
+            case "pumpkin":
+            case "pumpkin_seeds":
+            case "lily_pad":
+            case "vine":
+            case "tall_grass":
+            case "cocoa_beans":
                 return true;
                 return true;
 
 
             default:
             default:
@@ -445,6 +446,7 @@ public final class ItemUtils {
         }
         }
     }
     }
 
 
+
     /**
     /**
      * Checks to see if an item is a mob drop.
      * Checks to see if an item is a mob drop.
      *
      *