All changes up to 0.9.6

This commit is contained in:
nossr50 2011-03-22 04:59:02 -07:00
parent 8fc7c56c12
commit 6c6d2710e3
11 changed files with 74 additions and 26 deletions

View File

@ -1,5 +1,17 @@
Changelog:
#Versions without changelogs probably had very small misc fixes, like tweaks to the source code#
Version 0.9.6
Timer checks for player being null before adding them to the mcUsers system
Cooldowns will now show how much time is remaining when trying to use their respective abilities
SkullSpliiter will now correctly inform the player when they are too tired to use it
Acrobatics will no longer give XP if the event was cancelled by another plugin
Version 0.9.5
Super Breaker now gives a chance for Triple Drops based on mining skill
Ability durability loss down from 15 to 2
Ability durability loss is now toggle-able
Ability durability loss can be adjusted in the configuration file
Mining Picks are no longer lowered after activating Super Breaker
Version 0.9.4
Flowers won't drop wheat anymore
Signs won't trigger ability readiness anymore

View File

@ -15,12 +15,13 @@ public class mcAcrobatics {
public void acrobaticsCheck(Player player, EntityDamageEvent event, Location loc, int xx, int y, int z){
if(player != null){
if(Math.random() * 1000 <= mcUsers.getProfile(player).getAcrobaticsInt()){
event.setCancelled(true);
player.sendMessage("**ROLLED**");
if(!mcConfig.getInstance().isBlockWatched(loc.getWorld().getBlockAt(xx, y, z))
&& mcPermissions.getInstance().acrobatics(player)){
if(!event.isCancelled())
mcUsers.getProfile(player).addAcrobaticsGather(event.getDamage() * 8);
mcSkills.getInstance().XpCheck(player);
event.setCancelled(true);
}
return;
}
@ -29,6 +30,8 @@ public class mcAcrobatics {
return;
if(!mcConfig.getInstance().isBlockWatched(loc.getWorld().getBlockAt(xx, y, z))
&& mcPermissions.getInstance().acrobatics(player)){
if(!event.isCancelled())
mcUsers.getProfile(player).addAcrobaticsGather(event.getDamage() * 8);
mcUsers.getProfile(player).addAcrobaticsGather(event.getDamage() * 12);
mcSkills.getInstance().XpCheck(player);
mcConfig.getInstance().addBlockWatch(loc.getWorld().getBlockAt(xx, y, z));

View File

@ -12,6 +12,9 @@ import org.bukkit.event.block.BlockListener;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.block.BlockRightClickEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.Plugin;
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
public class mcBlockListener extends BlockListener {
private final mcMMO plugin;
@ -55,6 +58,7 @@ public class mcBlockListener extends BlockListener {
Block block = event.getBlock();
Location loc = block.getLocation();
int dmg = event.getDamageLevel().getLevel();
/*
* ABILITY PREPARATION CHECKS
*/
@ -82,7 +86,8 @@ public class mcBlockListener extends BlockListener {
byte type = block.getData();
ItemStack item = new ItemStack(mat, 1, (byte)0, type);
block.setType(Material.AIR);
mcm.getInstance().damageTool(player, (short) 15);
if(mcLoadProperties.toolsLoseDurabilityFromAbilities)
mcm.getInstance().damageTool(player, (short) mcLoadProperties.abilityDurabilityLoss);
block.getLocation().getWorld().dropItemNaturally(block.getLocation(), item);
}
/*
@ -170,7 +175,8 @@ public class mcBlockListener extends BlockListener {
blockx.setType(Material.AIR);
}
}
mcm.getInstance().damageTool(player, (short) 15);
if(mcLoadProperties.toolsLoseDurabilityFromAbilities)
mcm.getInstance().damageTool(player, (short) mcLoadProperties.abilityDurabilityLoss);
/*
* NOTE TO SELF
* I NEED TO REMOVE TREE FELL BLOCKS FROM BEING WATCHED AFTER THIS CODE IS EXECUTED

View File

@ -1,5 +1,6 @@
package com.gmail.nossr50;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
@ -64,7 +65,8 @@ public class mcItem {
}
player.sendMessage("**CHIMAERA WING**");
} else if (mcUsers.getProfile(player).getRecentlyHurt() >= 1 && is.getAmount() >= 10) {
player.sendMessage("You were injured recently and must wait to use this.");
player.sendMessage("You were injured recently and must wait to use this."
+ChatColor.YELLOW+" ("+(mcUsers.getProfile(player).getRecentlyHurt() * 2)+"s)");
} else if (is.getTypeId() == 288 && is.getAmount() <= 9){
player.sendMessage("You need more of that to use it");
}

View File

@ -1,15 +1,17 @@
package com.gmail.nossr50;
public class mcLoadProperties {
public static Boolean pvpxp, miningrequirespickaxe, woodcuttingrequiresaxe, pvp, eggs, apples, myspawnclearsinventory, cake, music, diamond, glowstone, slowsand, sulphur, netherrack, bones, coal, clay, anvilmessages;
public static Boolean toolsLoseDurabilityFromAbilities, pvpxp, miningrequirespickaxe, woodcuttingrequiresaxe, pvp, eggs, apples, myspawnclearsinventory, cake, music, diamond, glowstone, slowsand, sulphur, netherrack, bones, coal, clay, anvilmessages;
public static String mcability, mcmmo, mcc, mcrefresh, mcitem, mcgod, stats, mmoedit, ptp, party, myspawn, setmyspawn, whois, invite, accept, clearmyspawn;
public static int feathersConsumedByChimaeraWing, pvpxprewardmodifier, repairdiamondlevel, globalxpmodifier, miningxpmodifier, repairxpmodifier, woodcuttingxpmodifier, unarmedxpmodifier, herbalismxpmodifier, excavationxpmodifier, archeryxpmodifier, swordsxpmodifier, axesxpmodifier, acrobaticsxpmodifier;
public static int abilityDurabilityLoss, feathersConsumedByChimaeraWing, pvpxprewardmodifier, repairdiamondlevel, globalxpmodifier, miningxpmodifier, repairxpmodifier, woodcuttingxpmodifier, unarmedxpmodifier, herbalismxpmodifier, excavationxpmodifier, archeryxpmodifier, swordsxpmodifier, axesxpmodifier, acrobaticsxpmodifier;
public static void loadMain(){
String propertiesFile = mcMMO.maindirectory + "mcmmo.properties";
mcProperties properties = new mcProperties(propertiesFile);
properties.load();
toolsLoseDurabilityFromAbilities = properties.getBoolean("toolsLoseDurabilityFromAbilities", true);
abilityDurabilityLoss = properties.getInteger("abilityDurabilityLoss", 2);
feathersConsumedByChimaeraWing = properties.getInteger("feathersConsumedByChimaeraWing", 10);
pvpxp = properties.getBoolean("pvpGivesXP", true);
pvpxprewardmodifier = properties.getInteger("pvpXpRewardModifier", 1);

View File

@ -25,6 +25,10 @@ public class mcMining {
if(!mcm.getInstance().abilityBlockCheck(block))
return;
}
if(mcUsers.getProfile(player).getPickaxePreparationMode()){
mcUsers.getProfile(player).setPickaxePreparationMode(false);
mcUsers.getProfile(player).setPickaxePreparationTicks(0);
}
int miningticks = 2;
if(mcUsers.getProfile(player).getMiningInt() >= 50)
miningticks++;
@ -164,7 +168,8 @@ public class mcMining {
}
}
public void SuperBreakerBlockCheck(Player player, Block block){
mcm.getInstance().damageTool(player, (short) 15);
if(mcLoadProperties.toolsLoseDurabilityFromAbilities)
mcm.getInstance().damageTool(player, (short) mcLoadProperties.abilityDurabilityLoss);
Location loc = block.getLocation();
Material mat = Material.getMaterial(block.getTypeId());
byte damage = 0;
@ -173,6 +178,7 @@ public class mcMining {
if(!mcConfig.getInstance().isBlockWatched(block)){
mcUsers.getProfile(player).addMiningGather(3);
blockProcCheck(block, player);
blockProcCheck(block, player);
}
if(block.getTypeId() == 1){
mat = Material.COBBLESTONE;
@ -188,6 +194,7 @@ public class mcMining {
if(!mcConfig.getInstance().isBlockWatched(block)){
mcUsers.getProfile(player).addMiningGather(3);
blockProcCheck(block, player);
blockProcCheck(block, player);
}
mat = Material.getMaterial(87);
item = new ItemStack(mat, 1, (byte)0, damage);
@ -199,6 +206,7 @@ public class mcMining {
if(!mcConfig.getInstance().isBlockWatched(block)){
mcUsers.getProfile(player).addMiningGather(3);
blockProcCheck(block, player);
blockProcCheck(block, player);
}
mat = Material.getMaterial(348);
item = new ItemStack(mat, 1, (byte)0, damage);
@ -210,6 +218,7 @@ public class mcMining {
if(!mcConfig.getInstance().isBlockWatched(block)){
mcUsers.getProfile(player).addMiningGather(10);
blockProcCheck(block, player);
blockProcCheck(block, player);
}
mat = Material.getMaterial(263);
item = new ItemStack(mat, 1, (byte)0, damage);
@ -221,6 +230,7 @@ public class mcMining {
if(!mcConfig.getInstance().isBlockWatched(block)){
mcUsers.getProfile(player).addMiningGather(35);
blockProcCheck(block, player);
blockProcCheck(block, player);
}
block.setType(Material.AIR);
}
@ -229,6 +239,7 @@ public class mcMining {
if(!mcConfig.getInstance().isBlockWatched(block)){
mcUsers.getProfile(player).addMiningGather(75);
blockProcCheck(block, player);
blockProcCheck(block, player);
}
mat = Material.getMaterial(264);
item = new ItemStack(mat, 1, (byte)0, damage);
@ -240,6 +251,7 @@ public class mcMining {
if(!mcConfig.getInstance().isBlockWatched(block)){
mcUsers.getProfile(player).addMiningGather(25);
blockProcCheck(block, player);
blockProcCheck(block, player);
}
block.setType(Material.AIR);
}
@ -248,6 +260,7 @@ public class mcMining {
if(!mcConfig.getInstance().isBlockWatched(block)){
mcUsers.getProfile(player).addMiningGather(15);
blockProcCheck(block, player);
blockProcCheck(block, player);
}
mat = Material.getMaterial(331);
item = new ItemStack(mat, 1, (byte)0, damage);
@ -264,6 +277,7 @@ public class mcMining {
if(!mcConfig.getInstance().isBlockWatched(block)){
mcUsers.getProfile(player).addMiningGather(40);
blockProcCheck(block, player);
blockProcCheck(block, player);
}
mat = Material.getMaterial(351);
item = new ItemStack(mat, 1, (byte)0,(byte)0x4);

View File

@ -77,7 +77,8 @@ public class mcSkills {
return;
if(mcPermissions.getInstance().miningAbility(player) && mcm.getInstance().isMiningPick(player.getItemInHand()) && !mcUsers.getProfile(player).getPickaxePreparationMode()){
if(!mcUsers.getProfile(player).getSuperBreakerMode() && mcUsers.getProfile(player).getSuperBreakerCooldown() >= 1){
player.sendMessage(ChatColor.RED+"You are too tired to use that ability again.");
player.sendMessage(ChatColor.RED+"You are too tired to use that ability again."+ChatColor.YELLOW+" ("
+(mcUsers.getProfile(player).getSuperBreakerCooldown() * 2)+"s)");
return;
}
player.sendMessage(ChatColor.GREEN+"**YOU READY YOUR PICKAXE**");
@ -86,7 +87,8 @@ public class mcSkills {
}
if(mcPermissions.getInstance().excavationAbility(player) && mcm.getInstance().isShovel(player.getItemInHand()) && !mcUsers.getProfile(player).getShovelPreparationMode()){
if(!mcUsers.getProfile(player).getGigaDrillBreakerMode() && mcUsers.getProfile(player).getGigaDrillBreakerCooldown() >= 1){
player.sendMessage(ChatColor.RED+"You are too tired to use that ability again.");
player.sendMessage(ChatColor.RED+"You are too tired to use that ability again."
+ChatColor.YELLOW+" ("+(mcUsers.getProfile(player).getGigaDrillBreakerCooldown() * 2)+"s)");
return;
}
player.sendMessage(ChatColor.GREEN+"**YOU READY YOUR SHOVEL**");
@ -95,7 +97,8 @@ public class mcSkills {
}
if(mcPermissions.getInstance().swordsAbility(player) && mcm.getInstance().isSwords(player.getItemInHand()) && !mcUsers.getProfile(player).getSwordsPreparationMode()){
if(!mcUsers.getProfile(player).getSerratedStrikesMode() && mcUsers.getProfile(player).getSerratedStrikesCooldown() >= 1){
player.sendMessage(ChatColor.RED+"You are too tired to use that ability again.");
player.sendMessage(ChatColor.RED+"You are too tired to use that ability again."
+ChatColor.YELLOW+" ("+(mcUsers.getProfile(player).getSerratedStrikesCooldown() * 2)+"s)");
return;
}
player.sendMessage(ChatColor.GREEN+"**YOU READY YOUR SWORD**");
@ -104,7 +107,8 @@ public class mcSkills {
}
if(mcPermissions.getInstance().unarmedAbility(player) && player.getItemInHand().getTypeId() == 0 && !mcUsers.getProfile(player).getFistsPreparationMode()){
if(!mcUsers.getProfile(player).getBerserkMode() && mcUsers.getProfile(player).getBerserkCooldown() >= 1){
player.sendMessage(ChatColor.RED+"You are too tired to use that ability again.");
player.sendMessage(ChatColor.RED+"You are too tired to use that ability again."
+ChatColor.YELLOW+" ("+(mcUsers.getProfile(player).getBerserkCooldown() * 2)+"s)");
return;
}
player.sendMessage(ChatColor.GREEN+"**YOU READY YOUR FISTS**");
@ -215,6 +219,10 @@ public class mcSkills {
mcUsers.getProfile(player).setSkullSplitterTicks(ticks);
mcUsers.getProfile(player).setSkullSplitterMode(true);
}
if(!mcUsers.getProfile(player).getSkullSplitterMode() && mcUsers.getProfile(player).getSkullSplitterCooldown() >= 1){
player.sendMessage(ChatColor.RED+"You are too tired to use that ability again."
+ChatColor.YELLOW+" ("+(mcUsers.getProfile(player).getSkullSplitterCooldown() * 2)+"s)");
}
}
}
public void monitorSkills(Player player){

View File

@ -16,7 +16,7 @@ public class mcTimer extends TimerTask{
public void run() {
Player[] playerlist = plugin.getServer().getOnlinePlayers();
for(Player player : playerlist){
if(mcUsers.getProfile(player) == null)
if(player != null && mcUsers.getProfile(player) == null)
mcUsers.addUser(player);
/*
* MONITOR SKILLS

View File

@ -71,7 +71,8 @@ public class mcWoodCutting {
mcUsers.getProfile(player).setTreeFellerMode(true);
}
if(!mcUsers.getProfile(player).getTreeFellerMode() && mcUsers.getProfile(player).getTreeFellerCooldown() >= 1){
player.sendMessage(ChatColor.RED+"You are too tired to use that ability again.");
player.sendMessage(ChatColor.RED+"You are too tired to use that ability again."
+ChatColor.YELLOW+" ("+(mcUsers.getProfile(player).getTreeFellerCooldown() * 2)+"s)");
}
}
}

View File

@ -144,7 +144,7 @@ public class mcm {
}
public boolean shouldBeWatched(Block block){
int id = block.getTypeId();
if(id == 2 || id == 3 || id == 12 || id == 13 || id == 21 || id == 15 || id == 14 || id == 56 || id == 38 || id == 37 || id == 39 || id == 40 || id == 24){
if(id == 87 || id == 89 || id == 2 || id == 3 || id == 12 || id == 13 || id == 21 || id == 15 || id == 14 || id == 56 || id == 38 || id == 37 || id == 39 || id == 40 || id == 24){
return true;
} else {
return false;
@ -408,7 +408,7 @@ public class mcm {
player.sendMessage(ChatColor.RED+"-----[]"+ChatColor.GREEN+"MINING"+ChatColor.RED+"[]-----");
player.sendMessage(ChatColor.DARK_GRAY+"XP GAIN: "+ChatColor.WHITE+"Mining Stone & Ore");
player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"EFFECTS"+ChatColor.RED+"[]---");
player.sendMessage(ChatColor.DARK_AQUA+"Super Breaker (ABILITY): "+ChatColor.GREEN+"Fast mining");
player.sendMessage(ChatColor.DARK_AQUA+"Super Breaker (ABILITY): "+ChatColor.GREEN+"Speed+, Triple Drop Chance");
player.sendMessage(ChatColor.DARK_AQUA+"Double Drops: "+ChatColor.GREEN+"Double the normal loot");
player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"YOUR STATS"+ChatColor.RED+"[]---");
player.sendMessage(ChatColor.RED+"Double Drop Chance: "+ChatColor.YELLOW+percentage+"%");

View File

@ -1,3 +1,3 @@
name: mcMMO
main: com.gmail.nossr50.mcMMO
version: 0.9.4
version: 0.9.6