mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 07:06:45 +01:00
Add Beetroot to herbalism skill
Merge pull request #2918 from isokissa3/master
His was better.
(cherry picked from commit 3ed0fdf330
)
This commit is contained in:
parent
b1b8c4d713
commit
8901db4e18
@ -87,7 +87,7 @@ public class HerbalismCommand extends SkillCommand {
|
|||||||
protected void permissionsCheck(Player player) {
|
protected void permissionsCheck(Player player) {
|
||||||
hasHylianLuck = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.HYLIAN_LUCK);
|
hasHylianLuck = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.HYLIAN_LUCK);
|
||||||
canGreenTerra = Permissions.greenTerra(player);
|
canGreenTerra = Permissions.greenTerra(player);
|
||||||
canGreenThumbPlants = Permissions.greenThumbPlant(player, Material.CROPS) || Permissions.greenThumbPlant(player, Material.CARROT) || Permissions.greenThumbPlant(player, Material.POTATO) || Permissions.greenThumbPlant(player, Material.NETHER_WARTS) || Permissions.greenThumbPlant(player, Material.COCOA);
|
canGreenThumbPlants = Permissions.greenThumbPlant(player, Material.CROPS) || Permissions.greenThumbPlant(player, Material.CARROT) || Permissions.greenThumbPlant(player, Material.POTATO) || Permissions.greenThumbPlant(player, Material.BEETROOT) || Permissions.greenThumbPlant(player, Material.NETHER_WARTS) || Permissions.greenThumbPlant(player, Material.COCOA);
|
||||||
canGreenThumbBlocks = Permissions.greenThumbBlock(player, Material.DIRT) || Permissions.greenThumbBlock(player, Material.COBBLESTONE) || Permissions.greenThumbBlock(player, Material.COBBLE_WALL) || Permissions.greenThumbBlock(player, Material.SMOOTH_BRICK);
|
canGreenThumbBlocks = Permissions.greenThumbBlock(player, Material.DIRT) || Permissions.greenThumbBlock(player, Material.COBBLESTONE) || Permissions.greenThumbBlock(player, Material.COBBLE_WALL) || Permissions.greenThumbBlock(player, Material.SMOOTH_BRICK);
|
||||||
canFarmersDiet = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.FARMERS_DIET);
|
canFarmersDiet = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.FARMERS_DIET);
|
||||||
canDoubleDrop = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.HERBALISM_DOUBLE_DROPS) && !skill.getDoubleDropsDisabled();
|
canDoubleDrop = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.HERBALISM_DOUBLE_DROPS) && !skill.getDoubleDropsDisabled();
|
||||||
|
@ -576,6 +576,7 @@ public class EntityListener implements Listener {
|
|||||||
* RESTORES 3 HUNGER - RESTORES 5 1/2 HUNGER @
|
* RESTORES 3 HUNGER - RESTORES 5 1/2 HUNGER @
|
||||||
* 1000
|
* 1000
|
||||||
*/
|
*/
|
||||||
|
case BEETROOT:
|
||||||
case BREAD: /* RESTORES 2 1/2 HUNGER - RESTORES 5 HUNGER @ 1000 */
|
case BREAD: /* RESTORES 2 1/2 HUNGER - RESTORES 5 HUNGER @ 1000 */
|
||||||
case CARROT_ITEM: /*
|
case CARROT_ITEM: /*
|
||||||
* RESTORES 2 HUNGER - RESTORES 4 1/2 HUNGER @
|
* RESTORES 2 HUNGER - RESTORES 4 1/2 HUNGER @
|
||||||
|
@ -321,7 +321,7 @@ public class HerbalismManager extends SkillManager {
|
|||||||
case POTATO:
|
case POTATO:
|
||||||
seed = Material.POTATO_ITEM;
|
seed = Material.POTATO_ITEM;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BEETROOT_BLOCK:
|
case BEETROOT_BLOCK:
|
||||||
seed = Material.BEETROOT_SEEDS;
|
seed = Material.BEETROOT_SEEDS;
|
||||||
break;
|
break;
|
||||||
@ -353,6 +353,10 @@ public class HerbalismManager extends SkillManager {
|
|||||||
blockState.setMetadata(mcMMO.greenThumbDataKey, new FixedMetadataValue(mcMMO.p, (int) (System.currentTimeMillis() / Misc.TIME_CONVERSION_FACTOR)));
|
blockState.setMetadata(mcMMO.greenThumbDataKey, new FixedMetadataValue(mcMMO.p, (int) (System.currentTimeMillis() / Misc.TIME_CONVERSION_FACTOR)));
|
||||||
|
|
||||||
switch (blockState.getType()) {
|
switch (blockState.getType()) {
|
||||||
|
|
||||||
|
case POTATO:
|
||||||
|
case CARROT:
|
||||||
|
case BEETROOT_BLOCK:
|
||||||
case CROPS:
|
case CROPS:
|
||||||
Crops crops = (Crops) blockState.getData();
|
Crops crops = (Crops) blockState.getData();
|
||||||
|
|
||||||
@ -378,18 +382,6 @@ public class HerbalismManager extends SkillManager {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case BEETROOT_BLOCK:
|
|
||||||
case CARROT:
|
|
||||||
case POTATO:
|
|
||||||
if (greenTerra) {
|
|
||||||
blockState.setRawData(CropState.MEDIUM.getData());
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
blockState.setRawData(greenThumbStage);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
|
|
||||||
case NETHER_WARTS:
|
case NETHER_WARTS:
|
||||||
NetherWarts warts = (NetherWarts) blockState.getData();
|
NetherWarts warts = (NetherWarts) blockState.getData();
|
||||||
|
|
||||||
|
@ -147,11 +147,9 @@ public final class BlockUtils {
|
|||||||
case YELLOW_FLOWER:
|
case YELLOW_FLOWER:
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
case BEETROOT_BLOCK:
|
||||||
case CARROT:
|
case CARROT:
|
||||||
case POTATO:
|
case POTATO:
|
||||||
case BEETROOT_BLOCK:
|
|
||||||
return blockState.getRawData() == CropState.RIPE.getData();
|
|
||||||
|
|
||||||
case CROPS:
|
case CROPS:
|
||||||
return ((Crops) blockState.getData()).getState() == CropState.RIPE;
|
return ((Crops) blockState.getData()).getState() == CropState.RIPE;
|
||||||
|
|
||||||
|
@ -592,6 +592,8 @@ public final class ItemUtils {
|
|||||||
case CHORUS_FRUIT:
|
case CHORUS_FRUIT:
|
||||||
case CHORUS_FLOWER:
|
case CHORUS_FLOWER:
|
||||||
case POTATO_ITEM:
|
case POTATO_ITEM:
|
||||||
|
case BEETROOT:
|
||||||
|
case BEETROOT_SEEDS:
|
||||||
case NETHER_WARTS:
|
case NETHER_WARTS:
|
||||||
case BROWN_MUSHROOM:
|
case BROWN_MUSHROOM:
|
||||||
case RED_MUSHROOM:
|
case RED_MUSHROOM:
|
||||||
|
@ -408,6 +408,7 @@ Skills:
|
|||||||
###
|
###
|
||||||
Double_Drops:
|
Double_Drops:
|
||||||
Herbalism:
|
Herbalism:
|
||||||
|
Beetroot_Block: true
|
||||||
Brown_Mushroom: true
|
Brown_Mushroom: true
|
||||||
Beetroot_Block: true
|
Beetroot_Block: true
|
||||||
Cactus: true
|
Cactus: true
|
||||||
|
@ -340,6 +340,7 @@ permissions:
|
|||||||
mcmmo.ability.herbalism.greenthumb.plants.crops: true
|
mcmmo.ability.herbalism.greenthumb.plants.crops: true
|
||||||
mcmmo.ability.herbalism.greenthumb.plants.netherwarts: true
|
mcmmo.ability.herbalism.greenthumb.plants.netherwarts: true
|
||||||
mcmmo.ability.herbalism.greenthumb.plants.potato: true
|
mcmmo.ability.herbalism.greenthumb.plants.potato: true
|
||||||
|
mcmmo.ability.herbalism.greenthumb.plants.beetroot: true
|
||||||
mcmmo.ability.herbalism.greenthumb.plants.carrot:
|
mcmmo.ability.herbalism.greenthumb.plants.carrot:
|
||||||
description: Allows access to the Green Thumb ability for carrots
|
description: Allows access to the Green Thumb ability for carrots
|
||||||
mcmmo.ability.herbalism.greenthumb.plants.cocoa:
|
mcmmo.ability.herbalism.greenthumb.plants.cocoa:
|
||||||
@ -350,6 +351,8 @@ permissions:
|
|||||||
description: Allows access to the Green Thumb ability for netherwart
|
description: Allows access to the Green Thumb ability for netherwart
|
||||||
mcmmo.ability.herbalism.greenthumb.plants.potato:
|
mcmmo.ability.herbalism.greenthumb.plants.potato:
|
||||||
description: Allows access to the Green Thumb ability for potatoes
|
description: Allows access to the Green Thumb ability for potatoes
|
||||||
|
mcmmo.ability.herbalism.greenthumb.plants.beetroot:
|
||||||
|
description: Allows access to the Green Thumb ability for beetrootes
|
||||||
mcmmo.ability.herbalism.hylianluck:
|
mcmmo.ability.herbalism.hylianluck:
|
||||||
description: Allows access to the Hylian Luck ability
|
description: Allows access to the Hylian Luck ability
|
||||||
mcmmo.ability.herbalism.shroomthumb:
|
mcmmo.ability.herbalism.shroomthumb:
|
||||||
|
Loading…
Reference in New Issue
Block a user