mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-01-19 08:55:26 +01:00
Another WIP, some tweaks to WoodCutting and a working version of Leaderboards for MySQL.
This commit is contained in:
parent
d1a7e5b661
commit
947174c34e
@ -1,6 +1,8 @@
|
|||||||
Changelog:
|
Changelog:
|
||||||
#Versions without changelogs probably had very small misc fixes, like tweaks to the source code#
|
#Versions without changelogs probably had very small misc fixes, like tweaks to the source code#
|
||||||
Version 1.0
|
Version 1.0
|
||||||
|
Added Leaf Blower to WoodCutting
|
||||||
|
Different Trees give different WoodCutting XP
|
||||||
Water changing Gravel to Clay removed
|
Water changing Gravel to Clay removed
|
||||||
Code Organized/Optimized further
|
Code Organized/Optimized further
|
||||||
MySQL Support
|
MySQL Support
|
||||||
|
@ -40,13 +40,13 @@ public class Database {
|
|||||||
}
|
}
|
||||||
//Create the DB structure
|
//Create the DB structure
|
||||||
public void createStructure(){
|
public void createStructure(){
|
||||||
Write("CREATE TABLE IF NOT EXISTS `users` (`id` int(10) unsigned NOT NULL AUTO_INCREMENT," +
|
Write("CREATE TABLE IF NOT EXISTS `"+LoadProperties.MySQLtablePrefix+"users` (`id` int(10) unsigned NOT NULL AUTO_INCREMENT," +
|
||||||
"`user` varchar(30) NOT NULL," +
|
"`user` varchar(30) NOT NULL," +
|
||||||
"`lastlogin` int(10) unsigned NOT NULL," +
|
"`lastlogin` int(32) unsigned NOT NULL," +
|
||||||
"`party` varchar(100) NOT NULL DEFAULT ''," +
|
"`party` varchar(100) NOT NULL DEFAULT ''," +
|
||||||
"PRIMARY KEY (`id`)," +
|
"PRIMARY KEY (`id`)," +
|
||||||
"UNIQUE KEY `user` (`user`)) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;");
|
"UNIQUE KEY `user` (`user`)) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;");
|
||||||
Write("CREATE TABLE IF NOT EXISTS `skills` (`user_id` int(10) unsigned NOT NULL," +
|
Write("CREATE TABLE IF NOT EXISTS `"+LoadProperties.MySQLtablePrefix+"skills` (`user_id` int(10) unsigned NOT NULL," +
|
||||||
"`taming` int(10) unsigned NOT NULL DEFAULT '0'," +
|
"`taming` int(10) unsigned NOT NULL DEFAULT '0'," +
|
||||||
"`mining` int(10) unsigned NOT NULL DEFAULT '0'," +
|
"`mining` int(10) unsigned NOT NULL DEFAULT '0'," +
|
||||||
"`woodcutting` int(10) unsigned NOT NULL DEFAULT '0'," +
|
"`woodcutting` int(10) unsigned NOT NULL DEFAULT '0'," +
|
||||||
@ -59,7 +59,7 @@ public class Database {
|
|||||||
"`axes` int(10) unsigned NOT NULL DEFAULT '0'," +
|
"`axes` int(10) unsigned NOT NULL DEFAULT '0'," +
|
||||||
"`acrobatics` int(10) unsigned NOT NULL DEFAULT '0'," +
|
"`acrobatics` int(10) unsigned NOT NULL DEFAULT '0'," +
|
||||||
"PRIMARY KEY (`user_id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;");
|
"PRIMARY KEY (`user_id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;");
|
||||||
Write("CREATE TABLE IF NOT EXISTS `experience` (`user_id` int(10) unsigned NOT NULL," +
|
Write("CREATE TABLE IF NOT EXISTS `"+LoadProperties.MySQLtablePrefix+"experience` (`user_id` int(10) unsigned NOT NULL," +
|
||||||
"`taming` int(10) unsigned NOT NULL DEFAULT '0'," +
|
"`taming` int(10) unsigned NOT NULL DEFAULT '0'," +
|
||||||
"`mining` int(10) unsigned NOT NULL DEFAULT '0'," +
|
"`mining` int(10) unsigned NOT NULL DEFAULT '0'," +
|
||||||
"`woodcutting` int(10) unsigned NOT NULL DEFAULT '0'," +
|
"`woodcutting` int(10) unsigned NOT NULL DEFAULT '0'," +
|
||||||
@ -72,10 +72,10 @@ public class Database {
|
|||||||
"`axes` int(10) unsigned NOT NULL DEFAULT '0'," +
|
"`axes` int(10) unsigned NOT NULL DEFAULT '0'," +
|
||||||
"`acrobatics` int(10) unsigned NOT NULL DEFAULT '0'," +
|
"`acrobatics` int(10) unsigned NOT NULL DEFAULT '0'," +
|
||||||
"PRIMARY KEY (`user_id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;");
|
"PRIMARY KEY (`user_id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;");
|
||||||
Write("CREATE TABLE IF NOT EXISTS `spawn` (`user_id` int(10) NOT NULL," +
|
Write("CREATE TABLE IF NOT EXISTS `"+LoadProperties.MySQLtablePrefix+"spawn` (`user_id` int(10) NOT NULL," +
|
||||||
"`x` int(11) NOT NULL DEFAULT '0'," +
|
"`x` int(64) NOT NULL DEFAULT '0'," +
|
||||||
"`y` int(11) NOT NULL DEFAULT '0'," +
|
"`y` int(64) NOT NULL DEFAULT '0'," +
|
||||||
"`z` int(11) NOT NULL DEFAULT '0'," +
|
"`z` int(64) NOT NULL DEFAULT '0'," +
|
||||||
"`world` varchar(50) NOT NULL DEFAULT ''," +
|
"`world` varchar(50) NOT NULL DEFAULT ''," +
|
||||||
"PRIMARY KEY (`user_id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;");
|
"PRIMARY KEY (`user_id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;");
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@ import com.gmail.nossr50.mcMMO;
|
|||||||
|
|
||||||
public class LoadProperties {
|
public class LoadProperties {
|
||||||
public static Boolean useMySQL, cocoabeans, archeryFireRateLimit, mushrooms, toolsLoseDurabilityFromAbilities, pvpxp, miningrequirespickaxe, woodcuttingrequiresaxe, pvp, eggs, apples, myspawnclearsinventory, cake, music, diamond, glowstone, slowsand, sulphur, netherrack, bones, coal, clay, anvilmessages;
|
public static Boolean useMySQL, cocoabeans, archeryFireRateLimit, mushrooms, toolsLoseDurabilityFromAbilities, pvpxp, miningrequirespickaxe, woodcuttingrequiresaxe, pvp, eggs, apples, myspawnclearsinventory, cake, music, diamond, glowstone, slowsand, sulphur, netherrack, bones, coal, clay, anvilmessages;
|
||||||
public static String MySQLuserName, MySQLserverName, MySQLdbName, MySQLdbPass, mctop, addxp, mcability, mcmmo, mcc, mcrefresh, mcitem, mcgod, stats, mmoedit, ptp, party, myspawn, setmyspawn, whois, invite, accept, clearmyspawn;
|
public static String MySQLtablePrefix, MySQLuserName, MySQLserverName, MySQLdbName, MySQLdbPass, mctop, addxp, mcability, mcmmo, mcc, mcrefresh, mcitem, mcgod, stats, mmoedit, ptp, party, myspawn, setmyspawn, whois, invite, accept, clearmyspawn;
|
||||||
public static int MySQLport, xpGainMultiplier, superBreakerCooldown, greenTerraCooldown, gigaDrillBreakerCooldown, treeFellerCooldown, berserkCooldown, serratedStrikeCooldown, skullSplitterCooldown, abilityDurabilityLoss, feathersConsumedByChimaeraWing, pvpxprewardmodifier, repairdiamondlevel, globalxpmodifier, tamingxpmodifier, miningxpmodifier, repairxpmodifier, woodcuttingxpmodifier, unarmedxpmodifier, herbalismxpmodifier, excavationxpmodifier, archeryxpmodifier, swordsxpmodifier, axesxpmodifier, acrobaticsxpmodifier;
|
public static int MySQLport, xpGainMultiplier, superBreakerCooldown, greenTerraCooldown, gigaDrillBreakerCooldown, treeFellerCooldown, berserkCooldown, serratedStrikeCooldown, skullSplitterCooldown, abilityDurabilityLoss, feathersConsumedByChimaeraWing, pvpxprewardmodifier, repairdiamondlevel, globalxpmodifier, tamingxpmodifier, miningxpmodifier, repairxpmodifier, woodcuttingxpmodifier, unarmedxpmodifier, herbalismxpmodifier, excavationxpmodifier, archeryxpmodifier, swordsxpmodifier, axesxpmodifier, acrobaticsxpmodifier;
|
||||||
|
|
||||||
public static void loadMain(){
|
public static void loadMain(){
|
||||||
@ -31,6 +31,7 @@ public class LoadProperties {
|
|||||||
MySQLdbPass = properties.getString("MySQLdbPass", "defaultdbpass");
|
MySQLdbPass = properties.getString("MySQLdbPass", "defaultdbpass");
|
||||||
MySQLdbName = properties.getString("MySQLdbName", "defaultdbname");
|
MySQLdbName = properties.getString("MySQLdbName", "defaultdbname");
|
||||||
MySQLuserName = properties.getString("MySQLuserName", "defaultusername");
|
MySQLuserName = properties.getString("MySQLuserName", "defaultusername");
|
||||||
|
MySQLtablePrefix = properties.getString("MySQLTablePrefix", "mcmmo_");
|
||||||
MySQLport = properties.getInteger("MySQLport", 3306);
|
MySQLport = properties.getInteger("MySQLport", 3306);
|
||||||
useMySQL = properties.getBoolean("mysql", false);
|
useMySQL = properties.getBoolean("mysql", false);
|
||||||
|
|
||||||
@ -39,7 +40,6 @@ public class LoadProperties {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
archeryFireRateLimit = properties.getBoolean("archeryFireRateLimit", true);
|
archeryFireRateLimit = properties.getBoolean("archeryFireRateLimit", true);
|
||||||
myspawnclearsinventory = properties.getBoolean("mySpawnClearsInventory", true);
|
|
||||||
xpGainMultiplier = properties.getInteger("xpGainMultiplier", 1);
|
xpGainMultiplier = properties.getInteger("xpGainMultiplier", 1);
|
||||||
toolsLoseDurabilityFromAbilities = properties.getBoolean("toolsLoseDurabilityFromAbilities", true);
|
toolsLoseDurabilityFromAbilities = properties.getBoolean("toolsLoseDurabilityFromAbilities", true);
|
||||||
abilityDurabilityLoss = properties.getInteger("abilityDurabilityLoss", 2);
|
abilityDurabilityLoss = properties.getInteger("abilityDurabilityLoss", 2);
|
||||||
|
@ -7,58 +7,58 @@ import java.io.IOException;
|
|||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
public class mcProperties extends Properties{
|
public class mcProperties extends Properties{
|
||||||
//private static volatile mcProperties instance;
|
//private static volatile mcProperties instance;
|
||||||
private String fileName;
|
private String fileName;
|
||||||
public mcProperties(String file) {
|
public mcProperties(String file) {
|
||||||
this.fileName = file;
|
this.fileName = file;
|
||||||
}
|
}
|
||||||
public void load() {
|
public void load() {
|
||||||
File file = new File(this.fileName);
|
File file = new File(this.fileName);
|
||||||
if(file.exists()) {
|
if(file.exists()) {
|
||||||
try {
|
try {
|
||||||
load(new FileInputStream(this.fileName));
|
load(new FileInputStream(this.fileName));
|
||||||
|
} catch (IOException ex) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void save(String start){
|
||||||
|
try{
|
||||||
|
store(new FileOutputStream(this.fileName), start);
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
public int getInteger(String key, int value){
|
||||||
public void save(String start){
|
if(containsKey(key)){
|
||||||
try{
|
return Integer.parseInt(getProperty(key));
|
||||||
store(new FileOutputStream(this.fileName), start);
|
}
|
||||||
} catch (IOException ex) {
|
put(key, String.valueOf(value));
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
public String getString(String key, String value){
|
||||||
|
if(containsKey(key)){
|
||||||
|
return getProperty(key);
|
||||||
|
}
|
||||||
|
put(key, value);
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
public Boolean getBoolean(String key, boolean value) {
|
||||||
|
if (containsKey(key)) {
|
||||||
|
String boolString = getProperty(key);
|
||||||
|
return (boolString.length() > 0)
|
||||||
|
&& (boolString.toLowerCase().charAt(0) == 't');
|
||||||
|
}
|
||||||
|
put(key, value ? "true" : "false");
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
public double getDouble(String key, double value) {
|
||||||
|
if (containsKey(key)) {
|
||||||
|
return Double.parseDouble(getProperty(key));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
put(key, String.valueOf(value));
|
||||||
}
|
return value;
|
||||||
public int getInteger(String key, int value){
|
|
||||||
if(containsKey(key)){
|
|
||||||
return Integer.parseInt(getProperty(key));
|
|
||||||
}
|
|
||||||
put(key, String.valueOf(value));
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
public String getString(String key, String value){
|
|
||||||
if(containsKey(key)){
|
|
||||||
return getProperty(key);
|
|
||||||
}
|
|
||||||
put(key, value);
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
public Boolean getBoolean(String key, boolean value) {
|
|
||||||
if (containsKey(key)) {
|
|
||||||
String boolString = getProperty(key);
|
|
||||||
return (boolString.length() > 0)
|
|
||||||
&& (boolString.toLowerCase().charAt(0) == 't');
|
|
||||||
}
|
|
||||||
put(key, value ? "true" : "false");
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
public double getDouble(String key, double value) {
|
|
||||||
if (containsKey(key)) {
|
|
||||||
return Double.parseDouble(getProperty(key));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
put(key, String.valueOf(value));
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -67,23 +67,17 @@ public class PlayerProfile
|
|||||||
|
|
||||||
|
|
||||||
public boolean loadMySQL(Player p) {
|
public boolean loadMySQL(Player p) {
|
||||||
/* returns a list of all the users ordered by their username
|
|
||||||
HashMap<Integer, ArrayList<String>> userslist = mcMMO.database.Read("SELECT id, lastlogin, party FROM users ORDER BY user");
|
|
||||||
for(int i=1;i<=userslist.size();i++) {
|
|
||||||
System.out.println("User: " + userslist.get(i).get(0) + ", Lastlogin: " + userslist.get(i).get(1));
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
Integer id = 0;
|
Integer id = 0;
|
||||||
id = mcMMO.database.GetInt("SELECT id FROM users WHERE user = '" + p.getName() + "'");
|
id = mcMMO.database.GetInt("SELECT id FROM "+LoadProperties.MySQLtablePrefix+"users WHERE user = '" + p.getName() + "'");
|
||||||
this.userid = id;
|
this.userid = id;
|
||||||
if (id > 0) {
|
if (id > 0) {
|
||||||
HashMap<Integer, ArrayList<String>> users = mcMMO.database.Read("SELECT lastlogin, party FROM users WHERE id = " + id);
|
HashMap<Integer, ArrayList<String>> users = mcMMO.database.Read("SELECT lastlogin, party FROM "+LoadProperties.MySQLtablePrefix+"users WHERE id = " + id);
|
||||||
lastlogin = Integer.parseInt(users.get(1).get(0));
|
lastlogin = Integer.parseInt(users.get(1).get(0));
|
||||||
party = users.get(1).get(1);
|
party = users.get(1).get(1);
|
||||||
HashMap<Integer, ArrayList<String>> spawn = mcMMO.database.Read("SELECT world, x, y, z FROM spawn WHERE user_id = " + id);
|
HashMap<Integer, ArrayList<String>> spawn = mcMMO.database.Read("SELECT world, x, y, z FROM "+LoadProperties.MySQLtablePrefix+"spawn WHERE user_id = " + id);
|
||||||
myspawnworld = spawn.get(1).get(0);
|
myspawnworld = spawn.get(1).get(0);
|
||||||
myspawn = spawn.get(1).get(1) + "," + spawn.get(1).get(2) + "," + spawn.get(1).get(3);
|
myspawn = spawn.get(1).get(1) + "," + spawn.get(1).get(2) + "," + spawn.get(1).get(3);
|
||||||
HashMap<Integer, ArrayList<String>> skills = mcMMO.database.Read("SELECT taming, mining, repair, woodcutting, unarmed, herbalism, excavation, archery, swords, axes, acrobatics FROM skills WHERE user_id = " + id);
|
HashMap<Integer, ArrayList<String>> skills = mcMMO.database.Read("SELECT taming, mining, repair, woodcutting, unarmed, herbalism, excavation, archery, swords, axes, acrobatics FROM "+LoadProperties.MySQLtablePrefix+"skills WHERE user_id = " + id);
|
||||||
taming = skills.get(1).get(0);
|
taming = skills.get(1).get(0);
|
||||||
mining = skills.get(1).get(1);;
|
mining = skills.get(1).get(1);;
|
||||||
repair = skills.get(1).get(2);;
|
repair = skills.get(1).get(2);;
|
||||||
@ -95,7 +89,7 @@ public class PlayerProfile
|
|||||||
swords = skills.get(1).get(8);
|
swords = skills.get(1).get(8);
|
||||||
axes = skills.get(1).get(9);
|
axes = skills.get(1).get(9);
|
||||||
acrobatics = skills.get(1).get(10);
|
acrobatics = skills.get(1).get(10);
|
||||||
HashMap<Integer, ArrayList<String>> experience = mcMMO.database.Read("SELECT taming, mining, repair, woodcutting, unarmed, herbalism, excavation, archery, swords, axes, acrobatics FROM experience WHERE user_id = " + id);
|
HashMap<Integer, ArrayList<String>> experience = mcMMO.database.Read("SELECT taming, mining, repair, woodcutting, unarmed, herbalism, excavation, archery, swords, axes, acrobatics FROM "+LoadProperties.MySQLtablePrefix+"experience WHERE user_id = " + id);
|
||||||
tamingXP = experience.get(1).get(0);
|
tamingXP = experience.get(1).get(0);
|
||||||
miningXP = experience.get(1).get(1);;
|
miningXP = experience.get(1).get(1);;
|
||||||
repairXP = experience.get(1).get(2);;
|
repairXP = experience.get(1).get(2);;
|
||||||
@ -115,13 +109,12 @@ public class PlayerProfile
|
|||||||
}
|
}
|
||||||
public void addMySQLPlayer(Player p) {
|
public void addMySQLPlayer(Player p) {
|
||||||
Integer id = 0;
|
Integer id = 0;
|
||||||
mcMMO.database.Write("INSERT INTO users (user, lastlogin) VALUES ('" + p.getName() + "'," + System.currentTimeMillis() / 1000 +")");
|
mcMMO.database.Write("INSERT INTO "+LoadProperties.MySQLtablePrefix+"users (user, lastlogin) VALUES ('" + p.getName() + "'," + System.currentTimeMillis() / 1000 +")");
|
||||||
id = mcMMO.database.GetInt("SELECT id FROM users WHERE user = '" + p.getName() + "'");
|
id = mcMMO.database.GetInt("SELECT id FROM "+LoadProperties.MySQLtablePrefix+"users WHERE user = '" + p.getName() + "'");
|
||||||
mcMMO.database.Write("INSERT INTO spawn (user_id) VALUES ("+id+")");
|
mcMMO.database.Write("INSERT INTO "+LoadProperties.MySQLtablePrefix+"spawn (user_id) VALUES ("+id+")");
|
||||||
mcMMO.database.Write("INSERT INTO skills (user_id) VALUES ("+id+")");
|
mcMMO.database.Write("INSERT INTO "+LoadProperties.MySQLtablePrefix+"skills (user_id) VALUES ("+id+")");
|
||||||
mcMMO.database.Write("INSERT INTO experience (user_id) VALUES ("+id+")");
|
mcMMO.database.Write("INSERT INTO "+LoadProperties.MySQLtablePrefix+"experience (user_id) VALUES ("+id+")");
|
||||||
this.userid = id;
|
this.userid = id;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean load()
|
public boolean load()
|
||||||
@ -205,13 +198,12 @@ public class PlayerProfile
|
|||||||
|
|
||||||
public void save()
|
public void save()
|
||||||
{
|
{
|
||||||
Long timestamp = System.currentTimeMillis();
|
Long timestamp = System.currentTimeMillis()/1000; //Convert to seconds
|
||||||
|
|
||||||
// if we are using mysql save to database
|
// if we are using mysql save to database
|
||||||
if (LoadProperties.useMySQL) {
|
if (LoadProperties.useMySQL) {
|
||||||
mcMMO.database.Write("UPDATE users SET lastlogin = " + timestamp.intValue() + " WHERE id = " + this.userid);
|
mcMMO.database.Write("UPDATE "+LoadProperties.MySQLtablePrefix+"users SET lastlogin = " + timestamp.intValue() + " WHERE id = " + this.userid);
|
||||||
mcMMO.database.Write("UPDATE spawn SET world = '" + this.myspawnworld + "', x = " +getX()+", y = "+getY()+", z = "+getZ()+" WHERE user_id = "+this.userid);
|
mcMMO.database.Write("UPDATE "+LoadProperties.MySQLtablePrefix+"spawn SET world = '" + this.myspawnworld + "', x = " +getX()+", y = "+getY()+", z = "+getZ()+" WHERE user_id = "+this.userid);
|
||||||
mcMMO.database.Write("UPDATE skills SET "
|
mcMMO.database.Write("UPDATE "+LoadProperties.MySQLtablePrefix+"skills SET "
|
||||||
+" taming = "+taming
|
+" taming = "+taming
|
||||||
+", mining = "+mining
|
+", mining = "+mining
|
||||||
+", repair = "+repair
|
+", repair = "+repair
|
||||||
@ -224,7 +216,7 @@ public class PlayerProfile
|
|||||||
+", axes = "+axes
|
+", axes = "+axes
|
||||||
+", acrobatics = "+acrobatics
|
+", acrobatics = "+acrobatics
|
||||||
+" WHERE user_id = "+this.userid);
|
+" WHERE user_id = "+this.userid);
|
||||||
mcMMO.database.Write("UPDATE experience SET "
|
mcMMO.database.Write("UPDATE "+LoadProperties.MySQLtablePrefix+"experience SET "
|
||||||
+" taming = "+tamingXP
|
+" taming = "+tamingXP
|
||||||
+", mining = "+miningXP
|
+", mining = "+miningXP
|
||||||
+", repair = "+repairXP
|
+", repair = "+repairXP
|
||||||
|
@ -38,7 +38,6 @@ public class m {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getPowerLevel(Player player){
|
public static int getPowerLevel(Player player){
|
||||||
PlayerProfile PP = Users.getProfile(player);
|
PlayerProfile PP = Users.getProfile(player);
|
||||||
int x = 0;
|
int x = 0;
|
||||||
@ -346,8 +345,13 @@ public class m {
|
|||||||
player.sendMessage(ChatColor.DARK_GRAY+"XP GAIN: "+ChatColor.WHITE+"Chopping down trees");
|
player.sendMessage(ChatColor.DARK_GRAY+"XP GAIN: "+ChatColor.WHITE+"Chopping down trees");
|
||||||
player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"EFFECTS"+ChatColor.RED+"[]---");
|
player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"EFFECTS"+ChatColor.RED+"[]---");
|
||||||
player.sendMessage(ChatColor.DARK_AQUA+"Tree Feller (ABILITY): "+ChatColor.GREEN+"Make trees explode");
|
player.sendMessage(ChatColor.DARK_AQUA+"Tree Feller (ABILITY): "+ChatColor.GREEN+"Make trees explode");
|
||||||
|
player.sendMessage(ChatColor.DARK_AQUA+"Leaf Blower: "+ChatColor.GREEN+"Blow Away Leaves");
|
||||||
player.sendMessage(ChatColor.DARK_AQUA+"Double Drops: "+ChatColor.YELLOW+ChatColor.GREEN+"Double the normal loot");
|
player.sendMessage(ChatColor.DARK_AQUA+"Double Drops: "+ChatColor.YELLOW+ChatColor.GREEN+"Double the normal loot");
|
||||||
player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"YOUR STATS"+ChatColor.RED+"[]---");
|
player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"YOUR STATS"+ChatColor.RED+"[]---");
|
||||||
|
if(PP.getWoodCuttingInt() < 100)
|
||||||
|
player.sendMessage(ChatColor.GRAY+"LOCKED UNTIL 100+ SKILL (LEAF BLOWER)");
|
||||||
|
else
|
||||||
|
player.sendMessage(ChatColor.RED+"Leaf Blower: "+ChatColor.YELLOW+"Blow away leaves");
|
||||||
player.sendMessage(ChatColor.RED+"Double Drop Chance: "+ChatColor.YELLOW+percentage+"%");
|
player.sendMessage(ChatColor.RED+"Double Drop Chance: "+ChatColor.YELLOW+percentage+"%");
|
||||||
player.sendMessage(ChatColor.RED+"Tree Feller Length: "+ChatColor.YELLOW+ticks+"s");
|
player.sendMessage(ChatColor.RED+"Tree Feller Length: "+ChatColor.YELLOW+ticks+"s");
|
||||||
}
|
}
|
||||||
|
@ -96,13 +96,29 @@ public class mcBlockListener extends BlockListener {
|
|||||||
if(m.isAxes(inhand)){
|
if(m.isAxes(inhand)){
|
||||||
if(!Config.getInstance().isBlockWatched(block)){
|
if(!Config.getInstance().isBlockWatched(block)){
|
||||||
WoodCutting.woodCuttingProcCheck(player, block);
|
WoodCutting.woodCuttingProcCheck(player, block);
|
||||||
PP.addWoodcuttingXP(7 * LoadProperties.xpGainMultiplier);
|
//Default
|
||||||
|
if(block.getData() == (byte)0)
|
||||||
|
PP.addWoodcuttingXP(7 * LoadProperties.xpGainMultiplier);
|
||||||
|
//Spruce
|
||||||
|
if(block.getData() == (byte)1)
|
||||||
|
PP.addWoodcuttingXP(8 * LoadProperties.xpGainMultiplier);
|
||||||
|
//Birch
|
||||||
|
if(block.getData() == (byte)2)
|
||||||
|
PP.addWoodcuttingXP(9 * LoadProperties.xpGainMultiplier);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(block.getData() != 5){
|
if(!Config.getInstance().isBlockWatched(block)){
|
||||||
WoodCutting.woodCuttingProcCheck(player, block);
|
WoodCutting.woodCuttingProcCheck(player, block);
|
||||||
PP.addWoodcuttingXP(7 * LoadProperties.xpGainMultiplier);
|
//Default
|
||||||
|
if(block.getData() == (byte)0)
|
||||||
|
PP.addWoodcuttingXP(7 * LoadProperties.xpGainMultiplier);
|
||||||
|
//Spruce
|
||||||
|
if(block.getData() == (byte)1)
|
||||||
|
PP.addWoodcuttingXP(8 * LoadProperties.xpGainMultiplier);
|
||||||
|
//Birch
|
||||||
|
if(block.getData() == (byte)2)
|
||||||
|
PP.addWoodcuttingXP(9 * LoadProperties.xpGainMultiplier);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Skills.XpCheck(player);
|
Skills.XpCheck(player);
|
||||||
@ -132,9 +148,11 @@ public class mcBlockListener extends BlockListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(blockx.getTypeId() == 18){
|
if(blockx.getTypeId() == 18){
|
||||||
mat = Material.getMaterial(6);
|
mat = Material.SAPLING;
|
||||||
item = new ItemStack(mat, 1, (byte)0, (byte) 0);
|
|
||||||
if(Math.random() * 10 > 8)
|
item = new ItemStack(mat, 1, (short)0, blockx.getData());
|
||||||
|
|
||||||
|
if(Math.random() * 10 > 9)
|
||||||
blockx.getLocation().getWorld().dropItemNaturally(blockx.getLocation(), item);
|
blockx.getLocation().getWorld().dropItemNaturally(blockx.getLocation(), item);
|
||||||
}
|
}
|
||||||
blockx.setType(Material.AIR);
|
blockx.setType(Material.AIR);
|
||||||
@ -160,7 +178,7 @@ public class mcBlockListener extends BlockListener {
|
|||||||
Herbalism.herbalismProcCheck(block, player, event);
|
Herbalism.herbalismProcCheck(block, player, event);
|
||||||
|
|
||||||
//Change the byte back when broken
|
//Change the byte back when broken
|
||||||
if(block.getData() == 5)
|
if(block.getData() == 5 && m.shouldBeWatched(block))
|
||||||
block.setData((byte) 0);
|
block.setData((byte) 0);
|
||||||
}
|
}
|
||||||
public void onBlockDamage(BlockDamageEvent event) {
|
public void onBlockDamage(BlockDamageEvent event) {
|
||||||
@ -249,6 +267,19 @@ public class mcBlockListener extends BlockListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* LEAF BLOWER
|
||||||
|
*/
|
||||||
|
if(block.getTypeId() == 18 && mcPermissions.getInstance().woodcutting(player) && PP.getWoodCuttingInt() >= 100 && m.isAxes(player.getItemInHand()) && m.blockBreakSimulate(block, player, plugin))
|
||||||
|
{
|
||||||
|
m.damageTool(player, (short)1);
|
||||||
|
if(Math.random() * 10 > 9)
|
||||||
|
{
|
||||||
|
ItemStack x = new ItemStack(Material.SAPLING, 1, (short)0, block.getData());
|
||||||
|
block.getLocation().getWorld().dropItemNaturally(block.getLocation(), x);
|
||||||
|
}
|
||||||
|
block.setType(Material.AIR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onBlockFromTo(BlockFromToEvent event) {
|
public void onBlockFromTo(BlockFromToEvent event) {
|
||||||
|
@ -103,7 +103,7 @@ public class mcMMO extends JavaPlugin {
|
|||||||
mcLoadMySQL();
|
mcLoadMySQL();
|
||||||
database.createStructure(); //Make Structure
|
database.createStructure(); //Make Structure
|
||||||
|
|
||||||
Leaderboard.makeLeaderboards(); //Make the leaderboards
|
//Leaderboard.makeLeaderboards(); //Make the leaderboards
|
||||||
System.out.println( pdfFile.getName() + " version " + pdfFile.getVersion() + " is enabled!" );
|
System.out.println( pdfFile.getName() + " version " + pdfFile.getVersion() + " is enabled!" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package com.gmail.nossr50;
|
package com.gmail.nossr50;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
@ -99,6 +101,7 @@ public class mcPlayerListener extends PlayerListener {
|
|||||||
{
|
{
|
||||||
Block targetBlock = player.getTargetBlock(null, 20);
|
Block targetBlock = player.getTargetBlock(null, 20);
|
||||||
player.sendMessage("Target Block TypeID = "+targetBlock.getTypeId());
|
player.sendMessage("Target Block TypeID = "+targetBlock.getTypeId());
|
||||||
|
player.sendMessage("Target Block Byte Data = "+targetBlock.getData());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(player.getItemInHand().getTypeId() == 261 && LoadProperties.archeryFireRateLimit){
|
if(player.getItemInHand().getTypeId() == 261 && LoadProperties.archeryFireRateLimit){
|
||||||
@ -199,112 +202,185 @@ public class mcPlayerListener extends PlayerListener {
|
|||||||
PP.toggleAbilityUse();
|
PP.toggleAbilityUse();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(split[0].equalsIgnoreCase("/details")){
|
||||||
|
event.setCancelled(true);
|
||||||
|
player.sendMessage("Material : "+player.getItemInHand().getType());
|
||||||
|
player.sendMessage("Type ID : "+player.getItemInHand().getTypeId());
|
||||||
|
player.sendMessage("Byte Data : "+player.getItemInHand().getDurability());
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
* LEADER BOARD COMMAND
|
* LEADER BOARD COMMAND
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if(split[0].equalsIgnoreCase("/"+LoadProperties.mctop)){
|
if(split[0].equalsIgnoreCase("/"+LoadProperties.mctop)){
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
//Format: /top <skillname> <pagenumber>
|
if(LoadProperties.useMySQL == false){
|
||||||
|
/*
|
||||||
|
* POWER LEVEL INFO RETRIEVAL
|
||||||
|
*/
|
||||||
|
if(split.length == 1){
|
||||||
|
int p = 1;
|
||||||
|
String[] info = Leaderboard.retrieveInfo("powerlevel", p);
|
||||||
|
player.sendMessage(ChatColor.YELLOW+"--MMO"+ChatColor.BLUE+" Power Level "+ChatColor.YELLOW+"Leaderboard--");
|
||||||
|
int n = 1 * p; //Position
|
||||||
|
for(String x : info){
|
||||||
|
if(x != null){
|
||||||
|
String digit = String.valueOf(n);
|
||||||
|
if(n < 10)
|
||||||
|
digit ="0"+String.valueOf(n);
|
||||||
|
String[] splitx = x.split(":");
|
||||||
|
//Format: 1. Playername - skill value
|
||||||
|
player.sendMessage(digit+". "+ChatColor.GREEN+splitx[1]+" - "+ChatColor.WHITE+splitx[0]);
|
||||||
|
n++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(split.length >= 2 && Leaderboard.isInt(split[1])){
|
||||||
|
int p = 1;
|
||||||
|
//Grab page value if specified
|
||||||
|
if(split.length >= 2){
|
||||||
|
if(Leaderboard.isInt(split[1])){
|
||||||
|
p = Integer.valueOf(split[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int pt = p;
|
||||||
|
if(p > 1){
|
||||||
|
pt -= 1;
|
||||||
|
pt += (pt * 10);
|
||||||
|
pt = 10;
|
||||||
|
}
|
||||||
|
String[] info = Leaderboard.retrieveInfo("powerlevel", p);
|
||||||
|
player.sendMessage("--MMO Power Level Leaderboard--");
|
||||||
|
int n = 1 * pt; //Position
|
||||||
|
for(String x : info){
|
||||||
|
if(x != null){
|
||||||
|
String digit = String.valueOf(n);
|
||||||
|
if(n < 10)
|
||||||
|
digit ="0"+String.valueOf(n);
|
||||||
|
String[] splitx = x.split(":");
|
||||||
|
//Format: 1. Playername - skill value
|
||||||
|
player.sendMessage(digit+". "+ChatColor.GREEN+splitx[1]+" - "+ChatColor.WHITE+splitx[0]);
|
||||||
|
n++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* SKILL SPECIFIED INFO RETRIEVAL
|
||||||
|
*/
|
||||||
|
if(split.length >= 2 && Skills.isSkill(split[1])){
|
||||||
|
int p = 1;
|
||||||
|
//Grab page value if specified
|
||||||
|
if(split.length >= 3){
|
||||||
|
if(Leaderboard.isInt(split[2])){
|
||||||
|
p = Integer.valueOf(split[2]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int pt = p;
|
||||||
|
if(p > 1){
|
||||||
|
pt -= 1;
|
||||||
|
pt += (pt * 10);
|
||||||
|
pt = 10;
|
||||||
|
}
|
||||||
|
String firstLetter = split[1].substring(0,1); // Get first letter
|
||||||
|
String remainder = split[1].substring(1); // Get remainder of word.
|
||||||
|
String capitalized = firstLetter.toUpperCase() + remainder.toLowerCase();
|
||||||
|
|
||||||
|
String[] info = Leaderboard.retrieveInfo(split[1].toLowerCase(), p);
|
||||||
|
player.sendMessage(ChatColor.YELLOW+"--MMO "+ChatColor.BLUE+capitalized+ChatColor.YELLOW+" Leaderboard--");
|
||||||
|
int n = 1 * pt; //Position
|
||||||
|
for(String x : info){
|
||||||
|
if(x != null){
|
||||||
|
String digit = String.valueOf(n);
|
||||||
|
if(n < 10)
|
||||||
|
digit ="0"+String.valueOf(n);
|
||||||
|
String[] splitx = x.split(":");
|
||||||
|
//Format: 1. Playername - skill value
|
||||||
|
player.sendMessage(digit+". "+ChatColor.GREEN+splitx[1]+" - "+ChatColor.WHITE+splitx[0]);
|
||||||
|
n++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else
|
||||||
/*
|
/*
|
||||||
* POWER LEVEL INFO RETRIEVAL
|
* MYSQL LEADERBOARDS
|
||||||
*/
|
*/
|
||||||
if(split.length == 1){
|
{
|
||||||
int p = 1;
|
if(split.length >= 2 && Skills.isSkill(split[1]))
|
||||||
String[] info = Leaderboard.retrieveInfo("powerlevel", p);
|
{
|
||||||
player.sendMessage(ChatColor.YELLOW+"--MMO"+ChatColor.BLUE+" Power Level "+ChatColor.YELLOW+"Leaderboard--");
|
/*
|
||||||
int n = 1 * p; //Position
|
* Create a nice consistent capitalized leaderboard name
|
||||||
for(String x : info){
|
*/
|
||||||
if(x != null){
|
String lowercase = split[1].toLowerCase(); //For the query
|
||||||
String digit = String.valueOf(n);
|
String firstLetter = split[1].substring(0,1); //Get first letter
|
||||||
if(n < 10)
|
String remainder = split[1].substring(1); //Get remainder of word.
|
||||||
digit ="0"+String.valueOf(n);
|
String capitalized = firstLetter.toUpperCase() + remainder.toLowerCase();
|
||||||
String[] splitx = x.split(":");
|
|
||||||
//Format: 1. Playername - skill value
|
|
||||||
player.sendMessage(digit+". "+ChatColor.GREEN+splitx[1]+" - "+ChatColor.WHITE+splitx[0]);
|
|
||||||
n++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(split.length >= 2 && Leaderboard.isInt(split[1])){
|
|
||||||
int p = 1;
|
|
||||||
//Grab page value if specified
|
|
||||||
if(split.length >= 2){
|
|
||||||
if(Leaderboard.isInt(split[1])){
|
|
||||||
p = Integer.valueOf(split[1]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
int pt = p;
|
|
||||||
if(p > 1){
|
|
||||||
pt -= 1;
|
|
||||||
pt += (pt * 10);
|
|
||||||
pt = 10;
|
|
||||||
}
|
|
||||||
String[] info = Leaderboard.retrieveInfo("powerlevel", p);
|
|
||||||
player.sendMessage("--MMO Power Level Leaderboard--");
|
|
||||||
int n = 1 * pt; //Position
|
|
||||||
for(String x : info){
|
|
||||||
if(x != null){
|
|
||||||
String digit = String.valueOf(n);
|
|
||||||
if(n < 10)
|
|
||||||
digit ="0"+String.valueOf(n);
|
|
||||||
String[] splitx = x.split(":");
|
|
||||||
//Format: 1. Playername - skill value
|
|
||||||
player.sendMessage(digit+". "+ChatColor.GREEN+splitx[1]+" - "+ChatColor.WHITE+splitx[0]);
|
|
||||||
n++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* SKILL SPECIFIED INFO RETRIEVAL
|
|
||||||
*/
|
|
||||||
if(split.length >= 2 && Skills.isSkill(split[1])){
|
|
||||||
int p = 1;
|
|
||||||
//Grab page value if specified
|
|
||||||
if(split.length >= 3){
|
|
||||||
if(Leaderboard.isInt(split[2])){
|
|
||||||
p = Integer.valueOf(split[2]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
int pt = p;
|
|
||||||
if(p > 1){
|
|
||||||
pt -= 1;
|
|
||||||
pt += (pt * 10);
|
|
||||||
pt = 10;
|
|
||||||
}
|
|
||||||
String firstLetter = split[1].substring(0,1); // Get first letter
|
|
||||||
String remainder = split[1].substring(1); // Get remainder of word.
|
|
||||||
String capitalized = firstLetter.toUpperCase() + remainder.toLowerCase();
|
|
||||||
|
|
||||||
String[] info = Leaderboard.retrieveInfo(split[1].toLowerCase(), p);
|
player.sendMessage(ChatColor.YELLOW+"--mcMMO "+ChatColor.BLUE+capitalized+ChatColor.YELLOW+" Leaderboard--");
|
||||||
player.sendMessage(ChatColor.YELLOW+"--MMO "+ChatColor.BLUE+capitalized+ChatColor.YELLOW+" Leaderboard--");
|
if(split.length >= 3 && m.isInt(split[2]))
|
||||||
int n = 1 * pt; //Position
|
{
|
||||||
for(String x : info){
|
int n = 1; //For the page number
|
||||||
if(x != null){
|
int n2 = Integer.valueOf(split[2]);
|
||||||
String digit = String.valueOf(n);
|
if(n2 > 1)
|
||||||
if(n < 10)
|
{
|
||||||
digit ="0"+String.valueOf(n);
|
//Figure out the 'page' here
|
||||||
String[] splitx = x.split(":");
|
n = 10;
|
||||||
//Format: 1. Playername - skill value
|
n = n * (n2-1);
|
||||||
player.sendMessage(digit+". "+ChatColor.GREEN+splitx[1]+" - "+ChatColor.WHITE+splitx[0]);
|
}
|
||||||
n++;
|
//If a page number is specified
|
||||||
}
|
HashMap<Integer, ArrayList<String>> userslist = mcMMO.database.Read("SELECT "+lowercase+", user_id FROM "
|
||||||
|
+LoadProperties.MySQLtablePrefix+"skills ORDER BY `"+LoadProperties.MySQLtablePrefix+"skills`.`"+lowercase+"` DESC ");
|
||||||
|
|
||||||
|
for(int i=n;i<=n+10;i++)
|
||||||
|
{
|
||||||
|
HashMap<Integer, ArrayList<String>> username = mcMMO.database.Read("SELECT user FROM "+LoadProperties.MySQLtablePrefix+"users WHERE id = '" + Integer.valueOf(userslist.get(i).get(1)) + "'");
|
||||||
|
player.sendMessage(String.valueOf(i)+". "+ChatColor.GREEN+userslist.get(i).get(0)+" - "+ChatColor.WHITE+username.get(1).get(0));
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//If no page number is specified
|
||||||
|
HashMap<Integer, ArrayList<String>> userslist = mcMMO.database.Read("SELECT "+lowercase+", user_id FROM "
|
||||||
|
+LoadProperties.MySQLtablePrefix+"skills ORDER BY `"+LoadProperties.MySQLtablePrefix+"skills`.`"+lowercase+"` DESC ");
|
||||||
|
for(int i=1;i<=10;i++) //i<=userslist.size()
|
||||||
|
{
|
||||||
|
HashMap<Integer, ArrayList<String>> username = mcMMO.database.Read("SELECT user FROM "+LoadProperties.MySQLtablePrefix+"users WHERE id = '" + Integer.valueOf(userslist.get(i).get(1)) + "'");
|
||||||
|
player.sendMessage(String.valueOf(i)+". "+ChatColor.GREEN+userslist.get(i).get(0)+" - "+ChatColor.WHITE+username.get(1).get(0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(split.length >= 1)
|
||||||
|
{
|
||||||
|
player.sendMessage(ChatColor.YELLOW+"--mcMMO "+ChatColor.BLUE+"Power Level"+ChatColor.YELLOW+" Leaderboard--");
|
||||||
|
if(split.length >= 2 && m.isInt(split[1]))
|
||||||
|
{
|
||||||
|
int n = 1; //For the page number
|
||||||
|
int n2 = Integer.valueOf(split[1]);
|
||||||
|
if(n2 > 1)
|
||||||
|
{
|
||||||
|
//Figure out the 'page' here
|
||||||
|
n = 10;
|
||||||
|
n = n * (n2-1);
|
||||||
|
}
|
||||||
|
//If a page number is specified
|
||||||
|
HashMap<Integer, ArrayList<String>> userslist = mcMMO.database.Read("SELECT taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics, user_id FROM "
|
||||||
|
+LoadProperties.MySQLtablePrefix+"skills ORDER BY taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics DESC ");
|
||||||
|
for(int i=n;i<=n+10;i++)
|
||||||
|
{
|
||||||
|
HashMap<Integer, ArrayList<String>> username = mcMMO.database.Read("SELECT user FROM "+LoadProperties.MySQLtablePrefix+"users WHERE id = '" + Integer.valueOf(userslist.get(i).get(1)) + "'");
|
||||||
|
player.sendMessage(String.valueOf(i)+". "+ChatColor.GREEN+userslist.get(i).get(0)+" - "+ChatColor.WHITE+username.get(1).get(0));
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
HashMap<Integer, ArrayList<String>> userslist = mcMMO.database.Read("SELECT taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics, user_id FROM "
|
||||||
|
+LoadProperties.MySQLtablePrefix+"skills ORDER BY taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics DESC ");
|
||||||
|
for(int i=1;i<=10;i++)
|
||||||
|
{
|
||||||
|
HashMap<Integer, ArrayList<String>> username = mcMMO.database.Read("SELECT user FROM "+LoadProperties.MySQLtablePrefix+"users WHERE id = '" + Integer.valueOf(userslist.get(i).get(1)) + "'");
|
||||||
|
player.sendMessage(String.valueOf(i)+". "+ChatColor.GREEN+userslist.get(i).get(0)+" - "+ChatColor.WHITE+username.get(1).get(0));
|
||||||
|
//System.out.println(username.get(1).get(0));
|
||||||
|
//System.out.println("Mining : " + userslist.get(i).get(0) + ", User id : " + userslist.get(i).get(1));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
if(split[0].equalsIgnoreCase("/mutechat")){
|
|
||||||
event.setCancelled(true);
|
|
||||||
if(PP.getPartyChatOnlyToggle() == true)
|
|
||||||
player.sendMessage("Party Chat Only "+ChatColor.RED+"Off");
|
|
||||||
if(PP.getPartyChatOnlyToggle() == false)
|
|
||||||
player.sendMessage("Party Chat Only "+ChatColor.RED+"On");
|
|
||||||
PP.togglePartyChatOnly();
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
if(mcPermissions.getInstance().mcAbility(player) && split[0].equalsIgnoreCase("/"+LoadProperties.mcrefresh)){
|
if(mcPermissions.getInstance().mcAbility(player) && split[0].equalsIgnoreCase("/"+LoadProperties.mcrefresh)){
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
if(!mcPermissions.getInstance().mcrefresh(player)){
|
if(!mcPermissions.getInstance().mcrefresh(player)){
|
||||||
@ -460,14 +536,14 @@ public class mcPlayerListener extends PlayerListener {
|
|||||||
player.sendMessage("That is not a valid player");
|
player.sendMessage("That is not a valid player");
|
||||||
}
|
}
|
||||||
if(isPlayer(split[1])){
|
if(isPlayer(split[1])){
|
||||||
Player target = getPlayer(split[1]);
|
Player target = getPlayer(split[1]);
|
||||||
PlayerProfile PPt = Users.getProfile(target);
|
PlayerProfile PPt = Users.getProfile(target);
|
||||||
if(PP.getParty().equals(PPt.getParty())){
|
if(PP.getParty().equals(PPt.getParty())){
|
||||||
player.teleportTo(target);
|
player.teleportTo(target);
|
||||||
player.sendMessage(ChatColor.GREEN+"You have teleported to "+target.getName());
|
player.sendMessage(ChatColor.GREEN+"You have teleported to "+target.getName());
|
||||||
target.sendMessage(ChatColor.GREEN+player.getName() + " has teleported to you.");
|
target.sendMessage(ChatColor.GREEN+player.getName() + " has teleported to you.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* WHOIS COMMAND
|
* WHOIS COMMAND
|
||||||
|
@ -38,12 +38,12 @@ public class mcTimer extends TimerTask{
|
|||||||
/*
|
/*
|
||||||
* PLAYER BLEED MONITORING
|
* PLAYER BLEED MONITORING
|
||||||
*/
|
*/
|
||||||
if(thecount % 2 == 0 && player != null && PP.getBleedTicks() >= 1){
|
if(thecount % 2 == 0 && player != null && PP != null && PP.getBleedTicks() >= 1){
|
||||||
player.damage(2);
|
player.damage(2);
|
||||||
PP.decreaseBleedTicks();
|
PP.decreaseBleedTicks();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mcPermissions.getInstance().regeneration(player) && System.currentTimeMillis() >= PP.getRecentlyHurt() + 60000){
|
if(mcPermissions.getInstance().regeneration(player) && PP != null && System.currentTimeMillis() >= PP.getRecentlyHurt() + 60000){
|
||||||
if(thecount == 10 || thecount == 20 || thecount == 30 || thecount == 40){
|
if(thecount == 10 || thecount == 20 || thecount == 30 || thecount == 40){
|
||||||
if(player != null &&
|
if(player != null &&
|
||||||
player.getHealth() > 0 && player.getHealth() < 20
|
player.getHealth() > 0 && player.getHealth() < 20
|
||||||
|
Loading…
x
Reference in New Issue
Block a user