All changes up to 0.7.4

This commit is contained in:
nossr50 2011-02-23 23:29:34 -08:00
parent 67fbde3ebd
commit f875f1d1c0
8 changed files with 56 additions and 15 deletions

View File

@ -1,5 +1,14 @@
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.4
Work around for a bukkit bug that broke my onBlockDamage event
Added /clearmyspawn
Version 0.7.3
Fixed to work with build 424 of CB
Lowered the XP of gold due to it not being that rare anymore
Version 0.7.2
Fixed security flaw where players could access /mmoedit if the server was not running permissions
Reduced XP gain of woodcutting a bit
Version 0.7 Version 0.7
Completely rewrote the XP system Completely rewrote the XP system
Added an XP skillrate modifier to the settings file Added an XP skillrate modifier to the settings file

View File

@ -39,6 +39,7 @@ public class mcBlockListener extends BlockListener {
public void onBlockDamage(BlockDamageEvent event) { public void onBlockDamage(BlockDamageEvent event) {
//STARTED(0), DIGGING(1), BROKEN(3), STOPPED(2); //STARTED(0), DIGGING(1), BROKEN(3), STOPPED(2);
Player player = event.getPlayer(); Player player = event.getPlayer();
//player.sendMessage("mcMMO DEBUG: EVENT-OK DMG LEVEL ("+event.getDamageLevel().getLevel()+")");
Block block = event.getBlock(); Block block = event.getBlock();
int x = block.getX(); int x = block.getX();
int y = block.getY(); int y = block.getY();
@ -50,17 +51,16 @@ public class mcBlockListener extends BlockListener {
/* /*
* MINING * MINING
*/ */
if(dmg == 3 && !mcConfig.getInstance().isBlockWatched(block) && !mcConfig.getInstance().isCoordsWatched(xyz)){ if(dmg == 2 && !mcConfig.getInstance().isBlockWatched(block) && !mcConfig.getInstance().isCoordsWatched(xyz)){
if(mcPermissions.getInstance().mining(player)) if(mcPermissions.getInstance().mining(player))
mcm.getInstance().miningBlockCheck(player, block); mcm.getInstance().miningBlockCheck(player, block);
/* /*
* WOOD CUTTING * WOOD CUTTING
*/ */
if(block.getTypeId() == 17 if(block.getTypeId() == 17
&& mcPermissions.getInstance().woodcutting(player)){ && mcPermissions.getInstance().woodcutting(player)){
mcUsers.getProfile(player).addWoodcuttingGather(1);
mcm.getInstance().woodCuttingProcCheck(player, block, loc); mcm.getInstance().woodCuttingProcCheck(player, block, loc);
mcUsers.getProfile(player).addWoodcuttingGather(3); mcUsers.getProfile(player).addWoodcuttingGather(2);
} }
/* /*
* EXCAVATION * EXCAVATION

View File

@ -2,7 +2,7 @@ package com.gmail.nossr50;
public class mcLoadProperties { public class mcLoadProperties {
public static Boolean pvp, eggs, apples, cake, music, diamond, glowstone, slowsand, sulphur, netherrack, bones, coal, clay, anvilmessages; public static Boolean pvp, eggs, apples, cake, music, diamond, glowstone, slowsand, sulphur, netherrack, bones, coal, clay, anvilmessages;
public static String mcmmo, mcc, stats, mmoedit, ptp, party, myspawn, setmyspawn, whois, invite, accept; public static String mcmmo, mcc, stats, mmoedit, ptp, party, myspawn, setmyspawn, whois, invite, accept, clearmyspawn;
public static int xpmodifier; public static int xpmodifier;
public static void loadMain(){ public static void loadMain(){
@ -50,6 +50,7 @@ public class mcLoadProperties {
whois = properties.getString("whois", "whois"); whois = properties.getString("whois", "whois");
invite = properties.getString("invite", "invite"); invite = properties.getString("invite", "invite");
accept = properties.getString("accept", "accept"); accept = properties.getString("accept", "accept");
clearmyspawn = properties.getString("clearmyspawn", "clearmyspawn");
properties.save("==McMMO Configuration==\r\nYou can turn off excavation loot tables by turning the option to false\r\nYou can customize mcMMOs command names by modifying them here as well\r\nThis is an early version of the configuration file, eventually you'll be able to customize messages from mcMMO and XP gains"); properties.save("==McMMO Configuration==\r\nYou can turn off excavation loot tables by turning the option to false\r\nYou can customize mcMMOs command names by modifying them here as well\r\nThis is an early version of the configuration file, eventually you'll be able to customize messages from mcMMO and XP gains");
//herp derp //herp derp
} }

View File

@ -11,7 +11,7 @@ import com.nijikokun.bukkit.Permissions.Permissions;
public class mcPermissions { public class mcPermissions {
//Thanks to myWarp source code for helping me figure this shit out! //Thanks to myWarp source code for helping me figure this shit out!
private static Permissions permissionsPlugin; private static Permissions permissionsPlugin;
private static boolean permissionsEnabled = false; public static boolean permissionsEnabled = false;
private static volatile mcPermissions instance; private static volatile mcPermissions instance;
public static void initialize(Server server) { public static void initialize(Server server) {

View File

@ -112,7 +112,19 @@ public class mcPlayerListener extends PlayerListener {
/* /*
* MMOEDIT COMMAND * MMOEDIT COMMAND
*/ */
if(mcPermissions.getInstance().mmoedit(player) && split[0].equalsIgnoreCase("/"+mcLoadProperties.mmoedit)){ if(mcPermissions.getInstance().mySpawn(player) && split[0].equalsIgnoreCase("/"+mcLoadProperties.clearmyspawn)){
event.setCancelled(true);
double x = player.getWorld().getSpawnLocation().getX();
double y = player.getWorld().getSpawnLocation().getY();
double z = player.getWorld().getSpawnLocation().getZ();
mcUsers.getProfile(player).setMySpawn(x, y, z);
player.sendMessage(ChatColor.DARK_AQUA+"Myspawn is now cleared.");
}
if(mcPermissions.permissionsEnabled && split[0].equalsIgnoreCase("/"+mcLoadProperties.mmoedit)){
if(!mcPermissions.getInstance().mmoedit(player)){
player.sendMessage(ChatColor.YELLOW+"[mcMMO]"+ChatColor.DARK_RED +" Insufficient permissions.");
return;
}
if(split.length < 3){ if(split.length < 3){
player.sendMessage(ChatColor.RED+"Usage is /"+mcLoadProperties.mmoedit+" playername skillname newvalue"); player.sendMessage(ChatColor.RED+"Usage is /"+mcLoadProperties.mmoedit+" playername skillname newvalue");
return; return;
@ -193,7 +205,7 @@ public class mcPlayerListener extends PlayerListener {
+"/"+(mcUsers.getProfile(target).getHerbalismInt() + 5) * mcLoadProperties.xpmodifier+")"); +"/"+(mcUsers.getProfile(target).getHerbalismInt() + 5) * mcLoadProperties.xpmodifier+")");
player.sendMessage(ChatColor.YELLOW + "Excavation Skill: "+ ChatColor.GREEN + mcUsers.getProfile(target).getExcavation()+ChatColor.DARK_AQUA player.sendMessage(ChatColor.YELLOW + "Excavation Skill: "+ ChatColor.GREEN + mcUsers.getProfile(target).getExcavation()+ChatColor.DARK_AQUA
+ " XP("+mcUsers.getProfile(target).getExcavationGather() + " XP("+mcUsers.getProfile(target).getExcavationGather()
+"/"+(mcUsers.getProfile(target).getExcavationInt() + 5) * mcLoadProperties.xpmodifier+")"); +"/"+(mcUsers.getProfile(target).getExcavationInt() + 3) * mcLoadProperties.xpmodifier+")");
player.sendMessage(ChatColor.YELLOW + "Archery Skill: " + ChatColor.GREEN + mcUsers.getProfile(target).getArchery()+ChatColor.DARK_AQUA player.sendMessage(ChatColor.YELLOW + "Archery Skill: " + ChatColor.GREEN + mcUsers.getProfile(target).getArchery()+ChatColor.DARK_AQUA
+ " XP("+mcUsers.getProfile(target).getArcheryGather() + " XP("+mcUsers.getProfile(target).getArcheryGather()
+"/"+(mcUsers.getProfile(target).getArcheryInt() + 5) * mcLoadProperties.xpmodifier+")"); +"/"+(mcUsers.getProfile(target).getArcheryInt() + 5) * mcLoadProperties.xpmodifier+")");

View File

@ -207,6 +207,23 @@ class PlayerList
addPlayer(); addPlayer();
} }
public void scoreBoard()
{
try {
//Open the user file
FileReader file = new FileReader(location);
BufferedReader in = new BufferedReader(file);
String line = "";
while((line = in.readLine()) != null)
{
}
in.close();
} catch (Exception e) {
log.log(Level.SEVERE, "Exception while reading "
+ location + " (Are you sure you formatted it correctly?)", e);
}
}
public boolean load() public boolean load()
{ {
try { try {

View File

@ -574,7 +574,7 @@ public class mcm {
} }
//GOLD //GOLD
if(block.getTypeId() == 14){ if(block.getTypeId() == 14){
mcUsers.getProfile(player).addMiningGather(50); mcUsers.getProfile(player).addMiningGather(20);
mcm.getInstance().blockProcCheck(block, player); mcm.getInstance().blockProcCheck(block, player);
} }
//DIAMOND //DIAMOND
@ -1421,8 +1421,10 @@ public class mcm {
player.sendMessage(ChatColor.GREEN+"/"+mcLoadProperties.stats+ChatColor.GRAY+" - Check current skill levels"); player.sendMessage(ChatColor.GREEN+"/"+mcLoadProperties.stats+ChatColor.GRAY+" - Check current skill levels");
if(mcPermissions.getInstance().setMySpawn(player)) if(mcPermissions.getInstance().setMySpawn(player))
player.sendMessage(ChatColor.GRAY+"/"+mcLoadProperties.setmyspawn+" - Sets your spawn"); player.sendMessage(ChatColor.GRAY+"/"+mcLoadProperties.setmyspawn+" - Sets your spawn");
if(mcPermissions.getInstance().mySpawn(player)) if(mcPermissions.getInstance().mySpawn(player)){
player.sendMessage(ChatColor.GRAY+"/"+mcLoadProperties.myspawn+" - travel to myspawn, clears inventory"); player.sendMessage(ChatColor.GRAY+"/"+mcLoadProperties.myspawn+" - travel to myspawn, clears inventory");
player.sendMessage(ChatColor.GREEN+"/"+mcLoadProperties.clearmyspawn+" - resets your myspawn to default spawn location");
}
if(mcPermissions.getInstance().whois(player) || player.isOp()) if(mcPermissions.getInstance().whois(player) || player.isOp())
player.sendMessage(ChatColor.GRAY+"/"+mcLoadProperties.whois+" - view detailed info about a player (req op)"); player.sendMessage(ChatColor.GRAY+"/"+mcLoadProperties.whois+" - view detailed info about a player (req op)");
player.sendMessage(ChatColor.GRAY+"/woodcutting - Skill info"); player.sendMessage(ChatColor.GRAY+"/woodcutting - Skill info");
@ -1570,7 +1572,7 @@ 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(1); mcUsers.getProfile(player).addExcavationGather(2);
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){
@ -1660,11 +1662,11 @@ public class mcm {
} }
} }
} }
if(mcUsers.getProfile(player).getExcavationGatherInt() >= (mcUsers.getProfile(player).getExcavationInt() + 5) * mcLoadProperties.xpmodifier){ if(mcUsers.getProfile(player).getExcavationGatherInt() >= (mcUsers.getProfile(player).getExcavationInt() + 3) * mcLoadProperties.xpmodifier){
int skillups = 0; int skillups = 0;
while(mcUsers.getProfile(player).getExcavationGatherInt() >= (mcUsers.getProfile(player).getExcavationInt() +5) * mcLoadProperties.xpmodifier){ while(mcUsers.getProfile(player).getExcavationGatherInt() >= (mcUsers.getProfile(player).getExcavationInt() +3) * mcLoadProperties.xpmodifier){
skillups++; skillups++;
mcUsers.getProfile(player).removeExcavationGather((mcUsers.getProfile(player).getExcavationInt() + 5) * mcLoadProperties.xpmodifier); mcUsers.getProfile(player).removeExcavationGather((mcUsers.getProfile(player).getExcavationInt() + 3) * mcLoadProperties.xpmodifier);
mcUsers.getProfile(player).skillUpExcavation(1); mcUsers.getProfile(player).skillUpExcavation(1);
} }
player.sendMessage(ChatColor.YELLOW+"Excavation skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(player).getExcavation()+")"); player.sendMessage(ChatColor.YELLOW+"Excavation skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(player).getExcavation()+")");

View File

@ -1,3 +1,3 @@
name: mcMMO name: mcMMO
main: com.gmail.nossr50.mcMMO main: com.gmail.nossr50.mcMMO
version: 0.7.1 version: 0.7.4