Allow experience on crops grown with bonemeal.

This commit is contained in:
Glitchfinder 2018-05-15 11:31:52 -07:00
parent 906ead53dd
commit 5aa4949baa

View File

@ -2,6 +2,7 @@ package com.gmail.nossr50.listeners;
import java.util.HashSet; import java.util.HashSet;
import org.bukkit.DyeColor;
import org.bukkit.GameMode; import org.bukkit.GameMode;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.Sound; import org.bukkit.Sound;
@ -29,6 +30,7 @@ import org.bukkit.event.player.PlayerRespawnEvent;
import org.bukkit.event.player.PlayerStatisticIncrementEvent; import org.bukkit.event.player.PlayerStatisticIncrementEvent;
import org.bukkit.event.player.PlayerTeleportEvent; import org.bukkit.event.player.PlayerTeleportEvent;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.material.Dye;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.chat.ChatManager; import com.gmail.nossr50.chat.ChatManager;
@ -552,6 +554,20 @@ public class PlayerListener implements Listener {
/* GREEN THUMB CHECK */ /* GREEN THUMB CHECK */
HerbalismManager herbalismManager = mcMMOPlayer.getHerbalismManager(); HerbalismManager herbalismManager = mcMMOPlayer.getHerbalismManager();
if (heldItem.getType() == Material.INK_SACK) {
if (DyeColor.WHITE == ((Dye) heldItem.getData()).getColor()) {
switch (blockState.getType()) {
case BEETROOT_BLOCK:
case CARROT:
case COCOA:
case CROPS:
case NETHER_WARTS:
case POTATO:
mcMMO.getPlaceStore().setFalse(blockState);
}
}
}
if (herbalismManager.canGreenThumbBlock(blockState)) { if (herbalismManager.canGreenThumbBlock(blockState)) {
player.getInventory().setItemInMainHand(new ItemStack(Material.SEEDS, heldItem.getAmount() - 1)); player.getInventory().setItemInMainHand(new ItemStack(Material.SEEDS, heldItem.getAmount() - 1));