diff --git a/BankEconomyMod/src/me/kaZep/Base/Main.java b/BankEconomyMod/src/me/kaZep/Base/Main.java index 0e68621..d6ce417 100644 --- a/BankEconomyMod/src/me/kaZep/Base/Main.java +++ b/BankEconomyMod/src/me/kaZep/Base/Main.java @@ -110,6 +110,7 @@ public class Main extends JavaPlugin public long last_bank_withdraw_use_time=0; public String last_bank_withdraw_user=""; public long last_boss_dungeon_time=0; + public long last_player_death_time=0; public long check_nether_time=0; public long check_lights_time=0; public long check_spleef_game=0; diff --git a/BankEconomyMod/src/me/kaZep/Base/PlayerListener.java b/BankEconomyMod/src/me/kaZep/Base/PlayerListener.java index 2b49c27..b125b2d 100644 --- a/BankEconomyMod/src/me/kaZep/Base/PlayerListener.java +++ b/BankEconomyMod/src/me/kaZep/Base/PlayerListener.java @@ -7107,6 +7107,60 @@ implements Listener ev.event=0; this.plugin.explorers.add(ev); } + + + final public void doFireAspectDamage(final LivingEntity l, final Main plug) { + Bukkit.getScheduler().scheduleSyncDelayedTask(this.plugin, new Runnable() { + @Override + public void run() { + if (l.getHealth()!=0 && l.getFireTicks()>60 && !l.hasPotionEffect(PotionEffectType.FIRE_RESISTANCE)) { + double firedmg=1; + double oldfireticks=l.getFireTicks(); + DecimalFormat df = new DecimalFormat("#0.0"); + DecimalFormat df2 = new DecimalFormat("#0"); + //Bukkit.getLogger().info(l.getType().name()+" health: "+l.getHealth()+", Fire ticks:"+l.getFireTicks()); + //Get all fire protection values. + if (l.getEquipment().getBoots()!=null) { + for (int i=0;i0) { + l.setHealth(l.getHealth()-firedmg); + } else { + l.setHealth(0); + } + if (l instanceof Player) { + if (plug.getAccountsConfig().getBoolean(((Player)l).getName()+".settings.notify5")) { + ((Player)l).sendMessage(ChatColor.DARK_PURPLE+""+ChatColor.ITALIC+"Took "+df.format(firedmg)+" damage from "+ChatColor.WHITE+"FIRE_TICK"+ChatColor.DARK_PURPLE+""+ChatColor.ITALIC+" (-"+df2.format(((firedmg)/l.getMaxHealth())*100)+"%)"); + } + } + doFireAspectDamage(l, plug); + } + } + },(int)(20/((double)l.getFireTicks()/60))+1); + } @EventHandler public void onHurt(EntityDamageEvent e) { @@ -7200,14 +7254,11 @@ implements Listener } } EntityType allowedtypes[] = {EntityType.BAT,EntityType.BLAZE,EntityType.CAVE_SPIDER,EntityType.ENDERMAN,EntityType.GHAST,EntityType.MAGMA_CUBE,EntityType.PIG_ZOMBIE,EntityType.SILVERFISH,EntityType.SLIME,EntityType.SPIDER,EntityType.ZOMBIE,EntityType.SKELETON,EntityType.CREEPER}; - boolean contains=e.getEntity() instanceof Monster; + boolean contains=e.getEntity() instanceof LivingEntity; if (contains) { LivingEntity l = (LivingEntity)e.getEntity(); - if ((l.getCustomName()==null || (!l.getCustomName().contains(ChatColor.DARK_PURPLE+"") && !l.getCustomName().contains(ChatColor.DARK_AQUA+""))) && l.getType()!=EntityType.ENDER_DRAGON) { - if ((l.getTicksLived()<120 && e.getCause()==DamageCause.SUFFOCATION)) { - l.remove(); - e.setCancelled(true); - } + if (l.getFireTicks()>60 && e.getCause()==DamageCause.LAVA && !l.hasPotionEffect(PotionEffectType.FIRE_RESISTANCE)) { + l.setFireTicks(l.getFireTicks()+20); } } } @@ -7271,6 +7322,9 @@ implements Listener @EventHandler public void onPlayerOnFire(EntityCombustEvent e) { + if (e.getEntity() instanceof LivingEntity) { + doFireAspectDamage(((LivingEntity)e.getEntity()), this.plugin); + } if (e.getEntity().getType()==EntityType.PLAYER) { Player p = (Player)e.getEntity(); if (this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat6")>0) { @@ -10891,7 +10945,7 @@ implements Listener } //There is a small chance we can swap items between two centers. - if (Math.random()<=0.01) { + if (Math.random()<=0.15) { //Get the first center. It's randomly picked. if (this.plugin.recycling_center_list.size()<=2) { //If there are only two centers in the list, it has to be those two... @@ -11749,6 +11803,7 @@ implements Listener //If we have Fatal Survivor, use the force! Otherwise, uh, you're dead. final Player p = e.getEntity(); + this.plugin.last_player_death_time = Main.SERVER_TICK_TIME; e.setDeathMessage(e.getDeathMessage().replace(p.getScoreboard().getTeam(p.getName()).getPrefix()+p.getName()+p.getScoreboard().getTeam(p.getName()).getSuffix(),p.getName())); p.getScoreboard().getTeam(p.getName()).setSuffix(""); boolean survivor=false; @@ -14346,4 +14401,4 @@ class updateInventoryTask implements Runnable { return false; } -} \ No newline at end of file +} diff --git a/BankEconomyMod/src/me/kaZep/Base/RecyclingCenterNode.java b/BankEconomyMod/src/me/kaZep/Base/RecyclingCenterNode.java index 889670c..887c5d3 100644 --- a/BankEconomyMod/src/me/kaZep/Base/RecyclingCenterNode.java +++ b/BankEconomyMod/src/me/kaZep/Base/RecyclingCenterNode.java @@ -15,8 +15,8 @@ import org.bukkit.plugin.Plugin; //deposit, choosing the closest one. public class RecyclingCenterNode { - public static double chanceincrease = 3.0; //The amount of chance that each item will increase the chest as it gets placed. Increase this for less items. - public static double chestdecrease = 0.05; //The amount of chance that each item will decrease the chest. Increase this for more items. + public static double chanceincrease = 1.5; //The amount of chance that each item will increase the chest as it gets placed. Increase this for less items. + public static double chestdecrease = 0.25; //The amount of chance that each item will decrease the chest. Increase this for more items. //Store our items we can give out array along with our rare items we might potentially track. public static int[] items = {1,3,4,5,6,12,13,14,15,17,18,20,22,23,24,25,27,28,39,31,32,33,35,37,38,39,40,41,42,44,45,46,47,48,49,50,53,54,57,58,61,65,66,67,69,70,72,76,77,78,80,81,82,84,85,86,87,88,89,91,96,98,101,102,103,106,107,108,109,111,112,113,114,116,121,122,123,126,128,130,131,133,134,135,136,138,139,143,145,146,147,148,151,152,154,155,156,157,158,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,2256,2257,2258,2259,2260,2261,2262,2263,2264,2265,2266,2267}; //Rare items can only be given out in quantities of 1. To prevent massive amounts of OP. @@ -102,7 +102,7 @@ public class RecyclingCenterNode { tempchance*=2.0d; } } - if (Math.random()*tempchance<1.0d) { + if (Math.random()*tempchance<1.0d || (Main.SERVER_TICK_TIME-this.plugin.last_player_death_time<=12000 && Math.random()*tempchance<3.0d)) { boolean contains=false; for (int k=0;k - - - - - diff --git a/Plugin/.project b/Plugin/.project deleted file mode 100644 index ca7dc5f..0000000 --- a/Plugin/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - Plugin - - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - - diff --git a/Plugin/.settings/org.eclipse.jdt.core.prefs b/Plugin/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 54e493c..0000000 --- a/Plugin/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,11 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.6