mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 07:06:45 +01:00
More changes - 0.9 WIP
This commit is contained in:
parent
cdb5547ed1
commit
8b5cfbf347
@ -584,33 +584,29 @@ public class mcCombat {
|
||||
if(x instanceof Animals){
|
||||
Animals animals = (Animals)x;
|
||||
if(animals.getHealth() >= 1){
|
||||
animals.setHealth(mcm.getInstance().calculateMinusHealth(animals.getHealth(), 2));
|
||||
animals.damage(1);
|
||||
}
|
||||
if(animals.getHealth() <= 0){
|
||||
mcm.getInstance().simulateNaturalDrops(x);
|
||||
animals.damage(1);
|
||||
}
|
||||
}
|
||||
if(x instanceof Monster){
|
||||
Monster monster = (Monster)x;
|
||||
if(monster.getHealth() >= 1){
|
||||
monster.setHealth(mcm.getInstance().calculateMinusHealth(monster.getHealth(), 2));
|
||||
monster.damage(1);
|
||||
}
|
||||
if(monster.getHealth() <= 0){
|
||||
mcm.getInstance().simulateNaturalDrops(x);
|
||||
monster.damage(1);
|
||||
}
|
||||
}
|
||||
|
||||
if(x instanceof Player){
|
||||
Player player = (Player)x;
|
||||
if(player.getHealth() >= 1 && mcUsers.getProfile(player).getBleedTicks() >= 1){
|
||||
player.setHealth(mcm.getInstance().calculateMinusHealth(player.getHealth(), 1));
|
||||
player.damage(1);
|
||||
player.sendMessage(ChatColor.RED+"**BLEED**");
|
||||
if(player.getHealth() <= 0){
|
||||
mcUsers.getProfile(player).setBleedTicks(0);
|
||||
for(ItemStack items : player.getInventory().getContents()){
|
||||
if(items.getTypeId() != 0)
|
||||
player.getLocation().getWorld().dropItemNaturally(player.getLocation(), items);
|
||||
}
|
||||
}
|
||||
if(mcUsers.getProfile(player).getBleedTicks() >= 1){
|
||||
mcUsers.getProfile(player).setBleedTicks(mcUsers.getProfile(player).getBleedTicks() - 1);
|
||||
|
@ -27,6 +27,7 @@ public class mcConfig {
|
||||
public void addTreeFeller(Block block) {treeFeller.add(block);}
|
||||
public void addBleedTrack(Entity entity) {bleedTracker.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 void addArrowTrack(Entity entity, Integer arrowcount) {arrowTracker.put(entity, arrowcount);}
|
||||
public Integer getArrowCount(Entity entity) {return arrowTracker.get(entity);}
|
||||
|
@ -125,6 +125,9 @@ public class mcEntityListener extends EntityListener {
|
||||
public void onEntityDeath(EntityDeathEvent event) {
|
||||
Entity x = event.getEntity();
|
||||
mcSkills.getInstance().arrowRetrievalCheck(x);
|
||||
if(mcConfig.getInstance().isMobSpawnTracked(x)){
|
||||
mcConfig.getInstance().removeMobSpawnTrack(x);
|
||||
}
|
||||
if(x instanceof Player){
|
||||
Player player = (Player)x;
|
||||
if(mcUsers.getProfile(player).isDead()){
|
||||
|
@ -33,6 +33,16 @@ public class mcSkills {
|
||||
}
|
||||
}
|
||||
}
|
||||
public void decreaseCooldowns(Player player){
|
||||
mcUsers.getProfile(player).decreaseTreeFellerCooldown();
|
||||
if(mcUsers.getProfile(player).getTreeFellerCooldown() == 0){
|
||||
player.sendMessage(ChatColor.GREEN+"Your Tree Felling ability is refreshed!");
|
||||
}
|
||||
mcUsers.getProfile(player).decreaseSuperBreakerCooldown();
|
||||
if(mcUsers.getProfile(player).getSuperBreakerCooldown() == 0){
|
||||
player.sendMessage(ChatColor.GREEN+"Your Super Breaker ability is refreshed!");
|
||||
}
|
||||
}
|
||||
public void XpCheck(Player player){
|
||||
/*
|
||||
* ACROBATICS
|
||||
|
@ -15,58 +15,37 @@ public class mcTimer extends TimerTask{
|
||||
|
||||
public void run() {
|
||||
Player[] playerlist = plugin.getServer().getOnlinePlayers();
|
||||
/*
|
||||
if(thecount == 5 || thecount == 10 || thecount == 15 || thecount == 20){
|
||||
for(Player player : playerlist){
|
||||
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
|
||||
&& mcPermissions.getInstance().regeneration(player)){
|
||||
&& mcUsers.getProfile(player).getRecentlyHurt() == 0){
|
||||
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)){
|
||||
&& mcUsers.getProfile(player).getRecentlyHurt() == 0){
|
||||
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)){
|
||||
&& mcUsers.getProfile(player).getRecentlyHurt() == 0){
|
||||
player.setHealth(mcm.getInstance().calculateHealth(player.getHealth(), 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
for(Player player : playerlist){
|
||||
if(player != null && mcUsers.getProfile(player).getRecentlyHurt() >= 1){
|
||||
mcUsers.getProfile(player).decreaseLastHurt();
|
||||
}
|
||||
}
|
||||
if(thecount < 20){
|
||||
thecount++;
|
||||
} else {
|
||||
thecount = 1;
|
||||
}
|
||||
mcCombat.getInstance().bleedSimulate();
|
||||
*/
|
||||
|
||||
/*
|
||||
* COOLDOWN INTERACTIONS
|
||||
*/
|
||||
for(Player player : playerlist){
|
||||
/*
|
||||
* WOODCUTTING ABILITY
|
||||
*/
|
||||
@ -80,13 +59,6 @@ public class mcTimer extends TimerTask{
|
||||
player.sendMessage(ChatColor.GRAY+"**You feel strength leaving you**");
|
||||
}
|
||||
}
|
||||
//Monitor the cooldown
|
||||
if(!mcUsers.getProfile(player).getTreeFellerMode() && mcUsers.getProfile(player).getTreeFellerCooldown() >= 1){
|
||||
mcUsers.getProfile(player).decreaseTreeFellerCooldown();
|
||||
if(mcUsers.getProfile(player).getTreeFellerCooldown() == 0){
|
||||
player.sendMessage(ChatColor.GREEN+"Your Tree Felling ability is refreshed!");
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* MINING ABILITY
|
||||
@ -101,14 +73,21 @@ public class mcTimer extends TimerTask{
|
||||
player.sendMessage(ChatColor.GRAY+"**You feel strength leaving you**");
|
||||
}
|
||||
}
|
||||
//Monitor the cooldown
|
||||
if(!mcUsers.getProfile(player).getSuperBreakerMode() && mcUsers.getProfile(player).getSuperBreakerCooldown() >= 1){
|
||||
mcUsers.getProfile(player).decreaseSuperBreakerCooldown();
|
||||
if(mcUsers.getProfile(player).getSuperBreakerCooldown() == 0){
|
||||
player.sendMessage(ChatColor.GREEN+"Your Super Breaker ability is refreshed!");
|
||||
}
|
||||
}
|
||||
/*
|
||||
* COOLDOWN MONITORING
|
||||
*/
|
||||
if(mcUsers.getProfile(player).hasCooldowns())
|
||||
mcSkills.getInstance().decreaseCooldowns(player);
|
||||
}
|
||||
if(thecount < 20){
|
||||
thecount++;
|
||||
} else {
|
||||
thecount = 1;
|
||||
}
|
||||
/*
|
||||
* BLEED MONITORING
|
||||
*/
|
||||
mcCombat.getInstance().bleedSimulate();
|
||||
}
|
||||
}
|
||||
|
@ -433,6 +433,13 @@ class PlayerList
|
||||
public void setBleedTicks(Integer newvalue){
|
||||
bleedticks = newvalue;
|
||||
}
|
||||
public Boolean hasCooldowns(){
|
||||
if((treefellercooldown + superbreakercooldown) >= 1){
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* TREE FELLER STUFF
|
||||
*/
|
||||
|
@ -87,6 +87,7 @@ public class mcWoodCutting {
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user