Release of 1.0.00

This commit is contained in:
nossr50 2011-08-16 02:33:34 -07:00
parent 8208230e92
commit 03661fb651
23 changed files with 495 additions and 268 deletions

View File

@ -1,18 +1,23 @@
Changelog:
#Versions without changelogs probably had very small misc fixes, like tweaks to the source code
Version 1.0.51
Brand new XP Bars and Skill Icons designed by BrandonXP
Version 1.1.0
Brand new XP Bars, Health bars, and Skill Icons designed by BrandonXP
Added /xplock <skillname> to lock the xp bar to a skill
Repairing metal now has a sound effect
Leveling up now has a sound effect
Shears added to Repair
MySpawn now works correctly when you are in the nether
MySpawn message when you right click a bed is now squelched
Intervals at which players renegerate hp have doubled in length (making it take 100% longer to regenerate than before)
Rewrote many variables stored per player to be integer instead of long, reducing overall memory usage of mcMMO
Rewrote the Timer mcMMO relies on to instead use the BukkitScheduler for performance
Fixed the party member list of /party
Fixed bug where Swords would counter-attack Projectiles
Removed a debug message when repairing diamond armor
Changed chat to use getDisplayName() instead of getName()
Changed chat priority from lowest to highest
Added Clay to excavation
Added new items to Clay's loot tables
Archery now works with the latest CB
Version 1.0.50
New /xprate command for those with mcmmo.admin permissions!

View File

@ -3,7 +3,6 @@ package com.gmail.nossr50;
import org.bukkit.World;
import org.bukkit.entity.*;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityDamageByProjectileEvent;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.plugin.Plugin;
@ -50,7 +49,7 @@ public class Combat
combatAbilityChecks(attacker, PPa, pluginx);
//Check for offensive procs
if(!(event instanceof EntityDamageByProjectileEvent))
if(!(((EntityDamageByEntityEvent) event).getDamager() instanceof Arrow))
{
if(mcPermissions.getInstance().axes(attacker))
Axes.axeCriticalCheck(attacker, eventb, pluginx); //Axe Criticals
@ -218,8 +217,8 @@ public class Combat
}
}
//Another offensive check for Archery
if(event instanceof EntityDamageByProjectileEvent)
archeryCheck((EntityDamageByProjectileEvent) event, pluginx);
if(event instanceof EntityDamageByEntityEvent && event.getCause() == DamageCause.PROJECTILE && ((EntityDamageByEntityEvent) event).getDamager() instanceof Arrow)
archeryCheck((EntityDamageByEntityEvent)event, pluginx);
/*
* DEFENSIVE CHECKS
@ -228,7 +227,7 @@ public class Combat
{
Player defender = (Player)event.getEntity();
Swords.parryCheck((EntityDamageByEntityEvent) event, defender);
Swords.counterAttackChecks(event);
Swords.counterAttackChecks((EntityDamageByEntityEvent)event);
Acrobatics.dodgeChecks((EntityDamageByEntityEvent)event);
}
/*
@ -272,12 +271,12 @@ public class Combat
if(PPa.getFistsPreparationMode())
Unarmed.berserkActivationCheck(attacker);
}
public static void archeryCheck(EntityDamageByProjectileEvent event, mcMMO pluginx)
public static void archeryCheck(EntityDamageByEntityEvent event, mcMMO pluginx)
{
Entity y = event.getDamager();
Arrow arrow = (Arrow)event.getDamager();
Entity y = arrow.getShooter();
Entity x = event.getEntity();
Projectile projectile = event.getProjectile();
if(projectile.toString().equals("CraftArrow") && x instanceof Player)
if(x instanceof Player)
{
Player defender = (Player)x;
PlayerProfile PPd = Users.getProfile(defender);
@ -308,7 +307,7 @@ public class Combat
{
Player attacker = (Player)y;
PlayerProfile PPa = Users.getProfile(attacker);
if(projectile.toString().equals("CraftArrow") && mcPermissions.getInstance().archery(attacker))
if(mcPermissions.getInstance().archery(attacker))
{
Archery.trackArrows(pluginx, x, event, attacker);
/*

View File

@ -57,7 +57,8 @@ public class Commands
{
Player player = null;
PlayerProfile PP = null;
if(sender instanceof Player) {
if(sender instanceof Player)
{
player = (Player) sender;
PP = Users.getProfile(player);
}
@ -519,10 +520,8 @@ public class Commands
PP.toggleAbilityUse();
}
}
else if (label.equalsIgnoreCase("xprate"))
else if (LoadProperties.xprateEnable && label.equalsIgnoreCase(LoadProperties.xprate))
{
//TODO: Localization.. I know me so lazy today, I'll do it tomorrow
if(sender instanceof Player)
{
if(!mcPermissions.getInstance().admin(player))
@ -532,15 +531,15 @@ public class Commands
}
if(split.length <= 1)
{
player.sendMessage(ChatColor.DARK_AQUA+"Proper usage is /xprate [integer] [true:false]");
player.sendMessage(ChatColor.DARK_AQUA+"Also you can type /xprate reset to turn everything back to normal");
player.sendMessage(mcLocale.getString("Commands.xprate.proper", new Object[] {LoadProperties.xprate}));
player.sendMessage(mcLocale.getString("Commands.xprate.proper2", new Object[] {LoadProperties.xprate}));
}
if(split.length == 2 && split[1].equalsIgnoreCase("reset"))
{
if(xpevent)
{
for(Player x : Bukkit.getServer().getOnlinePlayers())
x.sendMessage(ChatColor.RED+"mcMMO XP Event is OVER!!");
x.sendMessage(mcLocale.getString("Commands.xprate.over"));
xpevent = !xpevent;
LoadProperties.xpGainMultiplier = oldrate;
} else
@ -560,23 +559,23 @@ public class Commands
xpevent = false;
} else
{
player.sendMessage("Enter true or false for the second value");
player.sendMessage(mcLocale.getString("Commands.xprate.proper3"));
return true;
}
LoadProperties.xpGainMultiplier = m.getInt(split[1]);
if(xpevent = true)
for(Player x : Bukkit.getServer().getOnlinePlayers())
{
x.sendMessage(ChatColor.GOLD+"XP EVENT FOR mcMMO HAS STARTED!");
x.sendMessage(ChatColor.GOLD+"mcMMO XP RATE IS NOW "+LoadProperties.xpGainMultiplier+"x!!");
x.sendMessage(mcLocale.getString("Commands.xprate.started"));
x.sendMessage(mcLocale.getString("Commands.xprate.started2", new Object[] {LoadProperties.xpGainMultiplier}));
}
}
} else
{
if(split.length <= 1)
{
System.out.println(ChatColor.DARK_AQUA+"Proper usage is /xprate [integer] [true:false]");
System.out.println(ChatColor.DARK_AQUA+"Also you can type /xprate reset to turn everything back to normal");
System.out.println(mcLocale.getString("Commands.xprate.proper", new Object[] {LoadProperties.xprate}));
System.out.println(mcLocale.getString("Commands.xprate.proper2", new Object[] {LoadProperties.xprate}));
}
if(split.length == 2 && split[1].equalsIgnoreCase("reset"))
@ -584,7 +583,7 @@ public class Commands
if(xpevent)
{
for(Player x : Bukkit.getServer().getOnlinePlayers())
x.sendMessage(ChatColor.RED+"mcMMO XP Event is OVER!!");
x.sendMessage(mcLocale.getString("Commands.xprate.over"));
xpevent = !xpevent;
LoadProperties.xpGainMultiplier = oldrate;
} else
@ -605,7 +604,7 @@ public class Commands
xpevent = false;
} else
{
System.out.println("Enter true or false for the second value");
System.out.println(mcLocale.getString("Commands.xprate.proper3"));
return true;
}
LoadProperties.xpGainMultiplier = m.getInt(split[1]);
@ -1148,7 +1147,16 @@ public class Commands
}
PP.acceptInvite();
Pinstance.addToParty(player, PP, PP.getParty(), true);
} else {
//Refresh party hp bars
if(LoadProperties.spoutEnabled)
{
SpoutStuff.resetPartyHealthBarDisplays(Party.getInstance().getPartyMembers(player));
SpoutStuff.resetPartyHealthBarDisplays(player);
}
} else
{
player.sendMessage(mcLocale.getString("mcPlayerListener.NoInvites"));
}
}
@ -1166,6 +1174,13 @@ public class Commands
if(PP.inParty() && (!Pinstance.isParty(PP.getParty()) || !Pinstance.isInParty(player, PP)))
{
Pinstance.addToParty(player, PP, PP.getParty(), false);
//Refresh party hp bars
if(LoadProperties.spoutEnabled)
{
SpoutStuff.resetPartyHealthBarDisplays(Party.getInstance().getPartyMembers(player));
SpoutStuff.resetPartyHealthBarDisplays(player);
}
}
if(args.length == 0 && !PP.inParty())
@ -1213,16 +1228,12 @@ public class Commands
player.sendMessage(mcLocale.getString("mcPlayerListener.YouAreInParty", new Object[] {PP.getParty()}));
player.sendMessage(mcLocale.getString("mcPlayerListener.PartyMembers")+" ("+tempList+ChatColor.GREEN+")");
return true;
} else if(args.length == 1){
} else if(args.length == 1)
{
if(args[0].equals("q") && PP.inParty())
{
ArrayList<Player> partymembers = Party.getInstance().getPartyMembers(player);
Pinstance.removeFromParty(player, PP);
if(LoadProperties.spoutEnabled)
SpoutStuff.resetPartyHealthBarDisplays(partymembers);
player.sendMessage(mcLocale.getString("mcPlayerListener.LeftParty"));
return true;
} else if (args[0].equalsIgnoreCase("?")) {
@ -1276,8 +1287,12 @@ public class Commands
Pinstance.removeFromParty(player, PP);
//Refresh party hp bars
if(LoadProperties.spoutEnabled)
{
SpoutStuff.resetPartyHealthBarDisplays(partymembers);
SpoutStuff.resetPartyHealthBarDisplays(player);
}
}
Pinstance.addToParty(player, PP, args[0], false);
return true;
@ -1332,8 +1347,12 @@ public class Commands
Pinstance.removeFromParty(tPlayer, tPP);
//Refresh party hp bars
if(LoadProperties.spoutEnabled)
{
SpoutStuff.resetPartyHealthBarDisplays(partymembers);
SpoutStuff.resetPartyHealthBarDisplays(player);
}
tPlayer.sendMessage(mcLocale.getString("mcPlayerListener.LeftParty"));
}
@ -1482,7 +1501,7 @@ public class Commands
}
String aPrefix = ChatColor.AQUA + "{" + ChatColor.WHITE
+ player.getName() + ChatColor.AQUA + "} ";
+ player.getDisplayName() + ChatColor.AQUA + "} ";
log.log(Level.INFO, "[A]<" + player.getDisplayName() + "> "
+ aMessage);
for (Player herp : Bukkit.getServer().getOnlinePlayers()) {
@ -1510,7 +1529,8 @@ public class Commands
/*
* MYSPAWN
*/
else if(LoadProperties.myspawnEnable && LoadProperties.enableMySpawn && label.equalsIgnoreCase(LoadProperties.myspawn)){
else if(LoadProperties.myspawnEnable && LoadProperties.enableMySpawn && label.equalsIgnoreCase(LoadProperties.myspawn))
{
if(!mcPermissions.getInstance().mySpawn(player)){
player.sendMessage(ChatColor.YELLOW+"[mcMMO] "+ChatColor.DARK_RED +mcLocale.getString("mcPlayerListener.NoPermission"));
return true;
@ -1536,6 +1556,45 @@ public class Commands
player.sendMessage(mcLocale.getString("mcPlayerListener.MyspawnNotExist"));
}
}
else if(LoadProperties.spoutEnabled && LoadProperties.xpbar && LoadProperties.xplockEnable && label.equalsIgnoreCase(LoadProperties.xplock))
{
if(split.length >= 2 && Skills.isSkill(split[1]) && mcPermissions.permission(player, "mcmmo.skills."+Skills.getSkillType(split[1]).toString().toLowerCase()))
{
if(PP.getXpBarLocked())
{
PP.setSkillLock(Skills.getSkillType(split[1]));
player.sendMessage(mcLocale.getString("Commands.xplock.locked", new Object[] {m.getCapitalized(PP.getSkillLock().toString())}));
}
else
{
PP.setSkillLock(Skills.getSkillType(split[1]));
PP.toggleXpBarLocked();
player.sendMessage(mcLocale.getString("Commands.xplock.locked", new Object[] {m.getCapitalized(PP.getSkillLock().toString())}));
}
SpoutStuff.updateXpBar(player);
} else if (split.length < 2)
{
if(PP.getXpBarLocked())
{
PP.toggleXpBarLocked();
player.sendMessage(mcLocale.getString("Commands.xplock.unlocked"));
} else if(PP.getLastGained() != null)
{
PP.toggleXpBarLocked();
PP.setSkillLock(PP.getLastGained());
player.sendMessage(mcLocale.getString("Commands.xplock.locked", new Object[] {m.getCapitalized(PP.getSkillLock().toString())}));
}
}
else if (split.length >= 2 && !Skills.isSkill(split[1]))
{
player.sendMessage("Commands.xplock.invalid");
}
else if(split.length >= 2 && Skills.isSkill(split[1]) && !mcPermissions.permission(player, "mcmmo.skills."+Skills.getSkillType(split[1]).toString().toLowerCase()))
{
player.sendMessage(ChatColor.YELLOW+"[mcMMO] "+ChatColor.DARK_RED +mcLocale.getString("mcPlayerListener.NoPermission"));
return true;
}
}
return true;
}
}

View File

@ -5,9 +5,9 @@ import org.bukkit.util.config.Configuration;
public class LoadProperties
{
public static Boolean slimeballs, spoutEnabled, donateMessage, chimaeraWingEnable, xpGainsMobSpawners, myspawnEnable, mccEnable, mcmmoEnable, partyEnable, inviteEnable, acceptEnable, whoisEnable, statsEnable, addxpEnable, ptpEnable, mmoeditEnable, clearmyspawnEnable, mcgodEnable, mcabilityEnable, mctopEnable, mcrefreshEnable, enableMotd, enableMySpawn, enableRegen, enableCobbleToMossy, useMySQL, cocoabeans, archeryFireRateLimit, mushrooms, toolsLoseDurabilityFromAbilities, pvpxp, miningrequirespickaxe, woodcuttingrequiresaxe, eggs, apples, cake, music, diamond, glowstone, slowsand, sulphur, netherrack, bones, coal, clay, anvilmessages;
public static String MySQLtablePrefix, MySQLuserName, MySQLserverName, MySQLdbName, MySQLdbPass, mctop, addxp, mcability, mcmmo, mcc, mcrefresh, mcgod, stats, mmoedit, ptp, party, myspawn, whois, invite, accept, clearmyspawn, nWood, nStone, nIron, nGold, nDiamond, locale;
public static int archeryLimit, chimaeraId, msandstone, mcocoa, water_thunder, cure_self, cure_other, mslimeballs, mbones, msulphur, mslowsand, mmushroom2, mglowstone2, mmusic, mdiamond2, mbase, mapple, meggs, mcake, mpine, mbirch, mspruce, mcactus, mmushroom, mflower, msugar, mpumpkin, mwheat, mgold, mdiamond, miron, mredstone, mlapis, mobsidian, mnetherrack, mglowstone, mcoal, mstone, MySQLport, xpGainMultiplier, superBreakerCooldown = 240, greenTerraCooldown = 240, gigaDrillBreakerCooldown = 240, treeFellerCooldown = 240, berserkCooldown = 240, serratedStrikeCooldown = 240, skullSplitterCooldown = 240, abilityDurabilityLoss, feathersConsumedByChimaeraWing, pvpxprewardmodifier, repairdiamondlevel, globalxpmodifier, tamingxpmodifier, miningxpmodifier, repairxpmodifier, woodcuttingxpmodifier, sorceryxpmodifier = 2, unarmedxpmodifier, herbalismxpmodifier, excavationxpmodifier, archeryxpmodifier, swordsxpmodifier, axesxpmodifier, acrobaticsxpmodifier, rWood, rStone, rIron, rGold, rDiamond;
public static Boolean xplockEnable, xpbar, xpicon, partybar, map, string, bucket, web, xprateEnable, slimeballs, spoutEnabled, donateMessage, chimaeraWingEnable, xpGainsMobSpawners, myspawnEnable, mccEnable, mcmmoEnable, partyEnable, inviteEnable, acceptEnable, whoisEnable, statsEnable, addxpEnable, ptpEnable, mmoeditEnable, clearmyspawnEnable, mcgodEnable, mcabilityEnable, mctopEnable, mcrefreshEnable, enableMotd, enableMySpawn, enableRegen, enableCobbleToMossy, useMySQL, cocoabeans, archeryFireRateLimit, mushrooms, toolsLoseDurabilityFromAbilities, pvpxp, miningrequirespickaxe, woodcuttingrequiresaxe, eggs, apples, cake, music, diamond, glowstone, slowsand, sulphur, netherrack, bones, coal, clay, anvilmessages;
public static String xplock, repair_url, xpbar_url, xpicon_url, partybar_url, MySQLtablePrefix, MySQLuserName, MySQLserverName, MySQLdbName, MySQLdbPass, mctop, addxp, xprate, mcability, mcmmo, mcc, mcrefresh, mcgod, stats, mmoedit, ptp, party, myspawn, whois, invite, accept, clearmyspawn, nWood, nStone, nIron, nGold, nDiamond, locale;
public static int xpbar_x, xpbar_y, xpicon_x, xpicon_y, partybar_x, partybar_y, partybar_spacing, mmap, mstring, mbucket, mweb, archeryLimit, chimaeraId, msandstone, mcocoa, water_thunder, cure_self, cure_other, mslimeballs, mbones, msulphur, mslowsand, mmushroom2, mglowstone2, mmusic, mdiamond2, mbase, mapple, meggs, mcake, mpine, mbirch, mspruce, mcactus, mmushroom, mflower, msugar, mpumpkin, mwheat, mgold, mdiamond, miron, mredstone, mlapis, mobsidian, mnetherrack, mglowstone, mcoal, mstone, MySQLport, xpGainMultiplier, superBreakerCooldown = 240, greenTerraCooldown = 240, gigaDrillBreakerCooldown = 240, treeFellerCooldown = 240, berserkCooldown = 240, serratedStrikeCooldown = 240, skullSplitterCooldown = 240, abilityDurabilityLoss, feathersConsumedByChimaeraWing, pvpxprewardmodifier, repairdiamondlevel, globalxpmodifier, tamingxpmodifier, miningxpmodifier, repairxpmodifier, woodcuttingxpmodifier, sorceryxpmodifier = 2, unarmedxpmodifier, herbalismxpmodifier, excavationxpmodifier, archeryxpmodifier, swordsxpmodifier, axesxpmodifier, acrobaticsxpmodifier, rWood, rStone, rIron, rGold, rDiamond;
public String directory = "plugins/mcMMO/";
File file = new File(directory + File.separator + "config.yml");
Configuration config = null;
@ -78,6 +78,21 @@ public class LoadProperties
System.out.println("Generating Config File...");
//Put in defaults
write("Spout.XP.Bar.Enabled", true);
write("Spout.XP.Bar.URL_DIR", "http://dl.dropbox.com/u/18212134/xpbar/");
write("Spout.XP.Icon.Enabled", true);
write("Spout.XP.Icon.URL_DIR", "http://dl.dropbox.com/u/18212134/xpbar/");
write("Spout.XP.Bar.X_POS", 95);
write("Spout.XP.Bar.Y_POS", 6);
write("Spout.XP.Icon.X_POS", 78);
write("Spout.XP.Icon.Y_POS", 2);
write("Spout.Party.HP.Enabled", true);
write("Spout.Party.HP.URL_DIR", "http://dl.dropbox.com/u/18212134/xpbar/");
write("Spout.Party.HP.X_POS", -11);
write("Spout.Party.HP.Y_POS", 0);
write("Spout.Party.HP.SPACING", 16);
write("Spout.SFX.Repair.URL", "http://dl.dropbox.com/u/18212134/xpbar/ui_armorweapon_repair.wav");
write("MySQL.Enabled", false);
write("MySQL.Server.Address", "localhost");
write("MySQL.Server.Port", 3306);
@ -145,6 +160,10 @@ public class LoadProperties
write("XP.Excavation.Cake", 300);
write("XP.Excavation.Slimeballs", 10);
write("XP.Excavation.Cocoa_Beans", 10);
write("XP.Excavation.Map", 20);
write("XP.Excavation.String", 20);
write("XP.Excavation.Bucket", 10);
write("XP.Excavation.Web", 15);
//write("Sorcery.Spells.Water.Thunder", 75);
//write("Sorcery.Spells.Curative.Cure_Self.Mana_Cost", 5);
@ -163,7 +182,13 @@ public class LoadProperties
write("Excavation.Drops.Netherrack", true);
write("Excavation.Drops.Bones", true);
write("Excavation.Drops.Slimeballs", true);
write("Excavation.Drops.Map", true);
write("Excavation.Drops.String", true);
write("Excavation.Drops.Bucket", true);
write("Excavation.Drops.Web", true);
write("Commands.xprate.Name", "xprate");
write("Commands.xprate.Enabled", true);
write("Commands.mctop.Name", "mctop");
write("Commands.mctop.Enabled", true);
write("Commands.addxp.Name", "addxp");
@ -197,6 +222,8 @@ public class LoadProperties
write("Commands.accept.Enabled", true);
write("Commands.clearmyspawn.Name", "clearmyspawn");
write("Commands.clearmyspawn.Enabled", true);
write("Commands.xplock.Enabled", true);
write("Commands.xplock.Name", "xplock");
write("Abilities.Tools.Durability_Loss_Enabled", true);
write("Abilities.Tools.Durability_Loss", 2);
@ -235,6 +262,21 @@ public class LoadProperties
donateMessage = readBoolean("Commands.mcmmo.Donate_Message", true);
xpGainsMobSpawners = readBoolean("XP.Gains.Mobspawners.Enabled", false);
xpbar = readBoolean("Spout.XP.Bar.Enabled", true);
xpbar_url = readString("Spout.XP.Bar.URL_DIR", "http://dl.dropbox.com/u/18212134/xpbar/");
xpicon = readBoolean("Spout.XP.Icon.Enabled", true);
xpicon_url = readString("Spout.XP.Icon.URL_DIR", "http://dl.dropbox.com/u/18212134/xpbar/");
xpbar_x = readInteger("Spout.XP.Bar.X_POS", 95);
xpbar_y = readInteger("Spout.XP.Bar.Y_POS", 6);
xpicon_x = readInteger("Spout.XP.Icon.X_POS", 78);
xpicon_y = readInteger("Spout.XP.Icon.Y_POS", 2);
partybar = readBoolean("Spout.Party.HP.Enabled", true);
partybar_url = readString("Spout.Party.HP.URL_DIR", "http://dl.dropbox.com/u/18212134/xpbar/");
partybar_x = readInteger("Spout.Party.HP.X_POS", -11);
partybar_y = readInteger("Spout.Party.HP.Y_POS", 0);
partybar_spacing = readInteger("Spout.Party.HP.SPACING", 16);
repair_url = readString("Spout.SFX.Repair.URL", "http://dl.dropbox.com/u/18212134/xpbar/ui_armorweapon_repair.wav");
msulphur = readInteger("XP.Excavation.Sulphur", 3);
mbones = readInteger("XP.Excavation.Bones", 3);
mbase = readInteger("XP.Excavation.Base", 4);
@ -248,6 +290,10 @@ public class LoadProperties
mcake = readInteger("XP.Excavation.Cake", 300);
mcocoa = readInteger("XP.Excavation.Cocoa_Beans", 10);
mslimeballs = readInteger("XP.Excavation.Slimeballs", 10);
mstring = readInteger("XP.Excavation.String", 20);
mbucket = readInteger("XP.Excavation.Bucket", 10);
mweb = readInteger("XP.Excavation.Web", 15);
mmap = readInteger("XP.Excavation.Map", 20);
msugar = readInteger("XP.Herbalism.Sugar_Cane", 3);
mwheat = readInteger("XP.Herbalism.Wheat", 5);
@ -355,6 +401,13 @@ public class LoadProperties
netherrack = readBoolean("Excavation.Drops.Netherrack", true);
bones = readBoolean("Excavation.Drops.Bones", true);
slimeballs = readBoolean("Excavation.Drops.Slimeballs", true);
map = readBoolean("Excavation.Drops.Map", true);
string = readBoolean("Excavation.Drops.String", true);
bucket = readBoolean("Excavation.Drops.Bucket", true);
web = readBoolean("Excavation.Drops.Web", true);
xprate = readString("Commands.xprate.Name", "xprate");
xprateEnable = readBoolean("Commands.xprate.Enabled", true);
mctop = readString("Commands.mctop.Name", "mctop");
mctopEnable = readBoolean("Commands.mctop.Enabled", true);
@ -403,5 +456,8 @@ public class LoadProperties
clearmyspawn = readString("Commands.clearmyspawn.Name", "clearmyspawn");
clearmyspawnEnable = readBoolean("Commands.clearmyspawn.Enabled", true);
xplockEnable = readBoolean("Commands.xplock.Enabled", true);
xplock = readString("Commands.xplock.Name", "xplock");
}
}

View File

@ -28,7 +28,7 @@ public class PlayerProfile
private String party, myspawn, myspawnworld, invite;
//TOGGLES
private boolean placedAnvil = false, partyChatMode = false, adminChatMode = false, godMode = false, greenTerraMode, partyChatOnly = false, greenTerraInformed = true, berserkInformed = true, skullSplitterInformed = true, gigaDrillBreakerInformed = true,
private boolean xpbarlocked = false, placedAnvil = false, partyChatMode = false, adminChatMode = false, godMode = false, greenTerraMode, partyChatOnly = false, greenTerraInformed = true, berserkInformed = true, skullSplitterInformed = true, gigaDrillBreakerInformed = true,
superBreakerInformed = true, serratedStrikesInformed = true, treeFellerInformed = true, dead, abilityuse = true, treeFellerMode, superBreakerMode, gigaDrillBreakerMode,
serratedStrikesMode, hoePreparationMode = false, shovelPreparationMode = false, swordsPreparationMode = false, fistsPreparationMode = false, pickaxePreparationMode = false, axePreparationMode = false, skullSplitterMode, berserkMode;
@ -39,7 +39,7 @@ public class PlayerProfile
respawnATS = 0, mySpawnATS = 0, greenTerraATS = 0, greenTerraDATS = 0, superBreakerATS = 0, superBreakerDATS = 0, serratedStrikesATS = 0, serratedStrikesDATS = 0, treeFellerATS = 0, treeFellerDATS = 0,
skullSplitterATS = 0, skullSplitterDATS = 0, hoePreparationATS = 0, axePreparationATS = 0, pickaxePreparationATS = 0, fistsPreparationATS = 0, shovelPreparationATS = 0, swordsPreparationATS = 0;
private SkillType lastgained = null;
private SkillType lastgained = null, skillLock = null;
//MySQL STUFF
private int xpbarinc=0, lastlogin=0, userid = 0, bleedticks = 0;
@ -424,6 +424,14 @@ public class PlayerProfile
log.log(Level.SEVERE, "Exception while writing to " + location + " (Are you sure you formatted it correctly?)", e);
}
}
public boolean getXpBarLocked()
{
return xpbarlocked;
}
public void toggleXpBarLocked()
{
xpbarlocked = !xpbarlocked;
}
public int getXpBarInc()
{
return xpbarinc;
@ -432,6 +440,14 @@ public class PlayerProfile
{
xpbarinc = newvalue;
}
public void setSkillLock(SkillType newvalue)
{
skillLock = newvalue;
}
public SkillType getSkillLock()
{
return skillLock;
}
public void setLastGained(SkillType newvalue)
{
lastgained = newvalue;

View File

@ -94,11 +94,13 @@ public class mcPlayerListener extends PlayerListener
/*
* GARBAGE COLLECTION
*/
//Discard the PlayerProfile object
Player player = event.getPlayer();
Users.removeUser(event.getPlayer());
//Health bar stuff
if(LoadProperties.spoutEnabled && Users.getProfile(player).inParty())
SpoutStuff.resetPartyHealthBarDisplays(Party.getInstance().getPartyMembers(player));
if(LoadProperties.spoutEnabled)
{
if(SpoutStuff.xpbars.containsKey(event.getPlayer()))
@ -108,9 +110,7 @@ public class mcPlayerListener extends PlayerListener
SpoutStuff.xpicons.remove(event.getPlayer());
}
//Health bar stuff
if(LoadProperties.spoutEnabled && Users.getProfile(player).inParty())
SpoutStuff.resetPartyHealthBarDisplays(Party.getInstance().getPartyMembers(player));
Users.removeUser(event.getPlayer());
}
public void onPlayerJoin(PlayerJoinEvent event)

View File

@ -2,7 +2,6 @@ package com.gmail.nossr50.listeners;
import org.getspout.spoutapi.event.spout.SpoutCraftEnableEvent;
import org.getspout.spoutapi.event.spout.SpoutListener;
import org.getspout.spoutapi.gui.GenericTexture;
import org.getspout.spoutapi.player.SpoutPlayer;
import com.gmail.nossr50.Users;
@ -15,41 +14,12 @@ public class mcSpoutListener extends SpoutListener
SpoutPlayer sPlayer = event.getPlayer();
if(sPlayer.isSpoutCraftEnabled())
{
//Setup xp bar
GenericTexture xpbar = new GenericTexture();
GenericTexture xpicon = new GenericTexture();
//Setup Party HUD stuff
if(Users.getProfile(sPlayer).inParty())
SpoutStuff.initializePartyTracking(sPlayer);
xpicon.setUrl("http://dl.dropbox.com/u/18212134/xpbar/icon.png");
xpicon.setHeight(16).setWidth(32).setX(93).setY(2);
xpbar.setUrl("http://dl.dropbox.com/u/18212134/xpbar/xpbar_inc000.png");
xpbar.setX(110).setY(6).setHeight(8).setWidth(256);
SpoutStuff.xpbars.put(sPlayer, xpbar);
SpoutStuff.xpicons.put(sPlayer, xpicon);
sPlayer.getMainScreen().attachWidget(SpoutStuff.xpbars.get(sPlayer));
sPlayer.getMainScreen().attachWidget(SpoutStuff.xpicons.get(sPlayer));
sPlayer.getMainScreen().setDirty(true);
//Setup player XP-Bar & XP-Icon
SpoutStuff.initializeXpBarDisplay(sPlayer);
}
}
/*
public void onServerTick(ServerTickEvent event)
{
for(Player x : SpoutStuff.xpbars.keySet())
{
PlayerProfile PP = Users.getProfile(x);
if(PP.getLastGained() != null)
{
if(SpoutStuff.shouldBeFilled(PP))
SpoutStuff.updateXpBarFill(x);
}
}
}
*/
}

View File

@ -346,3 +346,12 @@ Party.NowOwner=[[RED]]Du bist nun der Gruppenleiter.
Party.NowNotOwner=[[RED]]Du bist nicht laenger der Gruppenleiter.
Party.RequiresPass=[[RED]]Diese Gruppe benoetigt ein Passwort. Nutze [[YELLOW]]/{0}[[WHITE]] <party> <password>[[RED]] zum beitreten.
Party.PtpDelay=[[RED]]Du kannst dies nicht so zeitig erneut benutzen [[WHITE]]([[YELLOW]]{0}s[[WHITE]])
Commands.xprate.proper=[[DARK_AQUA]]Proper usage is /{0} [integer] [true:false]
Commands.xprate.proper2=[[DARK_AQUA]]Also you can type /{0} reset to turn everything back to normal
Commands.xprate.proper3=[[RED]]Enter true or false for the second value
Commands.xprate.over=[[RED]]mcMMO XP Rate Event is OVER!!
Commands.xprate.started=[[GOLD]]XP EVENT FOR mcMMO HAS STARTED!
Commands.xprate.started2=[[GOLD]]mcMMO XP RATE IS NOW {0}x!!
Commands.xplock.locked=[[GOLD]]Your XP BAR is now locked to {0}!
Commands.xplock.unlocked=[[GOLD]]Your XP BAR is now [[GREEN]]UNLOCKED[[GOLD]]!
Commands.xplock.invalid=[[RED]]That is not a valid skillname! Try /xplock mining

View File

@ -340,3 +340,12 @@ Party.PasswordSet=[[GREEN]]Party password set to {0}
Party.CouldNotKick=[[DARK_RED]]Could not kick player {0}
Party.NotInYourParty=[[DARK_RED]]{0} is not in your party
Party.CouldNotSetOwner=[[DARK_RED]]Could not set owner to {0}
Commands.xprate.proper=[[DARK_AQUA]]Proper usage is /{0} [integer] [true:false]
Commands.xprate.proper2=[[DARK_AQUA]]Also you can type /{0} reset to turn everything back to normal
Commands.xprate.proper3=[[RED]]Enter true or false for the second value
Commands.xprate.over=[[RED]]mcMMO XP Rate Event is OVER!!
Commands.xprate.started=[[GOLD]]XP EVENT FOR mcMMO HAS STARTED!
Commands.xprate.started2=[[GOLD]]mcMMO XP RATE IS NOW {0}x!!
Commands.xplock.locked=[[GOLD]]Your XP BAR is now locked to {0}!
Commands.xplock.unlocked=[[GOLD]]Your XP BAR is now [[GREEN]]UNLOCKED[[GOLD]]!
Commands.xplock.invalid=[[RED]]That is not a valid skillname! Try /xplock mining

View File

@ -319,3 +319,12 @@ Party.PasswordSet=[[GREEN]]Party password set to {0}
Party.CouldNotKick=[[DARK_RED]]Could not kick player {0}
Party.NotInYourParty=[[DARK_RED]]{0} is not in your party
Party.CouldNotSetOwner=[[DARK_RED]]Could not set owner to {0}
Commands.xprate.proper=[[DARK_AQUA]]Proper usage is /{0} [integer] [true:false]
Commands.xprate.proper2=[[DARK_AQUA]]Also you can type /{0} reset to turn everything back to normal
Commands.xprate.proper3=[[RED]]Enter true or false for the second value
Commands.xprate.over=[[RED]]mcMMO XP Rate Event is OVER!!
Commands.xprate.started=[[GOLD]]XP EVENT FOR mcMMO HAS STARTED!
Commands.xprate.started2=[[GOLD]]mcMMO XP RATE IS NOW {0}x!!
Commands.xplock.locked=[[GOLD]]Your XP BAR is now locked to {0}!
Commands.xplock.unlocked=[[GOLD]]Your XP BAR is now [[GREEN]]UNLOCKED[[GOLD]]!
Commands.xplock.invalid=[[RED]]That is not a valid skillname! Try /xplock mining

View File

@ -340,3 +340,12 @@ Party.PasswordSet=[[GREEN]]Party password set to {0}
Party.CouldNotKick=[[DARK_RED]]Could not kick player {0}
Party.NotInYourParty=[[DARK_RED]]{0} is not in your party
Party.CouldNotSetOwner=[[DARK_RED]]Could not set owner to {0}
Commands.xprate.proper=[[DARK_AQUA]]Proper usage is /{0} [integer] [true:false]
Commands.xprate.proper2=[[DARK_AQUA]]Also you can type /{0} reset to turn everything back to normal
Commands.xprate.proper3=[[RED]]Enter true or false for the second value
Commands.xprate.over=[[RED]]mcMMO XP Rate Event is OVER!!
Commands.xprate.started=[[GOLD]]XP EVENT FOR mcMMO HAS STARTED!
Commands.xprate.started2=[[GOLD]]mcMMO XP RATE IS NOW {0}x!!
Commands.xplock.locked=[[GOLD]]Your XP BAR is now locked to {0}!
Commands.xplock.unlocked=[[GOLD]]Your XP BAR is now [[GREEN]]UNLOCKED[[GOLD]]!
Commands.xplock.invalid=[[RED]]That is not a valid skillname! Try /xplock mining

View File

@ -346,3 +346,12 @@ Party.PasswordSet=[[GREEN]]Party password set to {0}
Party.CouldNotKick=[[DARK_RED]]Could not kick player {0}
Party.NotInYourParty=[[DARK_RED]]{0} is not in your party
Party.CouldNotSetOwner=[[DARK_RED]]Could not set owner to {0}
Commands.xprate.proper=[[DARK_AQUA]]Proper usage is /{0} [integer] [true:false]
Commands.xprate.proper2=[[DARK_AQUA]]Also you can type /{0} reset to turn everything back to normal
Commands.xprate.proper3=[[RED]]Enter true or false for the second value
Commands.xprate.over=[[RED]]mcMMO XP Rate Event is OVER!!
Commands.xprate.started=[[GOLD]]XP EVENT FOR mcMMO HAS STARTED!
Commands.xprate.started2=[[GOLD]]mcMMO XP RATE IS NOW {0}x!!
Commands.xplock.locked=[[GOLD]]Your XP BAR is now locked to {0}!
Commands.xplock.unlocked=[[GOLD]]Your XP BAR is now [[GREEN]]UNLOCKED[[GOLD]]!
Commands.xplock.invalid=[[RED]]That is not a valid skillname! Try /xplock mining

View File

@ -340,3 +340,12 @@ Party.PasswordSet=[[GREEN]]Haslo grupy zmienione na: {0}
Party.CouldNotKick=[[DARK_RED]]Nie mozna wyrzucic gracza {0}
Party.NotInYourParty=[[DARK_RED]]{0} nie jest czlonkiem twojej grupy.
Party.CouldNotSetOwner=[[DARK_RED]]Nie mozna przekazac grupy do {0}
Commands.xprate.proper=[[DARK_AQUA]]Proper usage is /{0} [integer] [true:false]
Commands.xprate.proper2=[[DARK_AQUA]]Also you can type /{0} reset to turn everything back to normal
Commands.xprate.proper3=[[RED]]Enter true or false for the second value
Commands.xprate.over=[[RED]]mcMMO XP Rate Event is OVER!!
Commands.xprate.started=[[GOLD]]XP EVENT FOR mcMMO HAS STARTED!
Commands.xprate.started2=[[GOLD]]mcMMO XP RATE IS NOW {0}x!!
Commands.xplock.locked=[[GOLD]]Your XP BAR is now locked to {0}!
Commands.xplock.unlocked=[[GOLD]]Your XP BAR is now [[GREEN]]UNLOCKED[[GOLD]]!
Commands.xplock.invalid=[[RED]]That is not a valid skillname! Try /xplock mining

View File

@ -54,7 +54,7 @@ public class mcPermissions
return permissionsEnabled;
}
private static boolean permission(Player player, String permission)
public static boolean permission(Player player, String permission)
{
if(!permissionsEnabled) return player.isOp();
switch(permissionType) {
@ -235,60 +235,6 @@ public class mcPermissions
}
return instance;
}
public boolean sorcery(Player player){
if (permissionsEnabled) {
return permission(player, "mcmmo.skills.sorcery");
} else {
return true;
}
}
/*
* SORCERY WATER
*/
public boolean sorceryWater(Player player)
{
if (permissionsEnabled) {
return permission(player, "mcmmo.skills.sorcery.water");
} else {
return true;
}
}
public boolean sorceryWaterThunder(Player player)
{
if (permissionsEnabled) {
return permission(player, "mcmmo.skills.sorcery.water.thunder");
} else {
return true;
}
}
/*
* SORCERY CURATIVE
*/
public boolean sorceryCurative(Player player)
{
if (permissionsEnabled) {
return permission(player, "mcmmo.skills.curative");
} else {
return true;
}
}
public boolean sorceryCurativeHealOther(Player player)
{
if (permissionsEnabled) {
return permission(player, "mcmmo.skills.curative.heal.other");
} else {
return true;
}
}
public boolean sorceryCurativeHealSelf(Player player)
{
if (permissionsEnabled) {
return permission(player, "mcmmo.skills.curative.heal.self");
} else {
return true;
}
}
public boolean taming(Player player) {
if (permissionsEnabled) {
return permission(player, "mcmmo.skills.taming");

View File

@ -20,6 +20,7 @@ import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.locale.mcLocale;
import com.gmail.nossr50.spout.SpoutStuff;
public class Party
@ -108,7 +109,7 @@ public class Party
for(Player p : Bukkit.getServer().getOnlinePlayers())
{
if(player != null && p != null)
if(p.isOnline() && player != null && p != null)
{
if(inSameParty(player, p) && !p.getName().equals(player.getName()))
{
@ -159,21 +160,32 @@ public class Party
public void removeFromParty(Player player, PlayerProfile PP)
{
ArrayList<Player> partymembers = Party.getInstance().getPartyMembers(player);
//Stop NPE... hopefully
if(!isParty(PP.getParty()) || !isInParty(player, PP))
addToParty(player, PP, PP.getParty(), false);
informPartyMembersQuit(player);
String party = PP.getParty();
if(isPartyLeader(player, party)) {
if(isPartyLeader(player, party))
{
if(isPartyLocked(party)) {
unlockParty(party);
}
}
this.partyPlayers.get(party).remove(player.getName());
if(isPartyEmpty(party)) deleteParty(party);
PP.removeParty();
savePartyPlayers();
//Refresh party hp bars
if(LoadProperties.spoutEnabled)
{
SpoutStuff.resetPartyHealthBarDisplays(partymembers);
SpoutStuff.resetPartyHealthBarDisplays(player);
}
}
public void addToParty(Player player, PlayerProfile PP, String newParty, Boolean invite) {

View File

@ -3,8 +3,7 @@ package com.gmail.nossr50.skills;
import org.bukkit.Location;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityDamageByProjectileEvent;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import com.gmail.nossr50.Users;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.datatypes.PlayerProfile;
@ -14,7 +13,7 @@ import com.gmail.nossr50.party.Party;
public class Archery
{
public static void trackArrows(mcMMO pluginx, Entity x, EntityDamageByProjectileEvent event, Player attacker)
public static void trackArrows(mcMMO pluginx, Entity x, EntityDamageByEntityEvent event, Player attacker)
{
PlayerProfile PPa = Users.getProfile(attacker);
if(!pluginx.misc.arrowTracker.containsKey(x) && event.getDamage() > 0)
@ -41,7 +40,7 @@ public class Archery
}
}
}
public static void ignitionCheck(Entity x, EntityDamageByProjectileEvent event, Player attacker)
public static void ignitionCheck(Entity x, EntityDamageByEntityEvent event, Player attacker)
{
PlayerProfile PPa = Users.getProfile(attacker);
if(Math.random() * 100 >= 75)

View File

@ -56,12 +56,7 @@ public class Excavation
}
public static boolean canBeGigaDrillBroken(Block block)
{
int i = block.getTypeId();
if(i == 2||i == 3||i == 12||i == 13){
return true;
} else {
return false;
}
return block.getType() == Material.DIRT || block.getType() == Material.GRASS || block.getType() == Material.SAND || block.getType() == Material.GRAVEL || block.getType() == Material.CLAY;
}
public static void excavationProcCheck(byte data, int type, Location loc, Player player)
{
@ -131,8 +126,8 @@ public class Excavation
is.add(new ItemStack(Material.SOUL_SAND, 1, (byte)0, (byte)0));
}
break;
case 13:
if(LoadProperties.slimeballs && PP.getSkillLevel(SkillType.EXCAVATION) >= 50)
case 82:
if(LoadProperties.slimeballs && PP.getSkillLevel(SkillType.EXCAVATION) >= 150)
{
if(Math.random() * 20 > 19)
{
@ -140,10 +135,43 @@ public class Excavation
is.add(new ItemStack(Material.SLIME_BALL, 1, (byte)0, (byte)0));
}
}
if(LoadProperties.string && PP.getSkillLevel(SkillType.EXCAVATION) >= 250)
{
if(Math.random() * 20 > 19)
{
xp+= LoadProperties.mstring * LoadProperties.xpGainMultiplier;
is.add(new ItemStack(Material.STRING, 1, (byte)0, (byte)0));
}
}
if(LoadProperties.map && PP.getSkillLevel(SkillType.EXCAVATION) >= 25)
{
if(Math.random() * 50 > 49)
{
xp+= LoadProperties.mmap * LoadProperties.xpGainMultiplier;
is.add(new ItemStack(Material.MAP, 1, (byte)0, (byte)0));
}
}
if(LoadProperties.bucket && PP.getSkillLevel(SkillType.EXCAVATION) >= 500)
{
if(Math.random() * 100 > 99)
{
xp+= LoadProperties.mbucket * LoadProperties.xpGainMultiplier;
is.add(new ItemStack(Material.BUCKET, 1, (byte)0, (byte)0));
}
}
if(LoadProperties.web && PP.getSkillLevel(SkillType.EXCAVATION) >= 750)
{
if(Math.random() * 20 > 19)
{
xp+= LoadProperties.mweb * LoadProperties.xpGainMultiplier;
is.add(new ItemStack(Material.WEB, 1, (byte)0, (byte)0));
}
}
break;
}
//DIRT SAND OR GRAVEL
if(type == 3 || type == 13 || type == 2 || type == 12)
if(type == 3 || type == 13 || type == 2 || type == 12 || type == 82)
{
xp+= LoadProperties.mbase * LoadProperties.xpGainMultiplier;
if(PP.getSkillLevel(SkillType.EXCAVATION) >= 750)
@ -193,7 +221,7 @@ public class Excavation
if(LoadProperties.cocoabeans == true && Math.random() * 75 > 74)
{
xp+= LoadProperties.mcocoa * LoadProperties.xpGainMultiplier;
is.add(new ItemStack(Material.getMaterial(351), 1, (short)3, (byte)0));
is.add(new ItemStack(Material.getMaterial(351), 1, (byte)0, (byte)3));
}
}
//CHANCE FOR SHROOMS

View File

@ -200,77 +200,38 @@ public class Repair {
}
}
public static boolean isArmor(ItemStack is){
if(is.getTypeId() == 306 || is.getTypeId() == 307 ||is.getTypeId() == 308 ||is.getTypeId() == 309 ||
return is.getTypeId() == 306 || is.getTypeId() == 307 ||is.getTypeId() == 308 ||is.getTypeId() == 309 ||
is.getTypeId() == 310 ||is.getTypeId() == 311 ||is.getTypeId() == 312 ||is.getTypeId() == 313 ||
is.getTypeId() == 314 || is.getTypeId() == 315 || is.getTypeId() == 316 || is.getTypeId() == 317){
return true;
} else {
return false;
}
is.getTypeId() == 314 || is.getTypeId() == 315 || is.getTypeId() == 316 || is.getTypeId() == 317;
}
public static boolean isGoldArmor(ItemStack is){
if(is.getTypeId() == 314 || is.getTypeId() == 315 || is.getTypeId() == 316 || is.getTypeId() == 317){
return true;
} else {
return false;
}
return is.getTypeId() == 314 || is.getTypeId() == 315 || is.getTypeId() == 316 || is.getTypeId() == 317;
}
public static boolean isIronArmor(ItemStack is){
if(is.getTypeId() == 306 || is.getTypeId() == 307 || is.getTypeId() == 308 || is.getTypeId() == 309)
{
return true;
} else {
return false;
}
return is.getTypeId() == 306 || is.getTypeId() == 307 || is.getTypeId() == 308 || is.getTypeId() == 309;
}
public static boolean isDiamondArmor(ItemStack is){
if(is.getTypeId() == 310 || is.getTypeId() == 311 || is.getTypeId() == 312 || is.getTypeId() == 313)
{
return true;
} else {
return false;
}
return is.getTypeId() == 310 || is.getTypeId() == 311 || is.getTypeId() == 312 || is.getTypeId() == 313;
}
public static boolean isTools(ItemStack is){
if(is.getTypeId() == 256 || is.getTypeId() == 257 || is.getTypeId() == 258 || is.getTypeId() == 267 || is.getTypeId() == 292 || //IRON
public static boolean isTools(ItemStack is)
{
return is.getTypeId() == 359 || is.getTypeId() == 256 || is.getTypeId() == 257 || is.getTypeId() == 258 || is.getTypeId() == 267 || is.getTypeId() == 292 || //IRON
is.getTypeId() == 276 || is.getTypeId() == 277 || is.getTypeId() == 278 || is.getTypeId() == 279 || is.getTypeId() == 293 || //DIAMOND
is.getTypeId() == 283 || is.getTypeId() == 285 || is.getTypeId() == 286 || is.getTypeId() == 284 || //GOLD
is.getTypeId() == 268 || is.getTypeId() == 269 || is.getTypeId() == 270 || is.getTypeId() == 271 || is.getTypeId() == 290 ||//WOOD
is.getTypeId() == 272 || is.getTypeId() == 273 || is.getTypeId() == 274 || is.getTypeId() == 275|| is.getTypeId() == 291) //STONE
{
return true;
} else {
return false;
}
is.getTypeId() == 272 || is.getTypeId() == 273 || is.getTypeId() == 274 || is.getTypeId() == 275|| is.getTypeId() == 291; //STONE
}
public static boolean isStoneTools(ItemStack is){
if(is.getTypeId() == 272 || is.getTypeId() == 273 || is.getTypeId() == 274 || is.getTypeId() == 275 || is.getTypeId() == 291){
return true;
} else {
return false;
}
return is.getTypeId() == 272 || is.getTypeId() == 273 || is.getTypeId() == 274 || is.getTypeId() == 275 || is.getTypeId() == 291;
}
public static boolean isWoodTools(ItemStack is){
if(is.getTypeId() == 268 || is.getTypeId() == 269 || is.getTypeId() == 270 || is.getTypeId() == 271 || is.getTypeId() == 290){
return true;
} else {
return false;
}
return is.getTypeId() == 268 || is.getTypeId() == 269 || is.getTypeId() == 270 || is.getTypeId() == 271 || is.getTypeId() == 290;
}
public static boolean isGoldTools(ItemStack is){
if(is.getTypeId() == 283 || is.getTypeId() == 285 || is.getTypeId() == 286 || is.getTypeId() == 284 || is.getTypeId() == 294){
return true;
} else {
return false;
}
return is.getTypeId() == 283 || is.getTypeId() == 285 || is.getTypeId() == 286 || is.getTypeId() == 284 || is.getTypeId() == 294;
}
public static boolean isIronTools(ItemStack is){
if(is.getTypeId() == 256 || is.getTypeId() == 257 || is.getTypeId() == 258 || is.getTypeId() == 267 || is.getTypeId() == 292)
{
return true;
} else {
return false;
}
return is.getTypeId() == 359 || is.getTypeId() == 256 || is.getTypeId() == 257 || is.getTypeId() == 258 || is.getTypeId() == 267 || is.getTypeId() == 292;
}
public static boolean isDiamondTools(ItemStack is){
@ -331,6 +292,10 @@ public class Repair {
/*
* TOOLS
*/
//SHEARS
case 359:
ramt = 119;
break;
//WOOD SWORD
case 268:
ramt = 30;

View File

@ -388,7 +388,7 @@ public class Skills
}
public static boolean hasCombatSkills(Player player)
{
if(mcPermissions.getInstance().axes(player) || mcPermissions.getInstance().archery(player) || mcPermissions.getInstance().sorcery(player) || mcPermissions.getInstance().swords(player) || mcPermissions.getInstance().taming(player) || mcPermissions.getInstance().unarmed(player))
if(mcPermissions.getInstance().axes(player) || mcPermissions.getInstance().archery(player) || mcPermissions.getInstance().swords(player) || mcPermissions.getInstance().taming(player) || mcPermissions.getInstance().unarmed(player))
return true;
else
return false;

View File

@ -1,14 +1,12 @@
package com.gmail.nossr50.skills;
import org.bukkit.ChatColor;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Wolf;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityDamageByProjectileEvent;
import org.bukkit.event.entity.EntityDamageEvent;
import com.gmail.nossr50.Combat;
import com.gmail.nossr50.Users;
import com.gmail.nossr50.m;
@ -194,10 +192,11 @@ public class Swords
}
}
}
public static void counterAttackChecks(EntityDamageEvent event){
public static void counterAttackChecks(EntityDamageByEntityEvent event)
{
//Don't want to counter attack arrows
if(event instanceof EntityDamageByProjectileEvent)
if(event.getDamager() instanceof Arrow)
return;
if(event instanceof EntityDamageByEntityEvent)

View File

@ -19,6 +19,8 @@ import org.getspout.spoutapi.sound.SoundManager;
import com.gmail.nossr50.Users;
import com.gmail.nossr50.m;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
import com.gmail.nossr50.datatypes.HealthBarMMO;
@ -32,21 +34,45 @@ public class SpoutStuff
public static HashMap<Player, GenericTexture> xpicons = new HashMap<Player, GenericTexture>();
public static HashMap<Player, ArrayList<HealthBarMMO>> partyHealthBars = new HashMap<Player, ArrayList<HealthBarMMO>>();
static mcMMO plugin = (mcMMO) Bukkit.getServer().getPluginManager().getPlugin("mcMMO");
public static void registerCustomEvent()
{
Bukkit.getServer().getPluginManager().registerEvent(Event.Type.CUSTOM_EVENT, spoutListener, Priority.Normal, Bukkit.getServer().getPluginManager().getPlugin("mcMMO"));
}
public static void initializeXpBarDisplay(SpoutPlayer sPlayer)
{
//Setup xp bar
GenericTexture xpbar = new GenericTexture();
GenericTexture xpicon = new GenericTexture();
xpicon.setUrl(LoadProperties.xpicon_url+"icon.png");
xpicon.setHeight(16).setWidth(32).setX(LoadProperties.xpicon_x).setY(LoadProperties.xpicon_y);
xpbar.setUrl(LoadProperties.xpbar_url+"xpbar_inc000.png");
xpbar.setX(LoadProperties.xpbar_x).setY(LoadProperties.xpbar_y).setHeight(8).setWidth(256);
SpoutStuff.xpbars.put(sPlayer, xpbar);
SpoutStuff.xpicons.put(sPlayer, xpicon);
sPlayer.getMainScreen().attachWidget(plugin, SpoutStuff.xpbars.get(sPlayer));
sPlayer.getMainScreen().attachWidget(plugin, SpoutStuff.xpicons.get(sPlayer));
sPlayer.getMainScreen().setDirty(true);
}
public static String getHealthBarURL(Integer hp)
{
String url = "";
if(hp.toString().toCharArray().length > 1)
url = "http://dl.dropbox.com/u/18212134/xpbar/health_inc"+hp+".png";
url = LoadProperties.xpbar_url+"health_inc"+hp+".png";
else
url = "http://dl.dropbox.com/u/18212134/xpbar/health_inc0"+hp+".png";
url = LoadProperties.xpbar_url+"health_inc0"+hp+".png";
return url;
}
public static void playSoundForPlayer(SoundEffect effect, Player player, Location location)
{
//Contrib stuff
@ -54,60 +80,143 @@ public class SpoutStuff
SpoutPlayer sPlayer = SpoutManager.getPlayer(player);
SM.playSoundEffect(sPlayer, effect, location);
}
public static void initializePartyTracking(SpoutPlayer player)
{
int pos = 0;
ArrayList<HealthBarMMO> hpbars = new ArrayList<HealthBarMMO>();
for(Player x : Party.getInstance().getPartyMembers(player))
if(Users.getProfile(player).inParty())
{
HealthBarMMO hpbar = new HealthBarMMO(x, x.getName());
hpbar.health_name.setX(0).setY(pos);
hpbar.health_bar.setX(-11).setY(pos+8);
hpbars.add(hpbar);
pos+=20;
}
int pos = LoadProperties.partybar_y;
partyHealthBars.put(player, hpbars);
for(HealthBarMMO x : partyHealthBars.get(player))
{
if(x != null)
ArrayList<HealthBarMMO> hpbars = new ArrayList<HealthBarMMO>();
for(Player x : Party.getInstance().getPartyMembers(player))
{
player.getMainScreen().attachWidget(x.health_bar);
player.getMainScreen().attachWidget(x.health_name);
}
}
player.getMainScreen().setDirty(true);
}
public static void resetPartyHealthBarDisplays(ArrayList<Player> players)
{
for(Player x : players)
{
SpoutPlayer sPlayer = SpoutManager.getPlayer(x);
if(sPlayer.isSpoutCraftEnabled())
{
ArrayList<Widget> widgets = new ArrayList<Widget>();
for(Widget w : sPlayer.getMainScreen().getAttachedWidgets())
if(x.isOnline())
{
if(w instanceof HealthBarMMO)
HealthBarMMO hpbar = new HealthBarMMO(x, x.getName());
hpbar.health_name.setX(LoadProperties.partybar_x+11).setY(pos);
hpbar.health_bar.setX(LoadProperties.partybar_x).setY(pos+8);
hpbars.add(hpbar);
pos+=LoadProperties.partybar_spacing;
}
}
if(hpbars.size() >= 1)
partyHealthBars.put(player, hpbars);
if(partyHealthBars.get(player) != null)
{
for(HealthBarMMO x : partyHealthBars.get(player))
{
if(x != null)
{
widgets.add(w);
player.getMainScreen().attachWidget(plugin, x.health_bar);
player.getMainScreen().attachWidget(plugin, x.health_name);
}
}
for(Widget w : widgets)
{
sPlayer.getMainScreen().removeWidget(w);
}
sPlayer.getMainScreen().setDirty(true);
partyHealthBars.get(x).clear();
initializePartyTracking(SpoutManager.getPlayer(x));
player.getMainScreen().setDirty(true);
}
}
}
public static void resetPartyHealthBarDisplays(final ArrayList<Player> players)
{
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(plugin,
new Runnable()
{
public void run()
{
for (Player x : players)
{
if(partyHealthBars.get(x) != null)
{
final SpoutPlayer sPlayer = SpoutManager.getPlayer(x);
if (sPlayer.isSpoutCraftEnabled())
{
ArrayList<Widget> widgets = new ArrayList<Widget>();
for (Widget w : sPlayer.getMainScreen().getAttachedWidgets())
{
for (HealthBarMMO hp : partyHealthBars.get(x))
{
if(w.getId() == hp.health_bar.getId() || w.getId() == hp.health_name.getId())
{
widgets.add(w);
}
}
}
for (Widget w : widgets)
{
sPlayer.getMainScreen().removeWidget(w);
}
sPlayer.getMainScreen().setDirty(true);
partyHealthBars.get(x).clear();
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(plugin,
new Runnable()
{
public void run() {
initializePartyTracking(sPlayer);
}
}, 1);
}
} else if (SpoutManager.getPlayer(x).isSpoutCraftEnabled())
{
initializePartyTracking(SpoutManager.getPlayer(x));
}
}
}
}, 1);
}
public static void resetPartyHealthBarDisplays(final Player player)
{
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(plugin,
new Runnable()
{
public void run()
{
if(partyHealthBars.get(player) != null)
{
SpoutPlayer sPlayer = SpoutManager.getPlayer(player);
if (sPlayer.isSpoutCraftEnabled())
{
System.out.println("Resetting health bars for "+player.getName());
ArrayList<Widget> widgets = new ArrayList<Widget>();
for (Widget w : sPlayer.getMainScreen().getAttachedWidgets())
{
for (HealthBarMMO hp : partyHealthBars.get(player))
{
if(w.getId() == hp.health_bar.getId() || w.getId() == hp.health_name.getId())
{
widgets.add(w);
}
}
}
for (Widget w : widgets)
{
System.out.println("Removing hpbar for "+sPlayer.getName());
sPlayer.getMainScreen().removeWidget(w);
}
sPlayer.getMainScreen().setDirty(true);
partyHealthBars.get(player).clear();
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(plugin,
new Runnable()
{
public void run() {
initializePartyTracking(SpoutManager
.getPlayer(player));
}
}, 1);
}
} else if (SpoutManager.getPlayer(player).isSpoutCraftEnabled())
{
initializePartyTracking(SpoutManager.getPlayer(player));
}
}
}, 1);
}
public static void updatePartyHealthBarDisplay(Player player, Integer hp)
{
@ -132,13 +241,13 @@ public class SpoutStuff
{
SoundManager SM = SpoutManager.getSoundManager();
SpoutPlayer sPlayer = SpoutManager.getPlayer(player);
SM.playCustomMusic(Bukkit.getServer().getPluginManager().getPlugin("mcMMO"), sPlayer, "http://dl.dropbox.com/u/18212134/xpbar/ui_armorweapon_repair.wav", false);
SM.playCustomMusic(Bukkit.getServer().getPluginManager().getPlugin("mcMMO"), sPlayer, LoadProperties.repair_url, false);
}
public static void playLevelUpNoise(Player player)
{
SoundManager SM = SpoutManager.getSoundManager();
SpoutPlayer sPlayer = SpoutManager.getPlayer(player);
SM.playCustomMusic(Bukkit.getServer().getPluginManager().getPlugin("mcMMO"), sPlayer, "http://dl.dropbox.com/u/18212134/ANUSOUND/"+(int)Math.random()*8+".wav", false);
//SoundManager SM = SpoutManager.getSoundManager();
//SpoutPlayer sPlayer = SpoutManager.getPlayer(player);
//SM.playCustomMusic(Bukkit.getServer().getPluginManager().getPlugin("mcMMO"), sPlayer, "http://dl.dropbox.com/u/18212134/ANUSOUND/"+(int)Math.random()*8+".wav", false);
}
public static void levelUpNotification(SkillType skillType, SpoutPlayer sPlayer)
@ -387,17 +496,25 @@ public class SpoutStuff
{
PlayerProfile PP = Users.getProfile(player);
if(PP.getLastGained() != null)
if(PP.getLastGained() != null && !PP.getXpBarLocked())
{
int num = getXpInc(PP.getSkillXpLevel(PP.getLastGained()), PP.getXpToLevel(PP.getLastGained()));
xpbars.get(player).setUrl(getUrlBar(num)).setDirty(true);
xpicons.get(player).setUrl(getUrlIcon(PP.getLastGained())).setDirty(true);
((SpoutPlayer)player).getMainScreen().setDirty(true);
SpoutManager.getPlayer(player).getMainScreen().setDirty(true);
} else if (PP.getXpBarLocked())
{
int num = getXpInc(PP.getSkillXpLevel(PP.getSkillLock()), PP.getXpToLevel(PP.getSkillLock()));
xpbars.get(player).setUrl(getUrlBar(num)).setDirty(true);
xpicons.get(player).setUrl(getUrlIcon(PP.getSkillLock())).setDirty(true);
SpoutManager.getPlayer(player).getMainScreen().setDirty(true);
}
}
public static void updateXpBarFill(Player player)
{
PlayerProfile PP = Users.getProfile(player);

View File

@ -1,8 +1,10 @@
name: mcMMO
main: com.gmail.nossr50.mcMMO
version: 1.0.51 WIP v2
version: 1.1.0
softdepend: [Spout]
commands:
xplock:
description: Lock your xp bar
xprate:
description: Modify the xp rate or start an event
mcc: