mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-12-25 18:17:46 +01:00
All changes up to 0.7.4
This commit is contained in:
parent
67fbde3ebd
commit
f875f1d1c0
@ -1,5 +1,14 @@
|
||||
Changelog:
|
||||
#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
|
||||
Completely rewrote the XP system
|
||||
Added an XP skillrate modifier to the settings file
|
||||
|
@ -39,6 +39,7 @@ public class mcBlockListener extends BlockListener {
|
||||
public void onBlockDamage(BlockDamageEvent event) {
|
||||
//STARTED(0), DIGGING(1), BROKEN(3), STOPPED(2);
|
||||
Player player = event.getPlayer();
|
||||
//player.sendMessage("mcMMO DEBUG: EVENT-OK DMG LEVEL ("+event.getDamageLevel().getLevel()+")");
|
||||
Block block = event.getBlock();
|
||||
int x = block.getX();
|
||||
int y = block.getY();
|
||||
@ -50,17 +51,16 @@ public class mcBlockListener extends BlockListener {
|
||||
/*
|
||||
* 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))
|
||||
mcm.getInstance().miningBlockCheck(player, block);
|
||||
/*
|
||||
* WOOD CUTTING
|
||||
*/
|
||||
if(block.getTypeId() == 17
|
||||
&& mcPermissions.getInstance().woodcutting(player)){
|
||||
mcUsers.getProfile(player).addWoodcuttingGather(1);
|
||||
&& mcPermissions.getInstance().woodcutting(player)){
|
||||
mcm.getInstance().woodCuttingProcCheck(player, block, loc);
|
||||
mcUsers.getProfile(player).addWoodcuttingGather(3);
|
||||
mcUsers.getProfile(player).addWoodcuttingGather(2);
|
||||
}
|
||||
/*
|
||||
* EXCAVATION
|
||||
|
@ -2,7 +2,7 @@ package com.gmail.nossr50;
|
||||
|
||||
public class mcLoadProperties {
|
||||
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 void loadMain(){
|
||||
@ -50,6 +50,7 @@ public class mcLoadProperties {
|
||||
whois = properties.getString("whois", "whois");
|
||||
invite = properties.getString("invite", "invite");
|
||||
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");
|
||||
//herp derp
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ import com.nijikokun.bukkit.Permissions.Permissions;
|
||||
public class mcPermissions {
|
||||
//Thanks to myWarp source code for helping me figure this shit out!
|
||||
private static Permissions permissionsPlugin;
|
||||
private static boolean permissionsEnabled = false;
|
||||
public static boolean permissionsEnabled = false;
|
||||
private static volatile mcPermissions instance;
|
||||
|
||||
public static void initialize(Server server) {
|
||||
|
@ -112,7 +112,19 @@ public class mcPlayerListener extends PlayerListener {
|
||||
/*
|
||||
* 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){
|
||||
player.sendMessage(ChatColor.RED+"Usage is /"+mcLoadProperties.mmoedit+" playername skillname newvalue");
|
||||
return;
|
||||
@ -193,7 +205,7 @@ public class mcPlayerListener extends PlayerListener {
|
||||
+"/"+(mcUsers.getProfile(target).getHerbalismInt() + 5) * mcLoadProperties.xpmodifier+")");
|
||||
player.sendMessage(ChatColor.YELLOW + "Excavation Skill: "+ ChatColor.GREEN + mcUsers.getProfile(target).getExcavation()+ChatColor.DARK_AQUA
|
||||
+ " 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
|
||||
+ " XP("+mcUsers.getProfile(target).getArcheryGather()
|
||||
+"/"+(mcUsers.getProfile(target).getArcheryInt() + 5) * mcLoadProperties.xpmodifier+")");
|
||||
|
@ -207,6 +207,23 @@ class PlayerList
|
||||
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()
|
||||
{
|
||||
try {
|
||||
|
@ -574,7 +574,7 @@ public class mcm {
|
||||
}
|
||||
//GOLD
|
||||
if(block.getTypeId() == 14){
|
||||
mcUsers.getProfile(player).addMiningGather(50);
|
||||
mcUsers.getProfile(player).addMiningGather(20);
|
||||
mcm.getInstance().blockProcCheck(block, player);
|
||||
}
|
||||
//DIAMOND
|
||||
@ -1421,8 +1421,10 @@ public class mcm {
|
||||
player.sendMessage(ChatColor.GREEN+"/"+mcLoadProperties.stats+ChatColor.GRAY+" - Check current skill levels");
|
||||
if(mcPermissions.getInstance().setMySpawn(player))
|
||||
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.GREEN+"/"+mcLoadProperties.clearmyspawn+" - resets your myspawn to default spawn location");
|
||||
}
|
||||
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+"/woodcutting - Skill info");
|
||||
@ -1570,7 +1572,7 @@ public class mcm {
|
||||
}
|
||||
//DIRT SAND OR GRAVEL
|
||||
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){
|
||||
//CHANCE TO GET CAKE
|
||||
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;
|
||||
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++;
|
||||
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);
|
||||
}
|
||||
player.sendMessage(ChatColor.YELLOW+"Excavation skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(player).getExcavation()+")");
|
||||
|
@ -1,3 +1,3 @@
|
||||
name: mcMMO
|
||||
main: com.gmail.nossr50.mcMMO
|
||||
version: 0.7.1
|
||||
version: 0.7.4
|
Loading…
Reference in New Issue
Block a user