mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 07:06:45 +01:00
Allow experience on crops grown with bonemeal.
This commit is contained in:
parent
906ead53dd
commit
5aa4949baa
@ -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));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user