mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-28 03:34:43 +02:00
Because PP is an awful variable name.
This commit is contained in:
@ -71,8 +71,8 @@ public class Axes {
|
||||
final double PVP_MODIFIER = 1.5;
|
||||
final int PVE_MODIFIER = 2;
|
||||
|
||||
PlayerProfile PPa = Users.getProfile(attacker);
|
||||
int skillLevel = PPa.getSkillLevel(SkillType.AXES);
|
||||
PlayerProfile attackerProfile = Users.getProfile(attacker);
|
||||
int skillLevel = attackerProfile.getSkillLevel(SkillType.AXES);
|
||||
int skillCheck = Misc.skillCheck(skillLevel, MAX_BONUS_LEVEL);
|
||||
|
||||
int randomChance = 2000;
|
||||
|
@ -242,9 +242,9 @@ public class BlastMining {
|
||||
* @param plugin mcMMO plugin instance
|
||||
*/
|
||||
public static void detonate(PlayerInteractEvent event, Player player, mcMMO plugin) {
|
||||
PlayerProfile PP = Users.getProfile(player);
|
||||
PlayerProfile profile = Users.getProfile(player);
|
||||
|
||||
if (PP.getSkillLevel(SkillType.MINING) < 125)
|
||||
if (profile.getSkillLevel(SkillType.MINING) < 125)
|
||||
return;
|
||||
|
||||
Block block = event.getClickedBlock();
|
||||
@ -279,8 +279,8 @@ public class BlastMining {
|
||||
AbilityType ability = AbilityType.BLAST_MINING;
|
||||
|
||||
/* Check Cooldown */
|
||||
if (!Skills.cooldownOver(PP.getSkillDATS(ability) * TIME_CONVERSION_FACTOR, ability.getCooldown(), player)) {
|
||||
player.sendMessage(LocaleLoader.getString("Skills.TooTired") + ChatColor.YELLOW + " (" + Skills.calculateTimeLeft(PP.getSkillDATS(ability) * TIME_CONVERSION_FACTOR, ability.getCooldown()) + "s)");
|
||||
if (!Skills.cooldownOver(profile.getSkillDATS(ability) * TIME_CONVERSION_FACTOR, ability.getCooldown(), player)) {
|
||||
player.sendMessage(LocaleLoader.getString("Skills.TooTired") + ChatColor.YELLOW + " (" + Skills.calculateTimeLeft(profile.getSkillDATS(ability) * TIME_CONVERSION_FACTOR, ability.getCooldown()) + "s)");
|
||||
|
||||
return;
|
||||
}
|
||||
@ -303,7 +303,7 @@ public class BlastMining {
|
||||
/* Disable the original one */
|
||||
block.setType(Material.AIR);
|
||||
|
||||
PP.setSkillDATS(ability, System.currentTimeMillis()); //Save DATS for Blast Mining
|
||||
PP.setAbilityInformed(ability, false);
|
||||
profile.setSkillDATS(ability, System.currentTimeMillis()); //Save DATS for Blast Mining
|
||||
profile.setAbilityInformed(ability, false);
|
||||
}
|
||||
}
|
||||
|
@ -40,8 +40,8 @@ public class Excavation {
|
||||
Material type = block.getType();
|
||||
Location loc = block.getLocation();
|
||||
|
||||
PlayerProfile PP = Users.getProfile(player);
|
||||
int skillLevel = PP.getSkillLevel(SkillType.EXCAVATION);
|
||||
PlayerProfile profile = Users.getProfile(player);
|
||||
int skillLevel = profile.getSkillLevel(SkillType.EXCAVATION);
|
||||
ArrayList<ItemStack> is = new ArrayList<ItemStack>();
|
||||
|
||||
List<ExcavationTreasure> treasures = new ArrayList<ExcavationTreasure>();
|
||||
@ -112,7 +112,7 @@ public class Excavation {
|
||||
}
|
||||
}
|
||||
|
||||
Skills.xpProcessing(player, PP, SkillType.EXCAVATION, xp);
|
||||
Skills.xpProcessing(player, profile, SkillType.EXCAVATION, xp);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -37,11 +37,11 @@ public class Fishing {
|
||||
/**
|
||||
* Get the player's current fishing loot tier.
|
||||
*
|
||||
* @param PP The profile of the player
|
||||
* @param profile The profile of the player
|
||||
* @return the player's current fishing rank
|
||||
*/
|
||||
public static int getFishingLootTier(PlayerProfile PP) {
|
||||
int level = PP.getSkillLevel(SkillType.FISHING);
|
||||
public static int getFishingLootTier(PlayerProfile profile) {
|
||||
int level = profile.getSkillLevel(SkillType.FISHING);
|
||||
int fishingTier;
|
||||
|
||||
if (level >= Config.getInstance().getFishingTierLevelsTier5()) {
|
||||
@ -70,11 +70,11 @@ public class Fishing {
|
||||
* @param event The event to modify
|
||||
*/
|
||||
private static void getFishingResults(Player player, PlayerFishEvent event) {
|
||||
PlayerProfile PP = Users.getProfile(player);
|
||||
PlayerProfile profile = Users.getProfile(player);
|
||||
List<FishingTreasure> rewards = new ArrayList<FishingTreasure>();
|
||||
Item theCatch = (Item) event.getCaught();
|
||||
|
||||
switch (getFishingLootTier(PP)) {
|
||||
switch (getFishingLootTier(profile)) {
|
||||
case 1:
|
||||
rewards = TreasuresConfig.getInstance().fishingRewardsTier1;
|
||||
break;
|
||||
@ -123,7 +123,7 @@ public class Fishing {
|
||||
theCatch.getItemStack().setDurability((short) (random.nextInt(maxDurability))); //Change durability to random value
|
||||
}
|
||||
|
||||
Skills.xpProcessing(player, PP, SkillType.FISHING, Config.getInstance().getFishingBaseXP());
|
||||
Skills.xpProcessing(player, profile, SkillType.FISHING, Config.getInstance().getFishingBaseXP());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -133,7 +133,7 @@ public class Fishing {
|
||||
*/
|
||||
public static void processResults(PlayerFishEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
PlayerProfile PP = Users.getProfile(player);
|
||||
PlayerProfile profile = Users.getProfile(player);
|
||||
|
||||
getFishingResults(player, event);
|
||||
Item theCatch = (Item) event.getCaught();
|
||||
@ -164,7 +164,7 @@ public class Fishing {
|
||||
}
|
||||
|
||||
/* Actual chance to have an enchantment is related to your fishing skill */
|
||||
if (random.nextInt(15) < Fishing.getFishingLootTier(PP)) {
|
||||
if (random.nextInt(15) < Fishing.getFishingLootTier(profile)) {
|
||||
enchanted = true;
|
||||
int randomEnchantLevel = random.nextInt(newEnchant.getMaxLevel()) + 1;
|
||||
|
||||
|
@ -75,10 +75,10 @@ public class Herbalism {
|
||||
* @param plugin mcMMO plugin instance
|
||||
*/
|
||||
public static void herbalismProcCheck(final Block block, Player player, BlockBreakEvent event, mcMMO plugin) {
|
||||
final PlayerProfile PP = Users.getProfile(player);
|
||||
final PlayerProfile profile = Users.getProfile(player);
|
||||
final int MAX_BONUS_LEVEL = 1000;
|
||||
|
||||
int herbLevel = PP.getSkillLevel(SkillType.HERBALISM);
|
||||
int herbLevel = profile.getSkillLevel(SkillType.HERBALISM);
|
||||
int id = block.getTypeId();
|
||||
Material type = block.getType();
|
||||
|
||||
@ -307,7 +307,7 @@ public class Herbalism {
|
||||
}
|
||||
}
|
||||
|
||||
Skills.xpProcessing(player, PP, SkillType.HERBALISM, xp);
|
||||
Skills.xpProcessing(player, profile, SkillType.HERBALISM, xp);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -321,8 +321,8 @@ public class Herbalism {
|
||||
private static void greenThumbWheat(Block block, Player player, BlockBreakEvent event, mcMMO plugin) {
|
||||
final int MAX_BONUS_LEVEL = 1500;
|
||||
|
||||
PlayerProfile PP = Users.getProfile(player);
|
||||
int herbLevel = PP.getSkillLevel(SkillType.HERBALISM);
|
||||
PlayerProfile profile = Users.getProfile(player);
|
||||
int herbLevel = profile.getSkillLevel(SkillType.HERBALISM);
|
||||
PlayerInventory inventory = player.getInventory();
|
||||
boolean hasSeeds = inventory.contains(Material.SEEDS);
|
||||
Location loc = block.getLocation();
|
||||
@ -333,13 +333,13 @@ public class Herbalism {
|
||||
randomChance = (int) (randomChance * 0.75);
|
||||
}
|
||||
|
||||
if (hasSeeds && PP.getAbilityMode(AbilityType.GREEN_TERRA) || hasSeeds && (herbLevel > MAX_BONUS_LEVEL || random.nextInt(randomChance) <= herbLevel)) {
|
||||
if (hasSeeds && profile.getAbilityMode(AbilityType.GREEN_TERRA) || hasSeeds && (herbLevel > MAX_BONUS_LEVEL || random.nextInt(randomChance) <= herbLevel)) {
|
||||
event.setCancelled(true);
|
||||
|
||||
Misc.dropItem(loc, new ItemStack(Material.WHEAT));
|
||||
Misc.randomDropItems(loc, new ItemStack(Material.SEEDS), 50, 3);
|
||||
|
||||
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new GreenThumbTimer(block, PP), 1);
|
||||
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new GreenThumbTimer(block, profile), 1);
|
||||
|
||||
inventory.removeItem(new ItemStack(Material.SEEDS));
|
||||
player.updateInventory(); // Needed until replacement available
|
||||
@ -356,8 +356,8 @@ public class Herbalism {
|
||||
public static void greenThumbBlocks(ItemStack is, Player player, Block block) {
|
||||
final int MAX_BONUS_LEVEL = 1500;
|
||||
|
||||
PlayerProfile PP = Users.getProfile(player);
|
||||
int skillLevel = PP.getSkillLevel(SkillType.HERBALISM);
|
||||
PlayerProfile profile = Users.getProfile(player);
|
||||
int skillLevel = profile.getSkillLevel(SkillType.HERBALISM);
|
||||
int seeds = is.getAmount();
|
||||
|
||||
player.setItemInHand(new ItemStack(Material.SEEDS, seeds - 1));
|
||||
|
@ -222,7 +222,7 @@ public class Mining {
|
||||
* @param block The block to award XP for
|
||||
*/
|
||||
public static void miningXP(Player player, Block block) {
|
||||
PlayerProfile PP = Users.getProfile(player);
|
||||
PlayerProfile profile = Users.getProfile(player);
|
||||
Material type = block.getType();
|
||||
int xp = 0;
|
||||
|
||||
@ -287,7 +287,7 @@ public class Mining {
|
||||
break;
|
||||
}
|
||||
|
||||
Skills.xpProcessing(player, PP, SkillType.MINING, xp);
|
||||
Skills.xpProcessing(player, profile, SkillType.MINING, xp);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -41,12 +41,12 @@ public class WoodCutting {
|
||||
public static void treeFeller(BlockBreakEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
Block firstBlock = event.getBlock();
|
||||
PlayerProfile PP = Users.getProfile(player);
|
||||
PlayerProfile profile = Users.getProfile(player);
|
||||
ArrayList<Block> toBeFelled = new ArrayList<Block>();
|
||||
|
||||
/* NOTE: Tree Feller will cut upwards like how you actually fell trees */
|
||||
processTreeFelling(firstBlock, toBeFelled);
|
||||
removeBlocks(toBeFelled, player, PP);
|
||||
removeBlocks(toBeFelled, player, profile);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -54,9 +54,9 @@ public class WoodCutting {
|
||||
*
|
||||
* @param toBeFelled List of Blocks to be removed from the tree
|
||||
* @param player The player using the ability
|
||||
* @param PP The PlayerProfile of the player
|
||||
* @param profile The PlayerProfile of the player
|
||||
*/
|
||||
private static void removeBlocks(ArrayList<Block> toBeFelled, Player player, PlayerProfile PP) {
|
||||
private static void removeBlocks(ArrayList<Block> toBeFelled, Player player, PlayerProfile profile) {
|
||||
if (toBeFelled.size() >= Config.getInstance().getTreeFellerThreshold()) {
|
||||
player.sendMessage(LocaleLoader.getString("Woodcutting.Skills.TreeFellerThreshold"));
|
||||
return;
|
||||
@ -213,7 +213,7 @@ public class WoodCutting {
|
||||
}
|
||||
|
||||
if (Permissions.getInstance().woodcutting(player)) {
|
||||
Skills.xpProcessing(player, PP, SkillType.WOODCUTTING, xp);
|
||||
Skills.xpProcessing(player, profile, SkillType.WOODCUTTING, xp);
|
||||
}
|
||||
}
|
||||
|
||||
@ -375,7 +375,7 @@ public class WoodCutting {
|
||||
* @param block The block being broken
|
||||
*/
|
||||
public static void woodcuttingBlockCheck(Player player, Block block) {
|
||||
PlayerProfile PP = Users.getProfile(player);
|
||||
PlayerProfile profile = Users.getProfile(player);
|
||||
int xp = 0;
|
||||
TreeSpecies species = TreeSpecies.getByData(block.getData());
|
||||
|
||||
@ -410,7 +410,7 @@ public class WoodCutting {
|
||||
}
|
||||
|
||||
WoodCutting.woodCuttingProcCheck(player, block);
|
||||
Skills.xpProcessing(player, PP, SkillType.WOODCUTTING, xp);
|
||||
Skills.xpProcessing(player, profile, SkillType.WOODCUTTING, xp);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -31,18 +31,18 @@ public class Repair {
|
||||
* Handle the XP gain for repair events.
|
||||
*
|
||||
* @param player Player repairing the item
|
||||
* @param PP PlayerProfile of the repairing player
|
||||
* @param profile PlayerProfile of the repairing player
|
||||
* @param is Item being repaired
|
||||
* @param durabilityBefore Durability of the item before repair
|
||||
* @param modify Amount to modify the durability by
|
||||
* @param boost True if the modifier is a boost, false if the modifier is a reduction
|
||||
*/
|
||||
protected static void xpHandler(Player player, PlayerProfile PP, short durabilityBefore, short durabilityAfter, double modify) {
|
||||
protected static void xpHandler(Player player, PlayerProfile profile, short durabilityBefore, short durabilityAfter, double modify) {
|
||||
short dif = (short) (durabilityBefore - durabilityAfter);
|
||||
|
||||
dif = (short) (dif * modify);
|
||||
|
||||
Skills.xpProcessing(player, PP, SkillType.REPAIR, dif * 10);
|
||||
Skills.xpProcessing(player, profile, SkillType.REPAIR, dif * 10);
|
||||
|
||||
//CLANG CLANG
|
||||
if (mcMMO.spoutEnabled) {
|
||||
@ -53,11 +53,11 @@ public class Repair {
|
||||
/**
|
||||
* Get current Arcane Forging rank.
|
||||
*
|
||||
* @param skillLevel The skill level of the player whose rank is being checked
|
||||
* @param profile The PlayerProfile of the player to get the rank for
|
||||
* @return The player's current Arcane Forging rank
|
||||
*/
|
||||
public static int getArcaneForgingRank(PlayerProfile PP) {
|
||||
int skillLevel = PP.getSkillLevel(SkillType.REPAIR);
|
||||
public static int getArcaneForgingRank(PlayerProfile profile) {
|
||||
int skillLevel = profile.getSkillLevel(SkillType.REPAIR);
|
||||
|
||||
if (skillLevel >= configInstance.getArcaneForgingRankLevels4()) {
|
||||
return 4;
|
||||
@ -250,9 +250,9 @@ public class Repair {
|
||||
* @param anvilID The item ID of the anvil block
|
||||
*/
|
||||
public static void placedAnvilCheck(Player player, int anvilID) {
|
||||
PlayerProfile PP = Users.getProfile(player);
|
||||
PlayerProfile profile = Users.getProfile(player);
|
||||
|
||||
if (!PP.getPlacedAnvil()) {
|
||||
if (!profile.getPlacedAnvil()) {
|
||||
if (mcMMO.spoutEnabled) {
|
||||
SpoutPlayer sPlayer = SpoutManager.getPlayer(player);
|
||||
|
||||
@ -264,7 +264,7 @@ public class Repair {
|
||||
player.sendMessage(LocaleLoader.getString("Repair.Listener.Anvil"));
|
||||
}
|
||||
|
||||
PP.togglePlacedAnvil();
|
||||
profile.togglePlacedAnvil();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -60,10 +60,10 @@ public class SimpleRepairManager implements RepairManager {
|
||||
@Override
|
||||
public void handleRepair(Player player, ItemStack item) {
|
||||
// Load some variables for use
|
||||
PlayerProfile PP = Users.getProfile(player);
|
||||
PlayerProfile profile = Users.getProfile(player);
|
||||
short startDurability = item.getDurability();
|
||||
PlayerInventory inventory = player.getInventory();
|
||||
int skillLevel = PP.getSkillLevel(SkillType.REPAIR);
|
||||
int skillLevel = profile.getSkillLevel(SkillType.REPAIR);
|
||||
Repairable repairable = repairables.get(item.getTypeId());
|
||||
|
||||
// Permissions checks on material and item types
|
||||
@ -147,7 +147,7 @@ public class SimpleRepairManager implements RepairManager {
|
||||
removeOneFrom(inventory, repairItemLocation);
|
||||
|
||||
// Give out XP like candy
|
||||
Repair.xpHandler(player, PP, startDurability, newDurability, repairable.getXpMultiplier());
|
||||
Repair.xpHandler(player, profile, startDurability, newDurability, repairable.getXpMultiplier());
|
||||
|
||||
// Repair the item!
|
||||
item.setDurability(newDurability);
|
||||
|
Reference in New Issue
Block a user