All changes up to 0.7.8

This commit is contained in:
nossr50 2011-02-24 06:30:42 -08:00
parent 0d208a6f1b
commit 35759ddf1f
5 changed files with 130 additions and 26 deletions

View File

@ -1,5 +1,13 @@
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 0.7.8
Massive tweaks to XP gain for Archery, Swords, Axes, Unarmed
Version 0.7.7
Minor tweak to how players are added to the flat file
Fixed some nullpointer exceptions when players die
Version 0.7.6
Fixed being able to repair diamond armor with below 50 skill
Myspawn now supports multiple worlds, clearing myspawn will set it to the first world created by the server
Version 0.7.5 Version 0.7.5
Removed random checks for herbalism XP Removed random checks for herbalism XP
Herbalism is now called properly (This should fix gaining no xp or double drops) Herbalism is now called properly (This should fix gaining no xp or double drops)

View File

@ -5,6 +5,8 @@ import java.util.logging.Logger;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.World.Environment;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerChatEvent; import org.bukkit.event.player.PlayerChatEvent;
@ -12,6 +14,7 @@ import org.bukkit.event.player.PlayerEvent;
import org.bukkit.event.player.PlayerItemEvent; import org.bukkit.event.player.PlayerItemEvent;
import org.bukkit.event.player.PlayerItemHeldEvent; import org.bukkit.event.player.PlayerItemHeldEvent;
import org.bukkit.event.player.PlayerListener; import org.bukkit.event.player.PlayerListener;
import org.bukkit.plugin.*;
import org.bukkit.event.player.PlayerRespawnEvent; import org.bukkit.event.player.PlayerRespawnEvent;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
@ -27,11 +30,14 @@ public class mcPlayerListener extends PlayerListener {
} }
public void onPlayerRespawn(PlayerRespawnEvent event) { public void onPlayerRespawn(PlayerRespawnEvent event) {
Player player = event.getPlayer(); Player player = event.getPlayer();
Location mySpawn = mcUsers.getProfile(player).getMySpawn(player);
if(mcUsers.getProfile(player).getMySpawnWorld() != null && !mcUsers.getProfile(player).getMySpawnWorld().equals("")){
mySpawn.setWorld(plugin.getServer().getWorld(mcUsers.getProfile(player).getMySpawnWorld()));
}
if(mcPermissions.getInstance().mySpawn(player)){ if(mcPermissions.getInstance().mySpawn(player)){
if(mcUsers.getProfile(player).getMySpawn(player) != null) if(mcUsers.getProfile(player).getMySpawn(player) != null)
event.setRespawnLocation(mcUsers.getProfile(player).getMySpawn(player)); event.setRespawnLocation(mySpawn);
} }
//HELLO CODE PEAKERS!
} }
public Player[] getPlayersOnline() { public Player[] getPlayersOnline() {
return plugin.getServer().getOnlinePlayers(); return plugin.getServer().getOnlinePlayers();
@ -114,10 +120,11 @@ public class mcPlayerListener extends PlayerListener {
*/ */
if(mcPermissions.getInstance().mySpawn(player) && split[0].equalsIgnoreCase("/"+mcLoadProperties.clearmyspawn)){ if(mcPermissions.getInstance().mySpawn(player) && split[0].equalsIgnoreCase("/"+mcLoadProperties.clearmyspawn)){
event.setCancelled(true); event.setCancelled(true);
double x = player.getWorld().getSpawnLocation().getX(); double x = plugin.getServer().getWorlds().get(0).getSpawnLocation().getX();
double y = player.getWorld().getSpawnLocation().getY(); double y = plugin.getServer().getWorlds().get(0).getSpawnLocation().getY();
double z = player.getWorld().getSpawnLocation().getZ(); double z = plugin.getServer().getWorlds().get(0).getSpawnLocation().getZ();
mcUsers.getProfile(player).setMySpawn(x, y, z); String worldname = plugin.getServer().getWorlds().get(0).getName();
mcUsers.getProfile(player).setMySpawn(x, y, z, worldname);
player.sendMessage(ChatColor.DARK_AQUA+"Myspawn is now cleared."); player.sendMessage(ChatColor.DARK_AQUA+"Myspawn is now cleared.");
} }
if(mcPermissions.permissionsEnabled && split[0].equalsIgnoreCase("/"+mcLoadProperties.mmoedit)){ if(mcPermissions.permissionsEnabled && split[0].equalsIgnoreCase("/"+mcLoadProperties.mmoedit)){
@ -248,7 +255,8 @@ public class mcPlayerListener extends PlayerListener {
double x = player.getLocation().getX(); double x = player.getLocation().getX();
double y = player.getLocation().getY(); double y = player.getLocation().getY();
double z = player.getLocation().getZ(); double z = player.getLocation().getZ();
mcUsers.getProfile(player).setMySpawn(x, y, z); String myspawnworld = player.getWorld().getName();
mcUsers.getProfile(player).setMySpawn(x, y, z, myspawnworld);
player.sendMessage(ChatColor.DARK_AQUA + "Myspawn has been set to your current location."); player.sendMessage(ChatColor.DARK_AQUA + "Myspawn has been set to your current location.");
} }
/* /*
@ -405,6 +413,9 @@ public class mcPlayerListener extends PlayerListener {
player.sendMessage(ChatColor.AQUA + "Admin chat toggled " + ChatColor.RED + "Off"); player.sendMessage(ChatColor.AQUA + "Admin chat toggled " + ChatColor.RED + "Off");
} }
} }
/*
* MYSPAWN
*/
if(split[0].equalsIgnoreCase("/"+mcLoadProperties.myspawn)){ if(split[0].equalsIgnoreCase("/"+mcLoadProperties.myspawn)){
if(!mcPermissions.getInstance().mySpawn(player)){ if(!mcPermissions.getInstance().mySpawn(player)){
player.sendMessage(ChatColor.YELLOW+"[mcMMO]"+ChatColor.DARK_RED +" Insufficient permissions."); player.sendMessage(ChatColor.YELLOW+"[mcMMO]"+ChatColor.DARK_RED +" Insufficient permissions.");
@ -414,7 +425,20 @@ public class mcPlayerListener extends PlayerListener {
if(mcUsers.getProfile(player).getMySpawn(player) != null){ if(mcUsers.getProfile(player).getMySpawn(player) != null){
player.getInventory().clear(); player.getInventory().clear();
player.setHealth(20); player.setHealth(20);
player.teleportTo(mcUsers.getProfile(player).getMySpawn(player)); Location mySpawn = mcUsers.getProfile(player).getMySpawn(player);
//player.sendMessage("mcMMO DEBUG CODE 1");
if(mcUsers.getProfile(player).getMySpawnWorld() != null && !mcUsers.getProfile(player).getMySpawnWorld().equals("")){
mySpawn.setWorld(plugin.getServer().getWorld(mcUsers.getProfile(player).getMySpawnWorld()));
//player.sendMessage("mcMMO DEBUG CODE 2");
} else {
//player.sendMessage("mcMMO DEBUG CODE 5");
mySpawn.setWorld(plugin.getServer().getWorlds().get(0));
}
//player.sendMessage("mcMMO DEBUG CODE 3");
player.teleportTo(mySpawn);
player.teleportTo(mySpawn);
//Two lines of teleporting to prevent a bug when players try teleporting from one world to another bringing them to that worlds spawn at first.
//player.sendMessage("mcMMO DEBUG CODE 4");
player.sendMessage("Inventory cleared & health restored"); player.sendMessage("Inventory cleared & health restored");
}else{ }else{
player.sendMessage(ChatColor.RED+"Configure your myspawn first with /setmyspawn"); player.sendMessage(ChatColor.RED+"Configure your myspawn first with /setmyspawn");

View File

@ -153,9 +153,10 @@ class PlayerList
class PlayerProfile class PlayerProfile
{ {
protected final Logger log = Logger.getLogger("Minecraft"); protected final Logger log = Logger.getLogger("Minecraft");
private String playerName, gather, wgather, woodcutting, repair, mining, party, myspawn, unarmed, herbalism, excavation, private String playerName, gather, wgather, woodcutting, repair, mining, party, myspawn, myspawnworld, unarmed, herbalism, excavation,
archery, swords, axes, invite, acrobatics, repairgather, unarmedgather, herbalismgather, excavationgather, archerygather, swordsgather, axesgather, acrobaticsgather; archery, swords, axes, invite, acrobatics, repairgather, unarmedgather, herbalismgather, excavationgather, archerygather, swordsgather, axesgather, acrobaticsgather;
private boolean dead; private boolean dead;
Player thisplayer;
char defaultColor; char defaultColor;
String location = "mcmmo.users"; String location = "mcmmo.users";
@ -172,8 +173,10 @@ class PlayerList
{ {
//Declare things //Declare things
playerName = player.getName(); playerName = player.getName();
thisplayer = player;
party = new String(); party = new String();
myspawn = new String(); myspawn = new String();
myspawnworld = new String();
mining = new String(); mining = new String();
repair = new String(); repair = new String();
repairgather = new String(); repairgather = new String();
@ -285,6 +288,8 @@ class PlayerList
axesgather = character[21]; axesgather = character[21];
if(character.length > 22) if(character.length > 22)
acrobaticsgather = character[22]; acrobaticsgather = character[22];
if(character.length > 23)
myspawnworld = character[23];
in.close(); in.close();
return true; return true;
} }
@ -346,6 +351,7 @@ class PlayerList
writer.append(swordsgather+":"); writer.append(swordsgather+":");
writer.append(axesgather+":"); writer.append(axesgather+":");
writer.append(acrobaticsgather+":"); writer.append(acrobaticsgather+":");
writer.append(myspawnworld+":");
writer.append("\r\n"); writer.append("\r\n");
} }
} }
@ -389,6 +395,7 @@ class PlayerList
out.append(0+":"); //swordsgather out.append(0+":"); //swordsgather
out.append(0+":"); //axesgather out.append(0+":"); //axesgather
out.append(0+":"); //acrobaticsgather out.append(0+":"); //acrobaticsgather
out.append(thisplayer.getWorld().getName());
//Add more in the same format as the line above //Add more in the same format as the line above
out.newLine(); out.newLine();
@ -1170,9 +1177,13 @@ class PlayerList
return false; return false;
} }
} }
public String getMySpawnWorld(){
return myspawnworld;
}
//Save a users spawn location //Save a users spawn location
public void setMySpawn(double x, double y, double z){ public void setMySpawn(double x, double y, double z, String myspawnworldlocation){
myspawn = x+","+y+","+z; myspawn = x+","+y+","+z;
myspawnworld = myspawnworldlocation;
save(); save();
} }
public String getX(){ public String getX(){
@ -1198,7 +1209,7 @@ class PlayerList
return dead; return dead;
} }
public Location getMySpawn(Player player){ public Location getMySpawn(Player player){
Location loc = player.getLocation(); Location loc = player.getWorld().getSpawnLocation();
if(isDouble(getX()) && isDouble(getY()) && isDouble(getX())){ if(isDouble(getX()) && isDouble(getY()) && isDouble(getX())){
loc.setX(Double.parseDouble(mcUsers.getProfile(player).getX())); loc.setX(Double.parseDouble(mcUsers.getProfile(player).getX()));
loc.setY(Double.parseDouble(mcUsers.getProfile(player).getY())); loc.setY(Double.parseDouble(mcUsers.getProfile(player).getY()));

View File

@ -11,6 +11,7 @@ import org.bukkit.entity.Creeper;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.entity.Monster; import org.bukkit.entity.Monster;
import org.bukkit.entity.Pig; import org.bukkit.entity.Pig;
import org.bukkit.entity.PigZombie;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.entity.Skeleton; import org.bukkit.entity.Skeleton;
import org.bukkit.entity.Spider; import org.bukkit.entity.Spider;
@ -132,8 +133,16 @@ public class mcm {
if(defender.getHealth() <= 0) if(defender.getHealth() <= 0)
mcm.getInstance().simulateNaturalDrops(defender); mcm.getInstance().simulateNaturalDrops(defender);
//XP //XP
if(Math.random() * 10 > 7){ if(x instanceof Creeper)
mcUsers.getProfile(attacker).addArcheryGather(1); mcUsers.getProfile(attacker).addArcheryGather(10);
if(x instanceof Spider)
mcUsers.getProfile(attacker).addArcheryGather(7);
if(x instanceof Skeleton)
mcUsers.getProfile(attacker).addArcheryGather(5);
if(x instanceof Zombie)
mcUsers.getProfile(attacker).addArcheryGather(3);
if(x instanceof PigZombie)
mcUsers.getProfile(attacker).addArcheryGather(7);
if(mcUsers.getProfile(attacker).getArcheryGatherInt() >= (mcUsers.getProfile(attacker).getArcheryInt() + 5) * mcLoadProperties.xpmodifier){ if(mcUsers.getProfile(attacker).getArcheryGatherInt() >= (mcUsers.getProfile(attacker).getArcheryInt() + 5) * mcLoadProperties.xpmodifier){
int skillups = 0; int skillups = 0;
while(mcUsers.getProfile(attacker).getArcheryGatherInt() >= (mcUsers.getProfile(attacker).getArcheryInt() +5) * mcLoadProperties.xpmodifier){ while(mcUsers.getProfile(attacker).getArcheryGatherInt() >= (mcUsers.getProfile(attacker).getArcheryInt() +5) * mcLoadProperties.xpmodifier){
@ -144,7 +153,6 @@ public class mcm {
attacker.sendMessage(ChatColor.YELLOW+"Archery skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(attacker).getArchery()+")"); attacker.sendMessage(ChatColor.YELLOW+"Archery skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(attacker).getArchery()+")");
} }
} }
}
/* /*
* Defender is Animals * Defender is Animals
*/ */
@ -945,7 +953,16 @@ public class mcm {
if(isSwords(attacker.getItemInHand()) if(isSwords(attacker.getItemInHand())
&& defender.getHealth() > 0 && defender.getHealth() > 0
&& mcPermissions.getInstance().swords(attacker)){ && mcPermissions.getInstance().swords(attacker)){
mcUsers.getProfile(attacker).addSwordsGather(1); if(x instanceof Creeper)
mcUsers.getProfile(attacker).addSwordsGather(10);
if(x instanceof Spider)
mcUsers.getProfile(attacker).addSwordsGather(7);
if(x instanceof Skeleton)
mcUsers.getProfile(attacker).addSwordsGather(5);
if(x instanceof Zombie)
mcUsers.getProfile(attacker).addSwordsGather(3);
if(x instanceof PigZombie)
mcUsers.getProfile(attacker).addSwordsGather(7);
if(mcUsers.getProfile(attacker).getSwordsGatherInt() >= (mcUsers.getProfile(attacker).getSwordsInt() + 5) * mcLoadProperties.xpmodifier){ if(mcUsers.getProfile(attacker).getSwordsGatherInt() >= (mcUsers.getProfile(attacker).getSwordsInt() + 5) * mcLoadProperties.xpmodifier){
int skillups = 0; int skillups = 0;
while(mcUsers.getProfile(attacker).getSwordsGatherInt() >= (mcUsers.getProfile(attacker).getSwordsInt() +5) * mcLoadProperties.xpmodifier){ while(mcUsers.getProfile(attacker).getSwordsGatherInt() >= (mcUsers.getProfile(attacker).getSwordsInt() +5) * mcLoadProperties.xpmodifier){
@ -960,6 +977,16 @@ public class mcm {
&& defender.getHealth() > 0 && defender.getHealth() > 0
&& mcPermissions.getInstance().axes(attacker)){ && mcPermissions.getInstance().axes(attacker)){
mcUsers.getProfile(attacker).addAxesGather(1); mcUsers.getProfile(attacker).addAxesGather(1);
if(x instanceof Creeper)
mcUsers.getProfile(attacker).addAxesGather(10);
if(x instanceof Spider)
mcUsers.getProfile(attacker).addAxesGather(7);
if(x instanceof Skeleton)
mcUsers.getProfile(attacker).addAxesGather(5);
if(x instanceof Zombie)
mcUsers.getProfile(attacker).addAxesGather(3);
if(x instanceof PigZombie)
mcUsers.getProfile(attacker).addAxesGather(7);
if(mcUsers.getProfile(attacker).getAxesGatherInt() >= (mcUsers.getProfile(attacker).getAxesInt() + 5) * mcLoadProperties.xpmodifier){ if(mcUsers.getProfile(attacker).getAxesGatherInt() >= (mcUsers.getProfile(attacker).getAxesInt() + 5) * mcLoadProperties.xpmodifier){
int skillups = 0; int skillups = 0;
while(mcUsers.getProfile(attacker).getAxesGatherInt() >= (mcUsers.getProfile(attacker).getAxesInt() +5) * mcLoadProperties.xpmodifier){ while(mcUsers.getProfile(attacker).getAxesGatherInt() >= (mcUsers.getProfile(attacker).getAxesInt() +5) * mcLoadProperties.xpmodifier){
@ -1003,7 +1030,16 @@ public class mcm {
defender.setHealth(calculateDamage(defender, 8)); defender.setHealth(calculateDamage(defender, 8));
} }
//XP //XP
mcUsers.getProfile(attacker).addUnarmedGather(1); if(x instanceof Creeper)
mcUsers.getProfile(attacker).addUnarmedGather(20);
if(x instanceof Spider)
mcUsers.getProfile(attacker).addUnarmedGather(15);
if(x instanceof Skeleton)
mcUsers.getProfile(attacker).addUnarmedGather(10);
if(x instanceof Zombie)
mcUsers.getProfile(attacker).addUnarmedGather(5);
if(x instanceof PigZombie)
mcUsers.getProfile(attacker).addUnarmedGather(15);
if(mcUsers.getProfile(attacker).getUnarmedGatherInt() >= (mcUsers.getProfile(attacker).getUnarmedInt() + 5) * mcLoadProperties.xpmodifier){ if(mcUsers.getProfile(attacker).getUnarmedGatherInt() >= (mcUsers.getProfile(attacker).getUnarmedInt() + 5) * mcLoadProperties.xpmodifier){
int skillups = 0; int skillups = 0;
while(mcUsers.getProfile(attacker).getUnarmedGatherInt() >= (mcUsers.getProfile(attacker).getUnarmedInt() +5) * mcLoadProperties.xpmodifier){ while(mcUsers.getProfile(attacker).getUnarmedGatherInt() >= (mcUsers.getProfile(attacker).getUnarmedInt() +5) * mcLoadProperties.xpmodifier){
@ -1453,11 +1489,17 @@ public class mcm {
* ARMOR * ARMOR
*/ */
if(mcm.getInstance().isArmor(is) && block.getTypeId() == 42){ if(mcm.getInstance().isArmor(is) && block.getTypeId() == 42){
if(mcm.getInstance().isDiamondArmor(is) && mcm.getInstance().hasDiamond(player)){ /*
* DIAMOND ARMOR
*/
if(mcm.getInstance().isDiamondArmor(is) && mcm.getInstance().hasDiamond(player) && mcUsers.getProfile(player).getRepairInt() >= 50){
mcm.getInstance().removeDiamond(player); mcm.getInstance().removeDiamond(player);
player.getItemInHand().setDurability(mcm.getInstance().getArmorRepairAmount(is, player)); player.getItemInHand().setDurability(mcm.getInstance().getArmorRepairAmount(is, player));
mcUsers.getProfile(player).addRepairGather(20); mcUsers.getProfile(player).addRepairGather(20);
} else if (mcm.getInstance().isIronArmor(is) && mcm.getInstance().hasIron(player)){ } else if (mcm.getInstance().isIronArmor(is) && mcm.getInstance().hasIron(player)){
/*
* IRON ARMOR
*/
mcm.getInstance().removeIron(player); mcm.getInstance().removeIron(player);
player.getItemInHand().setDurability(mcm.getInstance().getArmorRepairAmount(is, player)); player.getItemInHand().setDurability(mcm.getInstance().getArmorRepairAmount(is, player));
/* /*
@ -1472,11 +1514,17 @@ public class mcm {
* TOOLS * TOOLS
*/ */
if(mcm.getInstance().isTools(is) && block.getTypeId() == 42){ if(mcm.getInstance().isTools(is) && block.getTypeId() == 42){
/*
* IRON TOOLS
*/
if(mcm.getInstance().isIronTools(is) && mcm.getInstance().hasIron(player)){ if(mcm.getInstance().isIronTools(is) && mcm.getInstance().hasIron(player)){
is.setDurability(mcm.getInstance().getToolRepairAmount(is, durability, player)); is.setDurability(mcm.getInstance().getToolRepairAmount(is, durability, player));
mcm.getInstance().removeIron(player); mcm.getInstance().removeIron(player);
mcUsers.getProfile(player).addRepairGather(5); mcUsers.getProfile(player).addRepairGather(5);
} else if (mcm.getInstance().isDiamondTools(is) && mcm.getInstance().hasDiamond(player) && mcUsers.getProfile(player).getRepairInt() >= 50){ //Check if its diamond and the player has diamonds } else if (mcm.getInstance().isDiamondTools(is) && mcm.getInstance().hasDiamond(player) && mcUsers.getProfile(player).getRepairInt() >= 50){ //Check if its diamond and the player has diamonds
/*
* DIAMOND TOOLS
*/
is.setDurability(mcm.getInstance().getToolRepairAmount(is, durability, player)); is.setDurability(mcm.getInstance().getToolRepairAmount(is, durability, player));
mcm.getInstance().removeDiamond(player); mcm.getInstance().removeDiamond(player);
mcUsers.getProfile(player).addRepairGather(20); mcUsers.getProfile(player).addRepairGather(20);
@ -1512,7 +1560,7 @@ public class mcm {
if(type == 59 && block.getData() == (byte) 0x7){ if(type == 59 && block.getData() == (byte) 0x7){
mat = Material.getMaterial(296); mat = Material.getMaterial(296);
is = new ItemStack(mat, 1, (byte)0, (byte)0); is = new ItemStack(mat, 1, (byte)0, (byte)0);
mcUsers.getProfile(player).addHerbalismGather(3); mcUsers.getProfile(player).addHerbalismGather(5);
if(mcUsers.getProfile(player).getHerbalismInt() >= 50 && mcUsers.getProfile(player).getHerbalismInt() < 150){ if(mcUsers.getProfile(player).getHerbalismInt() >= 50 && mcUsers.getProfile(player).getHerbalismInt() < 150){
if(Math.random() * 10 > 8) if(Math.random() * 10 > 8)
loc.getWorld().dropItemNaturally(loc, is); loc.getWorld().dropItemNaturally(loc, is);
@ -1536,10 +1584,10 @@ public class mcm {
if(!mcConfig.getInstance().isBlockWatched(block)){ if(!mcConfig.getInstance().isBlockWatched(block)){
//player.sendMessage("DEBUG CODE 2"); //player.sendMessage("DEBUG CODE 2");
if(type == 39 || type == 40){ if(type == 39 || type == 40){
mcUsers.getProfile(player).addHerbalismGather(20); mcUsers.getProfile(player).addHerbalismGather(10);
} }
if(type == 37 || type == 38){ if(type == 37 || type == 38){
mcUsers.getProfile(player).addHerbalismGather(2); mcUsers.getProfile(player).addHerbalismGather(3);
} }
} }
if(mcUsers.getProfile(player).getHerbalismGatherInt() >= (mcUsers.getProfile(player).getHerbalismInt() + 5) * mcLoadProperties.xpmodifier){ if(mcUsers.getProfile(player).getHerbalismGatherInt() >= (mcUsers.getProfile(player).getHerbalismInt() + 5) * mcLoadProperties.xpmodifier){
@ -1560,12 +1608,14 @@ public class mcm {
if(type == 2 && mcUsers.getProfile(player).getExcavationInt() > 250){ if(type == 2 && mcUsers.getProfile(player).getExcavationInt() > 250){
//CHANCE TO GET EGGS //CHANCE TO GET EGGS
if(mcLoadProperties.eggs == true && Math.random() * 100 > 99){ if(mcLoadProperties.eggs == true && Math.random() * 100 > 99){
mcUsers.getProfile(player).addExcavationGather(10);
mat = Material.getMaterial(344); mat = Material.getMaterial(344);
is = new ItemStack(mat, 1, (byte)0, (byte)0); is = new ItemStack(mat, 1, (byte)0, (byte)0);
loc.getWorld().dropItemNaturally(loc, is); loc.getWorld().dropItemNaturally(loc, is);
} }
//CHANCE TO GET APPLES //CHANCE TO GET APPLES
if(mcLoadProperties.apples == true && Math.random() * 100 > 99){ if(mcLoadProperties.apples == true && Math.random() * 100 > 99){
mcUsers.getProfile(player).addExcavationGather(10);
mat = Material.getMaterial(260); mat = Material.getMaterial(260);
is = new ItemStack(mat, 1, (byte)0, (byte)0); is = new ItemStack(mat, 1, (byte)0, (byte)0);
loc.getWorld().dropItemNaturally(loc, is); loc.getWorld().dropItemNaturally(loc, is);
@ -1573,10 +1623,11 @@ public class mcm {
} }
//DIRT SAND OR GRAVEL //DIRT SAND OR GRAVEL
if(type == 3 || type == 13 || type == 2 || type == 12){ if(type == 3 || type == 13 || type == 2 || type == 12){
mcUsers.getProfile(player).addExcavationGather(2); mcUsers.getProfile(player).addExcavationGather(3);
if(mcUsers.getProfile(player).getExcavationInt() > 750){ if(mcUsers.getProfile(player).getExcavationInt() > 750){
//CHANCE TO GET CAKE //CHANCE TO GET CAKE
if(mcLoadProperties.cake == true && Math.random() * 2000 > 1999){ if(mcLoadProperties.cake == true && Math.random() * 2000 > 1999){
mcUsers.getProfile(player).addExcavationGather(300);
mat = Material.getMaterial(354); mat = Material.getMaterial(354);
is = new ItemStack(mat, 1, (byte)0, (byte)0); is = new ItemStack(mat, 1, (byte)0, (byte)0);
loc.getWorld().dropItemNaturally(loc, is); loc.getWorld().dropItemNaturally(loc, is);
@ -1585,6 +1636,7 @@ public class mcm {
if(mcUsers.getProfile(player).getExcavationInt() > 150){ if(mcUsers.getProfile(player).getExcavationInt() > 150){
//CHANCE TO GET MUSIC //CHANCE TO GET MUSIC
if(mcLoadProperties.music == true && Math.random() * 2000 > 1999){ if(mcLoadProperties.music == true && Math.random() * 2000 > 1999){
mcUsers.getProfile(player).addExcavationGather(300);
mat = Material.getMaterial(2256); mat = Material.getMaterial(2256);
is = new ItemStack(mat, 1, (byte)0, (byte)0); is = new ItemStack(mat, 1, (byte)0, (byte)0);
loc.getWorld().dropItemNaturally(loc, is); loc.getWorld().dropItemNaturally(loc, is);
@ -1594,6 +1646,7 @@ public class mcm {
if(mcUsers.getProfile(player).getExcavationInt() > 350){ if(mcUsers.getProfile(player).getExcavationInt() > 350){
//CHANCE TO GET DIAMOND //CHANCE TO GET DIAMOND
if(mcLoadProperties.diamond == true && Math.random() * 500 > 499){ if(mcLoadProperties.diamond == true && Math.random() * 500 > 499){
mcUsers.getProfile(player).addExcavationGather(100);
mat = Material.getMaterial(264); mat = Material.getMaterial(264);
is = new ItemStack(mat, 1, (byte)0, (byte)0); is = new ItemStack(mat, 1, (byte)0, (byte)0);
loc.getWorld().dropItemNaturally(loc, is); loc.getWorld().dropItemNaturally(loc, is);
@ -1602,6 +1655,7 @@ public class mcm {
if(mcUsers.getProfile(player).getExcavationInt() > 250){ if(mcUsers.getProfile(player).getExcavationInt() > 250){
//CHANCE TO GET MUSIC //CHANCE TO GET MUSIC
if(mcLoadProperties.music == true && Math.random() * 2000 > 1999){ if(mcLoadProperties.music == true && Math.random() * 2000 > 1999){
mcUsers.getProfile(player).addExcavationGather(300);
mat = Material.getMaterial(2257); mat = Material.getMaterial(2257);
is = new ItemStack(mat, 1, (byte)0, (byte)0); is = new ItemStack(mat, 1, (byte)0, (byte)0);
loc.getWorld().dropItemNaturally(loc, is); loc.getWorld().dropItemNaturally(loc, is);
@ -1612,18 +1666,21 @@ public class mcm {
if(type == 12){ if(type == 12){
//CHANCE TO GET GLOWSTONE //CHANCE TO GET GLOWSTONE
if(mcLoadProperties.glowstone == true && mcUsers.getProfile(player).getExcavationInt() > 50 && Math.random() * 100 > 95){ if(mcLoadProperties.glowstone == true && mcUsers.getProfile(player).getExcavationInt() > 50 && Math.random() * 100 > 95){
mcUsers.getProfile(player).addExcavationGather(3);
mat = Material.getMaterial(348); mat = Material.getMaterial(348);
is = new ItemStack(mat, 1, (byte)0, (byte)0); is = new ItemStack(mat, 1, (byte)0, (byte)0);
loc.getWorld().dropItemNaturally(loc, is); loc.getWorld().dropItemNaturally(loc, is);
} }
//CHANCE TO GET SLOWSAND //CHANCE TO GET SLOWSAND
if(mcLoadProperties.slowsand == true && mcUsers.getProfile(player).getExcavationInt() > 650 && Math.random() * 200 > 199){ if(mcLoadProperties.slowsand == true && mcUsers.getProfile(player).getExcavationInt() > 650 && Math.random() * 200 > 199){
mcUsers.getProfile(player).addExcavationGather(5);
mat = Material.getMaterial(88); mat = Material.getMaterial(88);
is = new ItemStack(mat, 1, (byte)0, (byte)0); is = new ItemStack(mat, 1, (byte)0, (byte)0);
loc.getWorld().dropItemNaturally(loc, is); loc.getWorld().dropItemNaturally(loc, is);
} }
//CHANCE TO GET DIAMOND //CHANCE TO GET DIAMOND
if(mcLoadProperties.diamond == true && mcUsers.getProfile(player).getExcavationInt() > 500 && Math.random() * 500 > 499){ if(mcLoadProperties.diamond == true && mcUsers.getProfile(player).getExcavationInt() > 500 && Math.random() * 500 > 499){
mcUsers.getProfile(player).addExcavationGather(100);
mat = Material.getMaterial(264); mat = Material.getMaterial(264);
is = new ItemStack(mat, 1, (byte)0, (byte)0); is = new ItemStack(mat, 1, (byte)0, (byte)0);
loc.getWorld().dropItemNaturally(loc, is); loc.getWorld().dropItemNaturally(loc, is);
@ -1633,6 +1690,7 @@ public class mcm {
if((type == 2 || type == 3) && mcUsers.getProfile(player).getExcavationInt() > 25){ if((type == 2 || type == 3) && mcUsers.getProfile(player).getExcavationInt() > 25){
//CHANCE TO GET GLOWSTONE //CHANCE TO GET GLOWSTONE
if(mcLoadProperties.glowstone == true && Math.random() * 100 > 95){ if(mcLoadProperties.glowstone == true && Math.random() * 100 > 95){
mcUsers.getProfile(player).addExcavationGather(5);
mat = Material.getMaterial(348); mat = Material.getMaterial(348);
is = new ItemStack(mat, 1, (byte)0, (byte)0); is = new ItemStack(mat, 1, (byte)0, (byte)0);
loc.getWorld().dropItemNaturally(loc, is); loc.getWorld().dropItemNaturally(loc, is);
@ -1642,6 +1700,7 @@ public class mcm {
if(type == 13){ if(type == 13){
//CHANCE TO GET NETHERRACK //CHANCE TO GET NETHERRACK
if(mcLoadProperties.netherrack == true && mcUsers.getProfile(player).getExcavationInt() > 850 && Math.random() * 200 > 199){ if(mcLoadProperties.netherrack == true && mcUsers.getProfile(player).getExcavationInt() > 850 && Math.random() * 200 > 199){
mcUsers.getProfile(player).addExcavationGather(3);
mat = Material.getMaterial(87); mat = Material.getMaterial(87);
is = new ItemStack(mat, 1, (byte)0, (byte)0); is = new ItemStack(mat, 1, (byte)0, (byte)0);
loc.getWorld().dropItemNaturally(loc, is); loc.getWorld().dropItemNaturally(loc, is);
@ -1649,6 +1708,7 @@ public class mcm {
//CHANCE TO GET SULPHUR //CHANCE TO GET SULPHUR
if(mcLoadProperties.sulphur == true && mcUsers.getProfile(player).getExcavationInt() > 75){ if(mcLoadProperties.sulphur == true && mcUsers.getProfile(player).getExcavationInt() > 75){
if(Math.random() * 10 > 9){ if(Math.random() * 10 > 9){
mcUsers.getProfile(player).addExcavationGather(3);
mat = Material.getMaterial(289); mat = Material.getMaterial(289);
is = new ItemStack(mat, 1, (byte)0, (byte)0); is = new ItemStack(mat, 1, (byte)0, (byte)0);
loc.getWorld().dropItemNaturally(loc, is); loc.getWorld().dropItemNaturally(loc, is);
@ -1657,6 +1717,7 @@ public class mcm {
//CHANCE TO GET BONES //CHANCE TO GET BONES
if(mcLoadProperties.bones == true && mcUsers.getProfile(player).getExcavationInt() > 175){ if(mcLoadProperties.bones == true && mcUsers.getProfile(player).getExcavationInt() > 175){
if(Math.random() * 10 > 6){ if(Math.random() * 10 > 6){
mcUsers.getProfile(player).addExcavationGather(3);
mat = Material.getMaterial(352); mat = Material.getMaterial(352);
is = new ItemStack(mat, 1, (byte)0, (byte)0); is = new ItemStack(mat, 1, (byte)0, (byte)0);
loc.getWorld().dropItemNaturally(loc, is); loc.getWorld().dropItemNaturally(loc, is);

View File

@ -1,3 +1,3 @@
name: mcMMO name: mcMMO
main: com.gmail.nossr50.mcMMO main: com.gmail.nossr50.mcMMO
version: 0.7.5 version: 0.7.8