mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-12-01 17:36:46 +01:00
A wip of 0.9.11, not recommended for use
This commit is contained in:
parent
ad46df0b9d
commit
b0f6e6267a
@ -1,153 +1,5 @@
|
|||||||
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.9.10
|
|
||||||
Party invites now show who they are from
|
|
||||||
Mushrooms added to Dirt/Grass excavation loot tables, drops with 500+ skill
|
|
||||||
mcMMO configuration files property setting names have been changed for readability
|
|
||||||
Fixed bug where Gold and Iron wouldn't drop anything during Super Breaker
|
|
||||||
Added /mcability info to /mcc
|
|
||||||
Potentially fixed NPE error when checking players for being in same party for PVP XP
|
|
||||||
Removed sand specific diamond drop from sand excavation loot table, Diamonds can still drop globally for sand
|
|
||||||
Added a global XP gain multiplier, increase it to increase XP gained
|
|
||||||
Reduced PVE XP for Unarmed, now identical to Axes/Swords
|
|
||||||
Changed Chat priority in mcMMO to be higher, this should help plugin conflicts
|
|
||||||
Mushroom XP raised to 40 from 10
|
|
||||||
Flower XP raised to 10 from 3
|
|
||||||
|
|
||||||
Version 0.9.9
|
|
||||||
Fixed problem where entities never got removed from the arrow retrieval list of entities
|
|
||||||
|
|
||||||
Version 0.9.8
|
|
||||||
EntityLiving shouldn't be cast to entities that are not an instance of EntityLiving
|
|
||||||
Added a null check in the timer for players being null before proceeding
|
|
||||||
|
|
||||||
Version 0.9.7
|
|
||||||
Procs/XP Gain will no longer happen when the Entity is immune to damage (Thanks EdwardHand!)
|
|
||||||
Axes critical damage versus players reduced to 150% damage from 200% damage
|
|
||||||
Fixed bug where Daze might not proc
|
|
||||||
Changed archery Daze to follow smooth transition
|
|
||||||
Added archery Daze chance info to /archery
|
|
||||||
Cooldown lengths are now customizable, they are in seconds and multiplied by 2 by mcMMO
|
|
||||||
|
|
||||||
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
|
|
||||||
Version 0.9.3
|
|
||||||
Bug stopping abilities from never wearing of may have been fixed
|
|
||||||
Changed color of "X Ability has worn off" to RED from GRAY
|
|
||||||
Super Breaker, Giga Drill Breaker, and Tree Feller now damage the tool significantly during use
|
|
||||||
Netherrack and Glowstone now give Mining XP
|
|
||||||
Netherrack and Glowstone are now effected by Super Breaker
|
|
||||||
Abilities will no longer be readied when you right click signs or beds
|
|
||||||
Chimaera Wings won't activate on blocks you can interact with and signs
|
|
||||||
Abilities now adjust their effects depending on tool quality
|
|
||||||
Superbreaker won't break things that tool couldn't normally break
|
|
||||||
Giga Drill Breaker will only give triple xp and triple drops for diamond tools, with a reduced effect for lesser tools
|
|
||||||
Skull Splitter now has a limit of opponents nearby it will strike based on your tool quality
|
|
||||||
Serrated Strikes now has a limit of opponents nearby it will strike based on your tool quality
|
|
||||||
Modified /mcmmo description to be a little bit more relevant.
|
|
||||||
|
|
||||||
Version 0.9.2
|
|
||||||
Changed priority of some of the mcMMO listeners
|
|
||||||
Now when certain abilities are activated it shouldn't say "You lower your x"
|
|
||||||
|
|
||||||
Version 0.9.1
|
|
||||||
Fixed "Unknown console command" errors with CB 556
|
|
||||||
Added /mcability command to toggle being able to trigger abilities with right click
|
|
||||||
Added some more nullchecks for people reporting NPE errors
|
|
||||||
Compatibility with NPC mods improved (Mainly for archery!)
|
|
||||||
Other plugins can now call inSameParty() from mcMMO to increase compatibility
|
|
||||||
|
|
||||||
Version 0.9
|
|
||||||
--NEW CONTENT--
|
|
||||||
Woodcutting now has the "Tree Feller" Ability
|
|
||||||
Unarmed now has the "Berserk" Ability
|
|
||||||
Swords now has the "Serrated Strikes" Ability
|
|
||||||
Mining now has the "Super Breaker" Ability
|
|
||||||
Axes now has the "Skull Splitter" Ability
|
|
||||||
Excavation now has the "Giga Drill Breaker" Ability
|
|
||||||
Added /mcrefresh <playername> - tool for refreshing cooldowns
|
|
||||||
Unarmed now has the "Deflect Arrows" passive skill
|
|
||||||
Chimaera Wing Item Added
|
|
||||||
|
|
||||||
--CHANGES--
|
|
||||||
HP Regen & Bleed are back
|
|
||||||
Woodcutting will drop the appropriate log on double drop procs
|
|
||||||
Herbalism now applies double drops to herbs
|
|
||||||
/<skillname> now shows much more information to the player regarding their stats
|
|
||||||
Axes skill Critical Strikes are now based directly on your skill level
|
|
||||||
Swords skill Bleed chance is now based directly on your skill level
|
|
||||||
Unarmed disarm chance is now based directly on your skill level
|
|
||||||
Acrobatics now gives XP when you roll
|
|
||||||
|
|
||||||
--BUGFIXES--
|
|
||||||
Memory Leak Fixed
|
|
||||||
Axes not doing critical strikes
|
|
||||||
Gold Armor repair
|
|
||||||
Capped skills now have the correct proc chance
|
|
||||||
/mmoedit is no longer case sensitive
|
|
||||||
More NPE errors fixed
|
|
||||||
Many bugs I forgot to write down
|
|
||||||
|
|
||||||
--PLUGIN COMPATABILITY FIXES--
|
|
||||||
If combat interactions are cancelled by other plugins mcMMO should ignore the event
|
|
||||||
If block damage interactions are cancelled by other plugins mcMMO should ignore the event
|
|
||||||
|
|
||||||
Version 0.8.22
|
|
||||||
Fixed bug where Axes did less damage than normal
|
|
||||||
Acrobatic rolls now give XP
|
|
||||||
Acrobatics XP increased for non-rolls
|
|
||||||
Version 0.8.21
|
|
||||||
Fixed bug where axe criticals would dupe items
|
|
||||||
Version 0.8.20
|
|
||||||
99.99% sure I fixed anvils that suddenly stop working
|
|
||||||
Version 0.8.19
|
|
||||||
Fixed being able to excavate placed blocks
|
|
||||||
Added toggle option to mining requiring a pickaxe
|
|
||||||
Added toggle option to woodcutting requiring an axe
|
|
||||||
PVP interactions now reward XP based on the damage caused (this is effected by skills)
|
|
||||||
PVP XP gain can be disabled in the configuration file
|
|
||||||
PVP XP has a modifier, increase the modifier for higher XP rewards from PVP combat
|
|
||||||
Version 0.8.18
|
|
||||||
Fixed sandstone not being watched for exploitation
|
|
||||||
Version 0.8.17
|
|
||||||
mcmmo.users moved to plugins/mcMMO/
|
|
||||||
Snowballs and Eggs will no longer trigger Ignition
|
|
||||||
Loot tables for excavation adjusted
|
|
||||||
Mining benefits now require the player to be holding a mining pick
|
|
||||||
Woodcutting benefits now require the player to be holding an axe
|
|
||||||
Version 0.8.16
|
|
||||||
Moved configuration file to /plugins/mcMMO
|
|
||||||
Arrows now have a chance to Ignite enemiesw
|
|
||||||
Fixed arrows not being retrievable from corpses
|
|
||||||
Added info about ignition to /archery
|
|
||||||
Version 0.8.14
|
|
||||||
Mining, Woodcutting, Herbalism, and Acrobatics proc rates now are based on your skill level directly rather than tiers you unlock via skill levels
|
|
||||||
Archery's ability to retrieve arrows from corpses now is based on your skill level directly rather than tiers you unlock via skill levels
|
|
||||||
Mining, Woodcutting, Herbalism, Archery, and Acrobatics now show their proc % relative to your skill if you type /<skillname>
|
|
||||||
You can now adjust what level is required to repair diamond in the configuration file
|
|
||||||
Changed mining XP rates to be a tad higher for some things
|
|
||||||
You can now get XP from sandstone
|
|
||||||
XP rates increased for gathering glowstone with excavation
|
|
||||||
XP rates increased a bit for excavation
|
|
||||||
Skill info is now a bit more detailed for certain skills
|
|
||||||
Added info about arrow retrieval to /archery
|
|
||||||
Version 0.8.13
|
|
||||||
Enemies no longer look like they have frozen when they die
|
|
||||||
Item duping fix
|
|
||||||
Version 0.8.11
|
Version 0.8.11
|
||||||
Performance improvements
|
Performance improvements
|
||||||
Memory leak fixed
|
Memory leak fixed
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.gmail.nossr50;
|
package com.gmail.nossr50;
|
||||||
|
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.entity.EntityDamageEvent;
|
import org.bukkit.event.entity.EntityDamageEvent;
|
||||||
@ -13,33 +14,68 @@ public class mcAcrobatics {
|
|||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
public void acrobaticsCheck(Player player, EntityDamageEvent event, Location loc, int xx, int y, int z){
|
public void acrobaticsCheck(Player player, EntityDamageEvent event, Location loc, int xx, int y, int z){
|
||||||
if(player != null){
|
if(player != null && mcUsers.getProfile(player).getAcrobaticsInt() >= 50
|
||||||
if(Math.random() * 1000 <= mcUsers.getProfile(player).getAcrobaticsInt()){
|
&& mcUsers.getProfile(player).getAcrobaticsInt() < 250
|
||||||
|
&& mcPermissions.getInstance().acrobatics(player)){
|
||||||
|
if(Math.random() * 10 > 8){
|
||||||
|
event.setCancelled(true);
|
||||||
player.sendMessage("**ROLLED**");
|
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) * mcLoadProperties.xpGainMultiplier);
|
|
||||||
mcSkills.getInstance().XpCheck(player);
|
|
||||||
event.setCancelled(true);
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(player != null && mcUsers.getProfile(player).getAcrobaticsInt() >= 250
|
||||||
|
&& mcUsers.getProfile(player).getAcrobaticsInt() < 450
|
||||||
|
&& mcPermissions.getInstance().acrobatics(player)){
|
||||||
|
if(Math.random() * 10 > 6){
|
||||||
|
event.setCancelled(true);
|
||||||
|
player.sendMessage("**ROLLED**");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(player != null && mcUsers.getProfile(player).getAcrobaticsInt() >= 450
|
||||||
|
&& mcUsers.getProfile(player).getAcrobaticsInt() < 750
|
||||||
|
&& mcPermissions.getInstance().acrobatics(player)){
|
||||||
|
if(Math.random() * 10 > 4){
|
||||||
|
event.setCancelled(true);
|
||||||
|
player.sendMessage("**ROLLED**");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(player != null && mcUsers.getProfile(player).getAcrobaticsInt() >= 750
|
||||||
|
&& mcUsers.getProfile(player).getAcrobaticsInt() < 950
|
||||||
|
&& mcPermissions.getInstance().acrobatics(player)){
|
||||||
|
if(Math.random() * 10 > 2){
|
||||||
|
event.setCancelled(true);
|
||||||
|
player.sendMessage("**BARREL ROLLED**");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(player != null && mcUsers.getProfile(player).getAcrobaticsInt() >= 950
|
||||||
|
&& mcPermissions.getInstance().acrobatics(player)){
|
||||||
|
event.setCancelled(true);
|
||||||
|
player.sendMessage("**ROLLED... LIKE A BOSS**");
|
||||||
|
return;
|
||||||
|
}
|
||||||
if(player != null && player.getHealth() - event.getDamage() <= 0)
|
if(player != null && player.getHealth() - event.getDamage() <= 0)
|
||||||
return;
|
return;
|
||||||
if(!mcConfig.getInstance().isBlockWatched(loc.getWorld().getBlockAt(xx, y, z))
|
if(!mcConfig.getInstance().isBlockWatched(loc.getWorld().getBlockAt(xx, y, z))
|
||||||
&& mcPermissions.getInstance().acrobatics(player)){
|
&& mcPermissions.getInstance().acrobatics(player)){
|
||||||
if(!event.isCancelled())
|
mcUsers.getProfile(player).addAcrobaticsGather(event.getDamage() * 3);
|
||||||
mcUsers.getProfile(player).addAcrobaticsGather(event.getDamage() * 8);
|
if(player != null && mcUsers.getProfile(player).getAcrobaticsGatherInt() >= mcUsers.getProfile(player).getXpToLevel("acrobatics")){
|
||||||
mcUsers.getProfile(player).addAcrobaticsGather((event.getDamage() * 12) * mcLoadProperties.xpGainMultiplier);
|
int skillups = 0;
|
||||||
mcSkills.getInstance().XpCheck(player);
|
while(mcUsers.getProfile(player).getAcrobaticsGatherInt() >= mcUsers.getProfile(player).getXpToLevel("acrobatics")){
|
||||||
mcConfig.getInstance().addBlockWatch(loc.getWorld().getBlockAt(xx, y, z));
|
skillups++;
|
||||||
if(player.getHealth() - event.getDamage() <= 0){
|
mcUsers.getProfile(player).removeAcrobaticsGather(mcUsers.getProfile(player).getXpToLevel("acrobatics"));
|
||||||
if(mcUsers.getProfile(player).isDead())
|
mcUsers.getProfile(player).skillUpAcrobatics(1);
|
||||||
return;
|
|
||||||
mcUsers.getProfile(player).setDead(true);
|
|
||||||
}
|
}
|
||||||
|
player.sendMessage(ChatColor.YELLOW+"Acrobatics skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(player).getAcrobatics()+")");
|
||||||
|
}
|
||||||
|
mcConfig.getInstance().addBlockWatch(loc.getWorld().getBlockAt(xx, y, z));
|
||||||
|
if(player.getHealth() - event.getDamage() <= 0){
|
||||||
|
if(mcUsers.getProfile(player).isDead())
|
||||||
|
return;
|
||||||
|
mcUsers.getProfile(player).setDead(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,18 +2,13 @@ package com.gmail.nossr50;
|
|||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.craftbukkit.entity.CraftEntity;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.block.BlockDamageEvent;
|
import org.bukkit.event.block.BlockDamageEvent;
|
||||||
import org.bukkit.event.block.BlockFromToEvent;
|
import org.bukkit.event.block.BlockFromToEvent;
|
||||||
import org.bukkit.event.block.BlockListener;
|
import org.bukkit.event.block.BlockListener;
|
||||||
import org.bukkit.event.block.BlockPlaceEvent;
|
import org.bukkit.event.block.BlockPlaceEvent;
|
||||||
import org.bukkit.event.block.BlockRightClickEvent;
|
|
||||||
import org.bukkit.inventory.ItemStack;
|
|
||||||
import org.bukkit.plugin.Plugin;
|
|
||||||
|
|
||||||
public class mcBlockListener extends BlockListener {
|
public class mcBlockListener extends BlockListener {
|
||||||
private final mcMMO plugin;
|
private final mcMMO plugin;
|
||||||
@ -23,175 +18,78 @@ public class mcBlockListener extends BlockListener {
|
|||||||
}
|
}
|
||||||
public void onBlockPlace(BlockPlaceEvent event) {
|
public void onBlockPlace(BlockPlaceEvent event) {
|
||||||
Block block;
|
Block block;
|
||||||
Player player = event.getPlayer();
|
if (event.getBlockReplacedState().getTypeId() == 78) {
|
||||||
if (event.getBlock() != null && event.getBlockReplacedState() != null && event.getBlockReplacedState().getTypeId() == 78) {
|
|
||||||
block = event.getBlockAgainst();
|
block = event.getBlockAgainst();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
block = event.getBlock();
|
block = event.getBlock();
|
||||||
}
|
}
|
||||||
if(player != null && mcm.getInstance().shouldBeWatched(block))
|
int x = block.getX();
|
||||||
|
int y = block.getY();
|
||||||
|
int z = block.getZ();
|
||||||
|
String xyz = x+","+y+","+z;
|
||||||
|
if(mcm.getInstance().shouldBeWatched(block))
|
||||||
mcConfig.getInstance().addBlockWatch(block);
|
mcConfig.getInstance().addBlockWatch(block);
|
||||||
if(block.getTypeId() == 42 && mcLoadProperties.anvilmessages)
|
if(block.getTypeId() == 42 && mcLoadProperties.anvilmessages)
|
||||||
event.getPlayer().sendMessage(ChatColor.DARK_RED+"You have placed an anvil, anvils can repair tools and armor.");
|
event.getPlayer().sendMessage(ChatColor.DARK_RED+"You have placed an anvil, anvils can repair tools and armor.");
|
||||||
}
|
}
|
||||||
public void onBlockRightClick(BlockRightClickEvent event) {
|
|
||||||
Block block = event.getBlock();
|
|
||||||
Player player = event.getPlayer();
|
|
||||||
ItemStack is = player.getItemInHand();
|
|
||||||
if(mcPermissions.getInstance().unarmed(player) && player.getItemInHand().getTypeId() == 0 && mcm.getInstance().abilityBlockCheck(block) && mcUsers.getProfile(player).getAbilityUse()){
|
|
||||||
mcSkills.getInstance().abilityActivationCheck(player, block);
|
|
||||||
}
|
|
||||||
if(block != null && player != null && mcPermissions.getInstance().repair(player) && event.getBlock().getTypeId() == 42){
|
|
||||||
mcRepair.getInstance().repairCheck(player, is, event.getBlock());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//put all Block related code here
|
//put all Block related code here
|
||||||
public void onBlockDamage(BlockDamageEvent event) {
|
public void onBlockDamage(BlockDamageEvent event) {
|
||||||
if(event.isCancelled())
|
//STARTED(0), DIGGING(1), BROKEN(3), STOPPED(2);
|
||||||
return;
|
Player player = event.getPlayer();
|
||||||
//STARTED(0), DIGGING(1), BROKEN(3), STOPPED(2);
|
//player.sendMessage("mcMMO DEBUG: EVENT-OK DMG LEVEL ("+event.getDamageLevel().getLevel()+")");
|
||||||
Player player = event.getPlayer();
|
Block block = event.getBlock();
|
||||||
ItemStack inhand = player.getItemInHand();
|
int x = block.getX();
|
||||||
//player.sendMessage("mcMMO DEBUG: EVENT-OK DMG LEVEL ("+event.getDamageLevel().getLevel()+")");
|
int y = block.getY();
|
||||||
Block block = event.getBlock();
|
int z = block.getZ();
|
||||||
Location loc = block.getLocation();
|
String xyz = x+","+y+","+z;
|
||||||
int dmg = event.getDamageLevel().getLevel();
|
Location loc = block.getLocation();
|
||||||
|
int dmg = event.getDamageLevel().getLevel();
|
||||||
/*
|
|
||||||
* ABILITY PREPARATION CHECKS
|
|
||||||
*/
|
|
||||||
if(mcUsers.getProfile(player).getAxePreparationMode() && block.getTypeId() == 17)
|
|
||||||
mcWoodCutting.getInstance().treeFellerCheck(player, block);
|
|
||||||
if(mcUsers.getProfile(player).getPickaxePreparationMode())
|
|
||||||
mcMining.getInstance().superBreakerCheck(player, block);
|
|
||||||
if(mcUsers.getProfile(player).getShovelPreparationMode() && mcExcavation.getInstance().canBeGigaDrillBroken(block))
|
|
||||||
mcExcavation.getInstance().gigaDrillBreakerActivationCheck(player, block);
|
|
||||||
if(mcUsers.getProfile(player).getFistsPreparationMode() && mcExcavation.getInstance().canBeGigaDrillBroken(block))
|
|
||||||
mcSkills.getInstance().berserkActivationCheck(player);
|
|
||||||
/*
|
|
||||||
* GIGA DRILL BREAKER CHECKS
|
|
||||||
*/
|
|
||||||
if(mcUsers.getProfile(player).getGigaDrillBreakerMode() && dmg == 0 && mcExcavation.getInstance().canBeGigaDrillBroken(block) && mcm.getInstance().isShovel(inhand)){
|
|
||||||
if(mcm.getInstance().getTier(player) >= 2)
|
|
||||||
mcExcavation.getInstance().excavationProcCheck(block, player);
|
|
||||||
if(mcm.getInstance().getTier(player) >= 3)
|
|
||||||
mcExcavation.getInstance().excavationProcCheck(block, player);
|
|
||||||
if(mcm.getInstance().getTier(player) >= 4)
|
|
||||||
mcExcavation.getInstance().excavationProcCheck(block, player);
|
|
||||||
Material mat = Material.getMaterial(block.getTypeId());
|
|
||||||
if(block.getTypeId() == 2)
|
|
||||||
mat = Material.DIRT;
|
|
||||||
byte type = block.getData();
|
|
||||||
ItemStack item = new ItemStack(mat, 1, (byte)0, type);
|
|
||||||
block.setType(Material.AIR);
|
|
||||||
if(mcLoadProperties.toolsLoseDurabilityFromAbilities)
|
|
||||||
mcm.getInstance().damageTool(player, (short) mcLoadProperties.abilityDurabilityLoss);
|
|
||||||
block.getLocation().getWorld().dropItemNaturally(block.getLocation(), item);
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* BERSERK MODE CHECKS
|
|
||||||
*/
|
|
||||||
if(mcUsers.getProfile(player).getBerserkMode() && player.getItemInHand().getTypeId() == 0 && dmg == 0 && mcExcavation.getInstance().canBeGigaDrillBroken(block)){
|
|
||||||
Material mat = Material.getMaterial(block.getTypeId());
|
|
||||||
if(block.getTypeId() == 2)
|
|
||||||
mat = Material.DIRT;
|
|
||||||
byte type = block.getData();
|
|
||||||
ItemStack item = new ItemStack(mat, 1, (byte)0, type);
|
|
||||||
block.setType(Material.AIR);
|
|
||||||
block.getLocation().getWorld().dropItemNaturally(block.getLocation(), item);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* SUPER BREAKER CHECKS
|
|
||||||
*/
|
|
||||||
if(mcUsers.getProfile(player).getSuperBreakerMode() && dmg == 0 && mcMining.getInstance().canBeSuperBroken(block)){
|
|
||||||
if(mcLoadProperties.miningrequirespickaxe){
|
|
||||||
if(mcm.getInstance().isMiningPick(inhand))
|
|
||||||
mcMining.getInstance().SuperBreakerBlockCheck(player, block);
|
|
||||||
} else {
|
|
||||||
mcMining.getInstance().SuperBreakerBlockCheck(player, block);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* HERBALISM
|
|
||||||
*/
|
|
||||||
if(dmg == 3){
|
|
||||||
if(mcPermissions.getInstance().herbalism(player))
|
|
||||||
mcHerbalism.getInstance().herbalismProcCheck(block, player);
|
|
||||||
}
|
|
||||||
if(player != null && dmg == 2 && !mcConfig.getInstance().isBlockWatched(block)){
|
|
||||||
/*
|
/*
|
||||||
* MINING
|
* HERBALISM
|
||||||
*/
|
*/
|
||||||
if(mcPermissions.getInstance().mining(player)){
|
if(dmg == 3){
|
||||||
if(mcLoadProperties.miningrequirespickaxe){
|
if(mcPermissions.getInstance().herbalism(player))
|
||||||
if(mcm.getInstance().isMiningPick(inhand))
|
mcHerbalism.getInstance().herbalismProcCheck(block, player);
|
||||||
mcMining.getInstance().miningBlockCheck(player, block);
|
}
|
||||||
} else {
|
/*
|
||||||
mcMining.getInstance().miningBlockCheck(player, block);
|
* MINING
|
||||||
}
|
*/
|
||||||
}
|
if(player != null && dmg == 2 && !mcConfig.getInstance().isBlockWatched(block)){
|
||||||
/*
|
if(mcPermissions.getInstance().mining(player))
|
||||||
* WOOD CUTTING
|
mcMining.getInstance().miningBlockCheck(player, block);
|
||||||
*/
|
/*
|
||||||
|
* WOOD CUTTING
|
||||||
|
*/
|
||||||
|
if(player != null && block.getTypeId() == 17 && mcPermissions.getInstance().woodcutting(player)){
|
||||||
|
mcWoodCutting.getInstance().woodCuttingProcCheck(player, block, loc);
|
||||||
|
mcUsers.getProfile(player).addWoodcuttingGather(7);
|
||||||
|
if(mcPermissions.getInstance().woodcuttingability(player)){
|
||||||
|
|
||||||
if(player != null && block.getTypeId() == 17 && mcPermissions.getInstance().woodcutting(player)){
|
}
|
||||||
if(mcLoadProperties.woodcuttingrequiresaxe){
|
}
|
||||||
if(mcm.getInstance().isAxes(inhand)){
|
/*
|
||||||
mcWoodCutting.getInstance().woodCuttingProcCheck(player, block, loc);
|
* EXCAVATION
|
||||||
mcUsers.getProfile(player).addWoodcuttingGather(7 * mcLoadProperties.xpGainMultiplier);
|
*/
|
||||||
}
|
if(mcPermissions.getInstance().excavation(player) && block != null && player != null)
|
||||||
} else {
|
mcExcavation.getInstance().excavationProcCheck(block, player);
|
||||||
mcWoodCutting.getInstance().woodCuttingProcCheck(player, block, loc);
|
/*
|
||||||
mcUsers.getProfile(player).addWoodcuttingGather(7 * mcLoadProperties.xpGainMultiplier);
|
* EXPLOIT COUNTERMEASURES
|
||||||
}
|
*/
|
||||||
mcSkills.getInstance().XpCheck(player);
|
mcConfig.getInstance().addBlockWatch(block);
|
||||||
/*
|
if(player != null && mcUsers.getProfile(player).getWoodCuttingGatherInt() >= mcUsers.getProfile(player).getXpToLevel("woodcutting")){
|
||||||
* IF PLAYER IS USING TREEFELLER
|
int skillups = 0;
|
||||||
*/
|
while(mcUsers.getProfile(player).getWoodCuttingGatherInt() >= mcUsers.getProfile(player).getXpToLevel("woodcutting")){
|
||||||
if(mcPermissions.getInstance().woodCuttingAbility(player) && mcUsers.getProfile(player).getTreeFellerMode() && block.getTypeId() == 17){
|
skillups++;
|
||||||
mcWoodCutting.getInstance().treeFeller(block, player);
|
mcUsers.getProfile(player).removeWoodCuttingGather(mcUsers.getProfile(player).getXpToLevel("woodcutting"));
|
||||||
for(Block blockx : mcConfig.getInstance().getTreeFeller()){
|
mcUsers.getProfile(player).skillUpWoodCutting(1);
|
||||||
if(blockx != null){
|
}
|
||||||
Material mat = Material.getMaterial(block.getTypeId());
|
player.sendMessage(ChatColor.YELLOW+"WoodCutting skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(player).getWoodCutting()+")");
|
||||||
byte type = 0;
|
}
|
||||||
if(block.getTypeId() == 17)
|
|
||||||
type = block.getData();
|
|
||||||
ItemStack item = new ItemStack(mat, 1, (byte)0, type);
|
|
||||||
if(blockx.getTypeId() == 17){
|
|
||||||
blockx.getLocation().getWorld().dropItemNaturally(blockx.getLocation(), item);
|
|
||||||
mcWoodCutting.getInstance().woodCuttingProcCheck(player, blockx, blockx.getLocation());
|
|
||||||
mcUsers.getProfile(player).addWoodcuttingGather(7);
|
|
||||||
}
|
|
||||||
if(blockx.getTypeId() == 18){
|
|
||||||
mat = Material.getMaterial(6);
|
|
||||||
item = new ItemStack(mat, 1, (byte)0, type);
|
|
||||||
if(Math.random() * 10 > 8)
|
|
||||||
blockx.getLocation().getWorld().dropItemNaturally(blockx.getLocation(), item);
|
|
||||||
}
|
|
||||||
blockx.setType(Material.AIR);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
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
|
|
||||||
* OR ELSE IT COULD BE A MEMORY LEAK SITUATION
|
|
||||||
*/
|
|
||||||
mcConfig.getInstance().clearTreeFeller();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* EXCAVATION
|
|
||||||
*/
|
|
||||||
if(mcPermissions.getInstance().excavation(player) && block != null && player != null)
|
|
||||||
mcExcavation.getInstance().excavationProcCheck(block, player);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void onBlockFlow(BlockFromToEvent event) {
|
public void onBlockFlow(BlockFromToEvent event) {
|
||||||
//Code borrowed from WorldGuard by sk89q
|
//Code borrowed from WorldGuard by sk89q
|
||||||
World world = event.getBlock().getWorld();
|
World world = event.getBlock().getWorld();
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -15,11 +15,9 @@ public class mcConfig {
|
|||||||
static ArrayList<String> partyChatList = new ArrayList<String>();
|
static ArrayList<String> partyChatList = new ArrayList<String>();
|
||||||
static ArrayList<String> godModeList = new ArrayList<String>();
|
static ArrayList<String> godModeList = new ArrayList<String>();
|
||||||
HashMap<Entity, Integer> arrowTracker = new HashMap<Entity, Integer>();
|
HashMap<Entity, Integer> arrowTracker = new HashMap<Entity, Integer>();
|
||||||
//HashMap<Entity, Player, String[]> xptracker = new HashMap<Entity, Player, String[]>();
|
|
||||||
static ArrayList<Entity> bleedTracker = new ArrayList<Entity>();
|
static ArrayList<Entity> bleedTracker = new ArrayList<Entity>();
|
||||||
static ArrayList<Entity> mobSpawnTracker = new ArrayList<Entity>();
|
static ArrayList<Entity> mobSpawnTracker = new ArrayList<Entity>();
|
||||||
public boolean isBlockWatched(Block block) {return blockWatchList.contains(block);}
|
public boolean isBlockWatched(Block block) {return blockWatchList.contains(block);}
|
||||||
public boolean isTreeFellerWatched(Block block) {return treeFeller.contains(block);}
|
|
||||||
public ArrayList<Block> getTreeFeller() {return treeFeller;}
|
public ArrayList<Block> getTreeFeller() {return treeFeller;}
|
||||||
public void removeBlockWatch(Block block) {blockWatchList.remove(blockWatchList.indexOf(block));}
|
public void removeBlockWatch(Block block) {blockWatchList.remove(blockWatchList.indexOf(block));}
|
||||||
public void addBlockWatch(Block block) {blockWatchList.add(block);}
|
public void addBlockWatch(Block block) {blockWatchList.add(block);}
|
||||||
@ -27,21 +25,12 @@ public class mcConfig {
|
|||||||
public void addTreeFeller(Block block) {treeFeller.add(block);}
|
public void addTreeFeller(Block block) {treeFeller.add(block);}
|
||||||
public void addBleedTrack(Entity entity) {bleedTracker.add(entity);}
|
public void addBleedTrack(Entity entity) {bleedTracker.add(entity);}
|
||||||
public void addMobSpawnTrack(Entity entity) {mobSpawnTracker.add(entity);}
|
public void addMobSpawnTrack(Entity entity) {mobSpawnTracker.add(entity);}
|
||||||
public void removeMobSpawnTrack(Entity entity) {mobSpawnTracker.remove(entity);}
|
|
||||||
public ArrayList<Entity> getBleedTracked() {return bleedTracker;}
|
public ArrayList<Entity> getBleedTracked() {return bleedTracker;}
|
||||||
public void addArrowTrack(Entity entity, Integer arrowcount) {arrowTracker.put(entity, arrowcount);}
|
public void addArrowTrack(Entity entity, Integer arrowcount) {arrowTracker.put(entity, arrowcount);}
|
||||||
public Integer getArrowCount(Entity entity) {return arrowTracker.get(entity);}
|
public Integer getArrowCount(Entity entity) {return arrowTracker.get(entity);}
|
||||||
public void removeArrowTracked(Entity entity){
|
|
||||||
if(arrowTracker.containsKey(entity)){
|
|
||||||
arrowTracker.remove(entity);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public void removeBleedTrack(Entity entity){
|
public void removeBleedTrack(Entity entity){
|
||||||
bleedTracker.remove(entity);
|
bleedTracker.remove(entity);
|
||||||
}
|
}
|
||||||
public void clearTreeFeller(){
|
|
||||||
treeFeller.clear();
|
|
||||||
}
|
|
||||||
public void setBleedCount(Entity entity, Integer newvalue){
|
public void setBleedCount(Entity entity, Integer newvalue){
|
||||||
bleedTracker.add(entity);
|
bleedTracker.add(entity);
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
package com.gmail.nossr50;
|
package com.gmail.nossr50;
|
||||||
|
|
||||||
import net.minecraft.server.EntityLiving;
|
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.craftbukkit.entity.CraftEntity;
|
|
||||||
import org.bukkit.entity.Animals;
|
import org.bukkit.entity.Animals;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.Monster;
|
import org.bukkit.entity.Monster;
|
||||||
@ -16,7 +13,6 @@ import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
|||||||
import org.bukkit.event.entity.EntityDeathEvent;
|
import org.bukkit.event.entity.EntityDeathEvent;
|
||||||
import org.bukkit.event.entity.EntityListener;
|
import org.bukkit.event.entity.EntityListener;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.util.Vector;
|
|
||||||
|
|
||||||
public class mcEntityListener extends EntityListener {
|
public class mcEntityListener extends EntityListener {
|
||||||
private final mcMMO plugin;
|
private final mcMMO plugin;
|
||||||
@ -39,14 +35,6 @@ public class mcEntityListener extends EntityListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void onEntityDamage(EntityDamageEvent event) {
|
public void onEntityDamage(EntityDamageEvent event) {
|
||||||
/*
|
|
||||||
* CHECK FOR INVULNERABILITY
|
|
||||||
*/
|
|
||||||
if(event.getEntity() instanceof CraftEntity){
|
|
||||||
CraftEntity cEntity = (CraftEntity)event.getEntity();
|
|
||||||
if(cEntity.getHandle() instanceof EntityLiving){
|
|
||||||
EntityLiving entityliving = (EntityLiving)cEntity.getHandle();
|
|
||||||
if(entityliving.noDamageTicks < entityliving.maxNoDamageTicks/2.0F){
|
|
||||||
Entity x = event.getEntity();
|
Entity x = event.getEntity();
|
||||||
DamageCause type = event.getCause();
|
DamageCause type = event.getCause();
|
||||||
/*
|
/*
|
||||||
@ -62,30 +50,20 @@ public class mcEntityListener extends EntityListener {
|
|||||||
mcAcrobatics.getInstance().acrobaticsCheck(player, event, loc, xx, y, z);
|
mcAcrobatics.getInstance().acrobaticsCheck(player, event, loc, xx, y, z);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ARCHERY CHECKS
|
* ARCHERY CHECKS
|
||||||
*/
|
*/
|
||||||
if(event instanceof EntityDamageByProjectileEvent && event.getDamage() >= 1){
|
if(event instanceof EntityDamageByProjectileEvent){
|
||||||
EntityDamageByProjectileEvent c = (EntityDamageByProjectileEvent)event;
|
EntityDamageByProjectileEvent c = (EntityDamageByProjectileEvent)event;
|
||||||
mcCombat.getInstance().archeryCheck(c);
|
mcCombat.getInstance().archeryCheck(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Entity Damage by Entity checks
|
* Entity Damage by Entity checks
|
||||||
*/
|
*/
|
||||||
if(event instanceof EntityDamageByEntityEvent && event.getDamage() >= 1){
|
if(event instanceof EntityDamageByEntityEvent){
|
||||||
if(event.isCancelled()){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
EntityDamageByEntityEvent eventb = (EntityDamageByEntityEvent)event;
|
EntityDamageByEntityEvent eventb = (EntityDamageByEntityEvent)event;
|
||||||
Entity e = eventb.getEntity(); //Defender
|
Entity e = eventb.getEntity(); //Defender
|
||||||
Entity f = eventb.getDamager(); //Attacker
|
Entity f = eventb.getDamager(); //Attacker
|
||||||
/*
|
|
||||||
* CHECK FOR PVP INTERACTIONS
|
|
||||||
*/
|
|
||||||
if(f instanceof Player && e instanceof Player && !mcLoadProperties.pvp)
|
|
||||||
event.setCancelled(true);
|
|
||||||
/*
|
/*
|
||||||
* IF DEFENDER IS PLAYER
|
* IF DEFENDER IS PLAYER
|
||||||
*/
|
*/
|
||||||
@ -93,6 +71,9 @@ public class mcEntityListener extends EntityListener {
|
|||||||
Player defender = (Player)e;
|
Player defender = (Player)e;
|
||||||
if(defender != null && mcConfig.getInstance().isGodModeToggled(defender.getName()))
|
if(defender != null && mcConfig.getInstance().isGodModeToggled(defender.getName()))
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
if(f instanceof Monster && defender != null){
|
||||||
|
mcUsers.getProfile(defender).setRecentlyHurt(30);
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
* PARRYING CHECK, CHECK TO SEE IF ITS A SUCCESSFUL PARRY OR NOT
|
* PARRYING CHECK, CHECK TO SEE IF ITS A SUCCESSFUL PARRY OR NOT
|
||||||
*/
|
*/
|
||||||
@ -105,17 +86,6 @@ public class mcEntityListener extends EntityListener {
|
|||||||
//((Player) f).sendMessage("DEBUG: EntityDamageByEntity cast correctly!");
|
//((Player) f).sendMessage("DEBUG: EntityDamageByEntity cast correctly!");
|
||||||
int typeid = ((Player) f).getItemInHand().getTypeId();
|
int typeid = ((Player) f).getItemInHand().getTypeId();
|
||||||
Player attacker = (Player)f;
|
Player attacker = (Player)f;
|
||||||
if(mcUsers.getProfile(attacker).getAxePreparationMode())
|
|
||||||
mcSkills.getInstance().skullSplitterCheck(attacker);
|
|
||||||
if(mcUsers.getProfile(attacker).getSwordsPreparationMode())
|
|
||||||
mcSkills.getInstance().serratedStrikesActivationCheck(attacker);
|
|
||||||
if(mcUsers.getProfile(attacker).getFistsPreparationMode())
|
|
||||||
mcSkills.getInstance().berserkActivationCheck(attacker);
|
|
||||||
/*
|
|
||||||
* BERSERK DAMAGE MODIFIER
|
|
||||||
*/
|
|
||||||
if(mcUsers.getProfile(attacker).getBerserkMode())
|
|
||||||
event.setDamage(event.getDamage() + (event.getDamage() / 2));
|
|
||||||
/*
|
/*
|
||||||
* Player versus Monster checks, this handles all skill damage modifiers and any procs.
|
* Player versus Monster checks, this handles all skill damage modifiers and any procs.
|
||||||
*/
|
*/
|
||||||
@ -133,15 +103,9 @@ public class mcEntityListener extends EntityListener {
|
|||||||
* Player versus Animals checks, these checks handle any skill modifiers or procs
|
* Player versus Animals checks, these checks handle any skill modifiers or procs
|
||||||
*/
|
*/
|
||||||
mcCombat.getInstance().playerVersusAnimalsChecks(e, attacker, eventb, typeid);
|
mcCombat.getInstance().playerVersusAnimalsChecks(e, attacker, eventb, typeid);
|
||||||
/*
|
|
||||||
* This will do AOE damage from the axes ability
|
|
||||||
*/
|
|
||||||
if(!event.isCancelled() && mcUsers.getProfile(attacker).getSkullSplitterMode() && mcm.getInstance().isAxes(attacker.getItemInHand()))
|
|
||||||
mcCombat.getInstance().applyAoeDamage(attacker, eventb, x);
|
|
||||||
if(!event.isCancelled() && mcUsers.getProfile(attacker).getSerratedStrikesMode() && mcm.getInstance().isSwords(attacker.getItemInHand()))
|
|
||||||
mcCombat.getInstance().applyAoeDamage(attacker, eventb, x);
|
|
||||||
}
|
}
|
||||||
|
if(f instanceof Player && e instanceof Player && !mcLoadProperties.pvp)
|
||||||
|
event.setCancelled(true);
|
||||||
if(e instanceof Monster || e instanceof Animals){
|
if(e instanceof Monster || e instanceof Animals){
|
||||||
if(e instanceof Monster){
|
if(e instanceof Monster){
|
||||||
Monster monster = (Monster)e;
|
Monster monster = (Monster)e;
|
||||||
@ -157,24 +121,9 @@ public class mcEntityListener extends EntityListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Check to see if the defender took damage so we can apply recently hurt
|
|
||||||
*/
|
|
||||||
if(x instanceof Player && !event.isCancelled()){
|
|
||||||
Player herpderp = (Player)x;
|
|
||||||
mcUsers.getProfile(herpderp).setRecentlyHurt(30);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public void onEntityDeath(EntityDeathEvent event) {
|
public void onEntityDeath(EntityDeathEvent event) {
|
||||||
Entity x = event.getEntity();
|
Entity x = event.getEntity();
|
||||||
mcSkills.getInstance().arrowRetrievalCheck(x);
|
|
||||||
if(mcConfig.getInstance().isMobSpawnTracked(x)){
|
|
||||||
mcConfig.getInstance().removeMobSpawnTrack(x);
|
|
||||||
}
|
|
||||||
if(x instanceof Player){
|
if(x instanceof Player){
|
||||||
Player player = (Player)x;
|
Player player = (Player)x;
|
||||||
if(mcUsers.getProfile(player).isDead()){
|
if(mcUsers.getProfile(player).isDead()){
|
||||||
|
@ -19,98 +19,44 @@ public class mcExcavation {
|
|||||||
}
|
}
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
public void gigaDrillBreakerActivationCheck(Player player, Block block){
|
|
||||||
if(mcm.getInstance().isShovel(player.getItemInHand())){
|
|
||||||
if(block != null){
|
|
||||||
if(!mcm.getInstance().abilityBlockCheck(block))
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(mcUsers.getProfile(player).getShovelPreparationMode()){
|
|
||||||
mcUsers.getProfile(player).setShovelPreparationMode(false);
|
|
||||||
mcUsers.getProfile(player).setShovelPreparationTicks(0);
|
|
||||||
}
|
|
||||||
int ticks = 2;
|
|
||||||
if(mcUsers.getProfile(player).getExcavationInt() >= 50)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getExcavationInt() >= 150)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getExcavationInt() >= 250)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getExcavationInt() >= 350)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getExcavationInt() >= 450)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getExcavationInt() >= 550)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getExcavationInt() >= 650)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getExcavationInt() >= 750)
|
|
||||||
ticks++;
|
|
||||||
|
|
||||||
if(!mcUsers.getProfile(player).getGigaDrillBreakerMode() && mcUsers.getProfile(player).getGigaDrillBreakerCooldown() == 0){
|
|
||||||
player.sendMessage(ChatColor.GREEN+"**GIGA DRILL BREAKER ACTIVATED**");
|
|
||||||
mcUsers.getProfile(player).setGigaDrillBreakerTicks(ticks);
|
|
||||||
mcUsers.getProfile(player).setGigaDrillBreakerMode(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public boolean canBeGigaDrillBroken(Block block){
|
|
||||||
int i = block.getTypeId();
|
|
||||||
if(i == 2||i == 3||i == 12||i == 13){
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public void excavationProcCheck(Block block, Player player){
|
public void excavationProcCheck(Block block, Player player){
|
||||||
int type = block.getTypeId();
|
int type = block.getTypeId();
|
||||||
Location loc = block.getLocation();
|
Location loc = block.getLocation();
|
||||||
ItemStack is = null;
|
ItemStack is = null;
|
||||||
Material mat = null;
|
Material mat = null;
|
||||||
if(type == 2){
|
if(type == 2 && mcUsers.getProfile(player).getExcavationInt() > 250){
|
||||||
if(mcUsers.getProfile(player).getExcavationInt() > 250){
|
//CHANCE TO GET EGGS
|
||||||
//CHANCE TO GET EGGS
|
if(mcLoadProperties.eggs == true && Math.random() * 100 > 99){
|
||||||
if(mcLoadProperties.eggs == true && Math.random() * 100 > 99){
|
mcUsers.getProfile(player).addExcavationGather(10);
|
||||||
mcUsers.getProfile(player).addExcavationGather(10 * mcLoadProperties.xpGainMultiplier);
|
mat = Material.getMaterial(344);
|
||||||
mat = Material.getMaterial(344);
|
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 APPLES
|
||||||
//CHANCE TO GET APPLES
|
if(mcLoadProperties.apples == true && Math.random() * 100 > 99){
|
||||||
if(mcLoadProperties.apples == true && Math.random() * 100 > 99){
|
mcUsers.getProfile(player).addExcavationGather(10);
|
||||||
mcUsers.getProfile(player).addExcavationGather(10 * mcLoadProperties.xpGainMultiplier);
|
mat = Material.getMaterial(260);
|
||||||
mat = Material.getMaterial(260);
|
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//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(4);
|
mcUsers.getProfile(player).addExcavationGather(3);
|
||||||
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){
|
||||||
mcUsers.getProfile(player).addExcavationGather(300 * mcLoadProperties.xpGainMultiplier);
|
mcUsers.getProfile(player).addExcavationGather(300);
|
||||||
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() > 350){
|
if(mcUsers.getProfile(player).getExcavationInt() > 150){
|
||||||
//CHANCE TO GET DIAMOND
|
//CHANCE TO GET MUSIC
|
||||||
if(mcLoadProperties.diamond == true && Math.random() * 750 > 749){
|
|
||||||
mcUsers.getProfile(player).addExcavationGather(100 * mcLoadProperties.xpGainMultiplier);
|
|
||||||
mat = Material.getMaterial(264);
|
|
||||||
is = new ItemStack(mat, 1, (byte)0, (byte)0);
|
|
||||||
loc.getWorld().dropItemNaturally(loc, is);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(mcUsers.getProfile(player).getExcavationInt() > 250){
|
|
||||||
//CHANCE TO GET YELLOW MUSIC
|
|
||||||
if(mcLoadProperties.music == true && Math.random() * 2000 > 1999){
|
if(mcLoadProperties.music == true && Math.random() * 2000 > 1999){
|
||||||
mcUsers.getProfile(player).addExcavationGather(300 * mcLoadProperties.xpGainMultiplier);
|
mcUsers.getProfile(player).addExcavationGather(300);
|
||||||
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);
|
||||||
@ -118,9 +64,18 @@ public class mcExcavation {
|
|||||||
|
|
||||||
}
|
}
|
||||||
if(mcUsers.getProfile(player).getExcavationInt() > 350){
|
if(mcUsers.getProfile(player).getExcavationInt() > 350){
|
||||||
//CHANCE TO GET GREEN MUSIC
|
//CHANCE TO GET DIAMOND
|
||||||
|
if(mcLoadProperties.diamond == true && Math.random() * 500 > 499){
|
||||||
|
mcUsers.getProfile(player).addExcavationGather(100);
|
||||||
|
mat = Material.getMaterial(264);
|
||||||
|
is = new ItemStack(mat, 1, (byte)0, (byte)0);
|
||||||
|
loc.getWorld().dropItemNaturally(loc, is);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(mcUsers.getProfile(player).getExcavationInt() > 250){
|
||||||
|
//CHANCE TO GET MUSIC
|
||||||
if(mcLoadProperties.music == true && Math.random() * 2000 > 1999){
|
if(mcLoadProperties.music == true && Math.random() * 2000 > 1999){
|
||||||
mcUsers.getProfile(player).addExcavationGather(300 * mcLoadProperties.xpGainMultiplier);
|
mcUsers.getProfile(player).addExcavationGather(300);
|
||||||
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);
|
||||||
@ -131,35 +86,31 @@ public class mcExcavation {
|
|||||||
if(type == 12){
|
if(type == 12){
|
||||||
//CHANCE TO GET GLOWSTONE
|
//CHANCE TO GET GLOWSTONE
|
||||||
if(mcLoadProperties.glowstone == true && mcUsers.getProfile(player).getExcavationInt() > 50 && Math.random() * 100 > 95){
|
if(mcLoadProperties.glowstone == true && mcUsers.getProfile(player).getExcavationInt() > 50 && Math.random() * 100 > 95){
|
||||||
mcUsers.getProfile(player).addExcavationGather(8 * mcLoadProperties.xpGainMultiplier);
|
mcUsers.getProfile(player).addExcavationGather(3);
|
||||||
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 SLOWSAND
|
//CHANCE TO GET SLOWSAND
|
||||||
if(mcLoadProperties.slowsand == true && mcUsers.getProfile(player).getExcavationInt() > 650 && Math.random() * 200 > 199){
|
if(mcLoadProperties.slowsand == true && mcUsers.getProfile(player).getExcavationInt() > 650 && Math.random() * 200 > 199){
|
||||||
mcUsers.getProfile(player).addExcavationGather(8 * mcLoadProperties.xpGainMultiplier);
|
mcUsers.getProfile(player).addExcavationGather(5);
|
||||||
mat = Material.getMaterial(88);
|
mat = Material.getMaterial(88);
|
||||||
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(mcLoadProperties.diamond == true && mcUsers.getProfile(player).getExcavationInt() > 500 && Math.random() * 500 > 499){
|
||||||
|
mcUsers.getProfile(player).addExcavationGather(100);
|
||||||
|
mat = Material.getMaterial(264);
|
||||||
|
is = new ItemStack(mat, 1, (byte)0, (byte)0);
|
||||||
|
loc.getWorld().dropItemNaturally(loc, is);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//GRASS OR DIRT
|
//GRASS OR DIRT
|
||||||
if(type == 2 || type == 3){
|
if((type == 2 || type == 3) && mcUsers.getProfile(player).getExcavationInt() > 25){
|
||||||
//CHANCE FOR SHROOMS
|
|
||||||
if(mcLoadProperties.mushrooms == true && mcUsers.getProfile(player).getExcavationInt() > 500 && Math.random() * 200 > 199){
|
|
||||||
mcUsers.getProfile(player).addExcavationGather(8 * mcLoadProperties.xpGainMultiplier);
|
|
||||||
if(Math.random() * 10 > 5){
|
|
||||||
mat = Material.getMaterial(39);
|
|
||||||
} else {
|
|
||||||
mat = Material.getMaterial(40);
|
|
||||||
}
|
|
||||||
is = new ItemStack(mat, 1, (byte)0, (byte)0);
|
|
||||||
loc.getWorld().dropItemNaturally(loc, is);
|
|
||||||
}
|
|
||||||
//CHANCE TO GET GLOWSTONE
|
//CHANCE TO GET GLOWSTONE
|
||||||
if(mcLoadProperties.glowstone == true && mcUsers.getProfile(player).getExcavationInt() > 25 && Math.random() * 100 > 95){
|
if(mcLoadProperties.glowstone == true && Math.random() * 100 > 95){
|
||||||
mcUsers.getProfile(player).addExcavationGather(8 * mcLoadProperties.xpGainMultiplier);
|
mcUsers.getProfile(player).addExcavationGather(5);
|
||||||
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);
|
||||||
@ -169,30 +120,38 @@ public class mcExcavation {
|
|||||||
if(type == 13){
|
if(type == 13){
|
||||||
//CHANCE TO GET NETHERRACK
|
//CHANCE TO GET NETHERRACK
|
||||||
if(mcLoadProperties.netherrack == true && mcUsers.getProfile(player).getExcavationInt() > 850 && Math.random() * 200 > 199){
|
if(mcLoadProperties.netherrack == true && mcUsers.getProfile(player).getExcavationInt() > 850 && Math.random() * 200 > 199){
|
||||||
mcUsers.getProfile(player).addExcavationGather(3 * mcLoadProperties.xpGainMultiplier);
|
mcUsers.getProfile(player).addExcavationGather(3);
|
||||||
mat = Material.getMaterial(87);
|
mat = Material.getMaterial(87);
|
||||||
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 SULPHUR
|
//CHANCE TO GET SULPHUR
|
||||||
if(mcLoadProperties.sulphur == true && mcUsers.getProfile(player).getExcavationInt() > 75){
|
if(mcLoadProperties.sulphur == true && mcUsers.getProfile(player).getExcavationInt() > 75){
|
||||||
if(Math.random() * 10 > 9){
|
if(Math.random() * 10 > 9){
|
||||||
mcUsers.getProfile(player).addExcavationGather(3 * mcLoadProperties.xpGainMultiplier);
|
mcUsers.getProfile(player).addExcavationGather(3);
|
||||||
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//CHANCE TO GET BONES
|
//CHANCE TO GET BONES
|
||||||
if(mcLoadProperties.bones == true && mcUsers.getProfile(player).getExcavationInt() > 175){
|
if(mcLoadProperties.bones == true && mcUsers.getProfile(player).getExcavationInt() > 175){
|
||||||
if(Math.random() * 10 > 9){
|
if(Math.random() * 10 > 6){
|
||||||
mcUsers.getProfile(player).addExcavationGather(3 * mcLoadProperties.xpGainMultiplier);
|
mcUsers.getProfile(player).addExcavationGather(3);
|
||||||
mat = Material.getMaterial(352);
|
mat = Material.getMaterial(352);
|
||||||
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mcSkills.getInstance().XpCheck(player);
|
if(mcUsers.getProfile(player).getExcavationGatherInt() >= mcUsers.getProfile(player).getXpToLevel("excavation")){
|
||||||
|
int skillups = 0;
|
||||||
|
while(mcUsers.getProfile(player).getExcavationGatherInt() >= mcUsers.getProfile(player).getXpToLevel("excavation")){
|
||||||
|
skillups++;
|
||||||
|
mcUsers.getProfile(player).removeExcavationGather(mcUsers.getProfile(player).getXpToLevel("excavation"));
|
||||||
|
mcUsers.getProfile(player).skillUpExcavation(1);
|
||||||
|
}
|
||||||
|
player.sendMessage(ChatColor.YELLOW+"Excavation skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(player).getExcavation()+")");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,44 +24,49 @@ public class mcHerbalism {
|
|||||||
Location loc = block.getLocation();
|
Location loc = block.getLocation();
|
||||||
ItemStack is = null;
|
ItemStack is = null;
|
||||||
Material mat = null;
|
Material mat = null;
|
||||||
|
//player.sendMessage("mcMMO DEBUG: Data ("+block.getData()+")"+" TYPEID ("+block.getTypeId()+")");
|
||||||
if(type == 59 && block.getData() == (byte) 0x7){
|
if(type == 59 && block.getData() == (byte) 0x7){
|
||||||
mat = Material.getMaterial(296);
|
mat = Material.getMaterial(296);
|
||||||
is = new ItemStack(mat, 1, (byte)0, (byte)0);
|
is = new ItemStack(mat, 1, (byte)0, (byte)0);
|
||||||
mcUsers.getProfile(player).addHerbalismGather(5 * mcLoadProperties.xpGainMultiplier);
|
mcUsers.getProfile(player).addHerbalismGather(5);
|
||||||
if(player != null){
|
if(mcUsers.getProfile(player).getHerbalismInt() >= 50 && mcUsers.getProfile(player).getHerbalismInt() < 150){
|
||||||
if(Math.random() * 1000 <= mcUsers.getProfile(player).getHerbalismInt()){
|
if(Math.random() * 10 > 8)
|
||||||
loc.getWorld().dropItemNaturally(loc, is);
|
loc.getWorld().dropItemNaturally(loc, is);
|
||||||
}
|
}
|
||||||
|
if(mcUsers.getProfile(player).getHerbalismInt() >= 150 && mcUsers.getProfile(player).getHerbalismInt() < 350 ){
|
||||||
|
if(Math.random() * 10 > 6)
|
||||||
|
loc.getWorld().dropItemNaturally(loc, is);
|
||||||
|
}
|
||||||
|
if(mcUsers.getProfile(player).getHerbalismInt() >= 350 && mcUsers.getProfile(player).getHerbalismInt() < 500 ){
|
||||||
|
if(Math.random() * 10 > 4)
|
||||||
|
loc.getWorld().dropItemNaturally(loc, is);
|
||||||
|
}
|
||||||
|
if(mcUsers.getProfile(player).getHerbalismInt() >= 500 && mcUsers.getProfile(player).getHerbalismInt() < 750 ){
|
||||||
|
if(Math.random() * 10 > 2)
|
||||||
|
loc.getWorld().dropItemNaturally(loc, is);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* We need to check not-wheat stuff for if it was placed by the player or not
|
* We need to check not-wheat stuff for if it was placed by the player or not
|
||||||
*/
|
*/
|
||||||
if(!mcConfig.getInstance().isBlockWatched(block)){
|
if(!mcConfig.getInstance().isBlockWatched(block)){
|
||||||
//Mushroom
|
//player.sendMessage("DEBUG CODE 2");
|
||||||
if(type == 39 || type == 40){
|
if(type == 39 || type == 40){
|
||||||
mat = Material.getMaterial(block.getTypeId());
|
mcUsers.getProfile(player).addHerbalismGather(10);
|
||||||
is = new ItemStack(mat, 1, (byte)0, (byte)0);
|
}
|
||||||
if(player != null){
|
if(type == 37 || type == 38){
|
||||||
if(Math.random() * 1000 <= mcUsers.getProfile(player).getHerbalismInt()){
|
mcUsers.getProfile(player).addHerbalismGather(3);
|
||||||
loc.getWorld().dropItemNaturally(loc, is);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
mcUsers.getProfile(player).addHerbalismGather(40 * mcLoadProperties.xpGainMultiplier);
|
|
||||||
}
|
|
||||||
//Flower
|
|
||||||
if(type == 37 || type == 38){
|
|
||||||
mat = Material.getMaterial(block.getTypeId());
|
|
||||||
is = new ItemStack(mat, 1, (byte)0, (byte)0);
|
|
||||||
if(player != null){
|
|
||||||
if(Math.random() * 1000 <= mcUsers.getProfile(player).getHerbalismInt()){
|
|
||||||
loc.getWorld().dropItemNaturally(loc, is);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
mcUsers.getProfile(player).addHerbalismGather(10 * mcLoadProperties.xpGainMultiplier);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
mcSkills.getInstance().XpCheck(player);
|
}
|
||||||
|
if(mcUsers.getProfile(player).getHerbalismGatherInt() >= mcUsers.getProfile(player).getXpToLevel("herbalism")){
|
||||||
|
int skillups = 0;
|
||||||
|
while(mcUsers.getProfile(player).getHerbalismGatherInt() >= mcUsers.getProfile(player).getXpToLevel("herbalism")){
|
||||||
|
skillups++;
|
||||||
|
mcUsers.getProfile(player).removeHerbalismGather(mcUsers.getProfile(player).getXpToLevel("herbalism"));
|
||||||
|
mcUsers.getProfile(player).skillUpHerbalism(1);
|
||||||
|
}
|
||||||
|
player.sendMessage(ChatColor.YELLOW+"Herbalism skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(player).getHerbalism()+")");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public void breadCheck(Player player, ItemStack is){
|
public void breadCheck(Player player, ItemStack is){
|
||||||
if(is.getTypeId() == 297){
|
if(is.getTypeId() == 297){
|
||||||
|
@ -1,81 +1,55 @@
|
|||||||
package com.gmail.nossr50;
|
package com.gmail.nossr50;
|
||||||
|
|
||||||
public class mcLoadProperties {
|
public class mcLoadProperties {
|
||||||
public static Boolean mushrooms, toolsLoseDurabilityFromAbilities, pvpxp, miningrequirespickaxe, woodcuttingrequiresaxe, pvp, eggs, apples, myspawnclearsinventory, cake, music, diamond, glowstone, slowsand, sulphur, netherrack, bones, coal, clay, anvilmessages;
|
public static Boolean 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 String mcmmo, mcc, mcgod, stats, mmoedit, ptp, party, myspawn, setmyspawn, whois, invite, accept, clearmyspawn;
|
||||||
public static int xpGainMultiplier, superBreakerCooldown, gigaDrillBreakerCooldown, treeFellerCooldown, berserkCooldown, serratedStrikeCooldown, skullSplitterCooldown, abilityDurabilityLoss, feathersConsumedByChimaeraWing, pvpxprewardmodifier, repairdiamondlevel, globalxpmodifier, miningxpmodifier, repairxpmodifier, woodcuttingxpmodifier, unarmedxpmodifier, herbalismxpmodifier, excavationxpmodifier, archeryxpmodifier, swordsxpmodifier, axesxpmodifier, acrobaticsxpmodifier;
|
public static int globalxpmodifier, miningxpmodifier, repairxpmodifier, woodcuttingxpmodifier, unarmedxpmodifier, herbalismxpmodifier, excavationxpmodifier, archeryxpmodifier, swordsxpmodifier, axesxpmodifier, acrobaticsxpmodifier;
|
||||||
|
|
||||||
public static void loadMain(){
|
public static void loadMain(){
|
||||||
String propertiesFile = mcMMO.maindirectory + "mcmmo.properties";
|
String propertiesFile = mcMMO.maindirectory + "mcmmo.properties";
|
||||||
mcProperties properties = new mcProperties(propertiesFile);
|
mcProperties properties = new mcProperties(propertiesFile);
|
||||||
properties.load();
|
properties.load();
|
||||||
|
|
||||||
/*
|
|
||||||
* COOLDOWN CONTROL
|
|
||||||
*/
|
|
||||||
superBreakerCooldown = properties.getInteger("superBreakerCooldown", 120);
|
|
||||||
gigaDrillBreakerCooldown = properties.getInteger("gigaDrillBreakerCooldown", 120);
|
|
||||||
treeFellerCooldown = properties.getInteger("treeFellerCooldown", 120);
|
|
||||||
berserkCooldown = properties.getInteger("berserkCooldown", 120);
|
|
||||||
serratedStrikeCooldown = properties.getInteger("serratedStrikeCooldown", 120);
|
|
||||||
skullSplitterCooldown = properties.getInteger("skullSplitterCooldown", 120);
|
|
||||||
/*
|
|
||||||
* OTHER
|
|
||||||
*/
|
|
||||||
myspawnclearsinventory = properties.getBoolean("mySpawnClearsInventory", true);
|
|
||||||
xpGainMultiplier = properties.getInteger("xpGainMultiplier", 1);
|
|
||||||
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);
|
|
||||||
miningrequirespickaxe = properties.getBoolean("miningRequiresPickaxe", true);
|
|
||||||
woodcuttingrequiresaxe = properties.getBoolean("woodcuttingRequiresAxe", true);
|
|
||||||
repairdiamondlevel = properties.getInteger("repairDiamondLevel", 50);
|
|
||||||
/*
|
/*
|
||||||
* EXPERIENCE RATE MODIFIER
|
* EXPERIENCE RATE MODIFIER
|
||||||
*/
|
*/
|
||||||
globalxpmodifier = properties.getInteger("globalXpModifier", 1);
|
globalxpmodifier = properties.getInteger("globalxpmodifier", 1);
|
||||||
miningxpmodifier = properties.getInteger("miningXpModifier", 2);
|
miningxpmodifier = properties.getInteger("miningxpmodifier", 2);
|
||||||
repairxpmodifier = properties.getInteger("repairXpModifier", 2);
|
repairxpmodifier = properties.getInteger("repairxpmodifier", 2);
|
||||||
woodcuttingxpmodifier = properties.getInteger("woodcuttingXpModifier", 2);
|
woodcuttingxpmodifier = properties.getInteger("woodcuttingxpmodifier", 2);
|
||||||
unarmedxpmodifier = properties.getInteger("unarmedXpModifier", 2);
|
unarmedxpmodifier = properties.getInteger("unarmedxpmodifier", 2);
|
||||||
herbalismxpmodifier = properties.getInteger("herbalismXpModifier", 2);
|
herbalismxpmodifier = properties.getInteger("herbalismxpmodifier", 2);
|
||||||
excavationxpmodifier = properties.getInteger("excavationXpModifier", 2);
|
excavationxpmodifier = properties.getInteger("excavationxpmodifier", 2);
|
||||||
archeryxpmodifier = properties.getInteger("archeryXpModifier", 2);
|
archeryxpmodifier = properties.getInteger("archeryxpmodifier", 2);
|
||||||
swordsxpmodifier = properties.getInteger("swordsXpModifier", 2);
|
swordsxpmodifier = properties.getInteger("swordsxpmodifier", 2);
|
||||||
axesxpmodifier = properties.getInteger("axesXpModifier", 2);
|
axesxpmodifier = properties.getInteger("axesxpmodifier", 2);
|
||||||
acrobaticsxpmodifier = properties.getInteger("acrobaticsXpModifier", 2);
|
acrobaticsxpmodifier = properties.getInteger("acrobaticsxpmodifier", 2);
|
||||||
/*
|
/*
|
||||||
* TOGGLE CLAY
|
* TOGGLE CLAY
|
||||||
*/
|
*/
|
||||||
clay = properties.getBoolean("gravelToClay", true);
|
clay = properties.getBoolean("graveltoclay", true);
|
||||||
/*
|
/*
|
||||||
* ANVIL MESSAGES
|
* ANVIL MESSAGES
|
||||||
*/
|
*/
|
||||||
anvilmessages = properties.getBoolean("anvilMessages", true);
|
anvilmessages = properties.getBoolean("anvilmessages", true);
|
||||||
/*
|
/*
|
||||||
* EXCAVATION LOOT TOGGLES
|
* EXCAVATION LOOT TOGGLES
|
||||||
*/
|
*/
|
||||||
mushrooms = properties.getBoolean("canExcavateMushrooms", true);
|
myspawnclearsinventory = properties.getBoolean("myspawnclearsinventory", true);
|
||||||
glowstone = properties.getBoolean("canExcavateGlowstone", true);
|
glowstone = properties.getBoolean("canexcavateglowstone", true);
|
||||||
pvp = properties.getBoolean("pvp", true);
|
pvp = properties.getBoolean("pvp", true);
|
||||||
eggs = properties.getBoolean("canExcavateEggs", true);
|
eggs = properties.getBoolean("canexcavateeggs", true);
|
||||||
apples = properties.getBoolean("canExcavateApples", true);
|
apples = properties.getBoolean("canexcavateapples", true);
|
||||||
cake = properties.getBoolean("canExcavateCake", true);
|
cake = properties.getBoolean("canexcavatecake", true);
|
||||||
music = properties.getBoolean("canExcavateMusic", true);
|
music = properties.getBoolean("canexcavatemusic", true);
|
||||||
diamond = properties.getBoolean("canExcavateDiamond", true);
|
diamond = properties.getBoolean("canexcavatediamond", true);
|
||||||
slowsand = properties.getBoolean("canExcavateSlowSand", true);
|
slowsand = properties.getBoolean("canexcavateslowsand", true);
|
||||||
sulphur = properties.getBoolean("canExcavateSulphur", true);
|
sulphur = properties.getBoolean("canexcavatesulphur", true);
|
||||||
netherrack = properties.getBoolean("canExcavateNetherrack", true);
|
netherrack = properties.getBoolean("canexcavatenetherrack", true);
|
||||||
bones = properties.getBoolean("canExcavateBones", true);
|
bones = properties.getBoolean("canexcavatebones", true);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* CUSTOM COMMANDS
|
* CUSTOM COMMANDS
|
||||||
*/
|
*/
|
||||||
mcability = properties.getString("/mcability", "mcability");
|
|
||||||
mcrefresh = properties.getString("/mcrefresh", "mcrefresh");
|
|
||||||
mcitem = properties.getString("/mcitem", "mcitem");
|
|
||||||
mcmmo = properties.getString("/mcmmo", "mcmmo");
|
mcmmo = properties.getString("/mcmmo", "mcmmo");
|
||||||
mcc = properties.getString("/mcc", "mcc");
|
mcc = properties.getString("/mcc", "mcc");
|
||||||
mcgod = properties.getString("/mcgod", "mcgod");
|
mcgod = properties.getString("/mcgod", "mcgod");
|
||||||
|
@ -18,7 +18,7 @@ import org.bukkit.entity.Player;
|
|||||||
|
|
||||||
|
|
||||||
public class mcMMO extends JavaPlugin {
|
public class mcMMO extends JavaPlugin {
|
||||||
static String maindirectory = "plugins/mcMMO/";
|
static String maindirectory = "mcMMO/";
|
||||||
static File Properties = new File(maindirectory + "mcmmo.properties");
|
static File Properties = new File(maindirectory + "mcmmo.properties");
|
||||||
public static final Logger log = Logger.getLogger("Minecraft");
|
public static final Logger log = Logger.getLogger("Minecraft");
|
||||||
private final mcPlayerListener playerListener = new mcPlayerListener(this);
|
private final mcPlayerListener playerListener = new mcPlayerListener(this);
|
||||||
@ -30,8 +30,9 @@ public class mcMMO extends JavaPlugin {
|
|||||||
private Permissions permissions;
|
private Permissions permissions;
|
||||||
private Timer mcMMO_Timer = new Timer(true);
|
private Timer mcMMO_Timer = new Timer(true);
|
||||||
|
|
||||||
|
//herp
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
mcMMO_Timer.schedule(new mcTimer(this), 0, (long)(2000));
|
//mcMMO_Timer.schedule(new mcTimer(this), 0, (long)(2000));
|
||||||
//Make the directory if it does not exist
|
//Make the directory if it does not exist
|
||||||
new File(maindirectory).mkdir();
|
new File(maindirectory).mkdir();
|
||||||
//Make the file if it does not exist
|
//Make the file if it does not exist
|
||||||
@ -60,23 +61,19 @@ public class mcMMO extends JavaPlugin {
|
|||||||
//Load the file
|
//Load the file
|
||||||
mcLoadProperties.loadMain();
|
mcLoadProperties.loadMain();
|
||||||
mcUsers.getInstance().loadUsers();
|
mcUsers.getInstance().loadUsers();
|
||||||
for(Player player : getServer().getOnlinePlayers()){
|
|
||||||
mcUsers.addUser(player);
|
|
||||||
}
|
|
||||||
PluginManager pm = getServer().getPluginManager();
|
PluginManager pm = getServer().getPluginManager();
|
||||||
pm.registerEvent(Event.Type.PLAYER_JOIN, playerListener, Priority.Normal, this);
|
pm.registerEvent(Event.Type.PLAYER_JOIN, playerListener, Priority.Normal, this);
|
||||||
pm.registerEvent(Event.Type.PLAYER_LOGIN, playerListener, Priority.Normal, this);
|
pm.registerEvent(Event.Type.PLAYER_LOGIN, playerListener, Priority.Normal, this);
|
||||||
pm.registerEvent(Event.Type.BLOCK_DAMAGED, blockListener, Priority.Highest, this);
|
pm.registerEvent(Event.Type.BLOCK_DAMAGED, blockListener, Priority.Normal, this);
|
||||||
pm.registerEvent(Event.Type.PLAYER_CHAT, playerListener, Priority.Lowest, this);
|
pm.registerEvent(Event.Type.PLAYER_CHAT, playerListener, Priority.Monitor, this);
|
||||||
pm.registerEvent(Event.Type.PLAYER_COMMAND_PREPROCESS, playerListener, Priority.Normal, this);
|
pm.registerEvent(Event.Type.PLAYER_COMMAND_PREPROCESS, playerListener, Priority.High, this);
|
||||||
pm.registerEvent(Event.Type.ENTITY_DEATH, entityListener, Priority.Normal, this);
|
pm.registerEvent(Event.Type.ENTITY_DEATH, entityListener, Priority.Normal, this);
|
||||||
pm.registerEvent(Event.Type.BLOCK_FLOW, blockListener, Priority.Normal, this);
|
pm.registerEvent(Event.Type.BLOCK_FLOW, blockListener, Priority.Normal, this);
|
||||||
pm.registerEvent(Event.Type.BLOCK_PLACED, blockListener, Priority.Normal, this);
|
pm.registerEvent(Event.Type.BLOCK_PLACED, blockListener, Priority.Normal, this);
|
||||||
pm.registerEvent(Event.Type.PLAYER_ITEM, playerListener, Priority.Monitor, this);
|
pm.registerEvent(Event.Type.PLAYER_ITEM, playerListener, Priority.Monitor, this);
|
||||||
pm.registerEvent(Event.Type.PLAYER_RESPAWN, playerListener, Priority.Normal, this);
|
pm.registerEvent(Event.Type.PLAYER_RESPAWN, playerListener, Priority.Normal, this);
|
||||||
pm.registerEvent(Event.Type.PLAYER_ITEM_HELD, playerListener, Priority.Normal, this);
|
pm.registerEvent(Event.Type.PLAYER_ITEM_HELD, playerListener, Priority.Normal, this);
|
||||||
pm.registerEvent(Event.Type.ENTITY_DAMAGED, entityListener, Priority.Highest, this);
|
pm.registerEvent(Event.Type.ENTITY_DAMAGED, entityListener, Priority.Normal, this);
|
||||||
pm.registerEvent(Event.Type.BLOCK_RIGHTCLICKED, blockListener, Priority.Normal, this);
|
|
||||||
//pm.registerEvent(Event.Type.CREATURE_SPAWN, entityListener, Priority.Normal, this);
|
//pm.registerEvent(Event.Type.CREATURE_SPAWN, entityListener, Priority.Normal, this);
|
||||||
//Displays a message when plugin is loaded
|
//Displays a message when plugin is loaded
|
||||||
PluginDescriptionFile pdfFile = this.getDescription();
|
PluginDescriptionFile pdfFile = this.getDescription();
|
||||||
@ -101,17 +98,6 @@ public class mcMMO extends JavaPlugin {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public boolean inSameParty(Player playera, Player playerb){
|
|
||||||
if(mcUsers.getProfile(playera).inParty() && mcUsers.getProfile(playerb).inParty()){
|
|
||||||
if(mcUsers.getProfile(playera).getParty().equals(mcUsers.getProfile(playerb).getParty())){
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public boolean isAdminChatToggled(Player player){
|
public boolean isAdminChatToggled(Player player){
|
||||||
if(mcConfig.getInstance().isAdminToggled(player.getName())){
|
if(mcConfig.getInstance().isAdminToggled(player.getName())){
|
||||||
return true;
|
return true;
|
||||||
|
@ -19,54 +19,14 @@ public class mcMining {
|
|||||||
}
|
}
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
public void superBreakerCheck(Player player, Block block){
|
|
||||||
if(mcm.getInstance().isMiningPick(player.getItemInHand())){
|
|
||||||
if(block != null){
|
|
||||||
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++;
|
|
||||||
if(mcUsers.getProfile(player).getMiningInt() >= 150)
|
|
||||||
miningticks++;
|
|
||||||
if(mcUsers.getProfile(player).getMiningInt() >= 250)
|
|
||||||
miningticks++;
|
|
||||||
if(mcUsers.getProfile(player).getMiningInt() >= 350)
|
|
||||||
miningticks++;
|
|
||||||
if(mcUsers.getProfile(player).getMiningInt() >= 450)
|
|
||||||
miningticks++;
|
|
||||||
if(mcUsers.getProfile(player).getMiningInt() >= 550)
|
|
||||||
miningticks++;
|
|
||||||
if(mcUsers.getProfile(player).getMiningInt() >= 650)
|
|
||||||
miningticks++;
|
|
||||||
if(mcUsers.getProfile(player).getMiningInt() >= 750)
|
|
||||||
miningticks++;
|
|
||||||
|
|
||||||
if(!mcUsers.getProfile(player).getSuperBreakerMode() && mcUsers.getProfile(player).getSuperBreakerCooldown() == 0){
|
|
||||||
player.sendMessage(ChatColor.GREEN+"**SUPER BREAKER ACTIVATED**");
|
|
||||||
mcUsers.getProfile(player).setSuperBreakerTicks(miningticks);
|
|
||||||
mcUsers.getProfile(player).setSuperBreakerMode(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public void blockProcSimulate(Block block){
|
public void blockProcSimulate(Block block){
|
||||||
Location loc = block.getLocation();
|
Location loc = block.getLocation();
|
||||||
Material mat = Material.getMaterial(block.getTypeId());
|
Material mat = Material.getMaterial(block.getTypeId());
|
||||||
byte damage = 0;
|
byte damage = 0;
|
||||||
ItemStack item = new ItemStack(mat, 1, (byte)0, damage);
|
ItemStack item = new ItemStack(mat, 1, (byte)0, damage);
|
||||||
if(block.getTypeId() != 89 && block.getTypeId() != 73 && block.getTypeId() != 74 && block.getTypeId() != 56 && block.getTypeId() != 21 && block.getTypeId() != 1 && block.getTypeId() != 16)
|
if(block.getTypeId() != 73 && block.getTypeId() != 74 && block.getTypeId() != 56 && block.getTypeId() != 21 && block.getTypeId() != 1 && block.getTypeId() != 16)
|
||||||
loc.getWorld().dropItemNaturally(loc, item);
|
loc.getWorld().dropItemNaturally(loc, item);
|
||||||
if(block.getTypeId() == 89){
|
//hurrdurr
|
||||||
mat = Material.getMaterial(348);
|
|
||||||
item = new ItemStack(mat, 1, (byte)0, damage);
|
|
||||||
loc.getWorld().dropItemNaturally(loc, item);
|
|
||||||
}
|
|
||||||
if(block.getTypeId() == 73 || block.getTypeId() == 74){
|
if(block.getTypeId() == 73 || block.getTypeId() == 74){
|
||||||
mat = Material.getMaterial(331);
|
mat = Material.getMaterial(331);
|
||||||
item = new ItemStack(mat, 1, (byte)0, damage);
|
item = new ItemStack(mat, 1, (byte)0, damage);
|
||||||
@ -77,224 +37,104 @@ public class mcMining {
|
|||||||
loc.getWorld().dropItemNaturally(loc, item);
|
loc.getWorld().dropItemNaturally(loc, item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(block.getTypeId() == 21){
|
if(block.getTypeId() == 21){
|
||||||
mat = Material.getMaterial(351);
|
mat = Material.getMaterial(351);
|
||||||
item = new ItemStack(mat, 1, (byte)0,(byte)0x4);
|
item = new ItemStack(mat, 1, (byte)0,(byte)0x4);
|
||||||
loc.getWorld().dropItemNaturally(loc, item);
|
loc.getWorld().dropItemNaturally(loc, item);
|
||||||
loc.getWorld().dropItemNaturally(loc, item);
|
loc.getWorld().dropItemNaturally(loc, item);
|
||||||
loc.getWorld().dropItemNaturally(loc, item);
|
loc.getWorld().dropItemNaturally(loc, item);
|
||||||
loc.getWorld().dropItemNaturally(loc, item);
|
loc.getWorld().dropItemNaturally(loc, item);
|
||||||
}
|
}
|
||||||
if(block.getTypeId() == 56){
|
if(block.getTypeId() == 56){
|
||||||
mat = Material.getMaterial(264);
|
mat = Material.getMaterial(264);
|
||||||
item = new ItemStack(mat, 1, (byte)0, damage);
|
item = new ItemStack(mat, 1, (byte)0, damage);
|
||||||
loc.getWorld().dropItemNaturally(loc, item);
|
loc.getWorld().dropItemNaturally(loc, item);
|
||||||
}
|
}
|
||||||
if(block.getTypeId() == 1){
|
if(block.getTypeId() == 1){
|
||||||
mat = Material.getMaterial(4);
|
mat = Material.getMaterial(4);
|
||||||
item = new ItemStack(mat, 1, (byte)0, damage);
|
item = new ItemStack(mat, 1, (byte)0, damage);
|
||||||
loc.getWorld().dropItemNaturally(loc, item);
|
loc.getWorld().dropItemNaturally(loc, item);
|
||||||
}
|
}
|
||||||
if(block.getTypeId() == 16){
|
if(block.getTypeId() == 16){
|
||||||
mat = Material.getMaterial(263);
|
mat = Material.getMaterial(263);
|
||||||
item = new ItemStack(mat, 1, (byte)0, damage);
|
item = new ItemStack(mat, 1, (byte)0, damage);
|
||||||
loc.getWorld().dropItemNaturally(loc, item);
|
loc.getWorld().dropItemNaturally(loc, item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void blockProcCheck(Block block, Player player){
|
public void blockProcCheck(Block block, Player player){
|
||||||
if(player != null){
|
if(mcUsers.getProfile(player).getMiningInt() > 2000){
|
||||||
if(Math.random() * 1000 <= mcUsers.getProfile(player).getMiningInt()){
|
blockProcSimulate(block);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(mcUsers.getProfile(player).getMiningInt() > 1250){
|
||||||
|
if((Math.random() * 10) > 2){
|
||||||
|
blockProcSimulate(block);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(mcUsers.getProfile(player).getMiningInt() > 750){
|
||||||
|
if((Math.random() * 10) > 4){
|
||||||
|
blockProcSimulate(block);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(mcUsers.getProfile(player).getMiningInt() > 150){
|
||||||
|
if((Math.random() * 10) > 6){
|
||||||
|
blockProcSimulate(block);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(mcUsers.getProfile(player).getMiningInt() > 25){
|
||||||
|
if((Math.random() * 10) > 8){
|
||||||
blockProcSimulate(block);
|
blockProcSimulate(block);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void miningBlockCheck(Player player, Block block){
|
public void miningBlockCheck(Player player, Block block){
|
||||||
int xp = 0;
|
if(block.getTypeId() == 1){
|
||||||
if(block.getTypeId() == 1 || block.getTypeId() == 24){
|
mcUsers.getProfile(player).addMiningGather(1);
|
||||||
xp += 3;
|
|
||||||
blockProcCheck(block, player);
|
blockProcCheck(block, player);
|
||||||
}
|
}
|
||||||
//NETHERRACK
|
//COAL
|
||||||
if(block.getTypeId() == 87){
|
if(block.getTypeId() == 16){
|
||||||
xp += 3;
|
mcUsers.getProfile(player).addMiningGather(5);
|
||||||
blockProcCheck(block, player);
|
blockProcCheck(block, player);
|
||||||
}
|
}
|
||||||
//GLOWSTONE
|
//GOLD
|
||||||
if(block.getTypeId() == 89){
|
if(block.getTypeId() == 14){
|
||||||
xp += 3;
|
mcUsers.getProfile(player).addMiningGather(35);
|
||||||
blockProcCheck(block, player);
|
blockProcCheck(block, player);
|
||||||
}
|
}
|
||||||
//COAL
|
//DIAMOND
|
||||||
if(block.getTypeId() == 16){
|
if(block.getTypeId() == 56){
|
||||||
xp += 10;
|
mcUsers.getProfile(player).addMiningGather(75);
|
||||||
blockProcCheck(block, player);
|
blockProcCheck(block, player);
|
||||||
}
|
}
|
||||||
//GOLD
|
//IRON
|
||||||
if(block.getTypeId() == 14){
|
if(block.getTypeId() == 15){
|
||||||
xp += 35;
|
mcUsers.getProfile(player).addMiningGather(20);
|
||||||
blockProcCheck(block, player);
|
blockProcCheck(block, player);
|
||||||
}
|
}
|
||||||
//DIAMOND
|
//REDSTONE
|
||||||
if(block.getTypeId() == 56){
|
if(block.getTypeId() == 73 || block.getTypeId() == 74){
|
||||||
xp += 75;
|
mcUsers.getProfile(player).addMiningGather(15);
|
||||||
blockProcCheck(block, player);
|
blockProcCheck(block, player);
|
||||||
}
|
}
|
||||||
//IRON
|
//LAPUS
|
||||||
if(block.getTypeId() == 15){
|
if(block.getTypeId() == 21){
|
||||||
xp += 25;
|
mcUsers.getProfile(player).addMiningGather(40);
|
||||||
blockProcCheck(block, player);
|
blockProcCheck(block, player);
|
||||||
}
|
}
|
||||||
//REDSTONE
|
if(player != null && mcUsers.getProfile(player).getMiningGatherInt() >= mcUsers.getProfile(player).getXpToLevel("mining")){
|
||||||
if(block.getTypeId() == 73 || block.getTypeId() == 74){
|
int skillups = 0;
|
||||||
xp += 15;
|
while(mcUsers.getProfile(player).getMiningGatherInt() >= mcUsers.getProfile(player).getXpToLevel("mining")){
|
||||||
blockProcCheck(block, player);
|
skillups++;
|
||||||
}
|
mcUsers.getProfile(player).removeMiningGather(mcUsers.getProfile(player).getXpToLevel("mining"));
|
||||||
//LAPUS
|
mcUsers.getProfile(player).skillUpMining(1);
|
||||||
if(block.getTypeId() == 21){
|
}
|
||||||
xp += 40;
|
player.sendMessage(ChatColor.YELLOW+"Mining skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(player).getMining()+")");
|
||||||
blockProcCheck(block, player);
|
}
|
||||||
}
|
|
||||||
mcUsers.getProfile(player).addMiningGather(xp * mcLoadProperties.xpGainMultiplier);
|
|
||||||
mcSkills.getInstance().XpCheck(player);
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* Handling SuperBreaker stuff
|
|
||||||
*/
|
|
||||||
public Boolean canBeSuperBroken(Block block){
|
|
||||||
int t = block.getTypeId();
|
|
||||||
if(t == 87 || t == 89 || t == 73 || t == 74 || t == 56 || t == 21 || t == 1 || t == 16 || t == 14 || t == 15){
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public void SuperBreakerBlockCheck(Player player, Block block){
|
|
||||||
if(mcLoadProperties.toolsLoseDurabilityFromAbilities)
|
|
||||||
mcm.getInstance().damageTool(player, (short) mcLoadProperties.abilityDurabilityLoss);
|
|
||||||
Location loc = block.getLocation();
|
|
||||||
Material mat = Material.getMaterial(block.getTypeId());
|
|
||||||
int xp = 0;
|
|
||||||
byte damage = 0;
|
|
||||||
ItemStack item = new ItemStack(mat, 1, (byte)0, damage);
|
|
||||||
if(block.getTypeId() == 1 || block.getTypeId() == 24){
|
|
||||||
if(!mcConfig.getInstance().isBlockWatched(block)){
|
|
||||||
xp += 3;
|
|
||||||
blockProcCheck(block, player);
|
|
||||||
blockProcCheck(block, player);
|
|
||||||
}
|
|
||||||
if(block.getTypeId() == 1){
|
|
||||||
mat = Material.COBBLESTONE;
|
|
||||||
} else {
|
|
||||||
mat = Material.SANDSTONE;
|
|
||||||
}
|
|
||||||
item = new ItemStack(mat, 1, (byte)0, damage);
|
|
||||||
loc.getWorld().dropItemNaturally(loc, item);
|
|
||||||
block.setType(Material.AIR);
|
|
||||||
}
|
|
||||||
//NETHERRACK
|
|
||||||
if(block.getTypeId() == 87){
|
|
||||||
if(!mcConfig.getInstance().isBlockWatched(block)){
|
|
||||||
xp += 3;
|
|
||||||
blockProcCheck(block, player);
|
|
||||||
blockProcCheck(block, player);
|
|
||||||
}
|
|
||||||
mat = Material.getMaterial(87);
|
|
||||||
item = new ItemStack(mat, 1, (byte)0, damage);
|
|
||||||
loc.getWorld().dropItemNaturally(loc, item);
|
|
||||||
block.setType(Material.AIR);
|
|
||||||
}
|
|
||||||
//GLOWSTONE
|
|
||||||
if(block.getTypeId() == 89){
|
|
||||||
if(!mcConfig.getInstance().isBlockWatched(block)){
|
|
||||||
xp += 3;
|
|
||||||
blockProcCheck(block, player);
|
|
||||||
blockProcCheck(block, player);
|
|
||||||
}
|
|
||||||
mat = Material.getMaterial(348);
|
|
||||||
item = new ItemStack(mat, 1, (byte)0, damage);
|
|
||||||
loc.getWorld().dropItemNaturally(loc, item);
|
|
||||||
block.setType(Material.AIR);
|
|
||||||
}
|
|
||||||
//COAL
|
|
||||||
if(block.getTypeId() == 16){
|
|
||||||
if(!mcConfig.getInstance().isBlockWatched(block)){
|
|
||||||
xp += 10;
|
|
||||||
blockProcCheck(block, player);
|
|
||||||
blockProcCheck(block, player);
|
|
||||||
}
|
|
||||||
mat = Material.getMaterial(263);
|
|
||||||
item = new ItemStack(mat, 1, (byte)0, damage);
|
|
||||||
loc.getWorld().dropItemNaturally(loc, item);
|
|
||||||
block.setType(Material.AIR);
|
|
||||||
}
|
|
||||||
//GOLD
|
|
||||||
if(block.getTypeId() == 14 && mcm.getInstance().getTier(player) >= 3){
|
|
||||||
if(!mcConfig.getInstance().isBlockWatched(block)){
|
|
||||||
xp += 35;
|
|
||||||
blockProcCheck(block, player);
|
|
||||||
blockProcCheck(block, player);
|
|
||||||
}
|
|
||||||
item = new ItemStack(mat, 1, (byte)0, damage);
|
|
||||||
loc.getWorld().dropItemNaturally(loc, item);
|
|
||||||
block.setType(Material.AIR);
|
|
||||||
}
|
|
||||||
//DIAMOND
|
|
||||||
if(block.getTypeId() == 56 && mcm.getInstance().getTier(player) >= 3){
|
|
||||||
if(!mcConfig.getInstance().isBlockWatched(block)){
|
|
||||||
xp += 75;
|
|
||||||
blockProcCheck(block, player);
|
|
||||||
blockProcCheck(block, player);
|
|
||||||
}
|
|
||||||
mat = Material.getMaterial(264);
|
|
||||||
item = new ItemStack(mat, 1, (byte)0, damage);
|
|
||||||
loc.getWorld().dropItemNaturally(loc, item);
|
|
||||||
block.setType(Material.AIR);
|
|
||||||
}
|
|
||||||
//IRON
|
|
||||||
if(block.getTypeId() == 15 && mcm.getInstance().getTier(player) >= 2){
|
|
||||||
if(!mcConfig.getInstance().isBlockWatched(block)){
|
|
||||||
xp += 25;
|
|
||||||
blockProcCheck(block, player);
|
|
||||||
blockProcCheck(block, player);
|
|
||||||
}
|
|
||||||
item = new ItemStack(mat, 1, (byte)0, damage);
|
|
||||||
loc.getWorld().dropItemNaturally(loc, item);
|
|
||||||
block.setType(Material.AIR);
|
|
||||||
}
|
|
||||||
//REDSTONE
|
|
||||||
if((block.getTypeId() == 73 || block.getTypeId() == 74) && mcm.getInstance().getTier(player) >= 4){
|
|
||||||
if(!mcConfig.getInstance().isBlockWatched(block)){
|
|
||||||
xp += 15;
|
|
||||||
blockProcCheck(block, player);
|
|
||||||
blockProcCheck(block, player);
|
|
||||||
}
|
|
||||||
mat = Material.getMaterial(331);
|
|
||||||
item = new ItemStack(mat, 1, (byte)0, damage);
|
|
||||||
loc.getWorld().dropItemNaturally(loc, item);
|
|
||||||
loc.getWorld().dropItemNaturally(loc, item);
|
|
||||||
loc.getWorld().dropItemNaturally(loc, item);
|
|
||||||
if(Math.random() * 10 > 5){
|
|
||||||
loc.getWorld().dropItemNaturally(loc, item);
|
|
||||||
}
|
|
||||||
block.setType(Material.AIR);
|
|
||||||
}
|
|
||||||
//LAPUS
|
|
||||||
if(block.getTypeId() == 21 && mcm.getInstance().getTier(player) >= 3){
|
|
||||||
if(!mcConfig.getInstance().isBlockWatched(block)){
|
|
||||||
xp += 40;
|
|
||||||
blockProcCheck(block, player);
|
|
||||||
blockProcCheck(block, player);
|
|
||||||
}
|
|
||||||
mat = Material.getMaterial(351);
|
|
||||||
item = new ItemStack(mat, 1, (byte)0,(byte)0x4);
|
|
||||||
loc.getWorld().dropItemNaturally(loc, item);
|
|
||||||
loc.getWorld().dropItemNaturally(loc, item);
|
|
||||||
loc.getWorld().dropItemNaturally(loc, item);
|
|
||||||
loc.getWorld().dropItemNaturally(loc, item);
|
|
||||||
block.setType(Material.AIR);
|
|
||||||
}
|
|
||||||
mcUsers.getProfile(player).addMiningGather(xp * mcLoadProperties.xpGainMultiplier);
|
|
||||||
mcSkills.getInstance().XpCheck(player);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -16,19 +16,11 @@ public class mcParty {
|
|||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
public boolean inSameParty(Player playera, Player playerb){
|
public boolean inSameParty(Player playera, Player playerb){
|
||||||
if(mcUsers.getProfile(playera) == null || mcUsers.getProfile(playerb) == null){
|
if(mcUsers.getProfile(playera).getParty().equals(mcUsers.getProfile(playerb).getParty())){
|
||||||
mcUsers.addUser(playera);
|
return true;
|
||||||
mcUsers.addUser(playerb);
|
} else {
|
||||||
}
|
return false;
|
||||||
if(mcUsers.getProfile(playera).inParty() && mcUsers.getProfile(playerb).inParty()){
|
}
|
||||||
if(mcUsers.getProfile(playera).getParty().equals(mcUsers.getProfile(playerb).getParty())){
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public int partyCount(Player player, Player[] players){
|
public int partyCount(Player player, Player[] players){
|
||||||
int x = 0;
|
int x = 0;
|
||||||
|
@ -30,13 +30,6 @@ public class mcPermissions {
|
|||||||
private boolean permission(Player player, String string) {
|
private boolean permission(Player player, String string) {
|
||||||
return permissionsPlugin.Security.permission(player, string);
|
return permissionsPlugin.Security.permission(player, string);
|
||||||
}
|
}
|
||||||
public boolean mcrefresh(Player player) {
|
|
||||||
if (permissionsEnabled) {
|
|
||||||
return permission(player, "mcmmo.tools.mcrefresh");
|
|
||||||
} else {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public boolean mmoedit(Player player) {
|
public boolean mmoedit(Player player) {
|
||||||
if (permissionsEnabled) {
|
if (permissionsEnabled) {
|
||||||
return permission(player, "mcmmo.tools.mmoedit");
|
return permission(player, "mcmmo.tools.mmoedit");
|
||||||
@ -44,49 +37,7 @@ public class mcPermissions {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public boolean excavationAbility(Player player){
|
public boolean woodcuttingability(Player player) {
|
||||||
if (permissionsEnabled) {
|
|
||||||
return permission(player, "mcmmo.ability.excavation");
|
|
||||||
} else {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public boolean unarmedAbility(Player player){
|
|
||||||
if (permissionsEnabled) {
|
|
||||||
return permission(player, "mcmmo.ability.unarmed");
|
|
||||||
} else {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public boolean chimaeraWing(Player player){
|
|
||||||
if (permissionsEnabled) {
|
|
||||||
return permission(player, "mcmmo.item.chimaerawing");
|
|
||||||
} else {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public boolean miningAbility(Player player){
|
|
||||||
if (permissionsEnabled) {
|
|
||||||
return permission(player, "mcmmo.ability.mining");
|
|
||||||
} else {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public boolean axesAbility(Player player){
|
|
||||||
if (permissionsEnabled) {
|
|
||||||
return permission(player, "mcmmo.ability.axes");
|
|
||||||
} else {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public boolean swordsAbility(Player player){
|
|
||||||
if (permissionsEnabled) {
|
|
||||||
return permission(player, "mcmmo.ability.swords");
|
|
||||||
} else {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public boolean woodCuttingAbility(Player player) {
|
|
||||||
if (permissionsEnabled) {
|
if (permissionsEnabled) {
|
||||||
return permission(player, "mcmmo.ability.woodcutting");
|
return permission(player, "mcmmo.ability.woodcutting");
|
||||||
} else {
|
} else {
|
||||||
@ -114,13 +65,6 @@ public class mcPermissions {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public boolean mcAbility(Player player) {
|
|
||||||
if (permissionsEnabled) {
|
|
||||||
return permission(player, "mcmmo.commands.ability");
|
|
||||||
} else {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public boolean mySpawn(Player player) {
|
public boolean mySpawn(Player player) {
|
||||||
if (permissionsEnabled) {
|
if (permissionsEnabled) {
|
||||||
return permission(player, "mcmmo.commands.myspawn");
|
return permission(player, "mcmmo.commands.myspawn");
|
||||||
@ -135,13 +79,6 @@ public class mcPermissions {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public boolean setMySpawnOther(Player player) {
|
|
||||||
if (permissionsEnabled) {
|
|
||||||
return permission(player, "mcmmo.commands.setmyspawnother");
|
|
||||||
} else {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public boolean partyChat(Player player) {
|
public boolean partyChat(Player player) {
|
||||||
if (permissionsEnabled) {
|
if (permissionsEnabled) {
|
||||||
return permission(player, "mcmmo.chat.partychat");
|
return permission(player, "mcmmo.chat.partychat");
|
||||||
|
@ -5,7 +5,6 @@ import java.util.logging.Logger;
|
|||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.player.PlayerChatEvent;
|
import org.bukkit.event.player.PlayerChatEvent;
|
||||||
@ -61,7 +60,7 @@ public class mcPlayerListener extends PlayerListener {
|
|||||||
public void onPlayerJoin(PlayerEvent event) {
|
public void onPlayerJoin(PlayerEvent event) {
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
if(mcPermissions.getInstance().motd(player)){
|
if(mcPermissions.getInstance().motd(player)){
|
||||||
player.sendMessage(ChatColor.BLUE + "This server is running mcMMO "+plugin.getDescription().getVersion()+" type /"+ChatColor.YELLOW+mcLoadProperties.mcmmo+ChatColor.BLUE+ " for help.");
|
player.sendMessage(ChatColor.BLUE + "This server is running mcMMO "+plugin.getDescription().getVersion()+" type /"+ChatColor.YELLOW+mcLoadProperties.mcmmo+ChatColor.BLUE+ " for help.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//Check if string is a player
|
//Check if string is a player
|
||||||
@ -70,25 +69,15 @@ public class mcPlayerListener extends PlayerListener {
|
|||||||
Block block = event.getBlockClicked();
|
Block block = event.getBlockClicked();
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
ItemStack is = player.getItemInHand();
|
ItemStack is = player.getItemInHand();
|
||||||
/*
|
|
||||||
* ABILITY ACTIVATION CHECKS
|
|
||||||
*/
|
|
||||||
if(block != null){
|
|
||||||
if(mcm.getInstance().abilityBlockCheck(block))
|
|
||||||
mcSkills.getInstance().abilityActivationCheck(player, block);
|
|
||||||
} else {
|
|
||||||
mcSkills.getInstance().abilityActivationCheck(player, block);
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* ITEM INTERACTIONS
|
|
||||||
*/
|
|
||||||
mcItem.getInstance().itemChecks(player);
|
|
||||||
/*
|
|
||||||
* HERBALISM MODIFIERS
|
|
||||||
*/
|
|
||||||
if(mcPermissions.getInstance().herbalism(player)){
|
if(mcPermissions.getInstance().herbalism(player)){
|
||||||
mcHerbalism.getInstance().breadCheck(player, is);
|
//BREADCHECK, CHECKS HERBALISM SKILL FOR BREAD HP MODIFIERS
|
||||||
mcHerbalism.getInstance().stewCheck(player, is);
|
mcHerbalism.getInstance().breadCheck(player, is);
|
||||||
|
//STEW, CHECKS HERBALISM SKILL FOR BREAD HP MODIFIERS
|
||||||
|
mcHerbalism.getInstance().stewCheck(player, is);
|
||||||
|
}
|
||||||
|
if(block != null && player != null && mcPermissions.getInstance().repair(player) && block.getTypeId() == 42){
|
||||||
|
//REPAIRCHECK, CHECKS TO MAKE SURE PLAYER IS RIGHT CLICKING AN ANVIL, PLAYER HAS ENOUGH RESOURCES, AND THE ITEM IS NOT AT FULL DURABILITY.
|
||||||
|
mcRepair.getInstance().repairCheck(player, is, block);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void onPlayerCommandPreprocess(PlayerChatEvent event){
|
public void onPlayerCommandPreprocess(PlayerChatEvent event){
|
||||||
@ -97,67 +86,6 @@ public class mcPlayerListener extends PlayerListener {
|
|||||||
String playerName = player.getName();
|
String playerName = player.getName();
|
||||||
//Check if the command is an mcMMO related help command
|
//Check if the command is an mcMMO related help command
|
||||||
mcm.getInstance().mcmmoHelpCheck(split, player, event);
|
mcm.getInstance().mcmmoHelpCheck(split, player, event);
|
||||||
if(mcPermissions.permissionsEnabled && split[0].equalsIgnoreCase("/"+mcLoadProperties.mcability)){
|
|
||||||
event.setCancelled(true);
|
|
||||||
if(mcUsers.getProfile(player).getAbilityUse()){
|
|
||||||
player.sendMessage("Ability use toggled off");
|
|
||||||
mcUsers.getProfile(player).toggleAbilityUse();
|
|
||||||
} else {
|
|
||||||
player.sendMessage("Ability use toggled on");
|
|
||||||
mcUsers.getProfile(player).toggleAbilityUse();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(mcPermissions.getInstance().mcAbility(player) && split[0].equalsIgnoreCase("/"+mcLoadProperties.mcrefresh)){
|
|
||||||
event.setCancelled(true);
|
|
||||||
if(!mcPermissions.getInstance().mcrefresh(player)){
|
|
||||||
player.sendMessage(ChatColor.YELLOW+"[mcMMO]"+ChatColor.DARK_RED +" Insufficient permissions.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(split.length >= 2 && isPlayer(split[1])){
|
|
||||||
player.sendMessage("You have refreshed "+split[1]+"'s cooldowns!");
|
|
||||||
player = getPlayer(split[1]);
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* AXE PREPARATION MODE
|
|
||||||
*/
|
|
||||||
mcUsers.getProfile(player).setAxePreparationMode(false);
|
|
||||||
mcUsers.getProfile(player).setAxePreparationTicks(0);
|
|
||||||
/*
|
|
||||||
* GIGA DRILL BREAKER
|
|
||||||
*/
|
|
||||||
mcUsers.getProfile(player).setGigaDrillBreakerCooldown(0);
|
|
||||||
mcUsers.getProfile(player).setGigaDrillBreakerMode(false);
|
|
||||||
mcUsers.getProfile(player).setGigaDrillBreakerTicks(0);
|
|
||||||
/*
|
|
||||||
* SERRATED STRIKE
|
|
||||||
*/
|
|
||||||
mcUsers.getProfile(player).setSerratedStrikesCooldown(0);
|
|
||||||
mcUsers.getProfile(player).setSerratedStrikesMode(false);
|
|
||||||
mcUsers.getProfile(player).setSerratedStrikesTicks(0);
|
|
||||||
/*
|
|
||||||
* SUPER BREAKER
|
|
||||||
*/
|
|
||||||
mcUsers.getProfile(player).setSuperBreakerCooldown(0);
|
|
||||||
mcUsers.getProfile(player).setSuperBreakerMode(false);
|
|
||||||
mcUsers.getProfile(player).setSuperBreakerTicks(0);
|
|
||||||
/*
|
|
||||||
* TREE FELLER
|
|
||||||
*/
|
|
||||||
mcUsers.getProfile(player).setTreeFellerCooldown(0);
|
|
||||||
mcUsers.getProfile(player).setTreeFellerMode(false);
|
|
||||||
mcUsers.getProfile(player).setTreeFellerTicks(0);
|
|
||||||
/*
|
|
||||||
* BERSERK
|
|
||||||
*/
|
|
||||||
mcUsers.getProfile(player).setBerserkCooldown(0);
|
|
||||||
mcUsers.getProfile(player).setBerserkMode(false);
|
|
||||||
mcUsers.getProfile(player).setBerserkTicks(0);
|
|
||||||
|
|
||||||
player.sendMessage(ChatColor.GREEN+"**ABILITIES REFRESHED!**");
|
|
||||||
}
|
|
||||||
if(split[0].equalsIgnoreCase("/"+mcLoadProperties.mcitem)){
|
|
||||||
|
|
||||||
}
|
|
||||||
/*
|
/*
|
||||||
* GODMODE COMMAND
|
* GODMODE COMMAND
|
||||||
*/
|
*/
|
||||||
@ -185,7 +113,6 @@ public class mcPlayerListener extends PlayerListener {
|
|||||||
player.sendMessage(ChatColor.DARK_AQUA+"Myspawn is now cleared.");
|
player.sendMessage(ChatColor.DARK_AQUA+"Myspawn is now cleared.");
|
||||||
}
|
}
|
||||||
if(mcPermissions.permissionsEnabled && split[0].equalsIgnoreCase("/"+mcLoadProperties.mmoedit)){
|
if(mcPermissions.permissionsEnabled && split[0].equalsIgnoreCase("/"+mcLoadProperties.mmoedit)){
|
||||||
event.setCancelled(true);
|
|
||||||
if(!mcPermissions.getInstance().mmoedit(player)){
|
if(!mcPermissions.getInstance().mmoedit(player)){
|
||||||
player.sendMessage(ChatColor.YELLOW+"[mcMMO]"+ChatColor.DARK_RED +" Insufficient permissions.");
|
player.sendMessage(ChatColor.YELLOW+"[mcMMO]"+ChatColor.DARK_RED +" Insufficient permissions.");
|
||||||
return;
|
return;
|
||||||
@ -318,21 +245,17 @@ public class mcPlayerListener extends PlayerListener {
|
|||||||
* SETMYSPAWN COMMAND
|
* SETMYSPAWN COMMAND
|
||||||
*/
|
*/
|
||||||
if(split[0].equalsIgnoreCase("/"+mcLoadProperties.setmyspawn)){
|
if(split[0].equalsIgnoreCase("/"+mcLoadProperties.setmyspawn)){
|
||||||
event.setCancelled(true);
|
|
||||||
if(!mcPermissions.getInstance().setMySpawn(player)){
|
if(!mcPermissions.getInstance().setMySpawn(player)){
|
||||||
player.sendMessage(ChatColor.YELLOW+"[mcMMO]"+ChatColor.DARK_RED +" Insufficient permissions.");
|
player.sendMessage(ChatColor.YELLOW+"[mcMMO]"+ChatColor.DARK_RED +" Insufficient permissions.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if((mcPermissions.getInstance().setMySpawnOther(player) || player.isOp()) && split.length >= 2 && isPlayer(split[1])){
|
event.setCancelled(true);
|
||||||
player.sendMessage("You have set "+split[1]+"'s spawn!");
|
|
||||||
player = getPlayer(split[1]);
|
|
||||||
}
|
|
||||||
double x = player.getLocation().getX();
|
double x = player.getLocation().getX();
|
||||||
double y = player.getLocation().getY();
|
double y = player.getLocation().getY();
|
||||||
double z = player.getLocation().getZ();
|
double z = player.getLocation().getZ();
|
||||||
String myspawnworld = player.getWorld().getName();
|
String myspawnworld = player.getWorld().getName();
|
||||||
mcUsers.getProfile(player).setMySpawn(x, y, z, myspawnworld);
|
mcUsers.getProfile(player).setMySpawn(x, y, z, myspawnworld);
|
||||||
player.sendMessage(ChatColor.DARK_AQUA + "Myspawn has been set.");
|
player.sendMessage(ChatColor.DARK_AQUA + "Myspawn has been set to your current location.");
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* STATS COMMAND
|
* STATS COMMAND
|
||||||
@ -341,7 +264,7 @@ public class mcPlayerListener extends PlayerListener {
|
|||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
player.sendMessage(ChatColor.GREEN + "Your mcMMO Stats");
|
player.sendMessage(ChatColor.GREEN + "Your mcMMO Stats");
|
||||||
if(mcPermissions.getInstance().permissionsEnabled)
|
if(mcPermissions.getInstance().permissionsEnabled)
|
||||||
player.sendMessage(ChatColor.DARK_GRAY+"If you don't have access to a skill it will not be shown here.");
|
player.sendMessage(ChatColor.DARK_GRAY+"If you don't have access to a skill it will not be shown here.");
|
||||||
if(mcPermissions.getInstance().mining(player))
|
if(mcPermissions.getInstance().mining(player))
|
||||||
player.sendMessage(ChatColor.YELLOW + "Mining Skill: " + ChatColor.GREEN + mcUsers.getProfile(player).getMining()+ChatColor.DARK_AQUA
|
player.sendMessage(ChatColor.YELLOW + "Mining Skill: " + ChatColor.GREEN + mcUsers.getProfile(player).getMining()+ChatColor.DARK_AQUA
|
||||||
+ " XP("+mcUsers.getProfile(player).getMiningGather()
|
+ " XP("+mcUsers.getProfile(player).getMiningGather()
|
||||||
@ -397,7 +320,6 @@ public class mcPlayerListener extends PlayerListener {
|
|||||||
}
|
}
|
||||||
//Invite Command
|
//Invite Command
|
||||||
if(mcPermissions.getInstance().party(player) && split[0].equalsIgnoreCase("/"+mcLoadProperties.invite)){
|
if(mcPermissions.getInstance().party(player) && split[0].equalsIgnoreCase("/"+mcLoadProperties.invite)){
|
||||||
event.setCancelled(true);
|
|
||||||
if(!mcUsers.getProfile(player).inParty()){
|
if(!mcUsers.getProfile(player).inParty()){
|
||||||
player.sendMessage(ChatColor.RED+"You are not in a party.");
|
player.sendMessage(ChatColor.RED+"You are not in a party.");
|
||||||
return;
|
return;
|
||||||
@ -410,13 +332,12 @@ public class mcPlayerListener extends PlayerListener {
|
|||||||
Player target = getPlayer(split[1]);
|
Player target = getPlayer(split[1]);
|
||||||
mcUsers.getProfile(target).modifyInvite(mcUsers.getProfile(player).getParty());
|
mcUsers.getProfile(target).modifyInvite(mcUsers.getProfile(player).getParty());
|
||||||
player.sendMessage(ChatColor.GREEN+"Invite sent successfully");
|
player.sendMessage(ChatColor.GREEN+"Invite sent successfully");
|
||||||
target.sendMessage(ChatColor.RED+"ALERT: "+ChatColor.GREEN+"You have received a party invite for "+mcUsers.getProfile(target).getInvite()+" from "+player.getName());
|
target.sendMessage(ChatColor.RED+"ALERT: "+ChatColor.GREEN+"You have received a party invite for "+mcUsers.getProfile(target).getInvite());
|
||||||
target.sendMessage(ChatColor.YELLOW+"Type "+ChatColor.GREEN+"/"+mcLoadProperties.accept+ChatColor.YELLOW+" to accept the invite");
|
target.sendMessage(ChatColor.YELLOW+"Type "+ChatColor.GREEN+"/"+mcLoadProperties.accept+ChatColor.YELLOW+" to accept the invite");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//Accept invite
|
//Accept invite
|
||||||
if(mcPermissions.getInstance().party(player) && split[0].equalsIgnoreCase("/"+mcLoadProperties.accept)){
|
if(mcPermissions.getInstance().party(player) && split[0].equalsIgnoreCase("/"+mcLoadProperties.accept)){
|
||||||
event.setCancelled(true);
|
|
||||||
if(mcUsers.getProfile(player).hasPartyInvite()){
|
if(mcUsers.getProfile(player).hasPartyInvite()){
|
||||||
if(mcUsers.getProfile(player).inParty()){
|
if(mcUsers.getProfile(player).inParty()){
|
||||||
mcParty.getInstance().informPartyMembersQuit(player, getPlayersOnline());
|
mcParty.getInstance().informPartyMembersQuit(player, getPlayersOnline());
|
||||||
@ -430,11 +351,11 @@ public class mcPlayerListener extends PlayerListener {
|
|||||||
}
|
}
|
||||||
//Party command
|
//Party command
|
||||||
if(split[0].equalsIgnoreCase("/"+mcLoadProperties.party)){
|
if(split[0].equalsIgnoreCase("/"+mcLoadProperties.party)){
|
||||||
event.setCancelled(true);
|
|
||||||
if(!mcPermissions.getInstance().party(player)){
|
if(!mcPermissions.getInstance().party(player)){
|
||||||
player.sendMessage(ChatColor.YELLOW+"[mcMMO]"+ChatColor.DARK_RED +" Insufficient permissions.");
|
player.sendMessage(ChatColor.YELLOW+"[mcMMO]"+ChatColor.DARK_RED +" Insufficient permissions.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
event.setCancelled(true);
|
||||||
if(split.length == 1 && !mcUsers.getProfile(player).inParty()){
|
if(split.length == 1 && !mcUsers.getProfile(player).inParty()){
|
||||||
player.sendMessage("Proper usage is "+"/"+mcLoadProperties.party+" <name> or 'q' to quit");
|
player.sendMessage("Proper usage is "+"/"+mcLoadProperties.party+" <name> or 'q' to quit");
|
||||||
return;
|
return;
|
||||||
@ -473,11 +394,11 @@ public class mcPlayerListener extends PlayerListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(split[0].equalsIgnoreCase("/p")){
|
if(split[0].equalsIgnoreCase("/p")){
|
||||||
event.setCancelled(true);
|
|
||||||
if(!mcPermissions.getInstance().party(player)){
|
if(!mcPermissions.getInstance().party(player)){
|
||||||
player.sendMessage(ChatColor.YELLOW+"[mcMMO]"+ChatColor.DARK_RED +" Insufficient permissions.");
|
player.sendMessage(ChatColor.YELLOW+"[mcMMO]"+ChatColor.DARK_RED +" Insufficient permissions.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
event.setCancelled(true);
|
||||||
if(mcConfig.getInstance().isAdminToggled(player.getName()))
|
if(mcConfig.getInstance().isAdminToggled(player.getName()))
|
||||||
mcConfig.getInstance().toggleAdminChat(playerName);
|
mcConfig.getInstance().toggleAdminChat(playerName);
|
||||||
mcConfig.getInstance().togglePartyChat(playerName);
|
mcConfig.getInstance().togglePartyChat(playerName);
|
||||||
@ -506,11 +427,11 @@ public class mcPlayerListener extends PlayerListener {
|
|||||||
* MYSPAWN
|
* MYSPAWN
|
||||||
*/
|
*/
|
||||||
if(split[0].equalsIgnoreCase("/"+mcLoadProperties.myspawn)){
|
if(split[0].equalsIgnoreCase("/"+mcLoadProperties.myspawn)){
|
||||||
event.setCancelled(true);
|
|
||||||
if(!mcPermissions.getInstance().mySpawn(player)){
|
if(!mcPermissions.getInstance().mySpawn(player)){
|
||||||
player.sendMessage(ChatColor.YELLOW+"[mcMMO]"+ChatColor.DARK_RED +" Insufficient permissions.");
|
player.sendMessage(ChatColor.YELLOW+"[mcMMO]"+ChatColor.DARK_RED +" Insufficient permissions.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
event.setCancelled(true);
|
||||||
if(mcUsers.getProfile(player).getMySpawn(player) != null){
|
if(mcUsers.getProfile(player).getMySpawn(player) != null){
|
||||||
if(mcLoadProperties.myspawnclearsinventory)
|
if(mcLoadProperties.myspawnclearsinventory)
|
||||||
player.getInventory().clear();
|
player.getInventory().clear();
|
||||||
|
@ -28,22 +28,22 @@ public class mcRepair {
|
|||||||
/*
|
/*
|
||||||
* DIAMOND ARMOR
|
* DIAMOND ARMOR
|
||||||
*/
|
*/
|
||||||
if(isDiamondArmor(is) && hasDiamond(player) && mcUsers.getProfile(player).getRepairInt() >= mcLoadProperties.repairdiamondlevel){
|
if(isDiamondArmor(is) && hasDiamond(player) && mcUsers.getProfile(player).getRepairInt() >= 50){
|
||||||
removeDiamond(player);
|
removeDiamond(player);
|
||||||
player.getItemInHand().setDurability(getArmorRepairAmount(is, player));
|
player.getItemInHand().setDurability(getArmorRepairAmount(is, player));
|
||||||
mcUsers.getProfile(player).addRepairGather(75 * mcLoadProperties.xpGainMultiplier);
|
mcUsers.getProfile(player).addRepairGather(75);
|
||||||
} else if (isIronArmor(is) && hasIron(player)){
|
} else if (isIronArmor(is) && hasIron(player)){
|
||||||
/*
|
/*
|
||||||
* IRON ARMOR
|
* IRON ARMOR
|
||||||
*/
|
*/
|
||||||
removeIron(player);
|
removeIron(player);
|
||||||
player.getItemInHand().setDurability(getArmorRepairAmount(is, player));
|
player.getItemInHand().setDurability(getArmorRepairAmount(is, player));
|
||||||
mcUsers.getProfile(player).addRepairGather(20 * mcLoadProperties.xpGainMultiplier);
|
mcUsers.getProfile(player).addRepairGather(20);
|
||||||
//GOLD ARMOR
|
//GOLD ARMOR
|
||||||
} else if (isGoldArmor(is) && hasGold(player)){
|
} else if (isGoldArmor(is) && hasGold(player)){
|
||||||
removeGold(player);
|
removeGold(player);
|
||||||
player.getItemInHand().setDurability(getArmorRepairAmount(is, player));
|
player.getItemInHand().setDurability(getArmorRepairAmount(is, player));
|
||||||
mcUsers.getProfile(player).addRepairGather(50 * mcLoadProperties.xpGainMultiplier);
|
mcUsers.getProfile(player).addRepairGather(50);
|
||||||
} else {
|
} else {
|
||||||
needMoreVespeneGas(is, player);
|
needMoreVespeneGas(is, player);
|
||||||
}
|
}
|
||||||
@ -58,18 +58,18 @@ public class mcRepair {
|
|||||||
if(isIronTools(is) && hasIron(player)){
|
if(isIronTools(is) && hasIron(player)){
|
||||||
is.setDurability(getToolRepairAmount(is, player));
|
is.setDurability(getToolRepairAmount(is, player));
|
||||||
removeIron(player);
|
removeIron(player);
|
||||||
mcUsers.getProfile(player).addRepairGather(20 * mcLoadProperties.xpGainMultiplier);
|
mcUsers.getProfile(player).addRepairGather(20);
|
||||||
} else if (isDiamondTools(is) && hasDiamond(player) && mcUsers.getProfile(player).getRepairInt() >= mcLoadProperties.repairdiamondlevel){ //Check if its diamond and the player has diamonds
|
} else if (isDiamondTools(is) && hasDiamond(player) && mcUsers.getProfile(player).getRepairInt() >= 50){ //Check if its diamond and the player has diamonds
|
||||||
/*
|
/*
|
||||||
* DIAMOND TOOLS
|
* DIAMOND TOOLS
|
||||||
*/
|
*/
|
||||||
is.setDurability(getToolRepairAmount(is, player));
|
is.setDurability(getToolRepairAmount(is, player));
|
||||||
removeDiamond(player);
|
removeDiamond(player);
|
||||||
mcUsers.getProfile(player).addRepairGather(75 * mcLoadProperties.xpGainMultiplier);
|
mcUsers.getProfile(player).addRepairGather(75);
|
||||||
} else if(isGoldTools(is) && hasGold(player)){
|
} else if(isGoldTools(is) && hasGold(player)){
|
||||||
is.setDurability(getToolRepairAmount(is, player));
|
is.setDurability(getToolRepairAmount(is, player));
|
||||||
removeGold(player);
|
removeGold(player);
|
||||||
mcUsers.getProfile(player).addRepairGather(50 * mcLoadProperties.xpGainMultiplier);
|
mcUsers.getProfile(player).addRepairGather(50);
|
||||||
} else {
|
} else {
|
||||||
needMoreVespeneGas(is, player);
|
needMoreVespeneGas(is, player);
|
||||||
}
|
}
|
||||||
@ -82,7 +82,15 @@ public class mcRepair {
|
|||||||
/*
|
/*
|
||||||
* GIVE SKILL IF THERE IS ENOUGH XP
|
* GIVE SKILL IF THERE IS ENOUGH XP
|
||||||
*/
|
*/
|
||||||
mcSkills.getInstance().XpCheck(player);
|
if(mcUsers.getProfile(player).getRepairGatherInt() >= mcUsers.getProfile(player).getXpToLevel("repair")){
|
||||||
|
int skillups = 0;
|
||||||
|
while(mcUsers.getProfile(player).getRepairGatherInt() >= mcUsers.getProfile(player).getXpToLevel("repair")){
|
||||||
|
skillups++;
|
||||||
|
mcUsers.getProfile(player).removeRepairGather(mcUsers.getProfile(player).getXpToLevel("repair"));
|
||||||
|
mcUsers.getProfile(player).skillUpRepair(1);
|
||||||
|
}
|
||||||
|
player.sendMessage(ChatColor.YELLOW+"Repair skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(player).getRepair()+")");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public boolean isArmor(ItemStack is){
|
public boolean isArmor(ItemStack is){
|
||||||
@ -288,50 +296,38 @@ public class mcRepair {
|
|||||||
switch(is.getTypeId())
|
switch(is.getTypeId())
|
||||||
{
|
{
|
||||||
case 306:
|
case 306:
|
||||||
durability -= 27;
|
durability -= 27;
|
||||||
break;
|
break;
|
||||||
case 310:
|
case 310:
|
||||||
durability -= 55;
|
durability -= 55;
|
||||||
break;
|
break;
|
||||||
case 307:
|
case 307:
|
||||||
durability -= 24;
|
durability -= 24;
|
||||||
break;
|
break;
|
||||||
case 311:
|
case 311:
|
||||||
durability -= 48;
|
durability -= 48;
|
||||||
break;
|
break;
|
||||||
case 308:
|
case 308:
|
||||||
durability -= 27;
|
durability -= 27;
|
||||||
break;
|
break;
|
||||||
case 312:
|
case 312:
|
||||||
durability -= 53;
|
durability -= 53;
|
||||||
break;
|
break;
|
||||||
case 309:
|
case 309:
|
||||||
durability -= 40;
|
durability -= 40;
|
||||||
break;
|
break;
|
||||||
case 313:
|
case 313:
|
||||||
durability -= 80;
|
durability -= 80;
|
||||||
break;
|
break;
|
||||||
case 314:
|
|
||||||
durability -= 13;
|
|
||||||
break;
|
|
||||||
case 315:
|
|
||||||
durability -= 12;
|
|
||||||
break;
|
|
||||||
case 316:
|
|
||||||
durability -= 14;
|
|
||||||
break;
|
|
||||||
case 317:
|
|
||||||
durability -= 20;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
if(durability < 0)
|
if(durability < 0)
|
||||||
durability = 0;
|
durability = 0;
|
||||||
if(checkPlayerProcRepair(player))
|
if(checkPlayerProcRepair(player))
|
||||||
durability = 0;
|
durability = 0;
|
||||||
return durability;
|
return durability;
|
||||||
}
|
}
|
||||||
public void needMoreVespeneGas(ItemStack is, Player player){
|
public void needMoreVespeneGas(ItemStack is, Player player){
|
||||||
if ((isDiamondTools(is) || isDiamondArmor(is)) && mcUsers.getProfile(player).getRepairInt() < mcLoadProperties.repairdiamondlevel){
|
if ((isDiamondTools(is) || isDiamondArmor(is)) && mcUsers.getProfile(player).getRepairInt() < 50){
|
||||||
player.sendMessage(ChatColor.DARK_RED +"You're not adept enough to repair Diamond");
|
player.sendMessage(ChatColor.DARK_RED +"You're not adept enough to repair Diamond");
|
||||||
} else if (isDiamondTools(is) && !hasDiamond(player) || isIronTools(is) && !hasIron(player) || isGoldTools(is) && !hasGold(player)){
|
} else if (isDiamondTools(is) && !hasDiamond(player) || isIronTools(is) && !hasIron(player) || isGoldTools(is) && !hasGold(player)){
|
||||||
if(isDiamondTools(is) && !hasDiamond(player))
|
if(isDiamondTools(is) && !hasDiamond(player))
|
||||||
@ -349,12 +345,27 @@ public class mcRepair {
|
|||||||
player.sendMessage(ChatColor.DARK_RED+"You need more "+ChatColor.GOLD+"Gold");
|
player.sendMessage(ChatColor.DARK_RED+"You need more "+ChatColor.GOLD+"Gold");
|
||||||
}
|
}
|
||||||
public boolean checkPlayerProcRepair(Player player){
|
public boolean checkPlayerProcRepair(Player player){
|
||||||
if(player != null){
|
if(mcUsers.getProfile(player).getRepairInt() >= 750){
|
||||||
if(Math.random() * 1000 <= mcUsers.getProfile(player).getRepairInt()){
|
if(Math.random() * 10 > 2){
|
||||||
|
player.sendMessage(ChatColor.GRAY + "That took no effort.");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} else if (mcUsers.getProfile(player).getRepairInt() >= 450 && mcUsers.getProfile(player).getRepairInt() < 750){
|
||||||
|
if(Math.random() * 10 > 4){
|
||||||
|
player.sendMessage(ChatColor.GRAY + "That felt really easy.");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} else if (mcUsers.getProfile(player).getRepairInt() >= 150 && mcUsers.getProfile(player).getRepairInt() < 450){
|
||||||
|
if(Math.random() * 10 > 6){
|
||||||
|
player.sendMessage(ChatColor.GRAY + "That felt pretty easy.");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} else if (mcUsers.getProfile(player).getRepairInt() >= 50 && mcUsers.getProfile(player).getRepairInt() < 150){
|
||||||
|
if(Math.random() * 10 > 8){
|
||||||
player.sendMessage(ChatColor.GRAY + "That felt easy.");
|
player.sendMessage(ChatColor.GRAY + "That felt easy.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
package com.gmail.nossr50;
|
package com.gmail.nossr50;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
|
||||||
import org.bukkit.block.Block;
|
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
@ -34,440 +32,6 @@ public class mcSkills {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void decreaseCooldowns(Player player){
|
|
||||||
if(mcUsers.getProfile(player).getTreeFellerCooldown() >= 1){
|
|
||||||
mcUsers.getProfile(player).decreaseTreeFellerCooldown();
|
|
||||||
if(mcUsers.getProfile(player).getTreeFellerCooldown() == 0){
|
|
||||||
player.sendMessage(ChatColor.GREEN+"Your "+ChatColor.YELLOW+"Tree Feller "+ChatColor.GREEN+"ability is refreshed!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(mcUsers.getProfile(player).getSuperBreakerCooldown() >= 1){
|
|
||||||
mcUsers.getProfile(player).decreaseSuperBreakerCooldown();
|
|
||||||
if(mcUsers.getProfile(player).getSuperBreakerCooldown() == 0){
|
|
||||||
player.sendMessage(ChatColor.GREEN+"Your "+ChatColor.YELLOW+"Super Breaker "+ChatColor.GREEN+"ability is refreshed!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(mcUsers.getProfile(player).getSerratedStrikesCooldown() >= 1){
|
|
||||||
mcUsers.getProfile(player).decreaseSerratedStrikesCooldown();
|
|
||||||
if(mcUsers.getProfile(player).getSerratedStrikesCooldown() == 0){
|
|
||||||
player.sendMessage(ChatColor.GREEN+"Your "+ChatColor.YELLOW+"Serrated Strikes "+ChatColor.GREEN+"ability is refreshed!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(mcUsers.getProfile(player).getBerserkCooldown() >= 1){
|
|
||||||
mcUsers.getProfile(player).decreaseBerserkCooldown();
|
|
||||||
if(mcUsers.getProfile(player).getBerserkCooldown() == 0){
|
|
||||||
player.sendMessage(ChatColor.GREEN+"Your "+ChatColor.YELLOW+"Berserk "+ChatColor.GREEN+"ability is refreshed!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(mcUsers.getProfile(player).getSkullSplitterCooldown() >= 1){
|
|
||||||
mcUsers.getProfile(player).decreaseSkullSplitterCooldown();
|
|
||||||
if(mcUsers.getProfile(player).getSkullSplitterCooldown() == 0){
|
|
||||||
player.sendMessage(ChatColor.GREEN+"Your "+ChatColor.YELLOW+"Skull Splitter "+ChatColor.GREEN+"ability is refreshed!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(mcUsers.getProfile(player).getGigaDrillBreakerCooldown() >= 1){
|
|
||||||
mcUsers.getProfile(player).decreaseGigaDrillBreakerCooldown();
|
|
||||||
if(mcUsers.getProfile(player).getGigaDrillBreakerCooldown() == 0){
|
|
||||||
player.sendMessage(ChatColor.GREEN+"Your "+ChatColor.YELLOW+"Giga Drill Breaker "+ChatColor.GREEN+"ability is refreshed!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public void abilityActivationCheck(Player player, Block block){
|
|
||||||
if(!mcUsers.getProfile(player).getAbilityUse())
|
|
||||||
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."+ChatColor.YELLOW+" ("
|
|
||||||
+(mcUsers.getProfile(player).getSuperBreakerCooldown() * 2)+"s)");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
player.sendMessage(ChatColor.GREEN+"**YOU READY YOUR PICKAXE**");
|
|
||||||
mcUsers.getProfile(player).setPickaxePreparationTicks(2);
|
|
||||||
mcUsers.getProfile(player).setPickaxePreparationMode(true);
|
|
||||||
}
|
|
||||||
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."
|
|
||||||
+ChatColor.YELLOW+" ("+(mcUsers.getProfile(player).getGigaDrillBreakerCooldown() * 2)+"s)");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
player.sendMessage(ChatColor.GREEN+"**YOU READY YOUR SHOVEL**");
|
|
||||||
mcUsers.getProfile(player).setShovelPreparationTicks(2);
|
|
||||||
mcUsers.getProfile(player).setShovelPreparationMode(true);
|
|
||||||
}
|
|
||||||
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."
|
|
||||||
+ChatColor.YELLOW+" ("+(mcUsers.getProfile(player).getSerratedStrikesCooldown() * 2)+"s)");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
player.sendMessage(ChatColor.GREEN+"**YOU READY YOUR SWORD**");
|
|
||||||
mcUsers.getProfile(player).setSwordsPreparationTicks(2);
|
|
||||||
mcUsers.getProfile(player).setSwordsPreparationMode(true);
|
|
||||||
}
|
|
||||||
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."
|
|
||||||
+ChatColor.YELLOW+" ("+(mcUsers.getProfile(player).getBerserkCooldown() * 2)+"s)");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
player.sendMessage(ChatColor.GREEN+"**YOU READY YOUR FISTS**");
|
|
||||||
mcUsers.getProfile(player).setFistsPreparationTicks(2);
|
|
||||||
mcUsers.getProfile(player).setFistsPreparationMode(true);
|
|
||||||
}
|
|
||||||
if((mcPermissions.getInstance().axes(player) || mcPermissions.getInstance().woodcutting(player)) && !mcUsers.getProfile(player).getAxePreparationMode()){
|
|
||||||
if(mcm.getInstance().isAxes(player.getItemInHand())){
|
|
||||||
player.sendMessage(ChatColor.GREEN+"**YOU READY YOUR AXE**");
|
|
||||||
mcUsers.getProfile(player).setAxePreparationTicks(2);
|
|
||||||
mcUsers.getProfile(player).setAxePreparationMode(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public void serratedStrikesActivationCheck(Player player){
|
|
||||||
if(mcm.getInstance().isSwords(player.getItemInHand())){
|
|
||||||
if(mcUsers.getProfile(player).getSwordsPreparationMode()){
|
|
||||||
mcUsers.getProfile(player).setSwordsPreparationMode(false);
|
|
||||||
mcUsers.getProfile(player).setSwordsPreparationTicks(0);
|
|
||||||
}
|
|
||||||
int ticks = 2;
|
|
||||||
if(mcUsers.getProfile(player).getSwordsInt() >= 50)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getSwordsInt() >= 150)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getSwordsInt() >= 250)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getSwordsInt() >= 350)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getSwordsInt() >= 450)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getSwordsInt() >= 550)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getSwordsInt() >= 650)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getSwordsInt() >= 750)
|
|
||||||
ticks++;
|
|
||||||
|
|
||||||
if(!mcUsers.getProfile(player).getSerratedStrikesMode() && mcUsers.getProfile(player).getSerratedStrikesCooldown() == 0){
|
|
||||||
player.sendMessage(ChatColor.GREEN+"**SERRATED STRIKES ACTIVATED**");
|
|
||||||
mcUsers.getProfile(player).setSerratedStrikesTicks(ticks);
|
|
||||||
mcUsers.getProfile(player).setSerratedStrikesMode(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public void berserkActivationCheck(Player player){
|
|
||||||
if(player.getItemInHand().getTypeId() == 0){
|
|
||||||
if(mcUsers.getProfile(player).getFistsPreparationMode()){
|
|
||||||
mcUsers.getProfile(player).setFistsPreparationMode(false);
|
|
||||||
mcUsers.getProfile(player).setFistsPreparationTicks(0);
|
|
||||||
}
|
|
||||||
int ticks = 2;
|
|
||||||
if(mcUsers.getProfile(player).getUnarmedInt() >= 50)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getUnarmedInt() >= 150)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getUnarmedInt() >= 250)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getUnarmedInt() >= 350)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getUnarmedInt() >= 450)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getUnarmedInt() >= 550)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getUnarmedInt() >= 650)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getUnarmedInt() >= 750)
|
|
||||||
ticks++;
|
|
||||||
|
|
||||||
if(!mcUsers.getProfile(player).getBerserkMode() && mcUsers.getProfile(player).getBerserkCooldown() == 0){
|
|
||||||
player.sendMessage(ChatColor.GREEN+"**BERSERK ACTIVATED**");
|
|
||||||
mcUsers.getProfile(player).setBerserkTicks(ticks);
|
|
||||||
mcUsers.getProfile(player).setBerserkMode(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public void skullSplitterCheck(Player player){
|
|
||||||
if(mcm.getInstance().isAxes(player.getItemInHand())){
|
|
||||||
/*
|
|
||||||
* CHECK FOR AXE PREP MODE
|
|
||||||
*/
|
|
||||||
if(mcUsers.getProfile(player).getAxePreparationMode()){
|
|
||||||
mcUsers.getProfile(player).setAxePreparationMode(false);
|
|
||||||
mcUsers.getProfile(player).setAxePreparationTicks(0);
|
|
||||||
}
|
|
||||||
int ticks = 2;
|
|
||||||
if(mcUsers.getProfile(player).getAxesInt() >= 50)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getAxesInt() >= 150)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getAxesInt() >= 250)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getAxesInt() >= 350)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getAxesInt() >= 450)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getAxesInt() >= 550)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getAxesInt() >= 650)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getAxesInt() >= 750)
|
|
||||||
ticks++;
|
|
||||||
|
|
||||||
if(!mcUsers.getProfile(player).getSkullSplitterMode() && mcUsers.getProfile(player).getSkullSplitterCooldown() == 0){
|
|
||||||
player.sendMessage(ChatColor.GREEN+"**SKULL SPLITTER ACTIVATED**");
|
|
||||||
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){
|
|
||||||
/*
|
|
||||||
* AXE PREPARATION MODE
|
|
||||||
*/
|
|
||||||
if(mcUsers.getProfile(player) == null)
|
|
||||||
mcUsers.addUser(player);
|
|
||||||
if(mcUsers.getProfile(player).getAxePreparationMode()){
|
|
||||||
mcUsers.getProfile(player).decreaseAxePreparationTicks();
|
|
||||||
if(mcUsers.getProfile(player).getAxePreparationTicks() <= 0){
|
|
||||||
mcUsers.getProfile(player).setAxePreparationMode(false);
|
|
||||||
player.sendMessage(ChatColor.GRAY+"**YOU LOWER YOUR AXE**");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(mcUsers.getProfile(player).getPickaxePreparationMode()){
|
|
||||||
mcUsers.getProfile(player).decreasePickaxePreparationTicks();
|
|
||||||
if(mcUsers.getProfile(player).getPickaxePreparationTicks() <= 0){
|
|
||||||
mcUsers.getProfile(player).setPickaxePreparationMode(false);
|
|
||||||
player.sendMessage(ChatColor.GRAY+"**YOU LOWER YOUR PICKAXE**");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(mcUsers.getProfile(player).getSwordsPreparationMode()){
|
|
||||||
mcUsers.getProfile(player).decreaseSwordsPreparationTicks();
|
|
||||||
if(mcUsers.getProfile(player).getSwordsPreparationTicks() <= 0){
|
|
||||||
mcUsers.getProfile(player).setSwordsPreparationMode(false);
|
|
||||||
player.sendMessage(ChatColor.GRAY+"**YOU LOWER YOUR SWORD**");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(mcUsers.getProfile(player).getFistsPreparationMode()){
|
|
||||||
mcUsers.getProfile(player).decreaseFistsPreparationTicks();
|
|
||||||
if(mcUsers.getProfile(player).getFistsPreparationTicks() <= 0){
|
|
||||||
mcUsers.getProfile(player).setFistsPreparationMode(false);
|
|
||||||
player.sendMessage(ChatColor.GRAY+"**YOU LOWER YOUR FISTS**");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(mcUsers.getProfile(player).getShovelPreparationMode()){
|
|
||||||
mcUsers.getProfile(player).decreaseShovelPreparationTicks();
|
|
||||||
if(mcUsers.getProfile(player).getShovelPreparationTicks() <= 0){
|
|
||||||
mcUsers.getProfile(player).setShovelPreparationMode(false);
|
|
||||||
player.sendMessage(ChatColor.GRAY+"**YOU LOWER YOUR SHOVEL**");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* AXES ABILITY
|
|
||||||
*/
|
|
||||||
if(mcPermissions.getInstance().axesAbility(player)){
|
|
||||||
//Monitor the length of Skull Splitter mode
|
|
||||||
if(mcUsers.getProfile(player).getSkullSplitterMode()){
|
|
||||||
mcUsers.getProfile(player).decreaseSkullSplitterTicks();
|
|
||||||
if(mcUsers.getProfile(player).getSkullSplitterTicks() <= 0){
|
|
||||||
mcUsers.getProfile(player).setSkullSplitterMode(false);
|
|
||||||
mcUsers.getProfile(player).setSkullSplitterCooldown(mcLoadProperties.skullSplitterCooldown);
|
|
||||||
player.sendMessage(ChatColor.RED+"**Skull Splitter has worn off**");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* WOODCUTTING ABILITY
|
|
||||||
*/
|
|
||||||
if(mcPermissions.getInstance().woodCuttingAbility(player)){
|
|
||||||
if(mcUsers.getProfile(player).getTreeFellerMode()){
|
|
||||||
mcUsers.getProfile(player).decreaseTreeFellerTicks();
|
|
||||||
if(mcUsers.getProfile(player).getTreeFellerTicks() <= 0){
|
|
||||||
mcUsers.getProfile(player).setTreeFellerMode(false);
|
|
||||||
mcUsers.getProfile(player).setTreeFellerCooldown(mcLoadProperties.treeFellerCooldown);
|
|
||||||
player.sendMessage(ChatColor.RED+"**Tree Feller has worn off**");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* MINING ABILITY
|
|
||||||
*/
|
|
||||||
if(mcPermissions.getInstance().miningAbility(player)){
|
|
||||||
if(mcUsers.getProfile(player).getSuperBreakerMode()){
|
|
||||||
mcUsers.getProfile(player).decreaseSuperBreakerTicks();
|
|
||||||
if(mcUsers.getProfile(player).getSuperBreakerTicks() <= 0){
|
|
||||||
mcUsers.getProfile(player).setSuperBreakerMode(false);
|
|
||||||
mcUsers.getProfile(player).setSuperBreakerCooldown(mcLoadProperties.superBreakerCooldown);
|
|
||||||
player.sendMessage(ChatColor.RED+"**Super Breaker has worn off**");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* EXCAVATION ABILITY
|
|
||||||
*/
|
|
||||||
if(mcPermissions.getInstance().excavationAbility(player)){
|
|
||||||
if(mcUsers.getProfile(player).getGigaDrillBreakerMode()){
|
|
||||||
mcUsers.getProfile(player).decreaseGigaDrillBreakerTicks();
|
|
||||||
if(mcUsers.getProfile(player).getGigaDrillBreakerTicks() <= 0){
|
|
||||||
mcUsers.getProfile(player).setGigaDrillBreakerMode(false);
|
|
||||||
mcUsers.getProfile(player).setGigaDrillBreakerCooldown(mcLoadProperties.gigaDrillBreakerCooldown);
|
|
||||||
player.sendMessage(ChatColor.RED+"**You feel spiral energy leaving you**");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* SWORDS ABILITY
|
|
||||||
*/
|
|
||||||
if(mcPermissions.getInstance().swordsAbility(player)){
|
|
||||||
if(mcUsers.getProfile(player).getSerratedStrikesMode()){
|
|
||||||
mcUsers.getProfile(player).decreaseSerratedStrikesTicks();
|
|
||||||
if(mcUsers.getProfile(player).getSerratedStrikesTicks() <= 0){
|
|
||||||
mcUsers.getProfile(player).setSerratedStrikesMode(false);
|
|
||||||
mcUsers.getProfile(player).setSerratedStrikesCooldown(mcLoadProperties.serratedStrikeCooldown);
|
|
||||||
player.sendMessage(ChatColor.RED+"**Serrated Strikes has worn off**");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* UNARMED ABILITY
|
|
||||||
*/
|
|
||||||
if(mcPermissions.getInstance().unarmedAbility(player)){
|
|
||||||
if(mcUsers.getProfile(player).getBerserkMode()){
|
|
||||||
mcUsers.getProfile(player).decreaseBerserkTicks();
|
|
||||||
if(mcUsers.getProfile(player).getBerserkTicks() <= 0){
|
|
||||||
mcUsers.getProfile(player).setBerserkMode(false);
|
|
||||||
mcUsers.getProfile(player).setBerserkCooldown(mcLoadProperties.berserkCooldown);
|
|
||||||
player.sendMessage(ChatColor.RED+"**Berserk has worn off**");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public void XpCheck(Player player){
|
|
||||||
/*
|
|
||||||
* ACROBATICS
|
|
||||||
*/
|
|
||||||
if(player != null && mcUsers.getProfile(player).getAcrobaticsGatherInt() >= mcUsers.getProfile(player).getXpToLevel("acrobatics")){
|
|
||||||
int skillups = 0;
|
|
||||||
while(mcUsers.getProfile(player).getAcrobaticsGatherInt() >= mcUsers.getProfile(player).getXpToLevel("acrobatics")){
|
|
||||||
skillups++;
|
|
||||||
mcUsers.getProfile(player).removeAcrobaticsGather(mcUsers.getProfile(player).getXpToLevel("acrobatics"));
|
|
||||||
mcUsers.getProfile(player).skillUpAcrobatics(1);
|
|
||||||
}
|
|
||||||
player.sendMessage(ChatColor.YELLOW+"Acrobatics skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(player).getAcrobatics()+")");
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* ARCHERY
|
|
||||||
*/
|
|
||||||
if(mcUsers.getProfile(player).getArcheryGatherInt() >= mcUsers.getProfile(player).getXpToLevel("archery")){
|
|
||||||
int skillups = 0;
|
|
||||||
while(mcUsers.getProfile(player).getArcheryGatherInt() >= mcUsers.getProfile(player).getXpToLevel("archery")){
|
|
||||||
skillups++;
|
|
||||||
mcUsers.getProfile(player).removeArcheryGather(mcUsers.getProfile(player).getXpToLevel("archery"));
|
|
||||||
mcUsers.getProfile(player).skillUpArchery(1);
|
|
||||||
}
|
|
||||||
player.sendMessage(ChatColor.YELLOW+"Archery skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(player).getArchery()+")");
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* SWORDS
|
|
||||||
*/
|
|
||||||
if(mcUsers.getProfile(player).getSwordsGatherInt() >= mcUsers.getProfile(player).getXpToLevel("swords")){
|
|
||||||
int skillups = 0;
|
|
||||||
while(mcUsers.getProfile(player).getSwordsGatherInt() >= mcUsers.getProfile(player).getXpToLevel("swords")){
|
|
||||||
skillups++;
|
|
||||||
mcUsers.getProfile(player).removeSwordsGather(mcUsers.getProfile(player).getXpToLevel("swords"));
|
|
||||||
mcUsers.getProfile(player).skillUpSwords(1);
|
|
||||||
}
|
|
||||||
player.sendMessage(ChatColor.YELLOW+"Swords skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(player).getSwords()+")");
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* AXES
|
|
||||||
*/
|
|
||||||
if(mcUsers.getProfile(player).getAxesGatherInt() >= mcUsers.getProfile(player).getXpToLevel("axes")){
|
|
||||||
int skillups = 0;
|
|
||||||
while(mcUsers.getProfile(player).getAxesGatherInt() >= mcUsers.getProfile(player).getXpToLevel("axes")){
|
|
||||||
skillups++;
|
|
||||||
mcUsers.getProfile(player).removeAxesGather(mcUsers.getProfile(player).getXpToLevel("axes"));
|
|
||||||
mcUsers.getProfile(player).skillUpAxes(1);
|
|
||||||
}
|
|
||||||
player.sendMessage(ChatColor.YELLOW+"Axes skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(player).getAxes()+")");
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* UNARMED
|
|
||||||
*/
|
|
||||||
if(mcUsers.getProfile(player).getUnarmedGatherInt() >= mcUsers.getProfile(player).getXpToLevel("unarmed")){
|
|
||||||
int skillups = 0;
|
|
||||||
while(mcUsers.getProfile(player).getUnarmedGatherInt() >= mcUsers.getProfile(player).getXpToLevel("unarmed")){
|
|
||||||
skillups++;
|
|
||||||
mcUsers.getProfile(player).removeUnarmedGather(mcUsers.getProfile(player).getXpToLevel("unarmed"));
|
|
||||||
mcUsers.getProfile(player).skillUpUnarmed(1);
|
|
||||||
}
|
|
||||||
player.sendMessage(ChatColor.YELLOW+"Unarmed skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(player).getUnarmed()+")");
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* HERBALISM
|
|
||||||
*/
|
|
||||||
if(mcUsers.getProfile(player).getHerbalismGatherInt() >= mcUsers.getProfile(player).getXpToLevel("herbalism")){
|
|
||||||
int skillups = 0;
|
|
||||||
while(mcUsers.getProfile(player).getHerbalismGatherInt() >= mcUsers.getProfile(player).getXpToLevel("herbalism")){
|
|
||||||
skillups++;
|
|
||||||
mcUsers.getProfile(player).removeHerbalismGather(mcUsers.getProfile(player).getXpToLevel("herbalism"));
|
|
||||||
mcUsers.getProfile(player).skillUpHerbalism(1);
|
|
||||||
}
|
|
||||||
player.sendMessage(ChatColor.YELLOW+"Herbalism skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(player).getHerbalism()+")");
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* MINING
|
|
||||||
*/
|
|
||||||
if(player != null && mcUsers.getProfile(player).getMiningGatherInt() >= mcUsers.getProfile(player).getXpToLevel("mining")){
|
|
||||||
int skillups = 0;
|
|
||||||
while(mcUsers.getProfile(player).getMiningGatherInt() >= mcUsers.getProfile(player).getXpToLevel("mining")){
|
|
||||||
skillups++;
|
|
||||||
mcUsers.getProfile(player).removeMiningGather(mcUsers.getProfile(player).getXpToLevel("mining"));
|
|
||||||
mcUsers.getProfile(player).skillUpMining(1);
|
|
||||||
}
|
|
||||||
player.sendMessage(ChatColor.YELLOW+"Mining skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(player).getMining()+")");
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* WOODCUTTING
|
|
||||||
*/
|
|
||||||
if(player != null && mcUsers.getProfile(player).getWoodCuttingGatherInt() >= mcUsers.getProfile(player).getXpToLevel("woodcutting")){
|
|
||||||
int skillups = 0;
|
|
||||||
while(mcUsers.getProfile(player).getWoodCuttingGatherInt() >= mcUsers.getProfile(player).getXpToLevel("woodcutting")){
|
|
||||||
skillups++;
|
|
||||||
mcUsers.getProfile(player).removeWoodCuttingGather(mcUsers.getProfile(player).getXpToLevel("woodcutting"));
|
|
||||||
mcUsers.getProfile(player).skillUpWoodCutting(1);
|
|
||||||
}
|
|
||||||
player.sendMessage(ChatColor.YELLOW+"WoodCutting skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(player).getWoodCutting()+")");
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* REPAIR
|
|
||||||
*/
|
|
||||||
if(mcUsers.getProfile(player).getRepairGatherInt() >= mcUsers.getProfile(player).getXpToLevel("repair")){
|
|
||||||
int skillups = 0;
|
|
||||||
while(mcUsers.getProfile(player).getRepairGatherInt() >= mcUsers.getProfile(player).getXpToLevel("repair")){
|
|
||||||
skillups++;
|
|
||||||
mcUsers.getProfile(player).removeRepairGather(mcUsers.getProfile(player).getXpToLevel("repair"));
|
|
||||||
mcUsers.getProfile(player).skillUpRepair(1);
|
|
||||||
}
|
|
||||||
player.sendMessage(ChatColor.YELLOW+"Repair skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(player).getRepair()+")");
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* EXCAVATION
|
|
||||||
*/
|
|
||||||
if(mcUsers.getProfile(player).getExcavationGatherInt() >= mcUsers.getProfile(player).getXpToLevel("excavation")){
|
|
||||||
int skillups = 0;
|
|
||||||
while(mcUsers.getProfile(player).getExcavationGatherInt() >= mcUsers.getProfile(player).getXpToLevel("excavation")){
|
|
||||||
skillups++;
|
|
||||||
mcUsers.getProfile(player).removeExcavationGather(mcUsers.getProfile(player).getXpToLevel("excavation"));
|
|
||||||
mcUsers.getProfile(player).skillUpExcavation(1);
|
|
||||||
}
|
|
||||||
player.sendMessage(ChatColor.YELLOW+"Excavation skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(player).getExcavation()+")");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public boolean isSkill(String skillname){
|
public boolean isSkill(String skillname){
|
||||||
if(skillname.equals("mining")){
|
if(skillname.equals("mining")){
|
||||||
return true;
|
return true;
|
||||||
@ -511,6 +75,5 @@ public class mcSkills {
|
|||||||
x++;
|
x++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mcConfig.getInstance().removeArrowTracked(entity);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
package com.gmail.nossr50;
|
package com.gmail.nossr50;
|
||||||
import java.awt.Color;
|
|
||||||
import java.util.TimerTask;
|
import java.util.TimerTask;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
|
||||||
import org.bukkit.entity.*;
|
import org.bukkit.entity.*;
|
||||||
|
|
||||||
public class mcTimer extends TimerTask{
|
public class mcTimer extends TimerTask{
|
||||||
@ -15,59 +13,50 @@ public class mcTimer extends TimerTask{
|
|||||||
|
|
||||||
public void run() {
|
public void run() {
|
||||||
Player[] playerlist = plugin.getServer().getOnlinePlayers();
|
Player[] playerlist = plugin.getServer().getOnlinePlayers();
|
||||||
|
if(thecount == 5 || thecount == 10 || thecount == 15 || thecount == 20){
|
||||||
|
for(Player player : playerlist){
|
||||||
|
if(player != null &&
|
||||||
|
player.getHealth() > 0 && player.getHealth() < 20
|
||||||
|
&& mcUsers.getProfile(player).getPowerLevel() >= 1000
|
||||||
|
&& mcUsers.getProfile(player).getRecentlyHurt() == 0
|
||||||
|
&& mcPermissions.getInstance().regeneration(player)){
|
||||||
|
player.setHealth(mcm.getInstance().calculateHealth(player.getHealth(), 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(thecount == 10 || thecount == 20){
|
||||||
|
for(Player player : playerlist){
|
||||||
|
if(player != null &&
|
||||||
|
player.getHealth() > 0 && player.getHealth() < 20
|
||||||
|
&& mcUsers.getProfile(player).getPowerLevel() >= 500
|
||||||
|
&& mcUsers.getProfile(player).getPowerLevel() < 1000
|
||||||
|
&& mcUsers.getProfile(player).getRecentlyHurt() == 0
|
||||||
|
&& mcPermissions.getInstance().regeneration(player)){
|
||||||
|
player.setHealth(mcm.getInstance().calculateHealth(player.getHealth(), 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(thecount == 20){
|
||||||
|
for(Player player : playerlist){
|
||||||
|
if(player != null &&
|
||||||
|
player.getHealth() > 0 && player.getHealth() < 20
|
||||||
|
&& mcUsers.getProfile(player).getPowerLevel() < 500
|
||||||
|
&& mcUsers.getProfile(player).getRecentlyHurt() == 0
|
||||||
|
&& mcPermissions.getInstance().regeneration(player)){
|
||||||
|
player.setHealth(mcm.getInstance().calculateHealth(player.getHealth(), 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
for(Player player : playerlist){
|
for(Player player : playerlist){
|
||||||
if(player == null)
|
if(player != null && mcUsers.getProfile(player).getRecentlyHurt() >= 1){
|
||||||
continue;
|
mcUsers.getProfile(player).decreaseLastHurt();
|
||||||
if(mcUsers.getProfile(player) == null)
|
|
||||||
mcUsers.addUser(player);
|
|
||||||
/*
|
|
||||||
* MONITOR SKILLS
|
|
||||||
*/
|
|
||||||
mcSkills.getInstance().monitorSkills(player);
|
|
||||||
/*
|
|
||||||
* COOLDOWN MONITORING
|
|
||||||
*/
|
|
||||||
mcSkills.getInstance().decreaseCooldowns(player);
|
|
||||||
|
|
||||||
if(mcPermissions.getInstance().regeneration(player)){
|
|
||||||
if(thecount == 5 || thecount == 10 || thecount == 15 || thecount == 20){
|
|
||||||
if(player != null &&
|
|
||||||
player.getHealth() > 0 && player.getHealth() < 20
|
|
||||||
&& mcUsers.getProfile(player).getPowerLevel() >= 1000
|
|
||||||
&& mcUsers.getProfile(player).getRecentlyHurt() == 0){
|
|
||||||
player.setHealth(mcm.getInstance().calculateHealth(player.getHealth(), 1));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(thecount == 10 || thecount == 20){
|
|
||||||
if(player != null &&
|
|
||||||
player.getHealth() > 0 && player.getHealth() < 20
|
|
||||||
&& mcUsers.getProfile(player).getPowerLevel() >= 500
|
|
||||||
&& mcUsers.getProfile(player).getPowerLevel() < 1000
|
|
||||||
&& mcUsers.getProfile(player).getRecentlyHurt() == 0){
|
|
||||||
player.setHealth(mcm.getInstance().calculateHealth(player.getHealth(), 1));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(thecount == 20){
|
|
||||||
if(player != null &&
|
|
||||||
player.getHealth() > 0 && player.getHealth() < 20
|
|
||||||
&& mcUsers.getProfile(player).getPowerLevel() < 500
|
|
||||||
&& mcUsers.getProfile(player).getRecentlyHurt() == 0){
|
|
||||||
player.setHealth(mcm.getInstance().calculateHealth(player.getHealth(), 1));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(player != null && mcUsers.getProfile(player).getRecentlyHurt() >= 1){
|
|
||||||
mcUsers.getProfile(player).decreaseLastHurt();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(thecount < 20){
|
if(thecount < 20){
|
||||||
thecount++;
|
thecount++;
|
||||||
} else {
|
} else {
|
||||||
thecount = 1;
|
thecount = 1;
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
* BLEED MONITORING
|
|
||||||
*/
|
|
||||||
mcCombat.getInstance().bleedSimulate();
|
mcCombat.getInstance().bleedSimulate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ import org.bukkit.plugin.Plugin;
|
|||||||
public class mcUsers {
|
public class mcUsers {
|
||||||
private static volatile mcUsers instance;
|
private static volatile mcUsers instance;
|
||||||
protected static final Logger log = Logger.getLogger("Minecraft");
|
protected static final Logger log = Logger.getLogger("Minecraft");
|
||||||
String location = "plugins/mcMMO/mcmmo.users";
|
String location = "mcmmo.users";
|
||||||
public static PlayerList players = new PlayerList();
|
public static PlayerList players = new PlayerList();
|
||||||
private Properties properties = new Properties();
|
private Properties properties = new Properties();
|
||||||
|
|
||||||
@ -156,14 +156,12 @@ class PlayerList
|
|||||||
protected final Logger log = Logger.getLogger("Minecraft");
|
protected final Logger log = Logger.getLogger("Minecraft");
|
||||||
private String playerName, gather, wgather, woodcutting, repair, mining, party, myspawn, myspawnworld, unarmed, herbalism, excavation,
|
private String playerName, gather, wgather, woodcutting, repair, mining, party, myspawn, myspawnworld, unarmed, herbalism, excavation,
|
||||||
archery, swords, axes, invite, acrobatics, repairgather, unarmedgather, herbalismgather, excavationgather, archerygather, swordsgather, axesgather, acrobaticsgather;
|
archery, swords, axes, invite, acrobatics, repairgather, unarmedgather, herbalismgather, excavationgather, archerygather, swordsgather, axesgather, acrobaticsgather;
|
||||||
private boolean dead, abilityuse = true, treeFellerMode, superBreakerMode, gigaDrillBreakerMode, serratedStrikesMode, shovelPreparationMode, swordsPreparationMode, fistsPreparationMode, pickaxePreparationMode, axePreparationMode, skullSplitterMode, berserkMode;
|
private boolean dead;
|
||||||
private int recentlyhurt = 0, bleedticks = 0, gigaDrillBreakerCooldown = 0, gigaDrillBreakerTicks = 0, berserkTicks = 0, berserkCooldown = 0, superBreakerTicks = 0, superBreakerCooldown = 0,
|
private int recentlyhurt = 0, bleedticks = 0;
|
||||||
serratedStrikesTicks = 0, skullSplitterTicks = 0, skullSplitterCooldown = 0, serratedStrikesCooldown = 0, treeFellerTicks = 0, treeFellerCooldown = 0,
|
|
||||||
axePreparationTicks = 0, pickaxePreparationTicks = 0, fistsPreparationTicks = 0, shovelPreparationTicks = 0, swordsPreparationTicks = 0;
|
|
||||||
Player thisplayer;
|
Player thisplayer;
|
||||||
char defaultColor;
|
char defaultColor;
|
||||||
|
|
||||||
String location = "plugins/mcMMO/mcmmo.users";
|
String location = "mcmmo.users";
|
||||||
|
|
||||||
|
|
||||||
//=====================================================================
|
//=====================================================================
|
||||||
@ -208,7 +206,7 @@ class PlayerList
|
|||||||
//gather = "0";
|
//gather = "0";
|
||||||
party = null;
|
party = null;
|
||||||
dead = false;
|
dead = false;
|
||||||
treeFellerMode = false;
|
|
||||||
//Try to load the player and if they aren't found, append them
|
//Try to load the player and if they aren't found, append them
|
||||||
if(!load())
|
if(!load())
|
||||||
addPlayer();
|
addPlayer();
|
||||||
@ -419,16 +417,6 @@ class PlayerList
|
|||||||
{
|
{
|
||||||
return player.getName().equals(playerName);
|
return player.getName().equals(playerName);
|
||||||
}
|
}
|
||||||
public boolean getAbilityUse(){
|
|
||||||
return abilityuse;
|
|
||||||
}
|
|
||||||
public void toggleAbilityUse(){
|
|
||||||
if(abilityuse == false){
|
|
||||||
abilityuse = true;
|
|
||||||
} else {
|
|
||||||
abilityuse = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public void decreaseLastHurt(){
|
public void decreaseLastHurt(){
|
||||||
if(recentlyhurt >= 1){
|
if(recentlyhurt >= 1){
|
||||||
recentlyhurt--;
|
recentlyhurt--;
|
||||||
@ -445,300 +433,6 @@ class PlayerList
|
|||||||
public void setBleedTicks(Integer newvalue){
|
public void setBleedTicks(Integer newvalue){
|
||||||
bleedticks = newvalue;
|
bleedticks = newvalue;
|
||||||
}
|
}
|
||||||
public Boolean hasCooldowns(){
|
|
||||||
if((treeFellerCooldown + superBreakerCooldown) >= 1){
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* SWORDS PREPARATION
|
|
||||||
*/
|
|
||||||
public boolean getSwordsPreparationMode(){
|
|
||||||
return swordsPreparationMode;
|
|
||||||
}
|
|
||||||
public void setSwordsPreparationMode(Boolean bool){
|
|
||||||
swordsPreparationMode = bool;
|
|
||||||
}
|
|
||||||
public Integer getSwordsPreparationTicks(){
|
|
||||||
return swordsPreparationTicks;
|
|
||||||
}
|
|
||||||
public void setSwordsPreparationTicks(Integer newvalue){
|
|
||||||
swordsPreparationTicks = newvalue;
|
|
||||||
}
|
|
||||||
public void decreaseSwordsPreparationTicks(){
|
|
||||||
if(swordsPreparationTicks >= 1){
|
|
||||||
swordsPreparationTicks--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* SHOVEL PREPARATION
|
|
||||||
*/
|
|
||||||
public boolean getShovelPreparationMode(){
|
|
||||||
return shovelPreparationMode;
|
|
||||||
}
|
|
||||||
public void setShovelPreparationMode(Boolean bool){
|
|
||||||
shovelPreparationMode = bool;
|
|
||||||
}
|
|
||||||
public Integer getShovelPreparationTicks(){
|
|
||||||
return shovelPreparationTicks;
|
|
||||||
}
|
|
||||||
public void setShovelPreparationTicks(Integer newvalue){
|
|
||||||
shovelPreparationTicks = newvalue;
|
|
||||||
}
|
|
||||||
public void decreaseShovelPreparationTicks(){
|
|
||||||
if(shovelPreparationTicks >= 1){
|
|
||||||
shovelPreparationTicks--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* FISTS PREPARATION
|
|
||||||
*/
|
|
||||||
public boolean getFistsPreparationMode(){
|
|
||||||
return fistsPreparationMode;
|
|
||||||
}
|
|
||||||
public void setFistsPreparationMode(Boolean bool){
|
|
||||||
fistsPreparationMode = bool;
|
|
||||||
}
|
|
||||||
public Integer getFistsPreparationTicks(){
|
|
||||||
return fistsPreparationTicks;
|
|
||||||
}
|
|
||||||
public void setFistsPreparationTicks(Integer newvalue){
|
|
||||||
fistsPreparationTicks = newvalue;
|
|
||||||
}
|
|
||||||
public void decreaseFistsPreparationTicks(){
|
|
||||||
if(fistsPreparationTicks >= 1){
|
|
||||||
fistsPreparationTicks--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* AXE PREPARATION
|
|
||||||
*/
|
|
||||||
public boolean getAxePreparationMode(){
|
|
||||||
return axePreparationMode;
|
|
||||||
}
|
|
||||||
public void setAxePreparationMode(Boolean bool){
|
|
||||||
axePreparationMode = bool;
|
|
||||||
}
|
|
||||||
public Integer getAxePreparationTicks(){
|
|
||||||
return axePreparationTicks;
|
|
||||||
}
|
|
||||||
public void setAxePreparationTicks(Integer newvalue){
|
|
||||||
axePreparationTicks = newvalue;
|
|
||||||
}
|
|
||||||
public void decreaseAxePreparationTicks(){
|
|
||||||
if(axePreparationTicks >= 1){
|
|
||||||
axePreparationTicks--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* PICKAXE PREPARATION
|
|
||||||
*/
|
|
||||||
public boolean getPickaxePreparationMode(){
|
|
||||||
return pickaxePreparationMode;
|
|
||||||
}
|
|
||||||
public void setPickaxePreparationMode(Boolean bool){
|
|
||||||
pickaxePreparationMode = bool;
|
|
||||||
}
|
|
||||||
public Integer getPickaxePreparationTicks(){
|
|
||||||
return pickaxePreparationTicks;
|
|
||||||
}
|
|
||||||
public void setPickaxePreparationTicks(Integer newvalue){
|
|
||||||
pickaxePreparationTicks = newvalue;
|
|
||||||
}
|
|
||||||
public void decreasePickaxePreparationTicks(){
|
|
||||||
if(pickaxePreparationTicks >= 1){
|
|
||||||
pickaxePreparationTicks--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* BERSERK MODE
|
|
||||||
*/
|
|
||||||
public boolean getBerserkMode(){
|
|
||||||
return berserkMode;
|
|
||||||
}
|
|
||||||
public void setBerserkMode(Boolean bool){
|
|
||||||
berserkMode = bool;
|
|
||||||
}
|
|
||||||
public Integer getBerserkTicks(){
|
|
||||||
return berserkTicks;
|
|
||||||
}
|
|
||||||
public void setBerserkTicks(Integer newvalue){
|
|
||||||
berserkTicks = newvalue;
|
|
||||||
}
|
|
||||||
public void decreaseBerserkTicks(){
|
|
||||||
if(berserkTicks >= 1){
|
|
||||||
berserkTicks--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public void setBerserkCooldown(Integer newvalue){
|
|
||||||
berserkCooldown = newvalue;
|
|
||||||
}
|
|
||||||
public int getBerserkCooldown(){
|
|
||||||
return berserkCooldown;
|
|
||||||
}
|
|
||||||
public void decreaseBerserkCooldown(){
|
|
||||||
if(berserkCooldown >= 1){
|
|
||||||
berserkCooldown--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* SKULL SPLITTER
|
|
||||||
*/
|
|
||||||
public boolean getSkullSplitterMode(){
|
|
||||||
return skullSplitterMode;
|
|
||||||
}
|
|
||||||
public void setSkullSplitterMode(Boolean bool){
|
|
||||||
skullSplitterMode = bool;
|
|
||||||
}
|
|
||||||
public Integer getSkullSplitterTicks(){
|
|
||||||
return skullSplitterTicks;
|
|
||||||
}
|
|
||||||
public void setSkullSplitterTicks(Integer newvalue){
|
|
||||||
skullSplitterTicks = newvalue;
|
|
||||||
}
|
|
||||||
public void decreaseSkullSplitterTicks(){
|
|
||||||
if(skullSplitterTicks >= 1){
|
|
||||||
skullSplitterTicks--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public void setSkullSplitterCooldown(Integer newvalue){
|
|
||||||
skullSplitterCooldown = newvalue;
|
|
||||||
}
|
|
||||||
public int getSkullSplitterCooldown(){
|
|
||||||
return skullSplitterCooldown;
|
|
||||||
}
|
|
||||||
public void decreaseSkullSplitterCooldown(){
|
|
||||||
if(skullSplitterCooldown >= 1){
|
|
||||||
skullSplitterCooldown--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* SERRATED STRIKES
|
|
||||||
*/
|
|
||||||
public boolean getSerratedStrikesMode(){
|
|
||||||
return serratedStrikesMode;
|
|
||||||
}
|
|
||||||
public void setSerratedStrikesMode(Boolean bool){
|
|
||||||
serratedStrikesMode = bool;
|
|
||||||
}
|
|
||||||
public Integer getSerratedStrikesTicks(){
|
|
||||||
return serratedStrikesTicks;
|
|
||||||
}
|
|
||||||
public void setSerratedStrikesTicks(Integer newvalue){
|
|
||||||
serratedStrikesTicks = newvalue;
|
|
||||||
}
|
|
||||||
public void decreaseSerratedStrikesTicks(){
|
|
||||||
if(serratedStrikesTicks >= 1){
|
|
||||||
serratedStrikesTicks--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public void setSerratedStrikesCooldown(Integer newvalue){
|
|
||||||
serratedStrikesCooldown = newvalue;
|
|
||||||
}
|
|
||||||
public int getSerratedStrikesCooldown(){
|
|
||||||
return serratedStrikesCooldown;
|
|
||||||
}
|
|
||||||
public void decreaseSerratedStrikesCooldown(){
|
|
||||||
if(serratedStrikesCooldown >= 1){
|
|
||||||
serratedStrikesCooldown--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* GIGA DRILL BREAKER
|
|
||||||
*/
|
|
||||||
public boolean getGigaDrillBreakerMode(){
|
|
||||||
return gigaDrillBreakerMode;
|
|
||||||
}
|
|
||||||
public void setGigaDrillBreakerMode(Boolean bool){
|
|
||||||
gigaDrillBreakerMode = bool;
|
|
||||||
}
|
|
||||||
public Integer getGigaDrillBreakerTicks(){
|
|
||||||
return gigaDrillBreakerTicks;
|
|
||||||
}
|
|
||||||
public void setGigaDrillBreakerTicks(Integer newvalue){
|
|
||||||
gigaDrillBreakerTicks = newvalue;
|
|
||||||
}
|
|
||||||
public void decreaseGigaDrillBreakerTicks(){
|
|
||||||
if(gigaDrillBreakerTicks >= 1){
|
|
||||||
gigaDrillBreakerTicks--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public void setGigaDrillBreakerCooldown(Integer newvalue){
|
|
||||||
gigaDrillBreakerCooldown = newvalue;
|
|
||||||
}
|
|
||||||
public int getGigaDrillBreakerCooldown(){
|
|
||||||
return gigaDrillBreakerCooldown;
|
|
||||||
}
|
|
||||||
public void decreaseGigaDrillBreakerCooldown(){
|
|
||||||
if(gigaDrillBreakerCooldown >= 1){
|
|
||||||
gigaDrillBreakerCooldown--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* TREE FELLER STUFF
|
|
||||||
*/
|
|
||||||
public boolean getTreeFellerMode(){
|
|
||||||
return treeFellerMode;
|
|
||||||
}
|
|
||||||
public void setTreeFellerMode(Boolean bool){
|
|
||||||
treeFellerMode = bool;
|
|
||||||
}
|
|
||||||
public Integer getTreeFellerTicks(){
|
|
||||||
return treeFellerTicks;
|
|
||||||
}
|
|
||||||
public void setTreeFellerTicks(Integer newvalue){
|
|
||||||
treeFellerTicks = newvalue;
|
|
||||||
}
|
|
||||||
public void decreaseTreeFellerTicks(){
|
|
||||||
if(treeFellerTicks >= 1){
|
|
||||||
treeFellerTicks--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public void setTreeFellerCooldown(Integer newvalue){
|
|
||||||
treeFellerCooldown = newvalue;
|
|
||||||
}
|
|
||||||
public int getTreeFellerCooldown(){
|
|
||||||
return treeFellerCooldown;
|
|
||||||
}
|
|
||||||
public void decreaseTreeFellerCooldown(){
|
|
||||||
if(treeFellerCooldown >= 1){
|
|
||||||
treeFellerCooldown--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* MINING
|
|
||||||
*/
|
|
||||||
public boolean getSuperBreakerMode(){
|
|
||||||
return superBreakerMode;
|
|
||||||
}
|
|
||||||
public void setSuperBreakerMode(Boolean bool){
|
|
||||||
superBreakerMode = bool;
|
|
||||||
}
|
|
||||||
public Integer getSuperBreakerTicks(){
|
|
||||||
return superBreakerTicks;
|
|
||||||
}
|
|
||||||
public void setSuperBreakerTicks(Integer newvalue){
|
|
||||||
superBreakerTicks = newvalue;
|
|
||||||
}
|
|
||||||
public void decreaseSuperBreakerTicks(){
|
|
||||||
if(superBreakerTicks >= 1){
|
|
||||||
superBreakerTicks--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public void setSuperBreakerCooldown(Integer newvalue){
|
|
||||||
superBreakerCooldown = newvalue;
|
|
||||||
}
|
|
||||||
public int getSuperBreakerCooldown(){
|
|
||||||
return superBreakerCooldown;
|
|
||||||
}
|
|
||||||
public void decreaseSuperBreakerCooldown(){
|
|
||||||
if(superBreakerCooldown >= 1){
|
|
||||||
superBreakerCooldown--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getRecentlyHurt(){
|
public Integer getRecentlyHurt(){
|
||||||
return recentlyhurt;
|
return recentlyhurt;
|
||||||
}
|
}
|
||||||
@ -1436,34 +1130,34 @@ class PlayerList
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void modifyskill(int newvalue, String skillname){
|
public void modifyskill(int newvalue, String skillname){
|
||||||
if(skillname.toLowerCase().equals("mining")){
|
if(skillname.equals("mining")){
|
||||||
mining = String.valueOf(newvalue);
|
mining = String.valueOf(newvalue);
|
||||||
}
|
}
|
||||||
if(skillname.toLowerCase().equals("woodcutting")){
|
if(skillname.equals("woodcutting")){
|
||||||
woodcutting = String.valueOf(newvalue);
|
woodcutting = String.valueOf(newvalue);
|
||||||
}
|
}
|
||||||
if(skillname.toLowerCase().equals("repair")){
|
if(skillname.equals("repair")){
|
||||||
repair = String.valueOf(newvalue);
|
repair = String.valueOf(newvalue);
|
||||||
}
|
}
|
||||||
if(skillname.toLowerCase().equals("herbalism")){
|
if(skillname.equals("herbalism")){
|
||||||
herbalism = String.valueOf(newvalue);
|
herbalism = String.valueOf(newvalue);
|
||||||
}
|
}
|
||||||
if(skillname.toLowerCase().equals("acrobatics")){
|
if(skillname.equals("acrobatics")){
|
||||||
acrobatics = String.valueOf(newvalue);
|
acrobatics = String.valueOf(newvalue);
|
||||||
}
|
}
|
||||||
if(skillname.toLowerCase().equals("swords")){
|
if(skillname.equals("swords")){
|
||||||
swords = String.valueOf(newvalue);
|
swords = String.valueOf(newvalue);
|
||||||
}
|
}
|
||||||
if(skillname.toLowerCase().equals("archery")){
|
if(skillname.equals("archery")){
|
||||||
archery = String.valueOf(newvalue);
|
archery = String.valueOf(newvalue);
|
||||||
}
|
}
|
||||||
if(skillname.toLowerCase().equals("unarmed")){
|
if(skillname.equals("unarmed")){
|
||||||
unarmed = String.valueOf(newvalue);
|
unarmed = String.valueOf(newvalue);
|
||||||
}
|
}
|
||||||
if(skillname.toLowerCase().equals("excavation")){
|
if(skillname.equals("excavation")){
|
||||||
excavation = String.valueOf(newvalue);
|
excavation = String.valueOf(newvalue);
|
||||||
}
|
}
|
||||||
if(skillname.toLowerCase().equals("axes")){
|
if(skillname.equals("axes")){
|
||||||
axes = String.valueOf(newvalue);
|
axes = String.valueOf(newvalue);
|
||||||
}
|
}
|
||||||
save();
|
save();
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
package com.gmail.nossr50;
|
package com.gmail.nossr50;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
@ -10,8 +7,6 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
public class mcWoodCutting {
|
public class mcWoodCutting {
|
||||||
int w = 0;
|
|
||||||
private boolean isdone = false;
|
|
||||||
private static mcMMO plugin;
|
private static mcMMO plugin;
|
||||||
public mcWoodCutting(mcMMO instance) {
|
public mcWoodCutting(mcMMO instance) {
|
||||||
plugin = instance;
|
plugin = instance;
|
||||||
@ -26,119 +21,47 @@ public class mcWoodCutting {
|
|||||||
public void woodCuttingProcCheck(Player player, Block block, Location loc){
|
public void woodCuttingProcCheck(Player player, Block block, Location loc){
|
||||||
byte type = block.getData();
|
byte type = block.getData();
|
||||||
Material mat = Material.getMaterial(block.getTypeId());
|
Material mat = Material.getMaterial(block.getTypeId());
|
||||||
if(player != null){
|
byte damage = 0;
|
||||||
if(Math.random() * 1000 <= mcUsers.getProfile(player).getWoodCuttingInt()){
|
if(mcUsers.getProfile(player).getWoodCuttingInt() > 1000){
|
||||||
ItemStack item = new ItemStack(mat, 1, (short) 0, type);
|
ItemStack item = new ItemStack(mat, 1, type, damage);
|
||||||
loc.getWorld().dropItemNaturally(loc, item);
|
loc.getWorld().dropItemNaturally(loc, item);
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
if(mcUsers.getProfile(player).getWoodCuttingInt() > 750){
|
||||||
public void treeFellerCheck(Player player, Block block){
|
if((Math.random() * 10) > 2){
|
||||||
if(mcm.getInstance().isAxes(player.getItemInHand())){
|
ItemStack item = new ItemStack(mat, 1, type, damage);
|
||||||
if(block != null){
|
loc.getWorld().dropItemNaturally(loc, item);
|
||||||
if(!mcm.getInstance().abilityBlockCheck(block))
|
return;
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
/*
|
|
||||||
* CHECK FOR AXE PREP MODE
|
|
||||||
*/
|
|
||||||
if(mcUsers.getProfile(player).getAxePreparationMode()){
|
|
||||||
mcUsers.getProfile(player).setAxePreparationMode(false);
|
|
||||||
mcUsers.getProfile(player).setAxePreparationTicks(0);
|
|
||||||
}
|
|
||||||
int treefellticks = 2;
|
|
||||||
if(mcUsers.getProfile(player).getWoodCuttingInt() >= 50)
|
|
||||||
treefellticks++;
|
|
||||||
if(mcUsers.getProfile(player).getWoodCuttingInt() >= 150)
|
|
||||||
treefellticks++;
|
|
||||||
if(mcUsers.getProfile(player).getWoodCuttingInt() >= 250)
|
|
||||||
treefellticks++;
|
|
||||||
if(mcUsers.getProfile(player).getWoodCuttingInt() >= 350)
|
|
||||||
treefellticks++;
|
|
||||||
if(mcUsers.getProfile(player).getWoodCuttingInt() >= 450)
|
|
||||||
treefellticks++;
|
|
||||||
if(mcUsers.getProfile(player).getWoodCuttingInt() >= 550)
|
|
||||||
treefellticks++;
|
|
||||||
if(mcUsers.getProfile(player).getWoodCuttingInt() >= 650)
|
|
||||||
treefellticks++;
|
|
||||||
if(mcUsers.getProfile(player).getWoodCuttingInt() >= 750)
|
|
||||||
treefellticks++;
|
|
||||||
|
|
||||||
if(!mcUsers.getProfile(player).getTreeFellerMode() && mcUsers.getProfile(player).getTreeFellerCooldown() == 0){
|
|
||||||
player.sendMessage(ChatColor.GREEN+"**TREE FELLING ACTIVATED**");
|
|
||||||
mcUsers.getProfile(player).setTreeFellerTicks(treefellticks);
|
|
||||||
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."
|
|
||||||
+ChatColor.YELLOW+" ("+(mcUsers.getProfile(player).getTreeFellerCooldown() * 2)+"s)");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
if(mcUsers.getProfile(player).getWoodCuttingInt() > 300){
|
||||||
|
if((Math.random() * 10) > 4){
|
||||||
|
ItemStack item = new ItemStack(mat, 1, type, damage);
|
||||||
|
loc.getWorld().dropItemNaturally(loc, item);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(mcUsers.getProfile(player).getWoodCuttingInt() > 100){
|
||||||
|
if((Math.random() * 10) > 6){
|
||||||
|
ItemStack item = new ItemStack(mat, 1, type, damage);
|
||||||
|
loc.getWorld().dropItemNaturally(loc, item);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(mcUsers.getProfile(player).getWoodCuttingInt() > 10){
|
||||||
|
if((Math.random() * 10) > 8){
|
||||||
|
ItemStack item = new ItemStack(mat, 1, type, damage);
|
||||||
|
loc.getWorld().dropItemNaturally(loc, item);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public void treeFeller(Block block, Player player){
|
public void treeFeller(Block block){
|
||||||
|
Location loc = block.getLocation();
|
||||||
int radius = 1;
|
int radius = 1;
|
||||||
if(mcUsers.getProfile(player).getWoodCuttingGatherInt() >= 500)
|
int typeid = 17;
|
||||||
radius++;
|
if(mcm.getInstance().isBlockAround(loc, radius, typeid)){
|
||||||
if(mcUsers.getProfile(player).getWoodCuttingGatherInt() >= 950)
|
|
||||||
radius++;
|
|
||||||
ArrayList<Block> blocklist = new ArrayList<Block>();
|
|
||||||
ArrayList<Block> toAdd = new ArrayList<Block>();
|
|
||||||
if(block != null)
|
|
||||||
blocklist.add(block);
|
|
||||||
while(isdone == false){
|
|
||||||
addBlocksToTreeFelling(blocklist, toAdd, radius);
|
|
||||||
}
|
|
||||||
//This needs to be a hashmap too!
|
|
||||||
isdone = false;
|
|
||||||
/*
|
|
||||||
* Add blocks from the temporary 'toAdd' array list into the 'treeFeller' array list
|
|
||||||
* We use this temporary list to prevent concurrent modification exceptions
|
|
||||||
*/
|
|
||||||
for(Block x : toAdd){
|
|
||||||
if(!mcConfig.getInstance().isTreeFellerWatched(x))
|
|
||||||
mcConfig.getInstance().addTreeFeller(x);
|
|
||||||
}
|
|
||||||
toAdd.clear();
|
|
||||||
}
|
|
||||||
public void addBlocksToTreeFelling(ArrayList<Block> blocklist, ArrayList<Block> toAdd, Integer radius){
|
|
||||||
int u = 0;
|
|
||||||
for (Block x : blocklist){
|
|
||||||
u++;
|
|
||||||
if(toAdd.contains(x))
|
|
||||||
continue;
|
|
||||||
w = 0;
|
|
||||||
Location loc = x.getLocation();
|
|
||||||
int vx = x.getX();
|
|
||||||
int vy = x.getY();
|
|
||||||
int vz = x.getZ();
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Run through the blocks around the broken block to see if they qualify to be 'felled'
|
|
||||||
*/
|
|
||||||
for (int cx = -radius; cx <= radius; cx++) {
|
|
||||||
for (int cy = -radius; cy <= radius; cy++) {
|
|
||||||
for (int cz = -radius; cz <= radius; cz++) {
|
|
||||||
Block blocktarget = loc.getWorld().getBlockAt(vx + cx, vy + cy, vz + cz);
|
|
||||||
if (!blocklist.contains(blocktarget) && !toAdd.contains(blocktarget) && (blocktarget.getTypeId() == 17 || blocktarget.getTypeId() == 18)) {
|
|
||||||
toAdd.add(blocktarget);
|
|
||||||
w++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* Add more blocks to blocklist so they can be 'felled'
|
|
||||||
*/
|
|
||||||
for(Block xx : toAdd){
|
|
||||||
if(!blocklist.contains(xx))
|
|
||||||
blocklist.add(xx);
|
|
||||||
}
|
|
||||||
if(u >= blocklist.size()){
|
|
||||||
isdone = true;
|
|
||||||
} else {
|
|
||||||
isdone = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,69 +30,11 @@ public class mcm {
|
|||||||
}
|
}
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
public void damageTool(Player player, short damage){
|
public static double getDistance(Location loca, Location locb)
|
||||||
if(player.getItemInHand().getTypeId() == 0)
|
|
||||||
return;
|
|
||||||
player.getItemInHand().setDurability((short) (player.getItemInHand().getDurability() + damage));
|
|
||||||
if(player.getItemInHand().getDurability() >= getMaxDurability(mcm.getInstance().getTier(player), player.getItemInHand())){
|
|
||||||
ItemStack[] inventory = player.getInventory().getContents();
|
|
||||||
for(ItemStack x : inventory){
|
|
||||||
if(x.getTypeId() == player.getItemInHand().getTypeId() && x.getDurability() == player.getItemInHand().getDurability()){
|
|
||||||
x.setTypeId(0);
|
|
||||||
x.setAmount(0);
|
|
||||||
player.getInventory().setContents(inventory);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public Integer getTier(Player player){
|
|
||||||
int i = player.getItemInHand().getTypeId();
|
|
||||||
if(i == 268 || i == 269 || i == 270 || i == 271 || i == 290){
|
|
||||||
return 1; //WOOD
|
|
||||||
} else if (i == 272 || i == 273 || i == 274 || i == 275 || i == 291){
|
|
||||||
return 2; //STONE
|
|
||||||
} else if (i == 256 || i == 257 || i == 258 || i == 267 || i == 292){
|
|
||||||
return 3; //IRON
|
|
||||||
} else if (i == 283 || i == 284 || i == 285 || i == 286 || i == 294){
|
|
||||||
return 1; //GOLD
|
|
||||||
} else if (i == 276 || i == 277 || i == 278 || i == 279 || i == 293){
|
|
||||||
return 4; //DIAMOND
|
|
||||||
} else {
|
|
||||||
return 1; //UNRECOGNIZED
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public Integer getMaxDurability(Integer tier, ItemStack item){
|
|
||||||
int id = item.getTypeId();
|
|
||||||
if(tier == 1){
|
|
||||||
if((id == 276 || id == 277 || id == 278 || id == 279 || id == 293)){
|
|
||||||
return 33;
|
|
||||||
} else {
|
|
||||||
return 60;
|
|
||||||
}
|
|
||||||
} else if (tier == 2){
|
|
||||||
return 132;
|
|
||||||
} else if (tier == 3){
|
|
||||||
return 251;
|
|
||||||
} else if (tier == 4){
|
|
||||||
return 1562;
|
|
||||||
} else {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public double getDistance(Location loca, Location locb)
|
|
||||||
{
|
{
|
||||||
return Math.sqrt(Math.pow(loca.getX() - locb.getX(), 2) + Math.pow(loca.getY() - locb.getY(), 2)
|
return Math.sqrt(Math.pow(loca.getX() - locb.getX(), 2) + Math.pow(loca.getY() - locb.getY(), 2)
|
||||||
+ Math.pow(loca.getZ() - locb.getZ(), 2));
|
+ Math.pow(loca.getZ() - locb.getZ(), 2));
|
||||||
}
|
}
|
||||||
public boolean abilityBlockCheck(Block block){
|
|
||||||
int i = block.getTypeId();
|
|
||||||
if(i == 68 || i == 355 || i == 323 || i == 25 || i == 54 || i == 69 || i == 92 || i == 77 || i == 58 || i == 61 || i == 62 || i == 42 || i == 71 || i == 64 || i == 84 || i == 324 || i == 330){
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public boolean isBlockAround(Location loc, Integer radius, Integer typeid){
|
public boolean isBlockAround(Location loc, Integer radius, Integer typeid){
|
||||||
Block blockx = loc.getBlock();
|
Block blockx = loc.getBlock();
|
||||||
int ox = blockx.getX();
|
int ox = blockx.getX();
|
||||||
@ -144,7 +86,7 @@ public class mcm {
|
|||||||
}
|
}
|
||||||
public boolean shouldBeWatched(Block block){
|
public boolean shouldBeWatched(Block block){
|
||||||
int id = block.getTypeId();
|
int id = block.getTypeId();
|
||||||
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){
|
if(id == 21 || id == 15 || id == 14 || id == 56 || id == 38 || id == 37 || id == 39 || id == 40){
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
@ -187,6 +129,70 @@ public class mcm {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
public void simulateNaturalDrops(Entity entity){
|
||||||
|
Location loc = entity.getLocation();
|
||||||
|
if(entity instanceof Pig){
|
||||||
|
if(Math.random() * 3 > 2){
|
||||||
|
if(Math.random() * 2 > 1){
|
||||||
|
mcDropItem(loc, 319); //BACON
|
||||||
|
}
|
||||||
|
mcDropItem(loc, 319);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(entity instanceof Spider){
|
||||||
|
if(Math.random() * 3 > 2){
|
||||||
|
if(Math.random() * 2 > 1){
|
||||||
|
mcDropItem(loc, 287); //SILK
|
||||||
|
}
|
||||||
|
mcDropItem(loc, 287);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(entity instanceof Skeleton){
|
||||||
|
if(Math.random() * 3 > 2){
|
||||||
|
if(Math.random() * 2 > 1){
|
||||||
|
mcDropItem(loc, 262); //ARROWS
|
||||||
|
}
|
||||||
|
mcDropItem(loc, 262);
|
||||||
|
}
|
||||||
|
if(Math.random() * 3 > 2){
|
||||||
|
if(Math.random() * 2 > 1){
|
||||||
|
mcDropItem(loc, 352); //BONES
|
||||||
|
}
|
||||||
|
mcDropItem(loc, 352);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(entity instanceof Zombie){
|
||||||
|
if(Math.random() * 3 > 2){
|
||||||
|
if(Math.random() * 2 > 1){
|
||||||
|
mcDropItem(loc, 288); //FEATHERS
|
||||||
|
}
|
||||||
|
mcDropItem(loc, 288);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(entity instanceof Cow){
|
||||||
|
if(Math.random() * 3 > 2){
|
||||||
|
if(Math.random() * 2 > 1){
|
||||||
|
mcDropItem(loc, 334); //LEATHER
|
||||||
|
}
|
||||||
|
if(Math.random() * 2 > 1){
|
||||||
|
mcDropItem(loc, 334);
|
||||||
|
}
|
||||||
|
mcDropItem(loc, 334);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(entity instanceof Squid){
|
||||||
|
if(Math.random() * 3 > 2){
|
||||||
|
if(Math.random() * 2 > 1){
|
||||||
|
mcDropItem(loc, 351); //INK SACS
|
||||||
|
}
|
||||||
|
if(Math.random() * 2 > 1){
|
||||||
|
mcDropItem(loc, 351);
|
||||||
|
}
|
||||||
|
mcDropItem(loc, 351);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mcSkills.getInstance().arrowRetrievalCheck(entity);
|
||||||
|
}
|
||||||
public void mcDropItem(Location loc, int id){
|
public void mcDropItem(Location loc, int id){
|
||||||
if(loc != null){
|
if(loc != null){
|
||||||
Material mat = Material.getMaterial(id);
|
Material mat = Material.getMaterial(id);
|
||||||
@ -203,13 +209,6 @@ public class mcm {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public boolean isShovel(ItemStack is){
|
|
||||||
if(is.getTypeId() == 269 || is.getTypeId() == 273 || is.getTypeId() == 277 || is.getTypeId() == 284 || is.getTypeId() == 256){
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public boolean isAxes(ItemStack is){
|
public boolean isAxes(ItemStack is){
|
||||||
if(is.getTypeId() == 271 || is.getTypeId() == 258 || is.getTypeId() == 286 || is.getTypeId() == 279 || is.getTypeId() == 275){
|
if(is.getTypeId() == 271 || is.getTypeId() == 258 || is.getTypeId() == 286 || is.getTypeId() == 279 || is.getTypeId() == 275){
|
||||||
return true;
|
return true;
|
||||||
@ -217,367 +216,106 @@ public class mcm {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public boolean isMiningPick(ItemStack is){
|
|
||||||
if(is.getTypeId() == 270 || is.getTypeId() == 274 || is.getTypeId() == 285 || is.getTypeId() == 257 || is.getTypeId() == 278){
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public void mcmmoHelpCheck(String[] split, Player player, PlayerChatEvent event){
|
public void mcmmoHelpCheck(String[] split, Player player, PlayerChatEvent event){
|
||||||
if(split[0].equalsIgnoreCase("/woodcutting")){
|
if(split[0].equalsIgnoreCase("/woodcutting")){
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
float skillvalue = (float)mcUsers.getProfile(player).getWoodCuttingInt();
|
|
||||||
int treefellticks = 2;
|
|
||||||
if(mcUsers.getProfile(player).getWoodCuttingInt() >= 50)
|
|
||||||
treefellticks++;
|
|
||||||
if(mcUsers.getProfile(player).getWoodCuttingInt() >= 150)
|
|
||||||
treefellticks++;
|
|
||||||
if(mcUsers.getProfile(player).getWoodCuttingInt() >= 250)
|
|
||||||
treefellticks++;
|
|
||||||
if(mcUsers.getProfile(player).getWoodCuttingInt() >= 350)
|
|
||||||
treefellticks++;
|
|
||||||
if(mcUsers.getProfile(player).getWoodCuttingInt() >= 450)
|
|
||||||
treefellticks++;
|
|
||||||
if(mcUsers.getProfile(player).getWoodCuttingInt() >= 550)
|
|
||||||
treefellticks++;
|
|
||||||
if(mcUsers.getProfile(player).getWoodCuttingInt() >= 650)
|
|
||||||
treefellticks++;
|
|
||||||
if(mcUsers.getProfile(player).getWoodCuttingInt() >= 750)
|
|
||||||
treefellticks++;
|
|
||||||
String percentage = String.valueOf((skillvalue / 1000) * 100);
|
|
||||||
player.sendMessage(ChatColor.RED+"-----[]"+ChatColor.GREEN+"WOODCUTTING"+ChatColor.RED+"[]-----");
|
player.sendMessage(ChatColor.RED+"-----[]"+ChatColor.GREEN+"WOODCUTTING"+ChatColor.RED+"[]-----");
|
||||||
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+"Double Drops: "+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+"Double Drop Chance: "+ChatColor.YELLOW+percentage+"%");
|
|
||||||
player.sendMessage(ChatColor.RED+"Tree Feller Length: "+ChatColor.YELLOW+(treefellticks * 2)+"s");
|
|
||||||
}
|
}
|
||||||
if(split[0].equalsIgnoreCase("/archery")){
|
if(split[0].equalsIgnoreCase("/archery")){
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
Integer rank = 0;
|
|
||||||
if(mcUsers.getProfile(player).getArcheryInt() >= 50)
|
|
||||||
rank++;
|
|
||||||
if(mcUsers.getProfile(player).getArcheryInt() >= 250)
|
|
||||||
rank++;
|
|
||||||
if(mcUsers.getProfile(player).getArcheryInt() >= 575)
|
|
||||||
rank++;
|
|
||||||
if(mcUsers.getProfile(player).getArcheryInt() >= 725)
|
|
||||||
rank++;
|
|
||||||
if(mcUsers.getProfile(player).getArcheryInt() >= 1000)
|
|
||||||
rank++;
|
|
||||||
float skillvalue = (float)mcUsers.getProfile(player).getArcheryInt();
|
|
||||||
String percentage = String.valueOf((skillvalue / 1000) * 100);
|
|
||||||
String percentagefire = String.valueOf((skillvalue / 1500) * 100);
|
|
||||||
String percentagedaze;
|
|
||||||
if(mcUsers.getProfile(player).getArcheryInt() < 1000){
|
|
||||||
percentagedaze = String.valueOf((skillvalue / 2000) * 100);
|
|
||||||
} else {
|
|
||||||
percentagedaze = "50";
|
|
||||||
}
|
|
||||||
player.sendMessage(ChatColor.RED+"-----[]"+ChatColor.GREEN+"ARCHERY"+ChatColor.RED+"[]-----");
|
player.sendMessage(ChatColor.RED+"-----[]"+ChatColor.GREEN+"ARCHERY"+ChatColor.RED+"[]-----");
|
||||||
player.sendMessage(ChatColor.DARK_GRAY+"XP GAIN: "+ChatColor.WHITE+"Attacking Monsters");
|
player.sendMessage(ChatColor.DARK_GRAY+"XP GAIN: "+ChatColor.WHITE+"Attacking Monsters");
|
||||||
player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"EFFECTS"+ChatColor.RED+"[]---");
|
player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"EFFECTS"+ChatColor.RED+"[]---");
|
||||||
player.sendMessage(ChatColor.DARK_AQUA+"Ignition: "+ChatColor.GREEN+"Enemies will catch on fire");
|
//player.sendMessage(ChatColor.DARK_AQUA+"Daze (Monsters): "+ChatColor.GREEN+"Enemies lose interest for 1 second");
|
||||||
player.sendMessage(ChatColor.DARK_AQUA+"Daze (Players): "+ChatColor.GREEN+"Disorients foes");
|
player.sendMessage(ChatColor.DARK_AQUA+"Daze (Players): "+ChatColor.GREEN+"Disorients foes");
|
||||||
player.sendMessage(ChatColor.DARK_AQUA+"Damage+: "+ChatColor.GREEN+"Modifies Damage");
|
player.sendMessage(ChatColor.DARK_AQUA+"Damage+: "+ChatColor.GREEN+"Modifies Damage");
|
||||||
player.sendMessage(ChatColor.DARK_AQUA+"Arrow Retrieval: "+ChatColor.GREEN+"Chance to retrieve arrows from corpses");
|
|
||||||
player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"YOUR STATS"+ChatColor.RED+"[]---");
|
|
||||||
player.sendMessage(ChatColor.RED+"Chance to Daze: "+ChatColor.YELLOW+percentagedaze+"%");
|
|
||||||
player.sendMessage(ChatColor.RED+"Chance to Retrieve Arrows: "+ChatColor.YELLOW+percentage+"%");
|
|
||||||
player.sendMessage(ChatColor.RED+"Chance for Ignition: "+ChatColor.YELLOW+percentagefire+"%");
|
|
||||||
player.sendMessage(ChatColor.RED+"Damage+ (Rank"+rank+"): Bonus "+rank+" damage");
|
|
||||||
}
|
}
|
||||||
if(split[0].equalsIgnoreCase("/axes")){
|
if(split[0].equalsIgnoreCase("/axes")){
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
String percentage;
|
|
||||||
float skillvalue = (float)mcUsers.getProfile(player).getAxesInt();
|
|
||||||
if(mcUsers.getProfile(player).getAxesInt() < 750){
|
|
||||||
percentage = String.valueOf((skillvalue / 1000) * 100);
|
|
||||||
} else {
|
|
||||||
percentage = "75";
|
|
||||||
}
|
|
||||||
int ticks = 2;
|
|
||||||
if(mcUsers.getProfile(player).getAxesInt() >= 50)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getAxesInt() >= 150)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getAxesInt() >= 250)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getAxesInt() >= 350)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getAxesInt() >= 450)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getAxesInt() >= 550)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getAxesInt() >= 650)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getAxesInt() >= 750)
|
|
||||||
ticks++;
|
|
||||||
player.sendMessage(ChatColor.RED+"-----[]"+ChatColor.GREEN+"AXES"+ChatColor.RED+"[]-----");
|
player.sendMessage(ChatColor.RED+"-----[]"+ChatColor.GREEN+"AXES"+ChatColor.RED+"[]-----");
|
||||||
player.sendMessage(ChatColor.DARK_GRAY+"XP GAIN: "+ChatColor.WHITE+"Attacking Monsters");
|
player.sendMessage(ChatColor.DARK_GRAY+"XP GAIN: "+ChatColor.WHITE+"Attacking Monsters");
|
||||||
player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"EFFECTS"+ChatColor.RED+"[]---");
|
player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"EFFECTS"+ChatColor.RED+"[]---");
|
||||||
player.sendMessage(ChatColor.DARK_AQUA+"Skull Splitter (ABILITY): "+ChatColor.GREEN+"Deal AoE Damage");
|
player.sendMessage(ChatColor.DARK_AQUA+"Critical Strikes (Monster): "+ChatColor.GREEN+"Instant kill");
|
||||||
player.sendMessage(ChatColor.DARK_AQUA+"Critical Strikes: "+ChatColor.GREEN+"Double Damage");
|
player.sendMessage(ChatColor.DARK_AQUA+"Critical Strikes (Players): "+ChatColor.GREEN+"Double Damage");
|
||||||
player.sendMessage(ChatColor.DARK_AQUA+"Axe Mastery (500 SKILL): "+ChatColor.GREEN+"Modifies Damage");
|
player.sendMessage(ChatColor.DARK_AQUA+"Axe Mastery (500 SKILL): "+ChatColor.GREEN+"Modifies Damage");
|
||||||
player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"YOUR STATS"+ChatColor.RED+"[]---");
|
|
||||||
player.sendMessage(ChatColor.RED+"Chance to crtically strike: "+ChatColor.YELLOW+percentage+"%");
|
|
||||||
if(mcUsers.getProfile(player).getAxesInt() < 500){
|
|
||||||
player.sendMessage(ChatColor.GRAY+"LOCKED UNTIL 500+ SKILL (AXEMASTERY)");
|
|
||||||
} else {
|
|
||||||
player.sendMessage(ChatColor.GREEN+"Axe Mastery - Bonus 4 damage");
|
|
||||||
}
|
|
||||||
player.sendMessage(ChatColor.RED+"Skull Splitter Length: "+ChatColor.YELLOW+(ticks * 2)+"s");
|
|
||||||
}
|
}
|
||||||
if(split[0].equalsIgnoreCase("/swords")){
|
if(split[0].equalsIgnoreCase("/swords")){
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
String percentage, parrypercentage = null;
|
|
||||||
float skillvalue = (float)mcUsers.getProfile(player).getSwordsInt();
|
|
||||||
if(mcUsers.getProfile(player).getSwordsInt() < 750){
|
|
||||||
percentage = String.valueOf((skillvalue / 1000) * 100);
|
|
||||||
} else {
|
|
||||||
percentage = "75";
|
|
||||||
}
|
|
||||||
if(mcUsers.getProfile(player).getSwordsInt() >= 775){
|
|
||||||
parrypercentage = "20";
|
|
||||||
} else if (mcUsers.getProfile(player).getSwordsInt() >= 445){
|
|
||||||
parrypercentage = "15";
|
|
||||||
} else if (mcUsers.getProfile(player).getSwordsInt() >= 250){
|
|
||||||
parrypercentage = "10";
|
|
||||||
} else if (mcUsers.getProfile(player).getSwordsInt() >= 25){
|
|
||||||
parrypercentage = "5";
|
|
||||||
} else {
|
|
||||||
parrypercentage = "0";
|
|
||||||
}
|
|
||||||
int ticks = 2;
|
|
||||||
if(mcUsers.getProfile(player).getSwordsInt() >= 50)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getSwordsInt() >= 150)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getSwordsInt() >= 250)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getSwordsInt() >= 350)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getSwordsInt() >= 450)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getSwordsInt() >= 550)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getSwordsInt() >= 650)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getSwordsInt() >= 750)
|
|
||||||
ticks++;
|
|
||||||
player.sendMessage(ChatColor.RED+"-----[]"+ChatColor.GREEN+"SWORDS"+ChatColor.RED+"[]-----");
|
player.sendMessage(ChatColor.RED+"-----[]"+ChatColor.GREEN+"SWORDS"+ChatColor.RED+"[]-----");
|
||||||
player.sendMessage(ChatColor.DARK_GRAY+"XP GAIN: "+ChatColor.WHITE+"Attacking Monsters");
|
player.sendMessage(ChatColor.DARK_GRAY+"XP GAIN: "+ChatColor.WHITE+"Attacking Monsters");
|
||||||
player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"EFFECTS"+ChatColor.RED+"[]---");
|
player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"EFFECTS"+ChatColor.RED+"[]---");
|
||||||
player.sendMessage(ChatColor.DARK_AQUA+"Serrated Strikes (ABILITY): "+ChatColor.GREEN+"25% DMG AoE, Bleed+ AoE");
|
|
||||||
player.sendMessage(ChatColor.DARK_GRAY+"Serrated Strikes Bleed+: "+ChatColor.GREEN+"Enemies Bleed Longer");
|
|
||||||
player.sendMessage(ChatColor.DARK_AQUA+"Parrying: "+ChatColor.GREEN+"Negates Damage");
|
player.sendMessage(ChatColor.DARK_AQUA+"Parrying: "+ChatColor.GREEN+"Negates Damage");
|
||||||
player.sendMessage(ChatColor.DARK_AQUA+"Bleed: "+ChatColor.GREEN+"Apply a 2 second bleed DoT to enemies");
|
player.sendMessage(ChatColor.DARK_AQUA+"Bleed: "+ChatColor.GREEN+"Apply a 2 second bleed DoT to enemies");
|
||||||
player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"YOUR STATS"+ChatColor.RED+"[]---");
|
|
||||||
player.sendMessage(ChatColor.RED+"Bleed Chance: "+ChatColor.YELLOW+percentage+"%");
|
|
||||||
player.sendMessage(ChatColor.RED+"Parry Chance:"+ChatColor.YELLOW+parrypercentage+"%");
|
|
||||||
player.sendMessage(ChatColor.RED+"Serrated Strikes Length: "+ChatColor.YELLOW+(ticks * 2)+"s");
|
|
||||||
}
|
}
|
||||||
if(split[0].equalsIgnoreCase("/acrobatics")){
|
if(split[0].equalsIgnoreCase("/acrobatics")){
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
float skillvalue = (float)mcUsers.getProfile(player).getAcrobaticsInt();
|
|
||||||
String percentage = String.valueOf((skillvalue / 1000) * 100);
|
|
||||||
player.sendMessage(ChatColor.RED+"-----[]"+ChatColor.GREEN+"ACROBATICS"+ChatColor.RED+"[]-----");
|
player.sendMessage(ChatColor.RED+"-----[]"+ChatColor.GREEN+"ACROBATICS"+ChatColor.RED+"[]-----");
|
||||||
player.sendMessage(ChatColor.DARK_GRAY+"XP GAIN: "+ChatColor.WHITE+"Falling");
|
player.sendMessage(ChatColor.DARK_GRAY+"XP GAIN: "+ChatColor.WHITE+"Falling");
|
||||||
player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"EFFECTS"+ChatColor.RED+"[]---");
|
player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"EFFECTS"+ChatColor.RED+"[]---");
|
||||||
player.sendMessage(ChatColor.DARK_AQUA+"Roll: "+ChatColor.GREEN+"Negates Damage");
|
player.sendMessage(ChatColor.DARK_AQUA+"Roll: "+ChatColor.GREEN+"Negates Damage");
|
||||||
player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"YOUR STATS"+ChatColor.RED+"[]---");
|
|
||||||
player.sendMessage(ChatColor.RED+"Roll Chance: "+ChatColor.YELLOW+percentage+"%");
|
|
||||||
}
|
}
|
||||||
if(split[0].equalsIgnoreCase("/mining")){
|
if(split[0].equalsIgnoreCase("/mining")){
|
||||||
float skillvalue = (float)mcUsers.getProfile(player).getMiningInt();
|
|
||||||
String percentage = String.valueOf((skillvalue / 1000) * 100);
|
|
||||||
int miningticks = 2;
|
|
||||||
if(mcUsers.getProfile(player).getMiningInt() >= 50)
|
|
||||||
miningticks++;
|
|
||||||
if(mcUsers.getProfile(player).getMiningInt() >= 150)
|
|
||||||
miningticks++;
|
|
||||||
if(mcUsers.getProfile(player).getMiningInt() >= 250)
|
|
||||||
miningticks++;
|
|
||||||
if(mcUsers.getProfile(player).getMiningInt() >= 350)
|
|
||||||
miningticks++;
|
|
||||||
if(mcUsers.getProfile(player).getMiningInt() >= 450)
|
|
||||||
miningticks++;
|
|
||||||
if(mcUsers.getProfile(player).getMiningInt() >= 550)
|
|
||||||
miningticks++;
|
|
||||||
if(mcUsers.getProfile(player).getMiningInt() >= 650)
|
|
||||||
miningticks++;
|
|
||||||
if(mcUsers.getProfile(player).getMiningInt() >= 750)
|
|
||||||
miningticks++;
|
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
player.sendMessage(ChatColor.RED+"-----[]"+ChatColor.GREEN+"MINING"+ChatColor.RED+"[]-----");
|
player.sendMessage(ChatColor.RED+"-----[]"+ChatColor.GREEN+"MINING"+ChatColor.RED+"[]-----");
|
||||||
player.sendMessage(ChatColor.DARK_GRAY+"XP GAIN: "+ChatColor.WHITE+"Mining Stone & Ore");
|
player.sendMessage(ChatColor.DARK_GRAY+"XP GAIN: "+ChatColor.WHITE+"Mining Stone & Ore");
|
||||||
player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"EFFECTS"+ChatColor.RED+"[]---");
|
player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"EFFECTS"+ChatColor.RED+"[]---");
|
||||||
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.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+"%");
|
|
||||||
player.sendMessage(ChatColor.RED+"Super Breaker Length: "+ChatColor.YELLOW+(miningticks * 2)+"s");
|
|
||||||
}
|
}
|
||||||
if(split[0].equalsIgnoreCase("/repair")){
|
if(split[0].equalsIgnoreCase("/repair")){
|
||||||
float skillvalue = (float)mcUsers.getProfile(player).getRepairInt();
|
|
||||||
String percentage = String.valueOf((skillvalue / 1000) * 100);
|
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
player.sendMessage(ChatColor.RED+"-----[]"+ChatColor.GREEN+"REPAIR"+ChatColor.RED+"[]-----");
|
player.sendMessage(ChatColor.RED+"-----[]"+ChatColor.GREEN+"REPAIR"+ChatColor.RED+"[]-----");
|
||||||
player.sendMessage(ChatColor.DARK_GRAY+"XP GAIN: "+ChatColor.WHITE+"Repairing");
|
player.sendMessage(ChatColor.DARK_GRAY+"XP GAIN: "+ChatColor.WHITE+"Repairing");
|
||||||
player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"EFFECTS"+ChatColor.RED+"[]---");
|
player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"EFFECTS"+ChatColor.RED+"[]---");
|
||||||
player.sendMessage(ChatColor.DARK_AQUA+"Repair: "+ChatColor.GREEN+"Repair Iron Tools & Armor");
|
player.sendMessage(ChatColor.DARK_AQUA+"Repair: "+ChatColor.GREEN+"Repair Iron Tools & Armor");
|
||||||
player.sendMessage(ChatColor.DARK_AQUA+"Super Repair: "+ChatColor.GREEN+"Fully Repair an item");
|
player.sendMessage(ChatColor.DARK_AQUA+"Diamond Repair (50+ SKILL): "+ChatColor.GREEN+"Repair Diamond Tools & Armor");
|
||||||
player.sendMessage(ChatColor.DARK_AQUA+"Diamond Repair ("+mcLoadProperties.repairdiamondlevel+"+ SKILL): "+ChatColor.GREEN+"Repair Diamond Tools & Armor");
|
|
||||||
player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"YOUR STATS"+ChatColor.RED+"[]---");
|
|
||||||
player.sendMessage(ChatColor.RED+"Super Repair Chance: "+ChatColor.YELLOW+percentage+"%");
|
|
||||||
}
|
}
|
||||||
if(split[0].equalsIgnoreCase("/unarmed")){
|
if(split[0].equalsIgnoreCase("/unarmed")){
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
int rank = 0;
|
|
||||||
String percentage, arrowpercentage;
|
|
||||||
float skillvalue = (float)mcUsers.getProfile(player).getUnarmedInt();
|
|
||||||
|
|
||||||
if(mcUsers.getProfile(player).getUnarmedInt() < 750){
|
|
||||||
percentage = String.valueOf((skillvalue / 1000) * 100);
|
|
||||||
} else {
|
|
||||||
percentage = "75";
|
|
||||||
}
|
|
||||||
|
|
||||||
if(mcUsers.getProfile(player).getUnarmedInt() < 1000){
|
|
||||||
arrowpercentage = String.valueOf(((skillvalue / 1000) * 100) / 2);
|
|
||||||
} else {
|
|
||||||
arrowpercentage = "50";
|
|
||||||
}
|
|
||||||
|
|
||||||
if(mcUsers.getProfile(player).getUnarmedInt() >= 50)
|
|
||||||
rank++;
|
|
||||||
if(mcUsers.getProfile(player).getUnarmedInt() >= 100)
|
|
||||||
rank++;
|
|
||||||
if(mcUsers.getProfile(player).getUnarmedInt() >= 200)
|
|
||||||
rank++;
|
|
||||||
if(mcUsers.getProfile(player).getUnarmedInt() >= 325)
|
|
||||||
rank++;
|
|
||||||
if(mcUsers.getProfile(player).getUnarmedInt() >= 475)
|
|
||||||
rank++;
|
|
||||||
if(mcUsers.getProfile(player).getUnarmedInt() >= 600)
|
|
||||||
rank++;
|
|
||||||
if(mcUsers.getProfile(player).getUnarmedInt() >= 775)
|
|
||||||
rank++;
|
|
||||||
if(mcUsers.getProfile(player).getUnarmedInt() >= 950)
|
|
||||||
rank++;
|
|
||||||
|
|
||||||
int ticks = 2;
|
|
||||||
if(mcUsers.getProfile(player).getUnarmedInt() >= 50)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getUnarmedInt() >= 150)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getUnarmedInt() >= 250)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getUnarmedInt() >= 350)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getUnarmedInt() >= 450)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getUnarmedInt() >= 550)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getUnarmedInt() >= 650)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getUnarmedInt() >= 750)
|
|
||||||
ticks++;
|
|
||||||
|
|
||||||
player.sendMessage(ChatColor.RED+"-----[]"+ChatColor.GREEN+"UNARMED"+ChatColor.RED+"[]-----");
|
player.sendMessage(ChatColor.RED+"-----[]"+ChatColor.GREEN+"UNARMED"+ChatColor.RED+"[]-----");
|
||||||
player.sendMessage(ChatColor.DARK_GRAY+"XP GAIN: "+ChatColor.WHITE+"Attacking Monsters");
|
player.sendMessage(ChatColor.DARK_GRAY+"XP GAIN: "+ChatColor.WHITE+"Attacking Monsters");
|
||||||
player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"EFFECTS"+ChatColor.RED+"[]---");
|
player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"EFFECTS"+ChatColor.RED+"[]---");
|
||||||
player.sendMessage(ChatColor.DARK_AQUA+"Berserk (ABILITY): "+ChatColor.GREEN+"+50% DMG, Breaks weak materials");
|
|
||||||
player.sendMessage(ChatColor.DARK_AQUA+"Disarm (Players): "+ChatColor.GREEN+"Drops the foes item held in hand");
|
player.sendMessage(ChatColor.DARK_AQUA+"Disarm (Players): "+ChatColor.GREEN+"Drops the foes item held in hand");
|
||||||
player.sendMessage(ChatColor.DARK_AQUA+"Damage+: "+ChatColor.GREEN+"Modifies Damage");
|
player.sendMessage(ChatColor.DARK_AQUA+"Damage+: "+ChatColor.GREEN+"Modifies Damage");
|
||||||
player.sendMessage(ChatColor.DARK_AQUA+"Arrow Deflect: "+ChatColor.GREEN+"Deflect arrows");
|
|
||||||
player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"YOUR STATS"+ChatColor.RED+"[]---");
|
|
||||||
player.sendMessage(ChatColor.RED+"Arrow Deflect Chance: "+ChatColor.YELLOW+arrowpercentage+"%");
|
|
||||||
player.sendMessage(ChatColor.RED+"Disarm Chance: "+ChatColor.YELLOW+percentage+"%");
|
|
||||||
player.sendMessage(ChatColor.RED+"Damage+ (Rank"+rank+"): Bonus "+rank+" damage");
|
|
||||||
player.sendMessage(ChatColor.RED+"Berserk Length: "+ChatColor.YELLOW+(ticks * 2)+"s");
|
|
||||||
}
|
}
|
||||||
if(split[0].equalsIgnoreCase("/herbalism")){
|
if(split[0].equalsIgnoreCase("/herbalism")){
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
int rank = 0;
|
|
||||||
if(mcUsers.getProfile(player).getHerbalismInt() >= 50){
|
|
||||||
rank++;
|
|
||||||
} else if (mcUsers.getProfile(player).getHerbalismInt() >= 150){
|
|
||||||
rank++;
|
|
||||||
} else if (mcUsers.getProfile(player).getHerbalismInt() >= 250){
|
|
||||||
rank++;
|
|
||||||
} else if (mcUsers.getProfile(player).getHerbalismInt() >= 350){
|
|
||||||
rank++;
|
|
||||||
} else if (mcUsers.getProfile(player).getHerbalismInt() >= 450){
|
|
||||||
rank++;
|
|
||||||
} else if (mcUsers.getProfile(player).getHerbalismInt() >= 550){
|
|
||||||
rank++;
|
|
||||||
} else if (mcUsers.getProfile(player).getHerbalismInt() >= 650){
|
|
||||||
rank++;
|
|
||||||
} else if (mcUsers.getProfile(player).getHerbalismInt() >= 750){
|
|
||||||
rank++;
|
|
||||||
}
|
|
||||||
float skillvalue = (float)mcUsers.getProfile(player).getHerbalismInt();
|
|
||||||
String percentage = String.valueOf((skillvalue / 1000) * 100);
|
|
||||||
player.sendMessage(ChatColor.RED+"-----[]"+ChatColor.GREEN+"HERBALISM"+ChatColor.RED+"[]-----");
|
player.sendMessage(ChatColor.RED+"-----[]"+ChatColor.GREEN+"HERBALISM"+ChatColor.RED+"[]-----");
|
||||||
player.sendMessage(ChatColor.DARK_GRAY+"XP GAIN: "+ChatColor.WHITE+"Harvesting Herbs");
|
player.sendMessage(ChatColor.DARK_GRAY+"XP GAIN: "+ChatColor.WHITE+"Harvesting Herbs");
|
||||||
player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"EFFECTS"+ChatColor.RED+"[]---");
|
player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"EFFECTS"+ChatColor.RED+"[]---");
|
||||||
player.sendMessage(ChatColor.DARK_AQUA+"Food+: "+ChatColor.GREEN+"Modifies health received from bread/stew");
|
player.sendMessage(ChatColor.DARK_AQUA+"Food+: "+ChatColor.GREEN+"Modifies health received from bread/stew");
|
||||||
player.sendMessage(ChatColor.DARK_AQUA+"Double Drops (Wheat): "+ChatColor.GREEN+"Double the normal loot");
|
player.sendMessage(ChatColor.DARK_AQUA+"Double Drops (Wheat): "+ChatColor.GREEN+"Double the normal loot");
|
||||||
player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"YOUR STATS"+ChatColor.RED+"[]---");
|
|
||||||
player.sendMessage(ChatColor.RED+"Double Drop Chance: "+percentage+"%");
|
|
||||||
player.sendMessage(ChatColor.RED+"Food+ (Rank"+rank+"): Bonus "+rank+" healing");
|
|
||||||
}
|
}
|
||||||
if(split[0].equalsIgnoreCase("/excavation")){
|
if(split[0].equalsIgnoreCase("/excavation")){
|
||||||
|
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
int ticks = 2;
|
|
||||||
if(mcUsers.getProfile(player).getExcavationInt() >= 50)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getExcavationInt() >= 150)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getExcavationInt() >= 250)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getExcavationInt() >= 350)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getExcavationInt() >= 450)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getExcavationInt() >= 550)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getExcavationInt() >= 650)
|
|
||||||
ticks++;
|
|
||||||
if(mcUsers.getProfile(player).getExcavationInt() >= 750)
|
|
||||||
ticks++;
|
|
||||||
player.sendMessage(ChatColor.RED+"-----[]"+ChatColor.GREEN+"EXCAVATION"+ChatColor.RED+"[]-----");
|
player.sendMessage(ChatColor.RED+"-----[]"+ChatColor.GREEN+"EXCAVATION"+ChatColor.RED+"[]-----");
|
||||||
player.sendMessage(ChatColor.DARK_GRAY+"XP GAIN: "+ChatColor.WHITE+"Digging and finding treasures");
|
player.sendMessage(ChatColor.DARK_GRAY+"XP GAIN: "+ChatColor.WHITE+"Digging and finding treasures");
|
||||||
player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"EFFECTS"+ChatColor.RED+"[]---");
|
player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"EFFECTS"+ChatColor.RED+"[]---");
|
||||||
player.sendMessage(ChatColor.DARK_AQUA+"Giga Drill Breaker (ABILITY): "+ChatColor.GREEN+"3x Drop Rate, 3x EXP, +Speed");
|
|
||||||
player.sendMessage(ChatColor.DARK_AQUA+"Treasure Hunter: "+ChatColor.GREEN+"Ability to dig for treasure");
|
player.sendMessage(ChatColor.DARK_AQUA+"Treasure Hunter: "+ChatColor.GREEN+"Ability to dig for treasure");
|
||||||
player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"YOUR STATS"+ChatColor.RED+"[]---");
|
|
||||||
player.sendMessage(ChatColor.RED+"Giga Drill Breaker Length: "+ChatColor.YELLOW+(ticks * 2)+"s");
|
|
||||||
}
|
}
|
||||||
if(split[0].equalsIgnoreCase("/"+mcLoadProperties.mcmmo)){
|
if(split[0].equalsIgnoreCase("/"+mcLoadProperties.mcmmo)){
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
player.sendMessage(ChatColor.RED+"-----[]"+ChatColor.GREEN+"mcMMO"+ChatColor.RED+"[]-----");
|
player.sendMessage(ChatColor.GRAY+"mcMMO is an RPG inspired plugin");
|
||||||
player.sendMessage(ChatColor.YELLOW+"mcMMO is an RPG server mod for minecraft.");
|
player.sendMessage(ChatColor.GRAY+"You can gain skills in several professions by");
|
||||||
player.sendMessage(ChatColor.YELLOW+"There are many skills added by mcMMO to minecraft.");
|
player.sendMessage(ChatColor.GRAY+"doing things related to that profession.");
|
||||||
player.sendMessage(ChatColor.YELLOW+"They can do anything from giving a chance");
|
player.sendMessage(ChatColor.GRAY+"Mining for example will increase your mining XP.");
|
||||||
player.sendMessage(ChatColor.YELLOW+"for double drops to letting you break materials instantly.");
|
player.sendMessage(ChatColor.GRAY+"Wood Cutting will increase Wood Cutting, etc...");
|
||||||
player.sendMessage(ChatColor.YELLOW+"For example, by harvesting logs from trees you will gain");
|
player.sendMessage(ChatColor.GRAY+"Repairing is simple in mcMMO");
|
||||||
player.sendMessage(ChatColor.YELLOW+"Woodcutting xp and once you have enough xp you will gain");
|
player.sendMessage(ChatColor.GRAY+"Say you want to repair an iron shovel");
|
||||||
player.sendMessage(ChatColor.YELLOW+"a skill level in Woodcutting. By raising this skill you will");
|
player.sendMessage(ChatColor.GRAY+"start by making an anvil by combining 9 iron ingots");
|
||||||
player.sendMessage(ChatColor.YELLOW+"be able to receive benefits like "+ChatColor.RED+"double drops");
|
player.sendMessage(ChatColor.GRAY+"on a workbench. Place the anvil and while holding the shovel");
|
||||||
player.sendMessage(ChatColor.YELLOW+"and increase the effects of the "+ChatColor.RED+"\"Tree Felling\""+ChatColor.YELLOW+" ability.");
|
player.sendMessage(ChatColor.GRAY+"right click the anvil to interact with it, If you have spare");
|
||||||
player.sendMessage(ChatColor.YELLOW+"mcMMO has abilities related to the skill, skills normally");
|
player.sendMessage(ChatColor.GRAY+"iron ingots in your inventory the item will be repaired.");
|
||||||
player.sendMessage(ChatColor.YELLOW+"provide passive bonuses but they also have activated");
|
player.sendMessage(ChatColor.GRAY+"You cannot hurt other party members");
|
||||||
player.sendMessage(ChatColor.YELLOW+"abilities too. Each ability is activated by holding");
|
player.sendMessage(ChatColor.BLUE+"Set your own spawn with "+ChatColor.RED+"/"+mcLoadProperties.setmyspawn);
|
||||||
player.sendMessage(ChatColor.YELLOW+"the appropriate tool and "+ChatColor.RED+"right clicking.");
|
player.sendMessage(ChatColor.GREEN+"Based on your skills you will get "+ChatColor.DARK_RED+"random procs "+ChatColor.GREEN+ "when");
|
||||||
player.sendMessage(ChatColor.YELLOW+"For example, if you hold a Mining Pick and right click");
|
player.sendMessage(ChatColor.GREEN+"using your profession, like "+ChatColor.DARK_RED+"double drops "+ChatColor.GREEN+"or "+ChatColor.DARK_RED+"better repairs");
|
||||||
player.sendMessage(ChatColor.YELLOW+"you will ready your Pickaxe, attack mining materials");
|
player.sendMessage(ChatColor.GREEN+"Find out mcMMO commands with /"+mcLoadProperties.mcc);
|
||||||
player.sendMessage(ChatColor.YELLOW+"and then "+ChatColor.RED+"Super Breaker "+ChatColor.YELLOW+"will activate.");
|
player.sendMessage(ChatColor.GREEN+"Appreciate the mod? ");
|
||||||
player.sendMessage(ChatColor.GREEN+"Find out mcMMO commands with "+ChatColor.DARK_AQUA+"/"+mcLoadProperties.mcc);
|
|
||||||
player.sendMessage(ChatColor.GREEN+"You can donate via paypal to"+ChatColor.DARK_RED+" nossr50@gmail.com");
|
player.sendMessage(ChatColor.GREEN+"You can donate via paypal to"+ChatColor.DARK_RED+" nossr50@gmail.com");
|
||||||
}
|
}
|
||||||
if(split[0].equalsIgnoreCase("/"+mcLoadProperties.mcc)){
|
if(split[0].equalsIgnoreCase("/"+mcLoadProperties.mcc)){
|
||||||
@ -603,8 +341,6 @@ public class mcm {
|
|||||||
player.sendMessage("/"+mcLoadProperties.setmyspawn+" "+ChatColor.RED+"- Set your MySpawn");
|
player.sendMessage("/"+mcLoadProperties.setmyspawn+" "+ChatColor.RED+"- Set your MySpawn");
|
||||||
}
|
}
|
||||||
player.sendMessage(ChatColor.GREEN+"--OTHER COMMANDS--");
|
player.sendMessage(ChatColor.GREEN+"--OTHER COMMANDS--");
|
||||||
if(mcPermissions.getInstance().mcAbility(player))
|
|
||||||
player.sendMessage("/"+mcLoadProperties.mcability+ChatColor.RED+" - Toggle ability activation with right click");
|
|
||||||
if(mcPermissions.getInstance().adminChat(player)){
|
if(mcPermissions.getInstance().adminChat(player)){
|
||||||
player.sendMessage("/a "+ChatColor.RED+"- Toggle admin chat");
|
player.sendMessage("/a "+ChatColor.RED+"- Toggle admin chat");
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
name: mcMMO
|
name: mcMMO
|
||||||
main: com.gmail.nossr50.mcMMO
|
main: com.gmail.nossr50.mcMMO
|
||||||
version: 0.9.10
|
version: 0.8.11 WIP B17
|
Loading…
Reference in New Issue
Block a user