Attempting to fix issues #272 , #266 , #261 , and #255 .

This commit is contained in:
U-YUE\Sean
2012-10-30 11:46:52 -07:00
parent 8dfa8c20f3
commit ab7a83b37e
18 changed files with 161 additions and 0 deletions

View File

@ -82,6 +82,9 @@ public class BlastMining {
* @param event Event whose explosion is being processed
*/
public static void dropProcessing(Player player, EntityExplodeEvent event) {
if(player == null)
return;
final int RANK_1_LEVEL = 125;
final int RANK_2_LEVEL = 250;
final int RANK_3_LEVEL = 375;
@ -172,6 +175,9 @@ public class BlastMining {
* @param event Event whose explosion radius is being changed
*/
public static void biggerBombs(Player player, ExplosionPrimeEvent event) {
if(player == null)
return;
final int RANK_1_LEVEL = 250;
final int RANK_2_LEVEL = 500;
final int RANK_3_LEVEL = 750;
@ -210,6 +216,9 @@ public class BlastMining {
* @param event Event whose explosion damage is being reduced
*/
public static void demolitionsExpertise(Player player, EntityDamageEvent event) {
if(player == null)
return;
final int RANK_1_LEVEL = 500;
final int RANK_2_LEVEL = 750;
final int RANK_3_LEVEL = 1000;
@ -242,6 +251,9 @@ public class BlastMining {
* @param plugin mcMMO plugin instance
*/
public static void detonate(PlayerInteractEvent event, Player player, mcMMO plugin) {
if(player == null)
return;
PlayerProfile profile = Users.getProfile(player);
if (profile.getSkillLevel(SkillType.MINING) < 125)

View File

@ -37,6 +37,9 @@ public class Excavation {
* @param player The player who broke the block
*/
public static void excavationProcCheck(Block block, Player player) {
if(player == null)
return;
Material type = block.getType();
Location location = block.getLocation();
@ -122,6 +125,9 @@ public class Excavation {
* @param block The block to check
*/
public static void gigaDrillBreaker(Player player, Block block) {
if(player == null)
return;
Skills.abilityDurabilityLoss(player.getItemInHand(), Config.getInstance().getAbilityToolDamage());
if (!mcMMO.placeStore.isTrue(block) && !Misc.blockBreakSimulate(block, player, true)) {

View File

@ -72,6 +72,9 @@ public class Fishing {
* @param event The event to modify
*/
private static void getFishingResults(Player player, PlayerFishEvent event) {
if(player == null)
return;
PlayerProfile profile = Users.getProfile(player);
List<FishingTreasure> rewards = new ArrayList<FishingTreasure>();
Item theCatch = (Item) event.getCaught();
@ -135,6 +138,9 @@ public class Fishing {
*/
public static void processResults(PlayerFishEvent event) {
Player player = event.getPlayer();
if(player == null)
return;
PlayerProfile profile = Users.getProfile(player);
getFishingResults(player, event);

View File

@ -37,6 +37,9 @@ public class Herbalism {
* @param block The block to be changed by Green Terra
*/
public static void greenTerra(Player player, Block block) {
if(player == null)
return;
PlayerInventory inventory = player.getInventory();
boolean hasSeeds = inventory.contains(Material.SEEDS);
@ -51,6 +54,9 @@ public class Herbalism {
}
public static void greenTerraConvert(Player player, Block block) {
if(player == null)
return;
Material type = block.getType();
if (Misc.blockBreakSimulate(block, player, false)) {
@ -77,6 +83,9 @@ public class Herbalism {
* @param plugin mcMMO plugin instance
*/
public static void herbalismProcCheck(final Block block, Player player, BlockBreakEvent event, mcMMO plugin) {
if(player == null)
return;
final PlayerProfile profile = Users.getProfile(player);
final int MAX_BONUS_LEVEL = 1000;
@ -372,6 +381,9 @@ public class Herbalism {
* @param plugin mcMMO plugin instance
*/
private static void greenThumbWheat(Block block, Player player, BlockBreakEvent event, mcMMO plugin) {
if(player == null)
return;
final int MAX_BONUS_LEVEL = 1500;
PlayerProfile profile = Users.getProfile(player);
@ -407,6 +419,9 @@ public class Herbalism {
* @param block The block being used in the ability
*/
public static void greenThumbBlocks(ItemStack is, Player player, Block block) {
if(player == null)
return;
final int MAX_BONUS_LEVEL = 1500;
PlayerProfile profile = Users.getProfile(player);