mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-02 00:30:07 +01:00
Tweaks to excavation drops and several bugfixes.
This commit is contained in:
parent
b3a2f5b036
commit
8fa4960beb
@ -140,7 +140,7 @@ public class mcPlayerListener extends PlayerListener {
|
|||||||
mcm.getInstance().removeIron(player);
|
mcm.getInstance().removeIron(player);
|
||||||
mcUsers.getProfile(player).skillUpRepair(1);
|
mcUsers.getProfile(player).skillUpRepair(1);
|
||||||
player.sendMessage(ChatColor.YELLOW+"Repair skill increased by 1. Total ("+mcUsers.getProfile(player).getRepair()+")");
|
player.sendMessage(ChatColor.YELLOW+"Repair skill increased by 1. Total ("+mcUsers.getProfile(player).getRepair()+")");
|
||||||
} 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
|
||||||
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).skillUpRepair(1);
|
mcUsers.getProfile(player).skillUpRepair(1);
|
||||||
@ -196,9 +196,9 @@ public class mcPlayerListener extends PlayerListener {
|
|||||||
player.sendMessage(ChatColor.GREEN+"~~UNARMED INFO~~");
|
player.sendMessage(ChatColor.GREEN+"~~UNARMED INFO~~");
|
||||||
player.sendMessage(ChatColor.GREEN+"Gaining Skill: "+ChatColor.DARK_GRAY+"Punching monsters and players.");
|
player.sendMessage(ChatColor.GREEN+"Gaining Skill: "+ChatColor.DARK_GRAY+"Punching monsters and players.");
|
||||||
player.sendMessage(ChatColor.GREEN+"~~EFFECTS~~");
|
player.sendMessage(ChatColor.GREEN+"~~EFFECTS~~");
|
||||||
player.sendMessage(ChatColor.GRAY+"Damage scales with unarmed skill. The first damage increase happens");
|
player.sendMessage(ChatColor.GRAY+"Damage scales with unarmed skill. The first damage increase");
|
||||||
player.sendMessage(ChatColor.DARK_GRAY+" at 50 skill. At very high skill levels, you will gain a proc");
|
player.sendMessage(ChatColor.DARK_GRAY+"happens at 50 skill. At very high skill levels, you will");
|
||||||
player.sendMessage(ChatColor.DARK_GRAY+"to disarm opponents on hit");
|
player.sendMessage(ChatColor.DARK_GRAY+"gain a proc to disarm opponents on hit");
|
||||||
}
|
}
|
||||||
if(split[0].equalsIgnoreCase("/herbalism")){
|
if(split[0].equalsIgnoreCase("/herbalism")){
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
@ -214,8 +214,9 @@ public class mcPlayerListener extends PlayerListener {
|
|||||||
player.sendMessage(ChatColor.GREEN+"Gaining Skill: "+ChatColor.DARK_GRAY+"Digging.");
|
player.sendMessage(ChatColor.GREEN+"Gaining Skill: "+ChatColor.DARK_GRAY+"Digging.");
|
||||||
player.sendMessage(ChatColor.GREEN+"~~EFFECTS~~");
|
player.sendMessage(ChatColor.GREEN+"~~EFFECTS~~");
|
||||||
player.sendMessage(ChatColor.GRAY+"You will find treasures while digging based on your excavation,");
|
player.sendMessage(ChatColor.GRAY+"You will find treasures while digging based on your excavation,");
|
||||||
player.sendMessage(ChatColor.GRAY+"and at high levels the rewards are quite nice. The item you get");
|
player.sendMessage(ChatColor.GRAY+"and at high levels the rewards are quite nice. The items you get");
|
||||||
player.sendMessage(ChatColor.GRAY+"depend on the block you're digging. They all give diffrent stuff.");
|
player.sendMessage(ChatColor.GRAY+"depend on the block you're digging.");
|
||||||
|
player.sendMessage(ChatColor.GRAY+"Different blocks give diffrent stuff.");
|
||||||
}
|
}
|
||||||
if(split[0].equalsIgnoreCase("/mcmmo")){
|
if(split[0].equalsIgnoreCase("/mcmmo")){
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
@ -37,7 +37,6 @@ public class mcUsers {
|
|||||||
try {
|
try {
|
||||||
writer = new FileWriter(location);
|
writer = new FileWriter(location);
|
||||||
writer.write("#Storage place for user information\r\n");
|
writer.write("#Storage place for user information\r\n");
|
||||||
writer.write("#username:nickname:suffix:tag:ignore,list,names:alias,commands,here\r\n");
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.log(Level.SEVERE, "Exception while creating " + location, e);
|
log.log(Level.SEVERE, "Exception while creating " + location, e);
|
||||||
} finally {
|
} finally {
|
||||||
@ -230,9 +229,7 @@ class PlayerList
|
|||||||
if(character.length > 9)
|
if(character.length > 9)
|
||||||
herbalism = character[9];
|
herbalism = character[9];
|
||||||
if(character.length > 10)
|
if(character.length > 10)
|
||||||
repair = character[10];
|
excavation = character[10];
|
||||||
if(character.length > 11)
|
|
||||||
excavation = character[11];
|
|
||||||
in.close();
|
in.close();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -276,7 +276,15 @@ public class mcm {
|
|||||||
Location loc = block.getLocation();
|
Location loc = block.getLocation();
|
||||||
ItemStack is = null;
|
ItemStack is = null;
|
||||||
Material mat = null;
|
Material mat = null;
|
||||||
//DIRT OR GRAVEL
|
if(type == 2 && mcUsers.getProfile(player).getExcavationInt() > 250){
|
||||||
|
//CHANCE TO GET APPLES
|
||||||
|
if(Math.random() * 100 > 99){
|
||||||
|
mat = Material.getMaterial(260);
|
||||||
|
is = new ItemStack(mat, 1, (byte)0, (byte)0);
|
||||||
|
loc.getWorld().dropItemNaturally(loc, is);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//DIRT SAND OR GRAVEL
|
||||||
if(type == 3 || type == 13 || type == 2){
|
if(type == 3 || type == 13 || type == 2){
|
||||||
if(Math.random() * 10 > 9){
|
if(Math.random() * 10 > 9){
|
||||||
mcUsers.getProfile(player).skillUpExcavation(1);
|
mcUsers.getProfile(player).skillUpExcavation(1);
|
||||||
@ -284,23 +292,27 @@ public class mcm {
|
|||||||
|
|
||||||
}
|
}
|
||||||
if(mcUsers.getProfile(player).getExcavationInt() > 750){
|
if(mcUsers.getProfile(player).getExcavationInt() > 750){
|
||||||
|
//CHANCE TO GET CAKE
|
||||||
if(Math.random() * 2000 > 1999){
|
if(Math.random() * 2000 > 1999){
|
||||||
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(mcUsers.getProfile(player).getExcavationInt() > 500 && type == 3){
|
if(mcUsers.getProfile(player).getExcavationInt() > 500){
|
||||||
|
//CHANCE TO GET MUSIC
|
||||||
if(Math.random() * 1000 > 999){
|
if(Math.random() * 1000 > 999){
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
//CHANCE TO GET MUSIC
|
||||||
if(Math.random() * 1000 > 999){
|
if(Math.random() * 1000 > 999){
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
//CHANCE TO GET DIAMOND
|
||||||
if(Math.random() * 500 > 499){
|
if(Math.random() * 500 > 499){
|
||||||
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);
|
||||||
@ -308,22 +320,26 @@ public class mcm {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//SAND
|
||||||
if(type == 12){
|
if(type == 12){
|
||||||
if(Math.random() * 10 > 9){
|
if(Math.random() * 10 > 9){
|
||||||
mcUsers.getProfile(player).skillUpExcavation(1);
|
mcUsers.getProfile(player).skillUpExcavation(1);
|
||||||
player.sendMessage(ChatColor.YELLOW+"Excavation skill increased by 1. Total ("+mcUsers.getProfile(player).getExcavationInt()+")");
|
player.sendMessage(ChatColor.YELLOW+"Excavation skill increased by 1. Total ("+mcUsers.getProfile(player).getExcavationInt()+")");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
//CHANCE TO GET GLOWSTONE
|
||||||
if(mcUsers.getProfile(player).getExcavationInt() > 50 && Math.random() * 100 > 95){
|
if(mcUsers.getProfile(player).getExcavationInt() > 50 && Math.random() * 100 > 95){
|
||||||
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 DIAMOND
|
||||||
if(mcUsers.getProfile(player).getExcavationInt() > 500 && Math.random() * 500 > 499){
|
if(mcUsers.getProfile(player).getExcavationInt() > 500 && Math.random() * 500 > 499){
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
//CHANCE TO GET COAL
|
||||||
if(mcUsers.getProfile(player).getExcavationInt() > 125){
|
if(mcUsers.getProfile(player).getExcavationInt() > 125){
|
||||||
if(Math.random() * 2000 > 1999){
|
if(Math.random() * 2000 > 1999){
|
||||||
mat = Material.getMaterial(263);
|
mat = Material.getMaterial(263);
|
||||||
@ -332,21 +348,33 @@ public class mcm {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//GRASS OR DIRT
|
||||||
if((type == 2 || type == 3) && mcUsers.getProfile(player).getExcavationInt() > 25){
|
if((type == 2 || type == 3) && mcUsers.getProfile(player).getExcavationInt() > 25){
|
||||||
|
//CHANCE TO GET GLOWSTONE
|
||||||
if(Math.random() * 10 > 7){
|
if(Math.random() * 10 > 7){
|
||||||
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(type == 13 && mcUsers.getProfile(player).getExcavationInt() > 75){
|
//GRAVEL
|
||||||
|
if(type == 13){
|
||||||
|
//CHANCE TO GET SULPHUR
|
||||||
|
if(mcUsers.getProfile(player).getExcavationInt() > 75){
|
||||||
if(Math.random() * 10 > 7){
|
if(Math.random() * 10 > 7){
|
||||||
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(mcUsers.getProfile(player).getExcavationInt() > 175){
|
||||||
|
if(Math.random() * 10 > 6){
|
||||||
|
mat = Material.getMaterial(352);
|
||||||
|
is = new ItemStack(mat, 1, (byte)0, (byte)0);
|
||||||
|
loc.getWorld().dropItemNaturally(loc, is);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public void woodCuttingProcCheck(Player player, Block block, Location loc){
|
public void woodCuttingProcCheck(Player player, Block block, Location loc){
|
||||||
if(mcUsers.getProfile(player).getWoodCuttingint() > 1000){
|
if(mcUsers.getProfile(player).getWoodCuttingint() > 1000){
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
name: mcMMO
|
name: mcMMO
|
||||||
main: com.bukkit.nossr50.mcMMO.mcMMO
|
main: com.bukkit.nossr50.mcMMO.mcMMO
|
||||||
version: 0.3
|
version: 0.3.1
|
Loading…
Reference in New Issue
Block a user