Skip to content

Commit

Permalink
Change isHerbalismDrop to use strings.. this method still needs more …
Browse files Browse the repository at this point in the history
…work
  • Loading branch information
nossr50 committed Apr 3, 2023
1 parent ae961ca commit cd96bc7
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 25 deletions.
1 change: 1 addition & 0 deletions Changelog.txt
Expand Up @@ -16,6 +16,7 @@ Version 2.1.219
Added 'Stripped_Cherry_Log' 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
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
Fixed locale pt_BR type (thanks MrPowerGamerBR)
Expand Down
52 changes: 27 additions & 25 deletions src/main/java/com/gmail/nossr50/util/ItemUtils.java
Expand Up @@ -22,6 +22,7 @@

import java.util.Collections;
import java.util.List;
import java.util.Locale;

public final class ItemUtils {
/**
Expand Down Expand Up @@ -413,38 +414,39 @@ public static boolean isMiningDrop(ItemStack item) {
*/
public static boolean isHerbalismDrop(ItemStack item) {
//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;

default:
return false;
}
}


/**
* Checks to see if an item is a mob drop.
*
Expand Down

0 comments on commit cd96bc7

Please sign in to comment.