Major updates to Herbalism.

This commit is contained in:
GJ 2012-03-10 13:03:31 -05:00
parent 5d55af8183
commit ce8ddded92
5 changed files with 273 additions and 287 deletions

View File

@ -147,7 +147,7 @@ public class BlockChecks {
case RED_ROSE: case RED_ROSE:
case YELLOW_FLOWER: case YELLOW_FLOWER:
case WATER_LILY: case WATER_LILY:
addToChangeQueue = false; //We don't want these added to chaneQueue - they're already being added to the fast queue addToChangeQueue = false; //We don't want these added to changeQueue - they're already being added to the fast queue
plugin.fastChangeQueue.push(block); plugin.fastChangeQueue.push(block);
break; break;

View File

@ -208,7 +208,7 @@ public enum AbilityType
case GIGA_DRILL_BREAKER: case GIGA_DRILL_BREAKER:
return Excavation.canBeGigaDrillBroken(block); return Excavation.canBeGigaDrillBroken(block);
case GREEN_TERRA: case GREEN_TERRA:
return Herbalism.canBeGreenTerra(block); return Herbalism.makeMossy(block.getType());
case LEAF_BLOWER: case LEAF_BLOWER:
return block.getType().equals(Material.LEAVES); return block.getType().equals(Material.LEAVES);
case SUPER_BREAKER: case SUPER_BREAKER:

View File

@ -62,7 +62,7 @@ public class mcBlockListener implements Listener {
/* Code to prevent issues with placed falling Sand/Gravel not being tracked */ /* Code to prevent issues with placed falling Sand/Gravel not being tracked */
if (mat.equals(Material.SAND) || mat.equals(Material.GRAVEL)) { if (mat.equals(Material.SAND) || mat.equals(Material.GRAVEL)) {
for (int y = -1; y + block.getY() >= 0 ; y--) { for (int y = -1; y + block.getY() >= 0; y--) {
if (block.getRelative(0, y, 0).getType().equals(Material.AIR)) { if (block.getRelative(0, y, 0).getType().equals(Material.AIR)) {
continue; continue;
} }
@ -121,17 +121,17 @@ public class mcBlockListener implements Listener {
*/ */
//Green Terra //Green Terra
if (PP.getHoePreparationMode() && mcPermissions.getInstance().herbalismAbility(player) && ((mat.equals(Material.CROPS) && block.getData() == (byte) 0x7) || Herbalism.canBeGreenTerra(block))) { if (PP.getHoePreparationMode() && mcPermissions.getInstance().herbalismAbility(player) && ((mat.equals(Material.CROPS) && block.getData() == (byte) 0x7) || Herbalism.canBeGreenTerra(mat))) {
Skills.abilityCheck(player, SkillType.HERBALISM); Skills.abilityCheck(player, SkillType.HERBALISM);
} }
//Wheat && Triple drops //Wheat && Triple drops
if (PP.getGreenTerraMode() && Herbalism.canBeGreenTerra(block)) { if (PP.getGreenTerraMode() && Herbalism.canBeGreenTerra(mat)) {
Herbalism.herbalismProcCheck(block, player, event, plugin); Herbalism.herbalismProcCheck(block, player, event, plugin);
Herbalism.herbalismProcCheck(block, player, event, plugin); //Called twice for triple drop functionality Herbalism.herbalismProcCheck(block, player, event, plugin); //Called twice for triple drop functionality
} }
if (mcPermissions.getInstance().herbalism(player) && block.getData() != (byte) 0x5 && Herbalism.canBeGreenTerra(block)) { if (mcPermissions.getInstance().herbalism(player) && block.getData() != (byte) 0x5 && Herbalism.canBeGreenTerra(mat)) {
Herbalism.herbalismProcCheck(block, player, event, plugin); Herbalism.herbalismProcCheck(block, player, event, plugin);
} }
@ -204,7 +204,7 @@ public class mcBlockListener implements Listener {
* ABILITY PREPARATION CHECKS * ABILITY PREPARATION CHECKS
*/ */
if (BlockChecks.abilityBlockCheck(mat)) { if (BlockChecks.abilityBlockCheck(mat)) {
if (PP.getHoePreparationMode() && Herbalism.canBeGreenTerra(block)) { if (PP.getHoePreparationMode() && Herbalism.canBeGreenTerra(mat)) {
Skills.abilityCheck(player, SkillType.HERBALISM); Skills.abilityCheck(player, SkillType.HERBALISM);
} }
else if (PP.getAxePreparationMode() && mat.equals(Material.LOG) && mcPermissions.getInstance().woodCuttingAbility(player)) { //Why are we checking the permissions here? else if (PP.getAxePreparationMode() && mat.equals(Material.LOG) && mcPermissions.getInstance().woodCuttingAbility(player)) { //Why are we checking the permissions here?
@ -229,11 +229,10 @@ public class mcBlockListener implements Listener {
/* /*
* ABILITY TRIGGER CHECKS * ABILITY TRIGGER CHECKS
*/ */
if (PP.getGreenTerraMode() && mcPermissions.getInstance().herbalismAbility(player)) { if (PP.getGreenTerraMode() && mcPermissions.getInstance().herbalismAbility(player) && Herbalism.makeMossy(mat)) {
Herbalism.greenTerra(player, block); Herbalism.greenTerra(player, block);
} }
else if (PP.getGigaDrillBreakerMode() && Skills.triggerCheck(player, block, AbilityType.GIGA_DRILL_BREAKER)) {
if (PP.getGigaDrillBreakerMode() && Skills.triggerCheck(player, block, AbilityType.GIGA_DRILL_BREAKER)) {
if (LoadProperties.excavationRequiresShovel && ItemChecks.isShovel(inhand)) { if (LoadProperties.excavationRequiresShovel && ItemChecks.isShovel(inhand)) {
event.setInstaBreak(true); event.setInstaBreak(true);
Excavation.gigaDrillBreaker(player, block); Excavation.gigaDrillBreaker(player, block);
@ -243,7 +242,7 @@ public class mcBlockListener implements Listener {
Excavation.gigaDrillBreaker(player, block); Excavation.gigaDrillBreaker(player, block);
} }
} }
if (PP.getBerserkMode() && Skills.triggerCheck(player, block, AbilityType.BERSERK)) { else if (PP.getBerserkMode() && Skills.triggerCheck(player, block, AbilityType.BERSERK)) {
if (inhand.getType().equals(Material.AIR)) { if (inhand.getType().equals(Material.AIR)) {
PlayerAnimationEvent armswing = new PlayerAnimationEvent(player); PlayerAnimationEvent armswing = new PlayerAnimationEvent(player);
Bukkit.getPluginManager().callEvent(armswing); Bukkit.getPluginManager().callEvent(armswing);
@ -255,7 +254,7 @@ public class mcBlockListener implements Listener {
SpoutStuff.playSoundForPlayer(SoundEffect.POP, player, block.getLocation()); SpoutStuff.playSoundForPlayer(SoundEffect.POP, player, block.getLocation());
} }
} }
if (PP.getSuperBreakerMode() && Skills.triggerCheck(player, block, AbilityType.SUPER_BREAKER)) { else if (PP.getSuperBreakerMode() && Skills.triggerCheck(player, block, AbilityType.SUPER_BREAKER)) {
if (LoadProperties.miningrequirespickaxe && ItemChecks.isMiningPick(inhand)) { if (LoadProperties.miningrequirespickaxe && ItemChecks.isMiningPick(inhand)) {
event.setInstaBreak(true); event.setInstaBreak(true);
Mining.SuperBreakerBlockCheck(player, block, plugin); Mining.SuperBreakerBlockCheck(player, block, plugin);
@ -265,7 +264,7 @@ public class mcBlockListener implements Listener {
Mining.SuperBreakerBlockCheck(player, block, plugin); Mining.SuperBreakerBlockCheck(player, block, plugin);
} }
} }
if (PP.getSkillLevel(SkillType.WOODCUTTING) >= 100 && event.getBlock().getType() == Material.LEAVES) { else if (PP.getSkillLevel(SkillType.WOODCUTTING) >= 100 && mat.equals(Material.LEAVES)) {
if (LoadProperties.woodcuttingrequiresaxe && ItemChecks.isAxe(inhand)) { if (LoadProperties.woodcuttingrequiresaxe && ItemChecks.isAxe(inhand)) {
if(Skills.triggerCheck(player, block, AbilityType.LEAF_BLOWER)) { if(Skills.triggerCheck(player, block, AbilityType.LEAF_BLOWER)) {
event.setInstaBreak(true); event.setInstaBreak(true);

View File

@ -3,7 +3,6 @@ package com.gmail.nossr50.skills;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.block.BlockBreakEvent;
@ -17,280 +16,266 @@ import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.datatypes.SkillType;
public class Herbalism public class Herbalism {
{
public static void greenTerra(Player player, Block block){ /**
PlayerInventory inventory = player.getInventory(); * Activate the Green Terra ability.
boolean hasSeeds = inventory.contains(Material.SEEDS); *
if(block.getType().equals(Material.COBBLESTONE) || block.getType().equals(Material.DIRT) || block.getType().equals(Material.SMOOTH_BRICK)){ * @param player The player activating the ability
if(!hasSeeds) * @param block The block to be changed by Green Terra
player.sendMessage("You need more seeds to spread Green Terra"); */
if(hasSeeds && !block.getType().equals(Material.WHEAT)) public static void greenTerra(Player player, Block block) {
{ PlayerInventory inventory = player.getInventory();
inventory.removeItem(new ItemStack(Material.SEEDS, 1)); boolean hasSeeds = inventory.contains(Material.SEEDS);
player.updateInventory(); Material type = block.getType();
if(LoadProperties.enableSmoothToMossy && block.getType().equals(Material.SMOOTH_BRICK))
block.setData((byte) 0x1); if (!hasSeeds) {
if(LoadProperties.enableDirtToGrass && block.getType().equals(Material.DIRT)) player.sendMessage("You need more seeds to spread Green Terra");
block.setType(Material.GRASS); }
if(LoadProperties.enableCobbleToMossy && block.getType().equals(Material.COBBLESTONE)) else if (hasSeeds && !block.getType().equals(Material.WHEAT)) {
block.setType(Material.MOSSY_COBBLESTONE); inventory.removeItem(new ItemStack(Material.SEEDS, 1));
} player.updateInventory();
}
} if (LoadProperties.enableSmoothToMossy && type.equals(Material.SMOOTH_BRICK)) {
block.setData((byte) 0x1);
public static Boolean canBeGreenTerra(Block block){ }
switch(block.getType()){ else if (LoadProperties.enableDirtToGrass && type.equals(Material.DIRT)) {
case BROWN_MUSHROOM: block.setType(Material.GRASS);
case CACTUS: }
case COBBLESTONE: else if (LoadProperties.enableCobbleToMossy && type.equals(Material.COBBLESTONE)) {
case CROPS: block.setType(Material.MOSSY_COBBLESTONE);
case DIRT: }
case JACK_O_LANTERN: }
case MELON_BLOCK:
case PUMPKIN:
case RED_MUSHROOM:
case RED_ROSE:
case SMOOTH_BRICK:
case SUGAR_CANE_BLOCK:
case VINE:
case WATER_LILY:
case YELLOW_FLOWER:
return true;
}
return false;
} }
public static void herbalismProcCheck(final Block block, Player player, BlockBreakEvent event, mcMMO plugin) /**
{ * Check if a block can be made mossy.
final PlayerProfile PP = Users.getProfile(player); *
int herbLevel = PP.getSkillLevel(SkillType.HERBALISM); * @param material The type of Block to check
int type = block.getTypeId(); * @return true if the block can be made mossy, false otherwise
Location loc = block.getLocation(); */
ItemStack is = null; public static Boolean makeMossy(Material type) {
Material mat = null; switch (type) {
PlayerInventory inventory = player.getInventory(); case COBBLESTONE:
boolean hasSeeds = inventory.contains(Material.SEEDS); case DIRT:
case SMOOTH_BRICK:
if(plugin.misc.blockWatchList.contains(block)) return true;
{
return; default:
} return false;
}
//Wheat }
if(type == 59 && block.getData() == (byte) 0x7)
{ /**
is = new ItemStack(Material.WHEAT, 1); * Check if a block is affected by Herbalism abilities.
PP.addXP(SkillType.HERBALISM, LoadProperties.mwheat, player); *
* @param type The type of Block to check
if(player != null) * @return true if the block is affected, false otherwise
{ */
if(herbLevel > 1000 || (Math.random() * 1000 <= herbLevel)) public static Boolean canBeGreenTerra(Material type){
m.mcDropItem(loc, is); switch (type) {
} case BROWN_MUSHROOM:
case CACTUS:
//GREEN THUMB case CROPS:
if(hasSeeds && PP.getGreenTerraMode() || hasSeeds && (herbLevel >= 1500 || (Math.random() * 1500 <= herbLevel))) case JACK_O_LANTERN:
{ case MELON_BLOCK:
event.setCancelled(true); case PUMPKIN:
m.mcDropItem(loc, is); case RED_MUSHROOM:
//DROP SOME SEEDS case RED_ROSE:
is = new ItemStack(Material.SEEDS, 1); case SUGAR_CANE_BLOCK:
m.mcDropItem(loc, is); case VINE:
case WATER_LILY:
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() { case YELLOW_FLOWER:
public void run() { return true;
block.setType(Material.CROPS);
//This replants the wheat at a certain stage in development based on Herbalism Skill default:
if(!PP.getGreenTerraMode()) return false;
{ }
if (PP.getSkillLevel(SkillType.HERBALISM) >= 600) }
block.setData((byte) 0x4);
else if (PP.getSkillLevel(SkillType.HERBALISM) >= 400) /**
block.setData((byte) 0x3); * Check for extra Herbalism drops.
else if (PP.getSkillLevel(SkillType.HERBALISM) >= 200) *
block.setData((byte) 0x2); * @param block The block to check for extra drops
else * @param player The player getting extra drops
block.setData((byte) 0x1); * @param event The event to use for Green Thumb
} else * @param plugin mcMMO plugin instance
block.setData((byte) 0x4); */
public static void herbalismProcCheck(final Block block, Player player, BlockBreakEvent event, mcMMO plugin) {
final PlayerProfile PP = Users.getProfile(player);
int herbLevel = PP.getSkillLevel(SkillType.HERBALISM);
int id = block.getTypeId();
Material type = block.getType();
Byte data = block.getData();
Location loc = block.getLocation();
Material mat = null;
int xp = 0;
int catciDrops = 0;
int caneDrops = 0;
switch (type) {
case BROWN_MUSHROOM:
case RED_MUSHROOM:
if (data != (byte) 0x5) {
mat = Material.getMaterial(id);
xp = LoadProperties.mmushroom;
}
break;
case CACTUS:
for (int y = 0; y <= 2; y++) {
Block b = block.getRelative(0, y, 0);
if (b.getType().equals(Material.CACTUS)) {
mat = Material.CACTUS;
if (!plugin.misc.blockWatchList.contains(b)) {
if(herbLevel > 1000 || (Math.random() * 1000 <= herbLevel)) {
catciDrops++;
}
xp += LoadProperties.mcactus;
} }
}, 1); }
}
inventory.removeItem(new ItemStack(Material.SEEDS, 1)); break;
player.updateInventory();
} case CROPS:
} if (data == (byte) 0x7) {
mat = Material.WHEAT;
//Nether Wart xp = LoadProperties.mwheat;
if(type == 115 && block.getData() == (byte) 0x3) greenThumb(block, player, event, plugin);
{ }
is = new ItemStack(Material.NETHER_STALK, 1); break;
PP.addXP(SkillType.HERBALISM, LoadProperties.mnetherwart, player);
if(player != null) case MELON_BLOCK:
{ if (data != (byte) 0x5) {
if(herbLevel > 1000 || (Math.random() * 1000 <= herbLevel)) mat = Material.MELON;
{ xp = LoadProperties.mmelon;
m.mcDropItems(loc, is, 2); }
m.mcRandomDropItems(loc, is, 50, 3); break;
}
} case NETHER_WARTS:
} if (data == (byte) 0x3) {
mat = Material.NETHER_STALK;
/* xp = LoadProperties.mnetherwart;
* We need to check not-wheat and not-netherwart stuff for if it was placed by the player or not }
*/ break;
if(block.getData() != (byte) 5)
{ case PUMPKIN:
//Cactus case JACK_O_LANTERN:
if(type == 81){ if (!plugin.misc.blockWatchList.contains(block)) {
//Setup the loop mat = Material.getMaterial(id);
World world = block.getWorld(); xp = LoadProperties.mpumpkin;
Block[] blockArray = new Block[3]; }
blockArray[0] = block; break;
blockArray[1] = world.getBlockAt(block.getX(), block.getY()+1, block.getZ());
blockArray[2] = world.getBlockAt(block.getX(), block.getY()+2, block.getZ()); case RED_ROSE:
case YELLOW_FLOWER:
Material[] materialArray = new Material[3]; if (!plugin.misc.blockWatchList.contains(block)) {
materialArray[0] = blockArray[0].getType(); mat = Material.getMaterial(id);
materialArray[1] = blockArray[1].getType(); xp = LoadProperties.mflower;
materialArray[2] = blockArray[2].getType(); }
break;
byte[] byteArray = new byte[3];
byteArray[0] = blockArray[0].getData(); case SUGAR_CANE_BLOCK:
byteArray[1] = blockArray[0].getData(); for (int y = 0; y <= 2; y++) {
byteArray[2] = blockArray[0].getData(); Block b = block.getRelative(0, y, 0);
if (b.getType().equals(Material.SUGAR_CANE_BLOCK)) {
int x = 0; mat = Material.SUGAR_CANE;
for(Block target : blockArray) if (!plugin.misc.blockWatchList.contains(b)) {
{ if(herbLevel > 1000 || (Math.random() * 1000 <= herbLevel)) {
if(materialArray[x] == Material.CACTUS) caneDrops++;
{ }
is = new ItemStack(Material.CACTUS, 1); xp += LoadProperties.msugar;
if(byteArray[x] != (byte) 5) }
{ }
if(herbLevel > 1000 || (Math.random() * 1000 <= herbLevel)) }
{ break;
m.mcDropItem(target.getLocation(), is);
} case VINE:
PP.addXP(SkillType.HERBALISM, LoadProperties.mcactus, player); if (!plugin.misc.blockWatchList.contains(block)) {
} mat = type;
} xp = LoadProperties.mvines;
x++; }
} break;
}
//Sugar Canes case WATER_LILY:
if(type == 83) if (data != (byte) 0x5) {
{ mat = type;
//Setup the loop xp = LoadProperties.mlilypad;
World world = block.getWorld(); }
Block[] blockArray = new Block[3]; break;
blockArray[0] = block;
blockArray[1] = world.getBlockAt(block.getX(), block.getY()+1, block.getZ()); default:
blockArray[2] = world.getBlockAt(block.getX(), block.getY()+2, block.getZ()); break;
}
Material[] materialArray = new Material[3];
materialArray[0] = blockArray[0].getType(); ItemStack is = new ItemStack(mat);
materialArray[1] = blockArray[1].getType();
materialArray[2] = blockArray[2].getType(); if (herbLevel > 1000 || (Math.random() * 1000 <= herbLevel)) {
if (type.equals(Material.CACTUS)) {
byte[] byteArray = new byte[3]; m.mcDropItems(loc, is, catciDrops);
byteArray[0] = blockArray[0].getData(); }
byteArray[1] = blockArray[0].getData(); else if (type.equals(Material.MELON_BLOCK)) {
byteArray[2] = blockArray[0].getData(); m.mcDropItems(loc, is, 3);
m.mcRandomDropItems(loc, is, 50, 4);
int x = 0; }
for(Block target : blockArray) else if (type.equals(Material.NETHER_WARTS)) {
{ m.mcDropItems(loc, is, 2);
if(materialArray[x] == Material.SUGAR_CANE_BLOCK) m.mcRandomDropItems(loc, is, 50, 3);
{ }
is = new ItemStack(Material.SUGAR_CANE, 1); else if (type.equals(Material.SUGAR_CANE_BLOCK)) {
//Check for being placed by the player m.mcDropItems(loc, is, caneDrops);
if(byteArray[x] != (byte) 5) }
{ else {
if(herbLevel > 1000 || (Math.random() * 1000 <= herbLevel)) m.mcDropItem(loc, is);
{ }
m.mcDropItem(target.getLocation(), is); }
}
PP.addXP(SkillType.HERBALISM, LoadProperties.msugar, player); PP.addXP(SkillType.HERBALISM, xp, player);
} Skills.XpCheckSkill(SkillType.HERBALISM, player);
} }
x++;
} /**
} * Apply the Green Thumb ability.
*
//Pumpkins * @param block The block to apply the ability to
if((type == 91 || type == 86)) * @param player The player using the ability
{ * @param event The event triggering the ability
mat = Material.getMaterial(block.getTypeId()); * @param plugin mcMMO plugin instance
is = new ItemStack(mat, 1); */
if(player != null) private static void greenThumb(final Block block, Player player, BlockBreakEvent event, mcMMO plugin) {
{ final PlayerProfile PP = Users.getProfile(player);
if(herbLevel > 1000 || (Math.random() * 1000 <= herbLevel)) int herbLevel = PP.getSkillLevel(SkillType.HERBALISM);
{ PlayerInventory inventory = player.getInventory();
m.mcDropItem(loc, is); boolean hasSeeds = inventory.contains(Material.SEEDS);
} Location loc = block.getLocation();
}
PP.addXP(SkillType.HERBALISM, LoadProperties.mpumpkin, player); if (hasSeeds && PP.getGreenTerraMode() || hasSeeds && (herbLevel >= 1500 || (Math.random() * 1500 <= herbLevel))) {
} event.setCancelled(true);
//Melon m.mcDropItem(loc, new ItemStack(Material.WHEAT, 1));
if(type == 103) m.mcDropItems(loc, new ItemStack(Material.SEEDS, 1), 3);
{
is = new ItemStack(Material.MELON, 1); Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
if(player != null) public void run() {
{ block.setType(Material.CROPS);
if(herbLevel > 1000 || (Math.random() * 1000 <= herbLevel))
{ //This replants the wheat at a certain stage in development based on Herbalism Skill
m.mcDropItems(loc, is, 3); if (!PP.getGreenTerraMode()) {
m.mcRandomDropItems(loc, is, 50, 4); if (PP.getSkillLevel(SkillType.HERBALISM) >= 600)
} block.setData((byte) 0x4);
} else if (PP.getSkillLevel(SkillType.HERBALISM) >= 400)
PP.addXP(SkillType.HERBALISM, LoadProperties.mmelon, player); block.setData((byte) 0x3);
} else if (PP.getSkillLevel(SkillType.HERBALISM) >= 200)
//Mushroom block.setData((byte) 0x2);
if(type == 39 || type == 40) else
{ block.setData((byte) 0x1);
mat = Material.getMaterial(block.getTypeId()); }
is = new ItemStack(mat, 1); else
if(player != null) block.setData((byte) 0x4);
{ }
if(herbLevel > 1000 || (Math.random() * 1000 <= herbLevel)) }, 1);
{
m.mcDropItem(loc, is); inventory.removeItem(new ItemStack(Material.SEEDS, 1));
} player.updateInventory();
} }
PP.addXP(SkillType.HERBALISM, LoadProperties.mmushroom, player);
}
//Flower
if(type == 37 || type == 38){
mat = Material.getMaterial(block.getTypeId());
is = new ItemStack(mat, 1);
if(player != null){
if(herbLevel > 1000 || (Math.random() * 1000 <= herbLevel))
m.mcDropItem(loc, is);
}
PP.addXP(SkillType.HERBALISM, LoadProperties.mflower, player);
}
//Lily Pads
if(type == 111)
{
is = new ItemStack(Material.WATER_LILY, 1);
if(player != null){
if(herbLevel > 1000 || (Math.random() * 1000 <= herbLevel))
m.mcDropItem(loc, is);
}
PP.addXP(SkillType.HERBALISM, LoadProperties.mlilypad, player);
}
//Vines
if(type == 106){
is = new ItemStack(Material.VINE, 1, (byte)0, (byte)0);
if(player != null){
if(herbLevel > 1000 || (Math.random() * 1000 <= herbLevel))
m.mcDropItem(loc, is);
}
PP.addXP(SkillType.HERBALISM, LoadProperties.mvines, player);
}
}
Skills.XpCheckSkill(SkillType.HERBALISM, player);
} }
} }

View File

@ -324,6 +324,8 @@ public class Skills
activate = false; activate = false;
break; break;
} }
case GREEN_TERRA:
if (!ability.blockCheck(block)) { if (!ability.blockCheck(block)) {
activate = false; activate = false;
break; break;