Version 1.2.01

This commit is contained in:
nossr50 2011-12-02 01:14:18 -08:00
parent a814b57311
commit 942a8363f3
21 changed files with 116 additions and 77 deletions

View File

@ -1,5 +1,20 @@
Changelog: Changelog:
#Versions without changelogs probably had very small misc fixes, like tweaks to the source code #Versions without changelogs probably had very small misc fixes, like tweaks to the source code
Version 1.2.01
Added a setting to turn off abilities completely from config
Added a setting to just turn off ability messages from config
Fixed the bug with sword repair
Fixed mcMMO not working properly with Spout
Added Fishing XP icon to Normal/Retro HUDs for Spout
Added icons to Spout notifications for leveling Fishing
Added Fishing Retro XP bar color customization to config file
The number of bones required to use Call of The Wild is now configurable
Reduced the XP animals would give from 1.5x to 1x
Removed current durability value message from Repairing
Fixed bug where Arcane Forging failed to display messages
Fixed bug where Arcane Forging tries to downgrade level 1 enchants
Fixed bug where Arcane Forging always kept enchantments if you had under 100 Repair skill
Version 1.2.00 Version 1.2.00
Added Fishing Skill Added Fishing Skill
Added Call Of The Wild to Taming Added Call Of The Wild to Taming

View File

@ -386,7 +386,7 @@ public class Combat
if(entity instanceof Animals) if(entity instanceof Animals)
{ {
xp = (int) (xpinc * 1.5); xp = (int) (xpinc * 1);
} else } else
{ {
if(entity instanceof Enderman) if(entity instanceof Enderman)

View File

@ -106,7 +106,7 @@ public class Commands
player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] {mcLocale.getString("m.EffectsTaming5_0"), mcLocale.getString("m.EffectsTaming5_1")})); player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] {mcLocale.getString("m.EffectsTaming5_0"), mcLocale.getString("m.EffectsTaming5_1")}));
player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] {mcLocale.getString("m.EffectsTaming6_0"), mcLocale.getString("m.EffectsTaming6_1")})); player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] {mcLocale.getString("m.EffectsTaming6_0"), mcLocale.getString("m.EffectsTaming6_1")}));
player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] {mcLocale.getString("m.EffectsTaming7_0"), mcLocale.getString("m.EffectsTaming7_1")})); player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] {mcLocale.getString("m.EffectsTaming7_0"), mcLocale.getString("m.EffectsTaming7_1")}));
player.sendMessage(mcLocale.getString("m.EffectsTaming7_2")); player.sendMessage(mcLocale.getString("m.EffectsTaming7_2", new Object[] {LoadProperties.bonesConsumedByCOTW}));
player.sendMessage(mcLocale.getString("m.SkillHeader", new Object[] {mcLocale.getString("m.YourStats")})); player.sendMessage(mcLocale.getString("m.SkillHeader", new Object[] {mcLocale.getString("m.YourStats")}));
if(PP.getSkillLevel(SkillType.TAMING) < 100) if(PP.getSkillLevel(SkillType.TAMING) < 100)
player.sendMessage(mcLocale.getString("m.AbilityLockTemplate", new Object[] {mcLocale.getString("m.AbilLockTaming1")})); player.sendMessage(mcLocale.getString("m.AbilityLockTemplate", new Object[] {mcLocale.getString("m.AbilLockTaming1")}));

View File

@ -23,7 +23,7 @@ import com.gmail.nossr50.datatypes.HUDType;
public class LoadProperties public class LoadProperties
{ {
public static Boolean showDisplayName, showFaces, watch, xplockEnable, xpbar, xpicon, partybar, string, bucket, web, xprateEnable, slimeballs, spoutEnabled, public static Boolean enableAbilityMessages, enableAbilities, showDisplayName, showFaces, watch, xplockEnable, xpbar, xpicon, partybar, string, bucket, web, xprateEnable, slimeballs, spoutEnabled,
donateMessage, chimaeraWingEnable, xpGainsMobSpawners, myspawnEnable, mccEnable, mcmmoEnable, partyEnable, inviteEnable, acceptEnable, donateMessage, chimaeraWingEnable, xpGainsMobSpawners, myspawnEnable, mccEnable, mcmmoEnable, partyEnable, inviteEnable, acceptEnable,
whoisEnable, statsEnable, addxpEnable, ptpEnable, mmoeditEnable, clearmyspawnEnable, mcgodEnable, mcabilityEnable, mctopEnable, whoisEnable, statsEnable, addxpEnable, ptpEnable, mmoeditEnable, clearmyspawnEnable, mcgodEnable, mcabilityEnable, mctopEnable,
mcrefreshEnable, enableMotd, enableMySpawn, enableRegen, enableCobbleToMossy, useMySQL, cocoabeans, mushrooms, mcrefreshEnable, enableMotd, enableMySpawn, enableRegen, enableCobbleToMossy, useMySQL, cocoabeans, mushrooms,
@ -40,9 +40,9 @@ public class LoadProperties
msugar, mpumpkin, mwheat, mgold, mdiamond, miron, mredstone, mlapis, mobsidian, mnetherrack, mglowstone, mcoal, mstone, MySQLport, msugar, mpumpkin, mwheat, mgold, mdiamond, miron, mredstone, mlapis, mobsidian, mnetherrack, mglowstone, mcoal, mstone, MySQLport,
xpGainMultiplier, superBreakerCooldown, greenTerraCooldown, gigaDrillBreakerCooldown, treeFellerCooldown, xpGainMultiplier, superBreakerCooldown, greenTerraCooldown, gigaDrillBreakerCooldown, treeFellerCooldown,
berserkCooldown, serratedStrikeCooldown, skullSplitterCooldown, abilityDurabilityLoss, berserkCooldown, serratedStrikeCooldown, skullSplitterCooldown, abilityDurabilityLoss,
feathersConsumedByChimaeraWing, repairdiamondlevel, rWood, rStone, rIron, rGold, rDiamond; feathersConsumedByChimaeraWing, bonesConsumedByCOTW, repairdiamondlevel, rWood, rStone, rIron, rGold, rDiamond;
public static double xpbackground_r, xpbackground_g, xpbackground_b, xpborder_r, xpborder_g, xpborder_b, acrobatics_r, acrobatics_g, acrobatics_b, archery_r, archery_g, archery_b, axes_r, axes_g, axes_b, public static double xpbackground_r, xpbackground_g, xpbackground_b, xpborder_r, xpborder_g, xpborder_b, fishing_r, fishing_g, fishing_b, acrobatics_r, acrobatics_g, acrobatics_b, archery_r, archery_g, archery_b, axes_r, axes_g, axes_b,
excavation_r, excavation_g, excavation_b, herbalism_r, herbalism_g, herbalism_b, mining_r, mining_g, mining_b, excavation_r, excavation_g, excavation_b, herbalism_r, herbalism_g, herbalism_b, mining_r, mining_g, mining_b,
repair_r, repair_g, repair_b, swords_r, swords_g, swords_b, taming_r, taming_g, taming_b, unarmed_r, unarmed_g, unarmed_b, repair_r, repair_g, repair_b, swords_r, swords_g, swords_b, taming_r, taming_g, taming_b, unarmed_r, unarmed_g, unarmed_b,
woodcutting_r, woodcutting_g, woodcutting_b, pvpxprewardmodifier, tamingxpmodifier, miningxpmodifier, woodcutting_r, woodcutting_g, woodcutting_b, pvpxprewardmodifier, tamingxpmodifier, miningxpmodifier,
@ -174,6 +174,9 @@ public class LoadProperties
write("Spout.HUD.Retro.Colors.Woodcutting.RED", 0.3); write("Spout.HUD.Retro.Colors.Woodcutting.RED", 0.3);
write("Spout.HUD.Retro.Colors.Woodcutting.GREEN", 0.3); write("Spout.HUD.Retro.Colors.Woodcutting.GREEN", 0.3);
write("Spout.HUD.Retro.Colors.Woodcutting.BLUE", 0.75); write("Spout.HUD.Retro.Colors.Woodcutting.BLUE", 0.75);
write("Spout.HUD.Retro.Colors.Fishing.RED", 0.3);
write("Spout.HUD.Retro.Colors.Fishing.GREEN", 0.3);
write("Spout.HUD.Retro.Colors.Fishing.BLUE", 0.75);
write("Spout.HUD.Retro.Colors.Border.RED", 0.0); write("Spout.HUD.Retro.Colors.Border.RED", 0.0);
write("Spout.HUD.Retro.Colors.Border.GREEN", 0.0); write("Spout.HUD.Retro.Colors.Border.GREEN", 0.0);
write("Spout.HUD.Retro.Colors.Border.BLUE", 0.0); write("Spout.HUD.Retro.Colors.Border.BLUE", 0.0);
@ -322,6 +325,8 @@ public class LoadProperties
write("Abilities.Cooldowns.Berserk", 240); write("Abilities.Cooldowns.Berserk", 240);
write("Abilities.Cooldowns.Serrated_Strikes", 240); write("Abilities.Cooldowns.Serrated_Strikes", 240);
write("Abilities.Cooldowns.Skull_Splitter", 240); write("Abilities.Cooldowns.Skull_Splitter", 240);
write("Abilities.Messages", true);
write("Abilities.Enabled", true);
write("Skills.Repair.Anvil_Messages", true); write("Skills.Repair.Anvil_Messages", true);
write("Skills.Repair.Gold.ID", 266); write("Skills.Repair.Gold.ID", 266);
@ -339,6 +344,7 @@ public class LoadProperties
write("Skills.Excavation.Requires_Shovel", true); write("Skills.Excavation.Requires_Shovel", true);
write("Skills.Mining.Requires_Pickaxe", true); write("Skills.Mining.Requires_Pickaxe", true);
write("Skills.Woodcutting.Requires_Axe", true); write("Skills.Woodcutting.Requires_Axe", true);
write("Skills.Taming.Call_Of_The_Wild.Bones_Required", 10);
loadkeys(); loadkeys();
} }
@ -356,9 +362,14 @@ public class LoadProperties
} }
} }
enableAbilityMessages = readBoolean("Abilities.Messages", true);
enableAbilities = readBoolean("Abilities.Enabled", true);
donateMessage = readBoolean("Commands.mcmmo.Donate_Message", true); donateMessage = readBoolean("Commands.mcmmo.Donate_Message", true);
xpGainsMobSpawners = readBoolean("XP.Gains.Mobspawners.Enabled", false); xpGainsMobSpawners = readBoolean("XP.Gains.Mobspawners.Enabled", false);
bonesConsumedByCOTW = readInteger("Skills.Taming.Call_Of_The_Wild.Bones_Required", 10);
xpbar = readBoolean("Spout.XP.Bar.Enabled", true); xpbar = readBoolean("Spout.XP.Bar.Enabled", true);
//web_url = readString("Spout.Images.URL_DIR", "http://mcmmo.rycochet.net/mcmmo/"); //web_url = readString("Spout.Images.URL_DIR", "http://mcmmo.rycochet.net/mcmmo/");
xpicon = readBoolean("Spout.XP.Icon.Enabled", true); xpicon = readBoolean("Spout.XP.Icon.Enabled", true);
@ -404,6 +415,9 @@ public class LoadProperties
woodcutting_r = readDouble("Spout.HUD.Retro.Colors.Woodcutting.RED", 0.3); woodcutting_r = readDouble("Spout.HUD.Retro.Colors.Woodcutting.RED", 0.3);
woodcutting_g = readDouble("Spout.HUD.Retro.Colors.Woodcutting.GREEN", 0.3); woodcutting_g = readDouble("Spout.HUD.Retro.Colors.Woodcutting.GREEN", 0.3);
woodcutting_b = readDouble("Spout.HUD.Retro.Colors.Woodcutting.BLUE", 0.75); woodcutting_b = readDouble("Spout.HUD.Retro.Colors.Woodcutting.BLUE", 0.75);
fishing_r = readDouble("Spout.HUD.Retro.Colors.Fishing.RED", 0.3);
fishing_g = readDouble("Spout.HUD.Retro.Colors.Fishing.GREEN", 0.3);
fishing_b = readDouble("Spout.HUD.Retro.Colors.Fishing.BLUE", 0.75);
xpborder_r = readDouble("Spout.HUD.Retro.Colors.Border.RED", 0.0); xpborder_r = readDouble("Spout.HUD.Retro.Colors.Border.RED", 0.0);
xpborder_g = readDouble("Spout.HUD.Retro.Colors.Border.GREEN", 0.0); xpborder_g = readDouble("Spout.HUD.Retro.Colors.Border.GREEN", 0.0);

View File

@ -27,7 +27,7 @@ import org.bukkit.World;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.craftbukkit.command.ColouredConsoleSender; import org.bukkit.craftbukkit.command.ColouredConsoleSender;
import org.bukkit.craftbukkit.entity.CraftItem; import org.bukkit.craftbukkit.entity.CraftItem;
import org.bukkit.entity.AnimalTamer; import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.CreatureType; import org.bukkit.entity.CreatureType;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
@ -62,7 +62,6 @@ import com.gmail.nossr50.skills.Fishing;
import com.gmail.nossr50.skills.Herbalism; import com.gmail.nossr50.skills.Herbalism;
import com.gmail.nossr50.skills.Repair; import com.gmail.nossr50.skills.Repair;
import com.gmail.nossr50.skills.Skills; import com.gmail.nossr50.skills.Skills;
import com.gmail.nossr50.skills.Taming;
public class mcPlayerListener extends PlayerListener public class mcPlayerListener extends PlayerListener
@ -191,10 +190,11 @@ public class mcPlayerListener extends PlayerListener
if(block != null && player != null && mcPermissions.getInstance().repair(player) && event.getClickedBlock().getTypeId() == 42) if(block != null && player != null && mcPermissions.getInstance().repair(player) && event.getClickedBlock().getTypeId() == 42)
{ {
event.setCancelled(true);//This is a fix for the sword repair bug
Repair.repairCheck(player, is, event.getClickedBlock()); Repair.repairCheck(player, is, event.getClickedBlock());
} }
if(m.abilityBlockCheck(block)) if(LoadProperties.enableAbilities && m.abilityBlockCheck(block))
{ {
if(block != null && m.isHoe(player.getItemInHand()) && block.getTypeId() != 3 && block.getTypeId() != 2 && block.getTypeId() != 60){ if(block != null && m.isHoe(player.getItemInHand()) && block.getTypeId() != 3 && block.getTypeId() != 2 && block.getTypeId() != 60){
Skills.hoeReadinessCheck(player); Skills.hoeReadinessCheck(player);
@ -240,7 +240,7 @@ public class mcPlayerListener extends PlayerListener
return; return;
} }
} }
if(action == Action.RIGHT_CLICK_AIR) if(LoadProperties.enableAbilities && action == Action.RIGHT_CLICK_AIR)
{ {
Skills.hoeReadinessCheck(player); Skills.hoeReadinessCheck(player);
Skills.abilityActivationCheck(player); Skills.abilityActivationCheck(player);
@ -275,9 +275,9 @@ public class mcPlayerListener extends PlayerListener
ItemStack[] inventory = player.getInventory().getContents(); ItemStack[] inventory = player.getInventory().getContents();
for(ItemStack x : inventory){ for(ItemStack x : inventory){
if(x != null && x.getType() == Material.BONE){ if(x != null && x.getType() == Material.BONE){
if(x.getAmount() >= 10) if(x.getAmount() >= LoadProperties.bonesConsumedByCOTW)
{ {
x.setAmount(x.getAmount() - 10); x.setAmount(x.getAmount() - LoadProperties.bonesConsumedByCOTW);
player.getInventory().setContents(inventory); player.getInventory().setContents(inventory);
player.updateInventory(); player.updateInventory();
break; break;

View File

@ -393,4 +393,4 @@ m.TamingSummon=[[GREEN]]Summoning complete
m.TamingSummonFailed=[[RED]]You have too many wolves nearby to summon any more. m.TamingSummonFailed=[[RED]]You have too many wolves nearby to summon any more.
m.EffectsTaming7_0=Call of the Wild m.EffectsTaming7_0=Call of the Wild
m.EffectsTaming7_1=Summon a wolf to your side m.EffectsTaming7_1=Summon a wolf to your side
m.EffectsTaming7_2=[[GRAY]]COTW HOW-TO: Crouch and right click with 10 Bones in hand m.EffectsTaming7_2=[[GRAY]]COTW HOW-TO: Crouch and right click with {0} Bones in hand

View File

@ -387,4 +387,4 @@ m.TamingSummon=[[GREEN]]Summoning complete
m.TamingSummonFailed=[[RED]]You have too many wolves nearby to summon any more. m.TamingSummonFailed=[[RED]]You have too many wolves nearby to summon any more.
m.EffectsTaming7_0=Call of the Wild m.EffectsTaming7_0=Call of the Wild
m.EffectsTaming7_1=Summon a wolf to your side m.EffectsTaming7_1=Summon a wolf to your side
m.EffectsTaming7_2=[[GRAY]]COTW HOW-TO: Crouch and right click with 10 Bones in hand m.EffectsTaming7_2=[[GRAY]]COTW HOW-TO: Crouch and right click with {0} Bones in hand

View File

@ -387,4 +387,4 @@ m.TamingSummon=[[GREEN]]Summoning complete
m.TamingSummonFailed=[[RED]]You have too many wolves nearby to summon any more. m.TamingSummonFailed=[[RED]]You have too many wolves nearby to summon any more.
m.EffectsTaming7_0=Call of the Wild m.EffectsTaming7_0=Call of the Wild
m.EffectsTaming7_1=Summon a wolf to your side m.EffectsTaming7_1=Summon a wolf to your side
m.EffectsTaming7_2=[[GRAY]]COTW HOW-TO: Crouch and right click with 10 Bones in hand m.EffectsTaming7_2=[[GRAY]]COTW HOW-TO: Crouch and right click with {0} Bones in hand

View File

@ -366,4 +366,4 @@ m.TamingSummon=[[GREEN]]Summoning complete
m.TamingSummonFailed=[[RED]]You have too many wolves nearby to summon any more. m.TamingSummonFailed=[[RED]]You have too many wolves nearby to summon any more.
m.EffectsTaming7_0=Call of the Wild m.EffectsTaming7_0=Call of the Wild
m.EffectsTaming7_1=Summon a wolf to your side m.EffectsTaming7_1=Summon a wolf to your side
m.EffectsTaming7_2=[[GRAY]]COTW HOW-TO: Crouch and right click with 10 Bones in hand m.EffectsTaming7_2=[[GRAY]]COTW HOW-TO: Crouch and right click with {0} Bones in hand

View File

@ -387,4 +387,4 @@ m.TamingSummon=[[GREEN]]Summoning complete
m.TamingSummonFailed=[[RED]]You have too many wolves nearby to summon any more. m.TamingSummonFailed=[[RED]]You have too many wolves nearby to summon any more.
m.EffectsTaming7_0=Call of the Wild m.EffectsTaming7_0=Call of the Wild
m.EffectsTaming7_1=Summon a wolf to your side m.EffectsTaming7_1=Summon a wolf to your side
m.EffectsTaming7_2=[[GRAY]]COTW HOW-TO: Crouch and right click with 10 Bones in hand m.EffectsTaming7_2=[[GRAY]]COTW HOW-TO: Crouch and right click with {0} Bones in hand

View File

@ -393,4 +393,4 @@ m.TamingSummon=[[GREEN]]Summoning complete
m.TamingSummonFailed=[[RED]]You have too many wolves nearby to summon any more. m.TamingSummonFailed=[[RED]]You have too many wolves nearby to summon any more.
m.EffectsTaming7_0=Call of the Wild m.EffectsTaming7_0=Call of the Wild
m.EffectsTaming7_1=Summon a wolf to your side m.EffectsTaming7_1=Summon a wolf to your side
m.EffectsTaming7_2=[[GRAY]]COTW HOW-TO: Crouch and right click with 10 Bones in hand m.EffectsTaming7_2=[[GRAY]]COTW HOW-TO: Crouch and right click with {0} Bones in hand

View File

@ -387,4 +387,4 @@ m.TamingSummon=[[GREEN]]Summoning complete
m.TamingSummonFailed=[[RED]]You have too many wolves nearby to summon any more. m.TamingSummonFailed=[[RED]]You have too many wolves nearby to summon any more.
m.EffectsTaming7_0=Call of the Wild m.EffectsTaming7_0=Call of the Wild
m.EffectsTaming7_1=Summon a wolf to your side m.EffectsTaming7_1=Summon a wolf to your side
m.EffectsTaming7_2=[[GRAY]]COTW HOW-TO: Crouch and right click with 10 Bones in hand m.EffectsTaming7_2=[[GRAY]]COTW HOW-TO: Crouch and right click with {0} Bones in hand

View File

@ -401,4 +401,4 @@ m.TamingSummon=[[GREEN]]Summoning complete
m.TamingSummonFailed=[[RED]]You have too many wolves nearby to summon any more. m.TamingSummonFailed=[[RED]]You have too many wolves nearby to summon any more.
m.EffectsTaming7_0=Call of the Wild m.EffectsTaming7_0=Call of the Wild
m.EffectsTaming7_1=Summon a wolf to your side m.EffectsTaming7_1=Summon a wolf to your side
m.EffectsTaming7_2=[[GRAY]]COTW HOW-TO: Crouch and right click with 10 Bones in hand m.EffectsTaming7_2=[[GRAY]]COTW HOW-TO: Crouch and right click with {0} Bones in hand

View File

@ -379,4 +379,4 @@ m.TamingSummon=[[GREEN]]Summoning complete
m.TamingSummonFailed=[[RED]]You have too many wolves nearby to summon any more. m.TamingSummonFailed=[[RED]]You have too many wolves nearby to summon any more.
m.EffectsTaming7_0=Call of the Wild m.EffectsTaming7_0=Call of the Wild
m.EffectsTaming7_1=Summon a wolf to your side m.EffectsTaming7_1=Summon a wolf to your side
m.EffectsTaming7_2=[[GRAY]]COTW HOW-TO: Crouch and right click with 10 Bones in hand m.EffectsTaming7_2=[[GRAY]]COTW HOW-TO: Crouch and right click with {0} Bones in hand

View File

@ -154,6 +154,21 @@ public class mcMMO extends JavaPlugin
pm.registerEvent(Event.Type.ENTITY_DAMAGE, entityListener, Priority.Monitor, this); pm.registerEvent(Event.Type.ENTITY_DAMAGE, entityListener, Priority.Monitor, this);
pm.registerEvent(Event.Type.CREATURE_SPAWN, entityListener, Priority.Normal, this); pm.registerEvent(Event.Type.CREATURE_SPAWN, entityListener, Priority.Normal, this);
PluginDescriptionFile pdfFile = this.getDescription();
mcPermissions.initialize(getServer());
if(LoadProperties.useMySQL)
{
database = new Database(this);
database.createStructure();
} else
Leaderboard.makeLeaderboards(); //Make the leaderboards
for(Player player : getServer().getOnlinePlayers()){Users.addUser(player);} //In case of reload add all users back into PlayerProfile
System.out.println(pdfFile.getName() + " version " + pdfFile.getVersion() + " is enabled!" );
Bukkit.getServer().getScheduler().scheduleAsyncRepeatingTask(this, mcMMO_Timer, 0, 20);
//Spout Stuff //Spout Stuff
if(LoadProperties.spoutEnabled) if(LoadProperties.spoutEnabled)
{ {
@ -175,21 +190,6 @@ public class mcMMO extends JavaPlugin
}, 20, 20); }, 20, 20);
*/ */
} }
PluginDescriptionFile pdfFile = this.getDescription();
mcPermissions.initialize(getServer());
if(LoadProperties.useMySQL)
{
database = new Database(this);
database.createStructure();
} else
Leaderboard.makeLeaderboards(); //Make the leaderboards
for(Player player : getServer().getOnlinePlayers()){Users.addUser(player);} //In case of reload add all users back into PlayerProfile
System.out.println(pdfFile.getName() + " version " + pdfFile.getVersion() + " is enabled!" );
Bukkit.getServer().getScheduler().scheduleAsyncRepeatingTask(this, mcMMO_Timer, 0, 20);
} }
public PlayerProfile getPlayerProfile(Player player) public PlayerProfile getPlayerProfile(Player player)

View File

@ -17,12 +17,10 @@
package com.gmail.nossr50.skills; package com.gmail.nossr50.skills;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.enchantments.Enchantment; import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import com.gmail.nossr50.Users; import com.gmail.nossr50.Users;
import com.gmail.nossr50.m; import com.gmail.nossr50.m;
import com.gmail.nossr50.mcPermissions; import com.gmail.nossr50.mcPermissions;
@ -50,7 +48,6 @@ public class Repair {
private static String nIron = LoadProperties.nIron; private static String nIron = LoadProperties.nIron;
@SuppressWarnings("deprecation")
public static void repairCheck(Player player, ItemStack is, Block block){ public static void repairCheck(Player player, ItemStack is, Block block){
PlayerProfile PP = Users.getProfile(player); PlayerProfile PP = Users.getProfile(player);
short durabilityBefore = player.getItemInHand().getDurability(); short durabilityBefore = player.getItemInHand().getDurability();
@ -69,7 +66,11 @@ public class Repair {
pos++; pos++;
} }
if(block != null && mcPermissions.getInstance().repair(player)){ if(block != null && mcPermissions.getInstance().repair(player))
{
//Handle the enchantments
addEnchants(player.getItemInHand(), enchants, enchantsLevel, PP, player);
if(player.getItemInHand().getDurability() > 0 && player.getItemInHand().getAmount() < 2){ if(player.getItemInHand().getDurability() > 0 && player.getItemInHand().getAmount() < 2){
/* /*
* ARMOR * ARMOR
@ -130,14 +131,6 @@ public class Repair {
* TOOLS * TOOLS
*/ */
if(isTools(is)){ if(isTools(is)){
if(is.getType() == Material.WOOD_SWORD || is.getType() == Material.STONE_SWORD || is.getType() == Material.IRON_SWORD ||
is.getType() == Material.GOLD_SWORD || is.getType() == Material.DIAMOND_SWORD)
{
player.sendMessage(ChatColor.GOLD+"[mcMMO] "+ChatColor.GREEN+"Sorry this is disabled due to a bug");
player.sendMessage(ChatColor.GREEN+" with changing the durability of swords in CB");
return;
}
if(isStoneTools(is) && hasItem(player, rStone)){ if(isStoneTools(is) && hasItem(player, rStone)){
removeItem(player, rStone); removeItem(player, rStone);
/* /*
@ -145,7 +138,6 @@ public class Repair {
*/ */
player.getItemInHand().setDurability(getRepairAmount(is, player)); player.getItemInHand().setDurability(getRepairAmount(is, player));
durabilityAfter = player.getItemInHand().getDurability(); durabilityAfter = player.getItemInHand().getDurability();
dif = (short) (durabilityBefore - durabilityAfter); dif = (short) (durabilityBefore - durabilityAfter);
if(m.isShovel(is)) if(m.isShovel(is))
@ -238,26 +230,16 @@ public class Repair {
} else { } else {
needMoreVespeneGas(is, player); needMoreVespeneGas(is, player);
} }
//This will solve the issue with swords not repairing properly
if(is.getType() == Material.WOOD_SWORD || is.getType() == Material.STONE_SWORD || is.getType() == Material.IRON_SWORD ||
is.getType() == Material.GOLD_SWORD || is.getType() == Material.DIAMOND_SWORD)
{
player.getItemInHand().getData().setData((byte)player.getItemInHand().getDurability());
}
player.sendMessage("Current Durability Value: "+player.getItemInHand().getDurability());
} }
} else { } else {
player.sendMessage(mcLocale.getString("Skills.FullDurability")); player.sendMessage(mcLocale.getString("Skills.FullDurability"));
} }
player.updateInventory(); //player.updateInventory();
/* /*
* GIVE SKILL IF THERE IS ENOUGH XP * GIVE SKILL IF THERE IS ENOUGH XP
*/ */
Skills.XpCheckSkill(SkillType.REPAIR, player); Skills.XpCheckSkill(SkillType.REPAIR, player);
addEnchants(player.getItemInHand(), enchants, enchantsLevel, PP, player);
} }
} }
public static int getArcaneForgingRank(PlayerProfile PP) public static int getArcaneForgingRank(PlayerProfile PP)
@ -290,6 +272,10 @@ public class Repair {
if(rank == 0) if(rank == 0)
{ {
player.sendMessage(mcLocale.getString("Repair.LostEnchants")); player.sendMessage(mcLocale.getString("Repair.LostEnchants"));
for(Enchantment x : enchants)
{
is.removeEnchantment(x);
}
return; return;
} }
@ -298,8 +284,7 @@ public class Repair {
for(Enchantment x : enchants) for(Enchantment x : enchants)
{ {
//Remove enchant //Remove enchant
if(is.getEnchantments().containsKey(x)) is.removeEnchantment(x);
is.removeEnchantment(x);
if(x.canEnchantItem(is)) if(x.canEnchantItem(is))
{ {
@ -320,7 +305,7 @@ public class Repair {
is.addEnchantment(x, enchantsLvl[pos]); is.addEnchantment(x, enchantsLvl[pos]);
} }
} else { } else {
failure = true; failure = true;
} }
} }
pos++; pos++;
@ -330,10 +315,10 @@ public class Repair {
{ {
player.sendMessage(mcLocale.getString("Repair.ArcanePerfect")); player.sendMessage(mcLocale.getString("Repair.ArcanePerfect"));
} else { } else {
if(failure == false) if(failure == true)
player.sendMessage("Repair.ArcaneFailed"); player.sendMessage(mcLocale.getString("Repair.ArcaneFailed"));
if(downgrade == false) if(downgrade == true)
player.sendMessage("Repair.Downgraded"); player.sendMessage(mcLocale.getString("Repair.Downgraded"));
} }
} }
public static int getEnchantChance(int rank) public static int getEnchantChance(int rank)

View File

@ -115,7 +115,8 @@ public class Skills
+ChatColor.YELLOW+" ("+calculateTimeLeft(player, (PP.getGreenTerraDeactivatedTimeStamp()*1000), LoadProperties.greenTerraCooldown)+"s)"); +ChatColor.YELLOW+" ("+calculateTimeLeft(player, (PP.getGreenTerraDeactivatedTimeStamp()*1000), LoadProperties.greenTerraCooldown)+"s)");
return; return;
} }
player.sendMessage(mcLocale.getString("Skills.ReadyHoe")); if(LoadProperties.enableAbilityMessages)
player.sendMessage(mcLocale.getString("Skills.ReadyHoe"));
PP.setHoePreparationATS(System.currentTimeMillis()); PP.setHoePreparationATS(System.currentTimeMillis());
PP.setHoePreparationMode(true); PP.setHoePreparationMode(true);
} }
@ -236,7 +237,8 @@ public class Skills
+ChatColor.YELLOW+" ("+calculateTimeLeft(player, (PP.getSuperBreakerDeactivatedTimeStamp()*1000), LoadProperties.superBreakerCooldown)+"s)"); +ChatColor.YELLOW+" ("+calculateTimeLeft(player, (PP.getSuperBreakerDeactivatedTimeStamp()*1000), LoadProperties.superBreakerCooldown)+"s)");
return; return;
} }
player.sendMessage(mcLocale.getString("Skills.ReadyPickAxe")); if(LoadProperties.enableAbilityMessages)
player.sendMessage(mcLocale.getString("Skills.ReadyPickAxe"));
PP.setPickaxePreparationATS(System.currentTimeMillis()); PP.setPickaxePreparationATS(System.currentTimeMillis());
PP.setPickaxePreparationMode(true); PP.setPickaxePreparationMode(true);
} }
@ -248,7 +250,8 @@ public class Skills
+ChatColor.YELLOW+" ("+calculateTimeLeft(player, (PP.getGigaDrillBreakerDeactivatedTimeStamp()*1000), LoadProperties.gigaDrillBreakerCooldown)+"s)"); +ChatColor.YELLOW+" ("+calculateTimeLeft(player, (PP.getGigaDrillBreakerDeactivatedTimeStamp()*1000), LoadProperties.gigaDrillBreakerCooldown)+"s)");
return; return;
} }
player.sendMessage(mcLocale.getString("Skills.ReadyShovel")); if(LoadProperties.enableAbilityMessages)
player.sendMessage(mcLocale.getString("Skills.ReadyShovel"));
PP.setShovelPreparationATS(System.currentTimeMillis()); PP.setShovelPreparationATS(System.currentTimeMillis());
PP.setShovelPreparationMode(true); PP.setShovelPreparationMode(true);
} }
@ -260,7 +263,8 @@ public class Skills
+ChatColor.YELLOW+" ("+calculateTimeLeft(player, (PP.getSerratedStrikesDeactivatedTimeStamp()*1000), LoadProperties.serratedStrikeCooldown)+"s)"); +ChatColor.YELLOW+" ("+calculateTimeLeft(player, (PP.getSerratedStrikesDeactivatedTimeStamp()*1000), LoadProperties.serratedStrikeCooldown)+"s)");
return; return;
} }
player.sendMessage(mcLocale.getString("Skills.ReadySword")); if(LoadProperties.enableAbilityMessages)
player.sendMessage(mcLocale.getString("Skills.ReadySword"));
PP.setSwordsPreparationATS(System.currentTimeMillis()); PP.setSwordsPreparationATS(System.currentTimeMillis());
PP.setSwordsPreparationMode(true); PP.setSwordsPreparationMode(true);
} }
@ -272,7 +276,8 @@ public class Skills
+ChatColor.YELLOW+" ("+calculateTimeLeft(player, (PP.getBerserkDeactivatedTimeStamp()*1000), LoadProperties.berserkCooldown)+"s)"); +ChatColor.YELLOW+" ("+calculateTimeLeft(player, (PP.getBerserkDeactivatedTimeStamp()*1000), LoadProperties.berserkCooldown)+"s)");
return; return;
} }
player.sendMessage(mcLocale.getString("Skills.ReadyFists")); if(LoadProperties.enableAbilityMessages)
player.sendMessage(mcLocale.getString("Skills.ReadyFists"));
PP.setFistsPreparationATS(System.currentTimeMillis()); PP.setFistsPreparationATS(System.currentTimeMillis());
PP.setFistsPreparationMode(true); PP.setFistsPreparationMode(true);
} }
@ -280,7 +285,8 @@ public class Skills
{ {
if(m.isAxes(player.getItemInHand())) if(m.isAxes(player.getItemInHand()))
{ {
player.sendMessage(mcLocale.getString("Skills.ReadyAxe")); if(LoadProperties.enableAbilityMessages)
player.sendMessage(mcLocale.getString("Skills.ReadyAxe"));
PP.setAxePreparationATS(System.currentTimeMillis()); PP.setAxePreparationATS(System.currentTimeMillis());
PP.setAxePreparationMode(true); PP.setAxePreparationMode(true);
} }

View File

@ -64,7 +64,6 @@ public class SpoutStuff
private final static mcSpoutScreenListener spoutScreenListener = new mcSpoutScreenListener(plugin); private final static mcSpoutScreenListener spoutScreenListener = new mcSpoutScreenListener(plugin);
public static HashMap<Player, HUDmmo> playerHUDs = new HashMap<Player, HUDmmo>(); public static HashMap<Player, HUDmmo> playerHUDs = new HashMap<Player, HUDmmo>();
//public static HashMap<Player, ArrayList<HealthBarMMO>> partyHealthBars = new HashMap<Player, ArrayList<HealthBarMMO>>();
public static HashMap<SpoutPlayer, PopupMMO> playerScreens = new HashMap<SpoutPlayer, PopupMMO>(); public static HashMap<SpoutPlayer, PopupMMO> playerScreens = new HashMap<SpoutPlayer, PopupMMO>();
public static Keyboard keypress; public static Keyboard keypress;
@ -128,10 +127,9 @@ public class SpoutStuff
for(SkillType y : SkillType.values()) for(SkillType y : SkillType.values())
{ {
if(y == SkillType.ALL) if(y == SkillType.ALL || y == SkillType.ENCHANTING || y == SkillType.ALCHEMY)
continue; continue;
String theFileNameA = m.getCapitalized(y.toString())+".png"; String theFileNameA = m.getCapitalized(y.toString())+".png";
String theFileNameB = m.getCapitalized(y.toString())+"_r.png"; String theFileNameB = m.getCapitalized(y.toString())+"_r.png";
@ -193,7 +191,7 @@ public class SpoutStuff
//Standard XP Icons //Standard XP Icons
for(SkillType y : SkillType.values()) for(SkillType y : SkillType.values())
{ {
if(y == SkillType.ALL) if(y == SkillType.ALL || y == SkillType.ENCHANTING || y == SkillType.ALCHEMY)
continue; continue;
files.add(new File(dir+"HUD/Standard/"+m.getCapitalized(y.toString())+".png")); files.add(new File(dir+"HUD/Standard/"+m.getCapitalized(y.toString())+".png"));
files.add(new File(dir+"HUD/Retro/"+m.getCapitalized(y.toString())+"_r.png")); files.add(new File(dir+"HUD/Retro/"+m.getCapitalized(y.toString())+"_r.png"));
@ -242,6 +240,8 @@ public class SpoutStuff
return new Color((float)LoadProperties.unarmed_r, (float)LoadProperties.unarmed_g, (float)LoadProperties.unarmed_b, 1f); return new Color((float)LoadProperties.unarmed_r, (float)LoadProperties.unarmed_g, (float)LoadProperties.unarmed_b, 1f);
case WOODCUTTING: case WOODCUTTING:
return new Color((float)LoadProperties.woodcutting_r, (float)LoadProperties.woodcutting_g, (float)LoadProperties.woodcutting_b, 1f); return new Color((float)LoadProperties.woodcutting_r, (float)LoadProperties.woodcutting_g, (float)LoadProperties.woodcutting_b, 1f);
case FISHING:
return new Color((float)LoadProperties.fishing_r, (float)LoadProperties.fishing_g, (float)LoadProperties.fishing_b, 1f);
default: default:
return new Color(0.3f, 0.3f, 0.75f, 1f); return new Color(0.3f, 0.3f, 0.75f, 1f);
} }
@ -490,6 +490,25 @@ public class SpoutStuff
break; break;
} }
break; break;
case FISHING:
switch(getNotificationTier(PP.getSkillLevel(skillType)))
{
case 1:
mat = Material.RAW_FISH;
break;
case 2:
mat = Material.RAW_FISH;
break;
case 3:
mat = Material.COOKED_FISH;
break;
case 4:
mat = Material.COOKED_FISH;
break;
case 5:
mat = Material.FISHING_ROD;
break;
}
default: default:
mat = Material.WATCH; mat = Material.WATCH;
break; break;

View File

@ -1,6 +1,6 @@
name: mcMMO name: mcMMO
main: com.gmail.nossr50.mcMMO main: com.gmail.nossr50.mcMMO
version: 1.2.00 version: 1.2.01
softdepend: [Spout] softdepend: [Spout]
author: nossr50 author: nossr50
description: mcMMO takes core Minecraft game mechanics and expands them to add an extensive RPG experience, the goal of the project has always been a quality RPG experience. Everything in mcMMO is carefully thought out and is constantly improving. mcMMO adds eleven skills to train in and level in, while also offering a high level of customization for server admins. There are countless features, including custom sounds, graphical elements, and more added when running mcMMO in conjunction with Spout. I carefully read feedback and evaluate the mechanics of mcMMO in every update to provide an ever-evolving experience. description: mcMMO takes core Minecraft game mechanics and expands them to add an extensive RPG experience, the goal of the project has always been a quality RPG experience. Everything in mcMMO is carefully thought out and is constantly improving. mcMMO adds eleven skills to train in and level in, while also offering a high level of customization for server admins. There are countless features, including custom sounds, graphical elements, and more added when running mcMMO in conjunction with Spout. I carefully read feedback and evaluate the mechanics of mcMMO in every update to provide an ever-evolving experience.

BIN
src/resources/Fishing.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
src/resources/Fishing_r.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB