mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 15:16:45 +01:00
Replant only the fully grown plants.
This commit is contained in:
parent
d778616b2c
commit
1fcecbd3e7
@ -134,9 +134,6 @@ public class HerbalismManager extends SkillManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (!BlockUtils.isHarvestable(blockState))
|
|
||||||
return;
|
|
||||||
|
|
||||||
xp = ExperienceConfig.getInstance().getXp(skill, blockState.getType());
|
xp = ExperienceConfig.getInstance().getXp(skill, blockState.getType());
|
||||||
|
|
||||||
if (Config.getInstance().getDoubleDropsEnabled(skill, material) && Permissions.secondaryAbilityEnabled(player, SecondaryAbility.HERBALISM_DOUBLE_DROPS)) {
|
if (Config.getInstance().getDoubleDropsEnabled(skill, material) && Permissions.secondaryAbilityEnabled(player, SecondaryAbility.HERBALISM_DOUBLE_DROPS)) {
|
||||||
@ -260,6 +257,9 @@ public class HerbalismManager extends SkillManager {
|
|||||||
* @param greenTerra boolean to determine if greenTerra is active or not
|
* @param greenTerra boolean to determine if greenTerra is active or not
|
||||||
*/
|
*/
|
||||||
private void processGreenThumbPlants(BlockState blockState, boolean greenTerra) {
|
private void processGreenThumbPlants(BlockState blockState, boolean greenTerra) {
|
||||||
|
if (!BlockUtils.isFullyGrown(blockState))
|
||||||
|
return;
|
||||||
|
|
||||||
Player player = getPlayer();
|
Player player = getPlayer();
|
||||||
PlayerInventory playerInventory = player.getInventory();
|
PlayerInventory playerInventory = player.getInventory();
|
||||||
Material seed = null;
|
Material seed = null;
|
||||||
|
@ -355,15 +355,13 @@ public final class BlockUtils {
|
|||||||
return transparentBlocks;
|
return transparentBlocks;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isHarvestable(BlockState blockState) {
|
public static boolean isFullyGrown(BlockState blockState) {
|
||||||
BlockData data = blockState.getBlockData();
|
BlockData data = blockState.getBlockData();
|
||||||
if (data.getMaterial() == Material.CACTUS || data.getMaterial() == Material.SUGAR_CANE)
|
if (data.getMaterial() == Material.CACTUS || data.getMaterial() == Material.SUGAR_CANE)
|
||||||
return true;
|
return true;
|
||||||
if (data instanceof Ageable)
|
if (data instanceof Ageable)
|
||||||
{
|
{
|
||||||
Ageable ageable = (Ageable) data;
|
Ageable ageable = (Ageable) data;
|
||||||
mcMMO.p.debug(ageable.getAge() + "/" + ageable.getMaximumAge());
|
|
||||||
System.out.println(ageable.getAge() + "/" + ageable.getMaximumAge());
|
|
||||||
return ageable.getAge() == ageable.getMaximumAge();
|
return ageable.getAge() == ageable.getMaximumAge();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user