@ -78,14 +78,15 @@ final class runServerHeartbeat implements Runnable {
//SAVE SERVER SETTINGS.
final long serverTickTime = TwosideKeeper . getServerTickTime ( ) ;
if ( serverTickTime - TwosideKeeper . LASTSERVERCHECK > = TwosideKeeper . SERVERCHECKERTICKS ) { //15 MINUTES (DEFAULT)
if ( TwosideKeeper . LAST_DEAL ! = Calendar . getInstance ( ) . get ( Calendar . DAY_OF_WEEK ) ) {
//This means the deal of the day has to be updated!
TwosideKeeper . LAST_DEAL = Calendar . getInstance ( ) . get ( Calendar . DAY_OF_WEEK ) ;
TwosideKeeper . DEAL_OF_THE_DAY_ITEM = WorldShop . generateItemDealOftheDay ( 1 ) ;
TwosideKeeper . DEAL_OF_THE_DAY_PCT = WorldShop . generatePercentOffForDealOftheDay ( ) ;
if ( TwosideKeeper . SERVER_TYPE ! = ServerType . QUIET ) {
DecimalFormat df = new DecimalFormat ( "0.00" ) ;
aPlugin . API . discordSendRaw ( "*The Deal of the Day has been updated!*\n **" + GenericFunctions . UserFriendlyMaterialName ( TwosideKeeper . DEAL_OF_THE_DAY_ITEM ) + "** ~~$" + df . format ( WorldShop . getBaseWorldShopPrice ( TwosideKeeper . DEAL_OF_THE_DAY_ITEM ) ) + "~~ $" + df . format ( WorldShop . getBaseWorldShopPrice ( TwosideKeeper . DEAL_OF_THE_DAY_ITEM ) * 0 . 8 ) + " **20% Off!**" ) ;
DecimalFormat df2 = new DecimalFormat ( "0" ) ;
aPlugin . API . discordSendRaw ( "*The Deal of the Day has been updated!*\n **" + GenericFunctions . UserFriendlyMaterialName ( TwosideKeeper . DEAL_OF_THE_DAY_ITEM ) + "** ~~$" + df . format ( WorldShop . getBaseWorldShopPrice ( TwosideKeeper . DEAL_OF_THE_DAY_ITEM ) ) + "~~ $" + df . format ( WorldShop . getBaseWorldShopPrice ( TwosideKeeper . DEAL_OF_THE_DAY_ITEM ) * ( 1 - TwosideKeeper . DEAL_OF_THE_DAY_PCT ) ) + " **" + df2 . format ( TwosideKeeper . DEAL_OF_THE_DAY_PCT * 100 ) + "% Off!**" ) ;
//MessageUtils.announceMessage("The Deal of the Day has been updated!");
}
for ( Player p : Bukkit . getOnlinePlayers ( ) ) {
@ -193,49 +194,119 @@ final class runServerHeartbeat implements Runnable {
}
if ( ! aPlugin . API . isAFK ( p ) ) {
if ( TwosideKeeper . TwosideShops . IsPlayerUsingTerminal ( p ) & &
( TwosideKeeper . TwosideShops . GetSession ( p ) . GetSign ( ) . getBlock ( ) = = null | | TwosideKeeper . TwosideShops . GetSession ( p ) . IsTimeExpired ( ) ) ) {
p . sendMessage ( ChatColor . RED + "Ran out of time! " + ChatColor . WHITE + "Shop session closed." ) ;
TwosideKeeper . TwosideShops . RemoveSession ( p ) ;
}
EndShopSession ( p ) ;
GenericFunctions . RemoveNewDebuffs ( p ) ;
if ( ItemSet . GetTotalBaseAmount ( GenericFunctions . getEquipment ( p ) , p , ItemSet . DASHER ) > 0 ) {
double spdmult = ItemSet . GetTotalBaseAmount ( GenericFunctions . getEquipment ( p ) , p , ItemSet . DASHER ) / 100d ;
aPlugin . API . setPlayerSpeedMultiplier ( p , ( float ) ( 1 . 0f + spdmult ) ) ;
ModifyDasherSetSpeedMultiplier ( p ) ;
ManageHighwinder ( p , pd ) ;
RemoveInvalidTarget ( p , pd ) ;
GiveArtifactBowXP ( serverTickTime , p , pd ) ;
ReduceFireResistanceDuration ( p ) ;
ControlTheEnd ( p , pd ) ;
ItemStack [ ] equips = p . getEquipment ( ) . getArmorContents ( ) ;
ShadowWalkerApplication ( p , equips ) ;
//PopulatePlayerBlockList(p,15,15,2,5,false);
PopRandomLavaBlock ( p ) ;
GenericFunctions . sendActionBarMessage ( p , "" ) ;
GenericFunctions . AutoRepairItems ( p ) ;
if ( GenericFunctions . hasStealth ( p ) ) { GenericFunctions . DamageRandomTool ( p ) ; }
//See if this player is sleeping.
HealForSleeping ( p , pd ) ;
//We need to see if this player's damage reduction has changed recently. If so, notify them.
//Check damage reduction by sending an artifical "1" damage to the player.
ManagePlayerScoreboardAndHealth ( p ) ;
if ( PlayerMode . isBarbarian ( p ) ) {
AutoConsumeFoods ( p ) ;
}
}
pd . highwinder = ArtifactAbility . containsEnchantment ( ArtifactAbility . HIGHWINDER , p . getEquipment ( ) . getItemInMainHand ( ) ) ;
if ( pd . highwinder ) {
pd . highwinderdmg = GenericFunctions . getAbilityValue ( ArtifactAbility . HIGHWINDER , p . getEquipment ( ) . getItemInMainHand ( ) ) ;
ModifyArmorBar ( p ) ;
ItemStack [ ] equips = p . getEquipment ( ) . getArmorContents ( ) ;
ResetVendetta ( serverTickTime , pd ) ;
ResetLifestealStacks ( serverTickTime , pd ) ;
ManagePlayerLink ( p , pd ) ;
DepleteDamagePool ( serverTickTime , p , pd ) ;
AdventurerModeSetExhaustion ( p ) ;
CalculateHealthRegeneration ( serverTickTime , p , pd , equips ) ;
ResetSwordCombo ( serverTickTime , p , pd ) ;
ResetSlayerAggro ( serverTickTime , p , pd ) ;
ApplyCometRegenBonus ( p ) ;
DasherFoodRegenPerk ( p ) ;
GivePartyNightVision ( p ) ;
}
if ( 93 . 182445 * pd . velocity > 4 . 317 ) {
pd . velocity / = 2 ;
} else {
pd . velocity = 0 ;
//TwosideKeeper.outputArmorDurability(p,">");
}
if ( pd . highwinder & & pd . target ! = null & & ! pd . target . isDead ( ) ) {
GenericFunctions . sendActionBarMessage ( p , TwosideKeeper . drawVelocityBar ( pd . velocity , pd . highwinderdmg ) , true ) ;
ManageSnowmanHunt ( ) ;
CheckAndAnnounceWeather ( ) ;
Christmas . ChristmasHeartbeat ( ) ;
MaintainMonsterData ( ) ;
PartyManager . SetupParties ( ) ;
TwosideKeeper . TwosideSpleefGames . TickEvent ( ) ;
performTimingsReport ( ) ;
}
if ( pd . target ! = null & & ! pd . target . isDead ( ) & & pd . target . getLocation ( ) . getWorld ( ) . equals ( p . getWorld ( ) ) & & pd . target . getLocation ( ) . distanceSquared ( p . getLocation ( ) ) > 256 ) {
pd . target = null ;
private void ManagePlayerScoreboardAndHealth ( Player p ) {
if ( ! p . isDead ( ) ) { TwosideKeeper . log ( "Player is not dead." , 5 ) ; TwosideKeeper . setPlayerMaxHealth ( p ) ; }
if ( p . getScoreboard ( ) . getTeam ( p . getName ( ) . toLowerCase ( ) ) = = null ) {
p . getScoreboard ( ) . registerNewTeam ( p . getName ( ) . toLowerCase ( ) ) . addPlayer ( p ) ;
}
p . getScoreboard ( ) . getTeam ( p . getName ( ) . toLowerCase ( ) ) . setSuffix ( TwosideKeeper . createHealthbar ( ( ( p . getHealth ( ) ) / p . getMaxHealth ( ) ) * 100 , p ) ) ;
p . getScoreboard ( ) . getTeam ( p . getName ( ) . toLowerCase ( ) ) . setPrefix ( GenericFunctions . PlayerModePrefix ( p ) ) ;
}
if ( pd . lasthittarget + 20 * 15 < = serverTickTime & & pd . storedbowxp > 0 & & GenericFunctions . isArtifactEquip ( p . getEquipment ( ) . getItemInMainHand ( ) ) & &
p . getEquipment ( ) . getItemInMainHand ( ) . getType ( ) = = Material . BOW ) {
AwakenedArtifact . addPotentialEXP ( p . getEquipment ( ) . getItemInMainHand ( ) , pd . storedbowxp , p ) ;
TwosideKeeper . log ( "Added " + pd . storedbowxp + " Artifact XP" , 4 ) ;
pd . storedbowxp = 0 ;
private void HealForSleeping ( Player p , PlayerStructure pd ) {
if ( p . isSleeping ( ) ) {
p . setHealth ( Bukkit . getPlayer ( pd . name ) . getMaxHealth ( ) ) ; //Heals the player fully when sleeping.
}
}
if ( p . getFireTicks ( ) > 0 & & p . hasPotionEffect ( PotionEffectType . FIRE_RESISTANCE ) ) {
int duration = GenericFunctions . getPotionEffectDuration ( PotionEffectType . FIRE_RESISTANCE , p ) ;
int lv = GenericFunctions . getPotionEffectLevel ( PotionEffectType . FIRE_RESISTANCE , p ) ;
if ( lv > 10 ) { lv = 10 ; }
GenericFunctions . logAndApplyPotionEffectToEntity ( PotionEffectType . FIRE_RESISTANCE , duration - ( 20 * ( 10 - lv ) ) , lv , p , true ) ;
private void ShadowWalkerApplication ( Player p , ItemStack [ ] equips ) {
for ( ItemStack equip : equips ) {
if ( ArtifactAbility . containsEnchantment ( ArtifactAbility . SHADOWWALKER , equip ) & &
p . isOnGround ( ) & & p . getLocation ( ) . getY ( ) > = 0 & & p . getLocation ( ) . getY ( ) < = 255 & & p . getLocation ( ) . add ( 0 , 0 , 0 ) . getBlock ( ) . getLightLevel ( ) < = 7 ) {
GenericFunctions . logAndApplyPotionEffectToEntity ( PotionEffectType . SPEED , 20 , 1 , p ) ;
}
}
if ( p . getLocation ( ) . getY ( ) > = 0 & & p . getLocation ( ) . getY ( ) < = 255 & & p . getLocation ( ) . add ( 0 , 0 , 0 ) . getBlock ( ) . getLightLevel ( ) < = 7 ) {
if ( ArtifactAbility . containsEnchantment ( ArtifactAbility . SHADOWWALKER , p . getEquipment ( ) . getItemInMainHand ( ) ) ) {
GenericFunctions . logAndApplyPotionEffectToEntity ( PotionEffectType . SPEED , 20 , 1 , p ) ;
}
//log("Apply speed. The light level here is "+p.getLocation().add(0,-1,0).getBlock().getLightLevel(),2);
}
}
private void ControlTheEnd ( Player p , PlayerStructure pd ) {
if ( p . getWorld ( ) . getName ( ) . equalsIgnoreCase ( "world_the_end" ) ) {
if ( ! pd . endnotification ) {
pd . endnotification = true ;
@ -247,49 +318,67 @@ final class runServerHeartbeat implements Runnable {
pd . endnotification = false ;
}
}
}
ItemStack [ ] equips = p . getEquipment ( ) . getArmorContents ( ) ;
for ( ItemStack equip : equips ) {
if ( ArtifactAbility . containsEnchantment ( ArtifactAbility . SHADOWWALKER , equip ) & &
p . isOnGround ( ) & & p . getLocation ( ) . getY ( ) > = 0 & & p . getLocation ( ) . getY ( ) < = 255 & & p . getLocation ( ) . add ( 0 , 0 , 0 ) . getBlock ( ) . getLightLevel ( ) < = 7 ) {
GenericFunctions . logAndApplyPotionEffectToEntity ( PotionEffectType . SPEED , 20 , 1 , p ) ;
private void ReduceFireResistanceDuration ( Player p ) {
if ( p . getFireTicks ( ) > 0 & & p . hasPotionEffect ( PotionEffectType . FIRE_RESISTANCE ) ) {
int duration = GenericFunctions . getPotionEffectDuration ( PotionEffectType . FIRE_RESISTANCE , p ) ;
int lv = GenericFunctions . getPotionEffectLevel ( PotionEffectType . FIRE_RESISTANCE , p ) ;
if ( lv > 10 ) { lv = 10 ; }
GenericFunctions . logAndApplyPotionEffectToEntity ( PotionEffectType . FIRE_RESISTANCE , duration - ( 20 * ( 10 - lv ) ) , lv , p , true ) ;
}
}
if ( p . getLocation ( ) . getY ( ) > = 0 & & p . getLocation ( ) . getY ( ) < = 255 & & p . getLocation ( ) . add ( 0 , 0 , 0 ) . getBlock ( ) . getLightLevel ( ) < = 7 ) {
if ( ArtifactAbility . containsEnchantment ( ArtifactAbility . SHADOWWALKER , p . getEquipment ( ) . getItemInMainHand ( ) ) ) {
GenericFunctions . logAndApplyPotionEffectToEntity ( PotionEffectType . SPEED , 20 , 1 , p ) ;
private void GiveArtifactBowXP ( final long serverTickTime , Player p , PlayerStructure pd ) {
if ( pd . lasthittarget + 20 * 15 < = serverTickTime & & pd . storedbowxp > 0 & & GenericFunctions . isArtifactEquip ( p . getEquipment ( ) . getItemInMainHand ( ) ) & &
p . getEquipment ( ) . getItemInMainHand ( ) . getType ( ) = = Material . BOW ) {
AwakenedArtifact . addPotentialEXP ( p . getEquipment ( ) . getItemInMainHand ( ) , pd . storedbowxp , p ) ;
TwosideKeeper . log ( "Added " + pd . storedbowxp + " Artifact XP" , 4 ) ;
pd . storedbowxp = 0 ;
}
//log("Apply speed. The light level here is "+p.getLocation().add(0,-1,0).getBlock().getLightLevel(),2);
}
//PopulatePlayerBlockList(p,15,15,2,5,false);
PopRandomLavaBlock ( p ) ;
GenericFunctions . sendActionBarMessage ( p , "" ) ;
GenericFunctions . AutoRepairItems ( p ) ;
if ( GenericFunctions . hasStealth ( p ) ) { GenericFunctions . DamageRandomTool ( p ) ; }
private void RemoveInvalidTarget ( Player p , PlayerStructure pd ) {
if ( pd . target ! = null & & ! pd . target . isDead ( ) & & pd . target . getLocation ( ) . getWorld ( ) . equals ( p . getWorld ( ) ) & & pd . target . getLocation ( ) . distanceSquared ( p . getLocation ( ) ) > 256 ) {
pd . target = null ;
}
}
//See if this player is sleeping.
if ( p . isSleeping ( ) ) {
p . setHealth ( Bukkit . getPlayer ( pd . name ) . getMaxHealth ( ) ) ; //Heals the player fully when sleeping.
private void ManageHighwinder ( Player p , PlayerStructure pd ) {
pd . highwinder = ArtifactAbility . containsEnchantment ( ArtifactAbility . HIGHWINDER , p . getEquipment ( ) . getItemInMainHand ( ) ) ;
if ( pd . highwinder ) {
pd . highwinderdmg = GenericFunctions . getAbilityValue ( ArtifactAbility . HIGHWINDER , p . getEquipment ( ) . getItemInMainHand ( ) ) ;
}
if ( 93 . 182445 * pd . velocity > 4 . 317 ) {
pd . velocity / = 2 ;
} else {
pd . velocity = 0 ;
}
if ( pd . highwinder & & pd . target ! = null & & ! pd . target . isDead ( ) ) {
GenericFunctions . sendActionBarMessage ( p , TwosideKeeper . drawVelocityBar ( pd . velocity , pd . highwinderdmg ) , true ) ;
}
}
//We need to see if this player's damage reduction has changed recently. If so, notify them.
//Check damage reduction by sending an artifical "1" damage to the player.
if ( ! p . isDead ( ) ) { TwosideKeeper . log ( "Player is not dead." , 5 ) ; TwosideKeeper . setPlayerMaxHealth ( p ) ; }
p . getScoreboard ( ) . getTeam ( p . getName ( ) . toLowerCase ( ) ) . setSuffix ( TwosideKeeper . createHealthbar ( ( ( p . getHealth ( ) ) / p . getMaxHealth ( ) ) * 100 , p ) ) ;
p . getScoreboard ( ) . getTeam ( p . getName ( ) . toLowerCase ( ) ) . setPrefix ( GenericFunctions . PlayerModePrefix ( p ) ) ;
private void ModifyDasherSetSpeedMultiplier ( Player p ) {
if ( ItemSet . GetTotalBaseAmount ( GenericFunctions . getEquipment ( p ) , p , ItemSet . DASHER ) > 0 ) {
double spdmult = ItemSet . GetTotalBaseAmount ( GenericFunctions . getEquipment ( p ) , p , ItemSet . DASHER ) / 100d ;
aPlugin . API . setPlayerSpeedMultiplier ( p , ( float ) ( 1 . 0f + spdmult ) ) ;
}
}
if ( PlayerMode . isBarbarian ( p ) ) {
AutoConsumeFoods ( p ) ;
private void EndShopSession ( Player p ) {
if ( TwosideKeeper . TwosideShops . IsPlayerUsingTerminal ( p ) & &
( TwosideKeeper . TwosideShops . GetSession ( p ) . GetSign ( ) . getBlock ( ) = = null | | TwosideKeeper . TwosideShops . GetSession ( p ) . IsTimeExpired ( ) ) ) {
p . sendMessage ( ChatColor . RED + "Ran out of time! " + ChatColor . WHITE + "Shop session closed." ) ;
TwosideKeeper . TwosideShops . RemoveSession ( p ) ;
}
}
private void ModifyArmorBar ( Player p ) {
p . getAttribute ( Attribute . GENERIC_ARMOR ) . setBaseValue ( 20 * ( 1 . 0d - CustomDamage . CalculateDamageReduction ( 1 , p , null ) ) + subtractVanillaArmorBar ( p . getEquipment ( ) . getArmorContents ( ) ) ) ;
}
ItemStack [ ] equips = p . getEquipment ( ) . getArmorContents ( ) ;
private void ResetVendetta ( final long serverTickTime , PlayerStructure pd ) {
if ( pd . lastcombat + ( 20 * 60 ) < serverTickTime ) {
pd . vendetta_amt = 0 ;
pd . thorns_amt = 0 ;
@ -298,13 +387,16 @@ final class runServerHeartbeat implements Runnable {
if ( pd . vendetta_amt > 0 & & pd . lastvendettastack + 200 < serverTickTime ) {
pd . vendetta_amt = 0 ;
}
pd . vendetta_amt = 50000 ;
pd . lastvendettastack = TwosideKeeper . getServerTickTime ( ) + 500 ;
}
private void ResetLifestealStacks ( final long serverTickTime , PlayerStructure pd ) {
if ( pd . lastattacked + ( 20 * 5 ) < serverTickTime ) {
pd . lastattacked = 0 ;
pd . lifestealstacks = 0 ;
}
}
private void ManageSnowmanHunt ( ) {
if ( TwosideKeeper . CHRISTMASEVENT_ACTIVATED ) {
if ( TwosideKeeper . LastSnowmanHunt + 36000 < TwosideKeeper . getServerTickTime ( ) & & TwosideKeeper . SnowmanHuntList . size ( ) > 7 ) {
TwosideKeeper . HuntingForSnowman = TwosideKeeper . SnowmanHuntList . get ( ( int ) ( Math . random ( ) * TwosideKeeper . SnowmanHuntList . size ( ) ) ) ;
@ -314,7 +406,9 @@ final class runServerHeartbeat implements Runnable {
TwosideKeeper . LastSnowmanHunt = TwosideKeeper . getServerTickTime ( ) ;
}
}
}
private void ManagePlayerLink ( Player p , PlayerStructure pd ) {
if ( pd . linkplayer ! = null & & pd . linkplayer . isValid ( ) ) {
GlowAPI . setGlowing ( pd . linkplayer , true , p ) ;
if ( pd . lastlinkteleport ! = 0 & & pd . lastlinkteleport + 12000 < TwosideKeeper . getServerTickTime ( ) ) {
@ -326,7 +420,9 @@ final class runServerHeartbeat implements Runnable {
GlowAPI . setGlowing ( pd . linkplayer , false , p ) ;
pd . linkplayer = null ;
}
}
private void DepleteDamagePool ( final long serverTickTime , Player p , PlayerStructure pd ) {
if ( pd . damagepool > 0 & & pd . damagepooltime + 20 < = serverTickTime ) {
double transferdmg = CustomDamage . getTransferDamage ( p ) + ( pd . damagepool * 0 . 01 ) ;
TwosideKeeper . log ( "Transfer Dmg is " + transferdmg + ". Damage Pool: " + pd . damagepool , 5 ) ;
@ -337,11 +433,67 @@ final class runServerHeartbeat implements Runnable {
pd . damagepool - = transferdmg ;
}
}
}
private void AdventurerModeSetExhaustion ( Player p ) {
if ( PlayerMode . getPlayerMode ( p ) = = PlayerMode . NORMAL ) {
p . setExhaustion ( Math . max ( 0 , p . getExhaustion ( ) - 0 . 5f ) ) ;
}
}
private void DasherFoodRegenPerk ( Player p ) {
if ( p . isSprinting ( ) & & p . getFoodLevel ( ) < 20
& & ItemSet . HasSetBonusBasedOnSetBonusCount ( GenericFunctions . getArmor ( p ) , p , ItemSet . DASHER , 4 ) ) {
p . setFoodLevel ( p . getFoodLevel ( ) + 1 ) ;
}
}
private void GivePartyNightVision ( Player p ) {
if ( ItemSet . HasSetBonusBasedOnSetBonusCount ( GenericFunctions . getArmor ( p ) , p , ItemSet . RUDOLPH , 4 ) ) {
if ( ! p . hasPotionEffect ( PotionEffectType . NIGHT_VISION ) ) {
GenericFunctions . logAndApplyPotionEffectToEntity ( PotionEffectType . NIGHT_VISION , Integer . MAX_VALUE , 1 , p , true ) ;
}
List < Player > partymembers = PartyManager . getPartyMembers ( p ) ;
for ( Player pl : partymembers ) {
if ( ! pl . hasPotionEffect ( PotionEffectType . NIGHT_VISION ) ) {
GenericFunctions . logAndApplyPotionEffectToEntity ( PotionEffectType . NIGHT_VISION , Integer . MAX_VALUE , 1 , pl , true ) ;
}
}
}
}
private void ApplyCometRegenBonus ( Player p ) {
double regenbuff = ItemSet . GetTotalBaseAmount ( GenericFunctions . getEquipment ( p ) , p , ItemSet . COMET ) ;
if ( regenbuff > 0 ) {
List < Player > partymembers = PartyManager . getPartyMembers ( p ) ;
for ( Player pl : partymembers ) {
PlayerStructure pld = PlayerStructure . GetPlayerStructure ( pl ) ;
pld . pctbonusregen = regenbuff / 100d ;
pld . pctbonusregentime = TwosideKeeper . getServerTickTime ( ) ;
}
}
}
private void ResetSlayerAggro ( final long serverTickTime , Player p , PlayerStructure pd ) {
if ( PlayerMode . isSlayer ( p ) ) {
if ( pd . lastsneak + 50 < = serverTickTime & &
p . isSneaking ( ) & &
ItemSet . HasSetBonusBasedOnSetBonusCount ( GenericFunctions . getHotbarItems ( p ) , p , ItemSet . MOONSHADOW , 7 ) ) {
GenericFunctions . deAggroNearbyTargets ( p ) ;
GenericFunctions . applyStealth ( p , true ) ;
}
}
}
private void ResetSwordCombo ( final long serverTickTime , Player p , PlayerStructure pd ) {
if ( ArtifactAbility . containsEnchantment ( ArtifactAbility . COMBO , p . getEquipment ( ) . getItemInMainHand ( ) ) & &
pd . last_swordhit + 40 < serverTickTime ) {
pd . swordcombo = 0 ; //Reset the sword combo meter since the time limit expired.
}
}
private void CalculateHealthRegeneration ( final long serverTickTime , Player p , PlayerStructure pd ,
ItemStack [ ] equips ) {
if ( pd . last_regen_time + TwosideKeeper . HEALTH_REGENERATION_RATE < = serverTickTime ) {
pd . last_regen_time = serverTickTime ;
//See if this player needs to be healed.
@ -381,62 +533,6 @@ final class runServerHeartbeat implements Runnable {
}
}
}
if ( ArtifactAbility . containsEnchantment ( ArtifactAbility . COMBO , p . getEquipment ( ) . getItemInMainHand ( ) ) & &
pd . last_swordhit + 40 < serverTickTime ) {
pd . swordcombo = 0 ; //Reset the sword combo meter since the time limit expired.
}
if ( PlayerMode . isSlayer ( p ) ) {
if ( pd . lastsneak + 50 < = serverTickTime & &
p . isSneaking ( ) & &
ItemSet . HasSetBonusBasedOnSetBonusCount ( GenericFunctions . getHotbarItems ( p ) , p , ItemSet . MOONSHADOW , 7 ) ) {
GenericFunctions . deAggroNearbyTargets ( p ) ;
GenericFunctions . applyStealth ( p , true ) ;
}
}
double regenbuff = ItemSet . GetTotalBaseAmount ( GenericFunctions . getEquipment ( p ) , p , ItemSet . COMET ) ;
if ( regenbuff > 0 ) {
List < Player > partymembers = PartyManager . getPartyMembers ( p ) ;
for ( Player pl : partymembers ) {
PlayerStructure pld = PlayerStructure . GetPlayerStructure ( pl ) ;
pld . pctbonusregen = regenbuff / 100d ;
pld . pctbonusregentime = TwosideKeeper . getServerTickTime ( ) ;
}
}
if ( p . isSprinting ( ) & & p . getFoodLevel ( ) < 20
& & ItemSet . HasSetBonusBasedOnSetBonusCount ( GenericFunctions . getArmor ( p ) , p , ItemSet . DASHER , 4 ) ) {
p . setFoodLevel ( p . getFoodLevel ( ) + 1 ) ;
}
if ( ItemSet . HasSetBonusBasedOnSetBonusCount ( GenericFunctions . getArmor ( p ) , p , ItemSet . RUDOLPH , 4 ) ) {
if ( ! p . hasPotionEffect ( PotionEffectType . NIGHT_VISION ) ) {
GenericFunctions . logAndApplyPotionEffectToEntity ( PotionEffectType . NIGHT_VISION , Integer . MAX_VALUE , 1 , p , true ) ;
}
List < Player > partymembers = PartyManager . getPartyMembers ( p ) ;
for ( Player pl : partymembers ) {
if ( ! pl . hasPotionEffect ( PotionEffectType . NIGHT_VISION ) ) {
GenericFunctions . logAndApplyPotionEffectToEntity ( PotionEffectType . NIGHT_VISION , Integer . MAX_VALUE , 1 , pl , true ) ;
}
}
}
}
//TwosideKeeper.outputArmorDurability(p,">");
}
CheckAndAnnounceWeather ( ) ;
Christmas . ChristmasHeartbeat ( ) ;
MaintainMonsterData ( ) ;
PartyManager . SetupParties ( ) ;
TwosideKeeper . TwosideSpleefGames . TickEvent ( ) ;
performTimingsReport ( ) ;
}