General cleanup to satisfy my OCD a little while longer.

This commit is contained in:
GJ
2013-01-21 17:22:54 -05:00
parent 900623461a
commit 0711454e31
37 changed files with 180 additions and 163 deletions

View File

@ -107,7 +107,7 @@ public class Herbalism {
randomChance = 75;
}
float chance = (float) (((double) MAX_CHANCE / (double) MAX_BONUS_LEVEL) * herbLevel);
float chance = (float) ((MAX_CHANCE / MAX_BONUS_LEVEL) * herbLevel);
if (chance > MAX_CHANCE) chance = (float) MAX_CHANCE;
switch (type) {
@ -125,7 +125,7 @@ public class Herbalism {
if (b.getType().equals(Material.CACTUS)) {
mat = Material.CACTUS;
if (!mcMMO.placeStore.isTrue(b)) {
if (chance > Misc.getRandom().nextInt(randomChance)) {
if (chance > Misc.getRandom().nextInt(randomChance)) {
catciDrops++;
}
xp += Config.getInstance().getHerbalismXPCactus();
@ -185,7 +185,7 @@ public class Herbalism {
if (b.getType().equals(Material.SUGAR_CANE_BLOCK)) {
mat = Material.SUGAR_CANE;
if (!mcMMO.placeStore.isTrue(b)) {
if (chance > Misc.getRandom().nextInt(randomChance)) {
if (chance > Misc.getRandom().nextInt(randomChance)) {
caneDrops++;
}
xp += Config.getInstance().getHerbalismXPSugarCane();
@ -410,8 +410,8 @@ public class Herbalism {
* @param plugin mcMMO plugin instance
*/
private static void greenThumbWheat(Block block, Player player, BlockBreakEvent event, mcMMO plugin) {
final int MAX_CHANCE = advancedConfig.getGreenThumbChanceMax();
final int MAX_BONUS_LEVEL = advancedConfig.getGreenThumbMaxLevel();
final int MAX_CHANCE = advancedConfig.getGreenThumbChanceMax();
final int MAX_BONUS_LEVEL = advancedConfig.getGreenThumbMaxLevel();
PlayerProfile profile = Users.getProfile(player);
int herbLevel = profile.getSkillLevel(SkillType.HERBALISM);
@ -455,7 +455,7 @@ public class Herbalism {
}
float chance = (float) (((double) MAX_CHANCE / (double) MAX_BONUS_LEVEL) * herbLevel);
if (chance > MAX_CHANCE) chance = (float) MAX_CHANCE;
if (chance > MAX_CHANCE) chance = MAX_CHANCE;
if (hasSeeds && profile.getAbilityMode(AbilityType.GREEN_TERRA) || hasSeeds && (chance > Misc.getRandom().nextInt(randomChance))) {
event.setCancelled(true);
@ -529,7 +529,7 @@ public class Herbalism {
}
float chance = (float) (((double) MAX_CHANCE / (double) MAX_BONUS_LEVEL) * skillLevel);
if (chance > MAX_CHANCE) chance = (float) MAX_CHANCE;
if (chance > MAX_CHANCE) chance = MAX_CHANCE;
if (chance > Misc.getRandom().nextInt(randomChance)) {
greenTerraConvert(player, block);

View File

@ -210,8 +210,8 @@ public class WoodCutting {
else if (x.getType() == Material.LEAVES) {
final int SAPLING_DROP_CHANCE = 10;
//Drop the right type of sapling
item = (new MaterialData(Material.SAPLING, (byte) (x.getData() & 3))).toItemStack(1);
//Drop the right type of sapling
item = (new MaterialData(Material.SAPLING, (byte) (x.getData() & 3))).toItemStack(1);
Misc.randomDropItem(x.getLocation(), item, SAPLING_DROP_CHANCE);

View File

@ -7,7 +7,7 @@ public class BiggerBombsEventHandler {
private ExplosionPrimeEvent event;
private float radius;
private float radiusModifier;
private float radiusModifier;
protected BiggerBombsEventHandler(MiningManager manager, ExplosionPrimeEvent event) {
this.skillLevel = manager.getSkillLevel();

View File

@ -35,7 +35,7 @@ public class Mining {
* @param player The player to award XP to
* @param block The block to award XP for
*/
protected static void miningXP(Player player, PlayerProfile profile, Block block, Material type) {
protected static void miningXP(Player player, PlayerProfile profile, Block block, Material type) {
int xp = 0;
switch (type) {

View File

@ -74,7 +74,7 @@ public class SuperBreakerEventHandler {
return true;
}
switch (blockType) {
case OBSIDIAN:
if (tier < Mining.DIAMOND_TOOL_TIER) {
@ -99,7 +99,7 @@ public class SuperBreakerEventHandler {
}
/* FALL THROUGH */
case COAL_ORE:
case COAL_ORE:
case ENDER_STONE:
case GLOWSTONE:
case MOSSY_COBBLESTONE:

View File

@ -205,8 +205,8 @@ public class Repair {
*/
protected static short repairCalculate(Player player, int skillLevel, short durability, int repairAmount) {
float bonus;
if (skillLevel >= REPAIR_MASTERY_MAX_BONUS_LEVEL) bonus = ((float) REPAIR_MASTERY_CHANCE_MAX / 100F);
else bonus = (((float) skillLevel) / ((float) REPAIR_MASTERY_MAX_BONUS_LEVEL)) * (((float) REPAIR_MASTERY_CHANCE_MAX) / 100F);
if (skillLevel >= REPAIR_MASTERY_MAX_BONUS_LEVEL) bonus = (REPAIR_MASTERY_CHANCE_MAX / 100F);
else bonus = (((float) skillLevel) / ((float) REPAIR_MASTERY_MAX_BONUS_LEVEL)) * ((REPAIR_MASTERY_CHANCE_MAX) / 100F);
if (Permissions.repairMastery(player)) {
bonus = repairAmount * bonus;

View File

@ -15,5 +15,5 @@ public class Unarmed {
public static final int DISARM_MAX_BONUS_LEVEL = advancedConfig.getDeflectMaxBonusLevel();
public static final int IRON_GRIP_MAX_CHANCE = advancedConfig.getIronGripChanceMax();
public static final int IRON_GRIP_MAX_BONUS_LEVEL = advancedConfig.getIronGripMaxBonusLevel();
public static final int IRON_GRIP_MAX_BONUS_LEVEL = advancedConfig.getIronGripMaxBonusLevel();
}