mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
Merge branch 'master' into locale.
This commit is contained in:
commit
c97fff320b
@ -6,6 +6,7 @@ import org.bukkit.entity.Animals;
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.IronGolem;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Wolf;
|
||||
@ -441,6 +442,11 @@ public class Combat {
|
||||
baseXP = LoadProperties.magmacubeXP;
|
||||
break;
|
||||
|
||||
case IRON_GOLEM:
|
||||
if (!((IronGolem) target).isPlayerCreated())
|
||||
baseXP = LoadProperties.irongolemXP;
|
||||
break;
|
||||
|
||||
case PIG_ZOMBIE:
|
||||
baseXP = LoadProperties.pigzombieXP;
|
||||
break;
|
||||
|
@ -274,7 +274,7 @@ public class ItemChecks {
|
||||
* @return true if the item is a tool, false otherwise
|
||||
*/
|
||||
public static boolean isTool(ItemStack is) {
|
||||
return isStoneTool(is) || isWoodTool(is) || isGoldTool(is) || isIronTool(is) || isDiamondTool(is) || is.getType().equals(Material.BOW);
|
||||
return isStoneTool(is) || isWoodTool(is) || isGoldTool(is) || isIronTool(is) || isDiamondTool(is) || isStringTool(is);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -317,6 +317,24 @@ public class ItemChecks {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks to see if an item is a string tool.
|
||||
*
|
||||
* @param is Item to check
|
||||
* @return true if the item is a string tool, false otherwise
|
||||
*/
|
||||
public static boolean isStringTool(ItemStack is) {
|
||||
switch (is.getType()) {
|
||||
case BOW:
|
||||
case FISHING_ROD:
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks to see if an item is a gold tool.
|
||||
*
|
||||
|
@ -37,14 +37,15 @@ public class RepairCommand implements CommandExecutor {
|
||||
|
||||
if (mcPermissions.getInstance().repair(player))
|
||||
player.sendMessage(mcLocale.getString("Effects.Level", new Object[] { PP.getSkillLevel(SkillType.REPAIR), PP.getSkillXpLevel(SkillType.REPAIR), PP.getXpToLevel(SkillType.REPAIR) }));
|
||||
|
||||
|
||||
player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Effects.Effects") }));
|
||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("m.EffectsRepair1_0"), mcLocale.getString("m.EffectsRepair1_1") }));
|
||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("m.EffectsRepair2_0"), mcLocale.getString("m.EffectsRepair2_1") }));
|
||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("m.EffectsRepair3_0"), mcLocale.getString("m.EffectsRepair3_1") }));
|
||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("m.EffectsRepair4_0", new Object[] { LoadProperties.repairdiamondlevel }), mcLocale.getString("m.EffectsRepair4_1") }));
|
||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("m.EffectsRepair4_0", new Object[] { LoadProperties.repairDiamondLevel }), mcLocale.getString("m.EffectsRepair4_1") }));
|
||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("m.EffectsRepair5_0"), mcLocale.getString("m.EffectsRepair5_1") }));
|
||||
player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Commands.Stats.Self") }));
|
||||
|
||||
player.sendMessage(mcLocale.getString("m.RepairRepairMastery", new Object[] { repairmastery }));
|
||||
player.sendMessage(mcLocale.getString("m.RepairSuperRepairChance", new Object[] { percentage }));
|
||||
player.sendMessage(mcLocale.getString("m.ArcaneForgingRank", new Object[] { Repair.getArcaneForgingRank(PP.getSkillLevel(SkillType.REPAIR)) }));
|
||||
|
@ -87,7 +87,7 @@ public class LoadProperties extends ConfigLoader{
|
||||
public static Boolean anvilmessages;
|
||||
public static int rWood, rStone, rIron, rGold, rDiamond, rString, rLeather;
|
||||
public static int anvilID;
|
||||
public static int repairStoneLevel, repairIronLevel, repairGoldLevel, repairdiamondlevel, repairBowLevel;
|
||||
public static int repairStoneLevel, repairIronLevel, repairGoldLevel, repairDiamondLevel, repairStringLevel;
|
||||
|
||||
/* Taming */
|
||||
public static int mtameWolf, mtameOcelot;
|
||||
@ -120,7 +120,7 @@ public class LoadProperties extends ConfigLoader{
|
||||
public static double pvpxprewardmodifier;
|
||||
public static double animalXP, creeperXP, skeletonXP, spiderXP, ghastXP, slimeXP,
|
||||
zombieXP, pigzombieXP, endermanXP, cavespiderXP, silverfishXP,
|
||||
blazeXP, magmacubeXP, enderdragonXP;
|
||||
blazeXP, magmacubeXP, enderdragonXP, irongolemXP;
|
||||
|
||||
/* XP Formula Multiplier */
|
||||
public static double tamingxpmodifier, miningxpmodifier, repairxpmodifier, woodcuttingxpmodifier,
|
||||
@ -373,11 +373,11 @@ public class LoadProperties extends ConfigLoader{
|
||||
woodcuttingrequiresaxe = config.getBoolean("Skills.Woodcutting.Requires_Axe", true);
|
||||
repairArmor = config.getBoolean("Skills.Repair.Can_Repair_Armor", true);
|
||||
repairTools = config.getBoolean("Skills.Repair.Can_Repair_Tools", true);
|
||||
repairdiamondlevel = config.getInt("Skills.Repair.Diamond.Level_Required", 50);
|
||||
repairDiamondLevel = config.getInt("Skills.Repair.Diamond.Level_Required", 50);
|
||||
repairIronLevel = config.getInt("Skills.Repair.Iron.Level_Required", 0);
|
||||
repairGoldLevel = config.getInt("Skills.Repair.Gold.Level_Required", 0);
|
||||
repairStoneLevel = config.getInt("Skills.Repair.Stone.Level_Required", 0);
|
||||
repairBowLevel = config.getInt("Skills.Repair.String.Level_Required", 0);
|
||||
repairStringLevel = config.getInt("Skills.Repair.String.Level_Required", 0);
|
||||
|
||||
tamingxpmodifier = config.getDouble("Experience.Formula.Multiplier.Taming", 1.0);
|
||||
miningxpmodifier = config.getDouble("Experience.Formula.Multiplier.Mining", 1.0);
|
||||
@ -475,6 +475,7 @@ public class LoadProperties extends ConfigLoader{
|
||||
blazeXP = config.getDouble("Experience.Combat.Multiplier.Blaze", 3.0);
|
||||
magmacubeXP = config.getDouble("Experience.Combat.Multiplier.Magma_Cube", 2.0);
|
||||
enderdragonXP = config.getDouble("Experience.Combat.Multiplier.Ender_Dragon", 8.0);
|
||||
irongolemXP = config.getDouble("Experience.Combat.Multiplier.Iron_Golem", 2.0);
|
||||
|
||||
detonatorID = config.getInt("Skills.Mining.Detonator_ID", 259);
|
||||
}
|
||||
|
@ -169,8 +169,8 @@ public class mcPermissions {
|
||||
return player.hasPermission("mcmmo.ability.repair.toolrepair");
|
||||
}
|
||||
|
||||
public boolean bowRepair(Player player) {
|
||||
return player.hasPermission("mcmmo.ability.repair.bowrepair");
|
||||
public boolean stringRepair(Player player) {
|
||||
return player.hasPermission("mcmmo.ability.repair.stringrepair");
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -48,7 +48,7 @@ public class Repair {
|
||||
* REPAIR ARMOR
|
||||
*/
|
||||
if (ItemChecks.isArmor(is) && LoadProperties.repairArmor && mcPermissions.getInstance().armorRepair(player)) {
|
||||
if (ItemChecks.isDiamondArmor(is) && inventory.contains(LoadProperties.rDiamond) && skillLevel >= LoadProperties.repairdiamondlevel && mcPermissions.getInstance().diamondRepair(player)) {
|
||||
if (ItemChecks.isDiamondArmor(is) && inventory.contains(LoadProperties.rDiamond) && skillLevel >= LoadProperties.repairDiamondLevel && mcPermissions.getInstance().diamondRepair(player)) {
|
||||
repairItem(player, is, new ItemStack(LoadProperties.rDiamond));
|
||||
xpHandler(player, PP, is, durabilityBefore, 6, true);
|
||||
}
|
||||
@ -85,7 +85,7 @@ public class Repair {
|
||||
repairItem(player, is, new ItemStack(LoadProperties.rIron));
|
||||
xpHandler(player, PP, is, durabilityBefore, 1, true);
|
||||
}
|
||||
else if (ItemChecks.isDiamondTool(is) && inventory.contains(LoadProperties.rDiamond) && skillLevel >= LoadProperties.repairdiamondlevel && mcPermissions.getInstance().diamondRepair(player)) {
|
||||
else if (ItemChecks.isDiamondTool(is) && inventory.contains(LoadProperties.rDiamond) && skillLevel >= LoadProperties.repairDiamondLevel && mcPermissions.getInstance().diamondRepair(player)) {
|
||||
repairItem(player, is, new ItemStack(LoadProperties.rDiamond));
|
||||
xpHandler(player, PP, is, durabilityBefore, 1, true);
|
||||
}
|
||||
@ -93,7 +93,7 @@ public class Repair {
|
||||
repairItem(player, is, new ItemStack(LoadProperties.rGold));
|
||||
xpHandler(player, PP, is, durabilityBefore, 8, true);
|
||||
}
|
||||
else if (is.getType().equals(Material.BOW) && inventory.contains(LoadProperties.rString) && skillLevel >= LoadProperties.repairBowLevel && mcPermissions.getInstance().bowRepair(player)){
|
||||
else if (ItemChecks.isStringTool(is) && inventory.contains(LoadProperties.rString) && skillLevel >= LoadProperties.repairStringLevel && mcPermissions.getInstance().stringRepair(player)){
|
||||
repairItem(player, is, new ItemStack(LoadProperties.rString));
|
||||
xpHandler(player, PP, is, durabilityBefore, 2, false);
|
||||
}
|
||||
@ -321,7 +321,7 @@ public class Repair {
|
||||
else if (ItemChecks.isHoe(is) || ItemChecks.isSword(is) || is.getType().equals(Material.SHEARS)) {
|
||||
ramt = maxDurability / 2;
|
||||
}
|
||||
else if (ItemChecks.isAxe(is) || ItemChecks.isMiningPick(is) || is.getType().equals(Material.BOW)) {
|
||||
else if (ItemChecks.isAxe(is) || ItemChecks.isMiningPick(is) || ItemChecks.isStringTool(is)) {
|
||||
ramt = maxDurability / 3;
|
||||
}
|
||||
else if (ItemChecks.isBoots(is)) {
|
||||
@ -354,7 +354,7 @@ public class Repair {
|
||||
}
|
||||
else {
|
||||
if (ItemChecks.isDiamondTool(is) || ItemChecks.isDiamondArmor(is)) {
|
||||
if (skillLevel < LoadProperties.repairdiamondlevel) {
|
||||
if (skillLevel < LoadProperties.repairDiamondLevel) {
|
||||
player.sendMessage(mcLocale.getString("Skills.AdeptDiamond"));
|
||||
}
|
||||
else {
|
||||
@ -391,7 +391,7 @@ public class Repair {
|
||||
else if (ItemChecks.isLeatherArmor(is)) {
|
||||
player.sendMessage(mcLocale.getString("Skills.NeedMore") + " " + ChatColor.YELLOW + m.prettyItemString(LoadProperties.rLeather));
|
||||
}
|
||||
else if (is.getType().equals(Material.BOW)) {
|
||||
else if (ItemChecks.isStringTool(is)) {
|
||||
player.sendMessage(mcLocale.getString("Skills.NeedMore") + " " + ChatColor.YELLOW + m.prettyItemString(LoadProperties.rString));
|
||||
}
|
||||
}
|
||||
|
@ -271,6 +271,7 @@ Experience:
|
||||
Ender_Dragon: 8.0
|
||||
Slime: 2.0
|
||||
Ghast: 3.0
|
||||
Iron_Golem: 2.0
|
||||
#
|
||||
# Settings for commands
|
||||
###
|
||||
|
@ -266,7 +266,7 @@ permissions:
|
||||
mcmmo.ability.repair.diamondrepair: true
|
||||
mcmmo.ability.repair.armorrepair: true
|
||||
mcmmo.ability.repair.toolrepair: true
|
||||
mcmmo.ability.repair.bowrepair: true
|
||||
mcmmo.ability.repair.stringrepair: true
|
||||
mcmmo.ability.repair.repairbonus:
|
||||
description: Allows access to Super Repair bonus
|
||||
mcmmo.ability.repair.arcaneforging:
|
||||
@ -287,8 +287,8 @@ permissions:
|
||||
description: Allows ability to repair armor
|
||||
mcmmo.ability.repair.toolrepair:
|
||||
description: Allows ability to repair tools
|
||||
mcmmo.ability.repair.bowrepair:
|
||||
description: Allows ability to repair bows
|
||||
mcmmo.ability.repair.stringrepair:
|
||||
description: Allows ability to repair Bow and Fishing rod
|
||||
mcmmo.ability.unarmed.*:
|
||||
description: Allows access to all Unarmed abilities
|
||||
children:
|
||||
@ -461,4 +461,4 @@ permissions:
|
||||
mcmmo.skills.acrobatics:
|
||||
description: Allows access to the Acrobatics skill
|
||||
mcmmo.skills.blastmining:
|
||||
description: Allows access to the Blast Mining subskill for Mining
|
||||
description: Allows access to the Blast Mining subskill for Mining
|
||||
|
Loading…
Reference in New Issue
Block a user