diff --git a/TwosideKeeper.jar b/TwosideKeeper.jar
index 04eab4f..948c099 100644
Binary files a/TwosideKeeper.jar and b/TwosideKeeper.jar differ
diff --git a/src/sig/plugin/TwosideKeeper/Buff.java b/src/sig/plugin/TwosideKeeper/Buff.java
index d0950e7..238f20f 100644
--- a/src/sig/plugin/TwosideKeeper/Buff.java
+++ b/src/sig/plugin/TwosideKeeper/Buff.java
@@ -17,7 +17,17 @@ public class Buff {
private Color col;
private String icon;
private boolean isGoodBuff; //If false, it's a debuff.
+ private boolean permanentBuff; //Whether or not this buff/debuff cannot be removed by normal means.
+ /**
+ * Creates a new Buff structure.
+ * @param displayName The name that will show up in the action bar for players if they have this buff.
+ * @param duration The amount of time in ticks the buff will remain active.
+ * @param amplifier The amplifier/level/stack amount of this buff.
+ * @param buffcolor The color of the particles this buff creates.
+ * @param icon An icon that appears for the buff in the action bar and status bar for monster name tags. This typically includes a chat color code as well to distinguish this buff's color.
+ * @param isGoodBuff Whether or not this is a good buff. Debuffs should have this set to false.
+ */
public Buff(String displayName, long duration, int amplifier, Color buffcolor, String icon, boolean isGoodBuff) {
this.displayName=displayName;
this.expireTime=TwosideKeeper.getServerTickTime()+duration;
@@ -25,6 +35,27 @@ public class Buff {
this.col=buffcolor;
this.icon=icon;
this.isGoodBuff=isGoodBuff;
+ this.permanentBuff=false;
+ }
+
+ /**
+ * Creates a new Buff structure.
+ * @param displayName The name that will show up in the action bar for players if they have this buff.
+ * @param duration The amount of time in ticks the buff will remain active.
+ * @param amplifier The amplifier/level/stack amount of this buff.
+ * @param buffcolor The color of the particles this buff creates.
+ * @param icon An icon that appears for the buff in the action bar and status bar for monster name tags. This typically includes a chat color code as well to distinguish this buff's color.
+ * @param isGoodBuff Whether or not this is a good buff. Debuffs should have this set to false.
+ * @param permanentBuff Whether or not this buff cannot be removed. When set to true, the method buffCanBeRemoved() returns false, notifying the programmers that this buff should not be removed. This make the use of removeBuff() for this buff do absolutely nothing.
+ */
+ public Buff(String displayName, long duration, int amplifier, Color buffcolor, String icon, boolean isGoodBuff, boolean permanentBuff) {
+ this.displayName=displayName;
+ this.expireTime=TwosideKeeper.getServerTickTime()+duration;
+ this.level=amplifier;
+ this.col=buffcolor;
+ this.icon=icon;
+ this.isGoodBuff=isGoodBuff;
+ this.permanentBuff=permanentBuff;
}
public static boolean hasBuffInHashMap(LivingEntity l, String name) {
@@ -111,7 +142,11 @@ public class Buff {
public static void addBuff(LivingEntity l, String name, Buff buff) {
addBuff(l,name,buff,false);
}
-
+ /**
+ * Attempts to add a buff to the target. This will not necessarily add the buff if the amplifier
+ * is weaker than what is currently applied, or the amplifier is the same but the duration is less.
+ * This follows the same rules established by all other buff mechanics added previously to the server.
+ */
public static void addBuff(LivingEntity l, String name, Buff buff, boolean stacking) {
if (l instanceof Player) {
Player p = (Player)l;
@@ -170,43 +205,77 @@ public class Buff {
if (l instanceof Player) {
Player p = (Player)l;
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
- pd.buffs.remove(name);
+ Buff b = pd.buffs.remove(name);
+ if (b!=null && !b.buffCanBeRemoved()) {
+ pd.buffs.put(name, b);
+ }
} else {
LivingEntityStructure les = LivingEntityStructure.GetLivingEntityStructure(l);
- les.buffs.remove(name);
+ Buff b = les.buffs.remove(name);
+ if (b!=null && !b.buffCanBeRemoved()) {
+ les.buffs.put(name, b);
+ }
}
}
+ /**
+ * Increases the level relative to the amt provided.
+ */
public void increaseStacks(int amt) {
level+=amt;
}
+ /**
+ * Decreases the level relative to the amt provided. Can go negative.
+ */
public void decreaseStacks(int amt) {
level-=amt;
}
+ /**
+ * Sets the level of the buff directly to amt.
+ */
public void setStacks(int amt) {
level=amt;
}
+ /**
+ * Increases the duration of the buff by duration number of ticks.
+ */
public void increaseDuration(int duration) {
expireTime+=duration;
}
+ /**
+ * Decreases duration of the buff by duration number of ticks.
+ */
public void decreaseDuration(int duration) {
expireTime-=duration;
}
+ /**
+ * Sets the duration of the buff to duration ticks.
+ */
public void setDuration(int duration) {
refreshDuration(duration);
}
+ /**
+ * Refreshes the buff's duration so time starts at the original duration again.
+ */
public void refreshDuration(int duration) {
expireTime=TwosideKeeper.getServerTickTime()+duration;
}
-
+ /**
+ * Whether or not this is considered a good buff (true) or a bad buff (false)
+ */
public boolean isGoodBuff() {
return isGoodBuff;
}
+ /**
+ * Whether or not this is considered a bad buff (true) or a good buff (false)
+ */
public boolean isDebuff() {
return !isGoodBuff;
}
-
- private static boolean hasBuffExpired(Buff b) {
+ /**
+ * Whether or not this buff has ran out of time.
+ */
+ public static boolean hasBuffExpired(Buff b) {
if (b.expireTime ents = l.getWorld().getNearbyEntities(l, range, range, range);
+ return ents.toArray(new Entity[ents.size()]);
+ }
+
+ public List getPlayersOnNode() {
+ long time = System.nanoTime();
+ Collection ents = l.getWorld().getNearbyEntities(l, range, range, range);
+ List list = new ArrayList();
+ for (Entity e : ents) {
+ if (e instanceof Player) {
+ list.add(e);
+ }
+ }
+ TwosideKeeper.log("Calculation time via nearby entities: "+(System.nanoTime()-time), TwosideKeeper.TIMINGS_DEBUG);
+ return list;
+ }
+
+ public List getNonPlayersOnNode() {
+ long time = System.nanoTime();
+ Collection ents = l.getWorld().getNearbyEntities(l, range, range, range);
+ List list = new ArrayList();
+ for (Entity e : ents) {
+ if (!(e instanceof Player)) {
+ list.add(e);
+ }
+ }
+ TwosideKeeper.log("Calculation time via nearby entities: "+(System.nanoTime()-time), TwosideKeeper.TIMINGS_DEBUG);
+ return list;
+ }
+ @Deprecated
+ public List getPlayersOnNodeViaDistanceSearch() {
+ long time = System.nanoTime();
+ List list = new ArrayList();
+ for (Player p : Bukkit.getOnlinePlayers()) {
+ if (p.getLocation().distance(l)<=range) {
+ list.add(p);
+ }
+ }
+ TwosideKeeper.log("Calculation time via distance search: "+(System.nanoTime()-time), TwosideKeeper.TIMINGS_DEBUG);
+ return list;
+ }
}
diff --git a/src/sig/plugin/TwosideKeeper/HelperStructures/ItemSet.java b/src/sig/plugin/TwosideKeeper/HelperStructures/ItemSet.java
index 87d0675..2408f16 100644
--- a/src/sig/plugin/TwosideKeeper/HelperStructures/ItemSet.java
+++ b/src/sig/plugin/TwosideKeeper/HelperStructures/ItemSet.java
@@ -958,10 +958,10 @@ public enum ItemSet {
lore.add(ChatColor.GRAY+" this target has to nearby targets.)");
lore.add(ChatColor.DARK_AQUA+" 4 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 4)+"% Chance of projectiles applying Cripple "+WorldShop.toRomanNumeral(tier)+" to target (10 sec).");
lore.add(ChatColor.GRAY+" (Cripple slows the target and decreases target's damage");
- lore.add(ChatColor.GRAY+" outpu t by 10% per level.)");
+ lore.add(ChatColor.GRAY+" output by 10% per level.)");
lore.add(ChatColor.DARK_AQUA+" 5 - "+ABILITY_LABEL+" Fire Cesspool"+ABILITY_LABEL_END);
- lore.add(ChatColor.GRAY+" Shooting projectiles at the ground converts the land into");
- lore.add(ChatColor.GRAY+" a temporary fire pool, applying stacking Burn to all");
+ lore.add(ChatColor.GRAY+" When projectiles hit a target, a temporary file pool");
+ lore.add(ChatColor.GRAY+" is created around it, applying stacking Burn to all");
lore.add(ChatColor.GRAY+" enemy targets in the fire pool. (Burn deals more damage");
lore.add(ChatColor.GRAY+" as the number of stacks increase.)");
break;
diff --git a/src/sig/plugin/TwosideKeeper/TwosideKeeper.java b/src/sig/plugin/TwosideKeeper/TwosideKeeper.java
index 0a74f5a..5c3582e 100644
--- a/src/sig/plugin/TwosideKeeper/TwosideKeeper.java
+++ b/src/sig/plugin/TwosideKeeper/TwosideKeeper.java
@@ -231,6 +231,7 @@ import sig.plugin.TwosideKeeper.HelperStructures.Effects.EarthWaveTask;
import sig.plugin.TwosideKeeper.HelperStructures.Effects.LavaPlume;
import sig.plugin.TwosideKeeper.HelperStructures.Effects.ReplaceBlockTask;
import sig.plugin.TwosideKeeper.HelperStructures.Effects.TemporaryBlock;
+import sig.plugin.TwosideKeeper.HelperStructures.Effects.TemporaryBlockNode;
import sig.plugin.TwosideKeeper.HelperStructures.Effects.TemporaryIce;
import sig.plugin.TwosideKeeper.HelperStructures.Effects.TemporaryLava;
import sig.plugin.TwosideKeeper.HelperStructures.Effects.WindSlash;
@@ -452,6 +453,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
public static final int COMBAT_DEBUG = 3;
public static final int GRAPH_DEBUG = 5;
public static final int GRAPH_DEBUG2 = 0;
+ public static final int TIMINGS_DEBUG = 5;
public static double worldShopDistanceSquared = 1000000;
public static double worldShopPriceMult = 2.0; //How much higher the price increases for every increment of worlsShopDistanceSquared.
@@ -478,6 +480,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
public static List cameras = new ArrayList();
public static List arenas = new ArrayList();
public static List windslashes = new ArrayList();
+ public static List blocknodes = new ArrayList();
public static HashMap temporaryblocks = new HashMap();
//public static stats StatCommand = new stats();
@@ -848,6 +851,13 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
}
}
TwosideKeeper.HeartbeatLogger.AddEntry("Temporary Wind Slash Handling", (int)(System.nanoTime()-time));time=System.nanoTime();
+ for (TemporaryBlockNode tbn : blocknodes) {
+ if (!tbn.runTick()) {
+ ScheduleRemoval(blocknodes,tbn);
+ }
+ }
+ TwosideKeeper.HeartbeatLogger.AddEntry("Temporary Block Node Handling", (int)(System.nanoTime()-time));time=System.nanoTime();
+
if ((int)(System.nanoTime()-totaltime)/1000000d>50) {
TwosideKeeper.log("WARNING! Structure Handling took longer than 1 tick! "+((int)(System.nanoTime()-totaltime)/1000000d)+"ms", 0);
}
@@ -1879,6 +1889,11 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
case "PARKOUR":{
p.sendMessage("PARKOUR!!");
}break;
+ case "TEMPORARYNODE":{
+ TemporaryBlockNode tbn = new TemporaryBlockNode(p.getLocation(),5,200,"TESTNODE",Particle.CRIT,30);
+ /*tbn.getPlayersOnNodeViaDistanceSearch();
+ tbn.getPlayersOnNodeViaNearbyEntities();*/
+ }break;
}
}
@@ -3131,32 +3146,25 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
@EventHandler(priority=EventPriority.LOW,ignoreCancelled = true)
public void onArrowHitBlock(ProjectileHitEvent ev) {
+ Projectile proj = ev.getEntity();
+ LivingEntity shooter = CustomDamage.getDamagerEntity(proj);
+ if (shooter!=null && shooter instanceof Player) {
+ Player p = (Player)shooter;
+ if (ItemSet.hasFullSet(p, ItemSet.SHARD)) {
+ GenericFunctions.DealExplosionDamageToEntities(ev.getEntity().getLocation(), 40f+shooter.getHealth()*0.1, 2, shooter, "Shrapnel Explosion");
+ aPlugin.API.sendSoundlessExplosion(ev.getEntity().getLocation(), 1);
+ SoundUtils.playGlobalSound(ev.getEntity().getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 0.6f, 0.5f);
+ }
+ else
+ if (!proj.hasMetadata("FIREPOOL") && ItemSet.hasFullSet(p, ItemSet.TOXIN)) {
+ //new TemporaryBlockNode(proj.getLocation(),3,100,"FIREPOOL",Particle.DRIP_LAVA,40);
+ TemporaryBlock.createTemporaryBlockCircle(proj.getLocation().add(0,-2,0), 2, Material.REDSTONE_BLOCK, (byte)0, 100, "FIRECESSPOOL");
+ proj.setMetadata("FIREPOOL", new FixedMetadataValue(this,true));
+ }
+ }
+
if (ev.getEntity() instanceof Arrow) {
Arrow a = (Arrow)ev.getEntity();
- LivingEntity shooter = CustomDamage.getDamagerEntity(a);
- if (shooter!=null && shooter instanceof Player) {
- Player p = (Player)shooter;
- if (ItemSet.hasFullSet(p, ItemSet.SHARD)) {
- GenericFunctions.DealExplosionDamageToEntities(ev.getEntity().getLocation(), 40f+shooter.getHealth()*0.1, 2, shooter, "Shrapnel Explosion");
- aPlugin.API.sendSoundlessExplosion(ev.getEntity().getLocation(), 1);
- SoundUtils.playGlobalSound(ev.getEntity().getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 0.6f, 0.5f);
- }
- else
- if (!a.hasMetadata("FIREPOOL") && ItemSet.hasFullSet(p, ItemSet.TOXIN)) {
- //TemporaryBlock.createTemporaryBlockCircle(a.getLocation().add(0,-2,0), 2, Material.REDSTONE_BLOCK, (byte)0, 100, "FIRECESSPOOL");
- //a.setMetadata("FIREPOOL", new FixedMetadataValue(this,true));
- AreaEffectCloud aec = (AreaEffectCloud)a.getWorld().spawnEntity(a.getLocation().getBlock().getLocation(), EntityType.AREA_EFFECT_CLOUD);
- aec.setCustomName("FIREPOOL");
- aec.setParticle(Particle.DRIP_LAVA);
- aec.setDurationOnUse(20*5);
- aec.setDuration(20*5);
- aec.setRadius(2);
- aec.setGlowing(true);
- aec.setReapplicationDelay(20);
- aec.setWaitTime(0);
- aec.addCustomEffect(new PotionEffect(PotionEffectType.HARM,0,0), true);
- }
- }
a.setCustomName("HIT");
return;
}
diff --git a/src/sig/plugin/TwosideKeeper/TwosideKeeperAPI.java b/src/sig/plugin/TwosideKeeper/TwosideKeeperAPI.java
index 130489e..aab6647 100644
--- a/src/sig/plugin/TwosideKeeper/TwosideKeeperAPI.java
+++ b/src/sig/plugin/TwosideKeeper/TwosideKeeperAPI.java
@@ -1,6 +1,7 @@
package sig.plugin.TwosideKeeper;
import java.util.Collection;
+import java.util.HashMap;
import java.util.List;
import org.bukkit.Location;
@@ -615,4 +616,66 @@ public final class TwosideKeeperAPI {
public static double getCooldownReduction(Player p) {
return CustomDamage.calculateCooldownReduction(p);
}
+
+ //Buff COMMANDS.
+ /**
+ * Returns whether or not a particular buff is active or not. Note that this is not the same
+ * as seeing if it exists in a player's buff data structure as expired buffs exist in those.
+ */
+ public static boolean isBuffActive(LivingEntity l, String buffname) {
+ return Buff.hasBuff(l,buffname);
+ }
+ /**
+ * Outputs all buffs a particular LivingEntity has to the console.
+ */
+ public static void outputBuffsToConsole(LivingEntity l) {
+ Buff.outputBuffs(l);
+ }
+ /**
+ * Returns a HashMap containing ALL buffs, expired or not that have been
+ * applied to this LivingEntity. Try isBuffExpired() to check which ones are
+ * active and which ones are not.
+ */
+ public static HashMap getBuffData(LivingEntity l) {
+ return Buff.getBuffData(l);
+ }
+ /**
+ * Returns whether or not this particular buff has expired. Note that past expired
+ * buffs are included in a player's buff data, so checking for expiration is
+ * important.
+ */
+ public static boolean isBuffExpired(Buff b) {
+ return Buff.hasBuffExpired(b);
+ }
+ /**
+ * Returns the remaining buff time in ticks of this particular buff. Returns 0 if the buff has expired already.
+ */
+ public static long getRemainingBuffTime(Buff b) {
+ return b.getRemainingBuffTime();
+ }
+ /**
+ * Returns the tick at which this buff expires.
+ */
+ public static long getBuffExpirationTickTime(Buff b) {
+ return b.getExpireTime();
+ }
+ /**
+ * Adds a buff to the player's buff data structure, overwriting the buff if it contains
+ * the same name. A new Buff data structure has to be created and filled in.
+ */
+ public static void addBuff(LivingEntity l, String name, Buff buff, boolean stacking) {
+ Buff.addBuff(l, name, buff, stacking);
+ }
+ /**
+ * Removes a buff, if possible.
+ */
+ public static void removeBuff(LivingEntity l, String name) {
+ Buff.removeBuff(l, name);
+ }
+ /**
+ * Returns whether or not a buff can be removed. (If it's not permanent)
+ */
+ public static boolean buffCanBeRemoved(Buff b) {
+ return Buff.buffCanBeRemoved(b);
+ }
}
diff --git a/src/sig/plugin/TwosideKeeper/runServerHeartbeat.java b/src/sig/plugin/TwosideKeeper/runServerHeartbeat.java
index 76b5f74..effa51e 100644
--- a/src/sig/plugin/TwosideKeeper/runServerHeartbeat.java
+++ b/src/sig/plugin/TwosideKeeper/runServerHeartbeat.java
@@ -348,7 +348,7 @@ final class runServerHeartbeat implements Runnable {
PlayerStructure pd = PlayerStructure.GetPlayerStructure((Player)ent);
if (Buff.hasBuff(ent, "Poison") && pd.lastPoisonTick+getPoisonTickDelay(ent)<=TwosideKeeper.getServerTickTime()) {
Bukkit.getScheduler().runTaskLater(TwosideKeeper.plugin, ()->{
- if (ent!=null) {
+ if (ent!=null && Buff.hasBuff(ent, "Poison")) {
CustomDamage.ApplyDamage(Buff.getBuff(ent, "Poison").getAmplifier(), null, ent, null, "POISON", CustomDamage.IGNOREDODGE|CustomDamage.TRUEDMG|CustomDamage.IGNORE_DAMAGE_TICK);
pd.lastPoisonTick=TwosideKeeper.getServerTickTime();
}
@@ -356,7 +356,7 @@ final class runServerHeartbeat implements Runnable {
}
if (Buff.hasBuff(ent, "SHRAPNEL") && pd.lastShrapnelTick<=TwosideKeeper.getServerTickTime()) {
Bukkit.getScheduler().runTaskLater(TwosideKeeper.plugin, ()->{
- if (ent!=null) {
+ if (ent!=null && Buff.hasBuff(ent, "SHRAPNEL")) {
CustomDamage.ApplyDamage((Buff.getBuff(ent, "SHRAPNEL").getAmplifier()*2)*(1d-CustomDamage.getFireResistance(ent)), null, ent, null, "Shrapnel", CustomDamage.IGNOREDODGE|CustomDamage.TRUEDMG|CustomDamage.IGNORE_DAMAGE_TICK);
pd.lastShrapnelTick=TwosideKeeper.getServerTickTime();
SoundUtils.playLocalSound((Player)ent, Sound.ENTITY_GENERIC_EXTINGUISH_FIRE, 1.0f, 1.0f);
@@ -366,7 +366,7 @@ final class runServerHeartbeat implements Runnable {
}
if (Buff.hasBuff(ent, "BLEEDING") && pd.lastBleedingTick<=TwosideKeeper.getServerTickTime()) {
Bukkit.getScheduler().runTaskLater(TwosideKeeper.plugin, ()->{
- if (ent!=null) {
+ if (ent!=null && Buff.hasBuff(ent, "BLEEDING")) {
CustomDamage.ApplyDamage((Buff.getBuff(ent, "BLEEDING").getAmplifier()), null, ent, null, "Bleeding", CustomDamage.IGNOREDODGE|CustomDamage.TRUEDMG|CustomDamage.IGNORE_DAMAGE_TICK);
pd.lastBleedingTick=TwosideKeeper.getServerTickTime();
//SoundUtils.playLocalSound((Player)ent, Sound.ENTITY_GENERIC_EXTINGUISH_FIRE, 1.0f, 1.0f);
@@ -381,7 +381,7 @@ final class runServerHeartbeat implements Runnable {
}
if (Buff.hasBuff(ent, "INFECTION") && pd.lastInfectionTick<=TwosideKeeper.getServerTickTime()) {
Bukkit.getScheduler().runTaskLater(TwosideKeeper.plugin, ()->{
- if (ent!=null) {
+ if (ent!=null && Buff.hasBuff(ent, "INFECTION")) {
CustomDamage.ApplyDamage(Buff.getBuff(ent, "INFECTION").getAmplifier(), null, ent, null, "Infection", CustomDamage.IGNOREDODGE|CustomDamage.TRUEDMG|CustomDamage.IGNORE_DAMAGE_TICK);
pd.lastInfectionTick=TwosideKeeper.getServerTickTime();
infectNearbyPlayers(ent,pd.buffs);
@@ -399,7 +399,7 @@ final class runServerHeartbeat implements Runnable {
}
if (Buff.hasBuff(ent, "BURN") && pd.lastBurnTick<=TwosideKeeper.getServerTickTime()) {
Bukkit.getScheduler().runTaskLater(TwosideKeeper.plugin, ()->{
- if (ent!=null) {
+ if (ent!=null && Buff.hasBuff(ent, "BURN")) {
CustomDamage.ApplyDamage(Buff.getBuff(ent, "BURN").getAmplifier(), null, ent, null, "Burn", CustomDamage.IGNOREDODGE|CustomDamage.TRUEDMG|CustomDamage.IGNORE_DAMAGE_TICK);
pd.lastBurnTick=TwosideKeeper.getServerTickTime();
}
@@ -412,7 +412,7 @@ final class runServerHeartbeat implements Runnable {
LivingEntityStructure les = LivingEntityStructure.GetLivingEntityStructure(ent);
if (Buff.hasBuff(ent, "Poison") && les.lastPoisonTick+getPoisonTickDelay(ent)<=TwosideKeeper.getServerTickTime()) {
Bukkit.getScheduler().runTaskLater(TwosideKeeper.plugin, ()->{
- if (ent!=null) {
+ if (ent!=null && Buff.hasBuff(ent, "Poison")) {
CustomDamage.ApplyDamage(Buff.getBuff(ent, "Poison").getAmplifier(), null, ent, null, "POISON", CustomDamage.IGNOREDODGE|CustomDamage.TRUEDMG|CustomDamage.IGNORE_DAMAGE_TICK);
les.lastPoisonTick=TwosideKeeper.getServerTickTime();
}
@@ -420,7 +420,7 @@ final class runServerHeartbeat implements Runnable {
}
if (Buff.hasBuff(ent, "SHRAPNEL") && les.lastShrapnelTick<=TwosideKeeper.getServerTickTime()) {
Bukkit.getScheduler().runTaskLater(TwosideKeeper.plugin, ()->{
- if (ent!=null) {
+ if (ent!=null && Buff.hasBuff(ent, "SHRAPNEL")) {
CustomDamage.ApplyDamage((Buff.getBuff(ent, "SHRAPNEL").getAmplifier()*2)*(1d-CustomDamage.getFireResistance(ent)), null, ent, null, "Shrapnel", CustomDamage.IGNOREDODGE|CustomDamage.TRUEDMG|CustomDamage.IGNORE_DAMAGE_TICK);
les.lastShrapnelTick=TwosideKeeper.getServerTickTime();
//SoundUtils.playLocalSound((Player)ent, Sound.ENTITY_GENERIC_EXTINGUISH_FIRE, 1.0f, 1.0f);
@@ -437,7 +437,7 @@ final class runServerHeartbeat implements Runnable {
//SoundUtils.playLocalSound((Player)ent, Sound.ENTITY_GENERIC_EXTINGUISH_FIRE, 1.0f, 1.0f);
//ent.getWorld().spawnParticle(Particle.LAVA, ent.getEyeLocation(), CustomDamage.GetHeartAmount(Buff.getBuff(ent, "SHRAPNEL").getAmplifier())*5);
Bukkit.getScheduler().runTaskLater(TwosideKeeper.plugin, ()->{
- if (ent!=null) {
+ if (ent!=null && Buff.hasBuff(ent, "BLEEDING")) {
CustomDamage.ApplyDamage((Buff.getBuff(ent, "BLEEDING").getAmplifier()), null, ent, null, "Bleeding", CustomDamage.IGNOREDODGE|CustomDamage.TRUEDMG|CustomDamage.IGNORE_DAMAGE_TICK);
}
}, 10); //Bleeding DOT is twice as fast.
@@ -446,7 +446,7 @@ final class runServerHeartbeat implements Runnable {
}
if (Buff.hasBuff(ent, "INFECTION") && les.lastInfectionTick<=TwosideKeeper.getServerTickTime()) {
Bukkit.getScheduler().runTaskLater(TwosideKeeper.plugin, ()->{
- if (ent!=null) {
+ if (ent!=null && Buff.hasBuff(ent, "INFECTION")) {
CustomDamage.ApplyDamage(Buff.getBuff(ent, "INFECTION").getAmplifier(), null, ent, null, "Infection", CustomDamage.IGNOREDODGE|CustomDamage.TRUEDMG|CustomDamage.IGNORE_DAMAGE_TICK);
les.lastInfectionTick=TwosideKeeper.getServerTickTime();
infectNearbyEntities(ent,les.buffs);
@@ -464,7 +464,7 @@ final class runServerHeartbeat implements Runnable {
}
if (Buff.hasBuff(ent, "BURN") && les.lastBurnTick<=TwosideKeeper.getServerTickTime()) {
Bukkit.getScheduler().runTaskLater(TwosideKeeper.plugin, ()->{
- if (ent!=null) {
+ if (ent!=null && Buff.hasBuff(ent, "BURN")) {
CustomDamage.ApplyDamage(Buff.getBuff(ent, "BURN").getAmplifier(), null, ent, null, "Burn", CustomDamage.IGNOREDODGE|CustomDamage.TRUEDMG|CustomDamage.IGNORE_DAMAGE_TICK);
les.lastBurnTick=TwosideKeeper.getServerTickTime();
}
@@ -543,6 +543,7 @@ final class runServerHeartbeat implements Runnable {
}
}
if (colors.size()>0) {
+ //TwosideKeeper.log("Colors are: "+colors.toString(), 0);
for (int i=0;i0) {
+ //TwosideKeeper.log("->Colors are: "+colors.toString(), 0);
for (int i=0;i