public override void PostUpdateWorld()
        {
            NPC.LunarShieldPowerExpert = 150;

            if (ShouldBeEternityMode)
            {
                if (EternityMode && !FargoSoulsUtil.WorldIsExpertOrHarder())
                {
                    EternityMode = false;
                    FargoSoulsUtil.PrintLocalization($"Mods.{Mod.Name}.Message.{Name}.EternityWrongDifficulty", new Color(175, 75, 255));
                    if (Main.netMode == NetmodeID.Server)
                    {
                        NetMessage.SendData(MessageID.WorldData);
                    }
                    if (!Main.dedServ)
                    {
                        SoundEngine.PlaySound(SoundID.Roar, Main.LocalPlayer.Center);
                    }
                }
                else if (!EternityMode && FargoSoulsUtil.WorldIsExpertOrHarder())
                {
                    EternityMode = true;
                    FargoSoulsUtil.PrintLocalization($"Mods.{Mod.Name}.Message.{Name}.EternityOn", new Color(175, 75, 255));
                    if (Main.netMode == NetmodeID.Server)
                    {
                        NetMessage.SendData(MessageID.WorldData);
                    }
                    if (!Main.dedServ)
                    {
                        SoundEngine.PlaySound(SoundID.Roar, Main.LocalPlayer.Center);
                    }
                }
            }
            else if (EternityMode)
            {
                EternityMode = false;
                FargoSoulsUtil.PrintLocalization($"Mods.{Mod.Name}.Message.{Name}.EternityOff", new Color(175, 75, 255));
                if (Main.netMode == NetmodeID.Server)
                {
                    NetMessage.SendData(MessageID.WorldData);
                }
                if (!Main.dedServ)
                {
                    SoundEngine.PlaySound(SoundID.Roar, Main.LocalPlayer.Center);
                }
            }

            if (EternityMode)
            {
                NPC.LunarShieldPowerExpert = 50;

                if (!haveForcedAbomFromGoblins && !NPC.downedSlimeKing && !NPC.downedBoss1 && !Main.hardMode && //pre boss, disable some events
                    ModContent.TryFind("Fargowiltas", "Abominationn", out ModNPC abom) && !NPC.AnyNPCs(abom.Type))
                {
                    if (Main.raining || Sandstorm.Happening || Main.bloodMoon)
                    {
                        Main.raining        = false;
                        Main.rainTime       = 0;
                        Main.maxRaining     = 0;
                        Sandstorm.Happening = false;
                        Sandstorm.TimeLeft  = 0;
                        if (Main.bloodMoon)
                        {
                            FargoSoulsUtil.PrintLocalization($"Mods.{Mod.Name}.Message.{Name}.BloodMoonCancel", new Color(175, 75, 255));
                        }
                        Main.bloodMoon = false;
                        if (Main.netMode == NetmodeID.Server)
                        {
                            NetMessage.SendData(MessageID.WorldData);
                        }
                    }
                }

                if (!MasochistModeReal && EternityMode && FargoSoulsUtil.WorldIsMaster() && CanPlayMaso && !FargoSoulsUtil.AnyBossAlive())
                {
                    MasochistModeReal = true;
                    FargoSoulsUtil.PrintLocalization($"Mods.{Mod.Name}.Message.{Name}.MasochistOn", new Color(51, 255, 191, 0));
                    if (Main.netMode == NetmodeID.Server)
                    {
                        NetMessage.SendData(MessageID.WorldData);
                    }
                    if (!Main.dedServ)
                    {
                        SoundEngine.PlaySound(SoundID.Roar, Main.LocalPlayer.Center);
                    }
                }
            }

            if (MasochistModeReal && !(EternityMode && FargoSoulsUtil.WorldIsMaster() && CanPlayMaso))
            {
                MasochistModeReal = false;
                FargoSoulsUtil.PrintLocalization($"Mods.{Mod.Name}.Message.{Name}.MasochistOff", new Color(51, 255, 191, 0));
                if (Main.netMode == NetmodeID.Server)
                {
                    NetMessage.SendData(MessageID.WorldData);
                }
                if (!Main.dedServ)
                {
                    SoundEngine.PlaySound(SoundID.Roar, Main.LocalPlayer.Center);
                }
            }

            //Main.NewText(BuilderMode);

            #region commented

            //right when day starts

            /*if(/*Main.time == 0 && Main.dayTime && !Main.eclipse && FargoSoulsWorld.masochistMode)
             * {
             *      SoundEngine.PlaySound(SoundID.Roar, player.Center);
             *
             *      if (Main.netMode == NetmodeID.SinglePlayer)
             *      {
             *          Main.eclipse = true;
             *          //Main.NewText(Lang.misc[20], 50, 255, 130, false);
             *      }
             *      else
             *      {
             *          //NetMessage.SendData(61, -1, -1, "", player.whoAmI, -6f, 0f, 0f, 0, 0, 0);
             *      }
             *
             *
             * }*/

            // if (this.itemTime == 0 && this.itemAnimation > 0 && item.type == 361 && Main.CanStartInvasion(1, true))
            // {
            // this.itemTime = item.useTime;
            // SoundEngine.PlaySound(SoundID.Roar, this.Center);
            // if (Main.netMode != NetmodeID.MultiplayerClient)
            // {
            // if (Main.invasionType == 0)
            // {
            // Main.invasionDelay = 0;
            // Main.StartInvasion(1);
            // }
            // }
            // else
            // {
            // NetMessage.SendData(61, -1, -1, "", this.whoAmI, -1f, 0f, 0f, 0, 0, 0);
            // }
            // }
            // if (this.itemTime == 0 && this.itemAnimation > 0 && item.type == 602 && Main.CanStartInvasion(2, true))
            // {
            // this.itemTime = item.useTime;
            // SoundEngine.PlaySound(SoundID.Roar, this.Center);
            // if (Main.netMode != NetmodeID.MultiplayerClient)
            // {
            // if (Main.invasionType == 0)
            // {
            // Main.invasionDelay = 0;
            // Main.StartInvasion(2);
            // }
            // }
            // else
            // {
            // NetMessage.SendData(61, -1, -1, "", this.whoAmI, -2f, 0f, 0f, 0, 0, 0);
            // }
            // }
            // if (this.itemTime == 0 && this.itemAnimation > 0 && item.type == 1315 && Main.CanStartInvasion(3, true))
            // {
            // this.itemTime = item.useTime;
            // SoundEngine.PlaySound(SoundID.Roar, this.Center);
            // if (Main.netMode != NetmodeID.MultiplayerClient)
            // {
            // if (Main.invasionType == 0)
            // {
            // Main.invasionDelay = 0;
            // Main.StartInvasion(3);
            // }
            // }
            // else
            // {
            // NetMessage.SendData(61, -1, -1, "", this.whoAmI, -3f, 0f, 0f, 0, 0, 0);
            // }
            // }
            // if (this.itemTime == 0 && this.itemAnimation > 0 && item.type == 1844 && !Main.dayTime && !Main.pumpkinMoon && !Main.snowMoon && !DD2Event.Ongoing)
            // {
            // this.itemTime = item.useTime;
            // SoundEngine.PlaySound(SoundID.Roar, this.Center);
            // if (Main.netMode != NetmodeID.MultiplayerClient)
            // {
            // Main.NewText(Lang.misc[31], 50, 255, 130, false);
            // Main.startPumpkinMoon();
            // }
            // else
            // {
            // NetMessage.SendData(61, -1, -1, "", this.whoAmI, -4f, 0f, 0f, 0, 0, 0);
            // }
            // }

            // if (this.itemTime == 0 && this.itemAnimation > 0 && item.type == 3601 && NPC.downedGolemBoss && Main.hardMode && !NPC.AnyDanger() && !NPC.AnyoneNearCultists())
            // {
            // SoundEngine.PlaySound(SoundID.Roar, this.Center);
            // this.itemTime = item.useTime;
            // if (Main.netMode == NetmodeID.SinglePlayer)
            // {
            // WorldGen.StartImpendingDoom();
            // }
            // else
            // {
            // NetMessage.SendData(61, -1, -1, "", this.whoAmI, -8f, 0f, 0f, 0, 0, 0);
            // }
            // }
            // if (this.itemTime == 0 && this.itemAnimation > 0 && item.type == 1958 && !Main.dayTime && !Main.pumpkinMoon && !Main.snowMoon && !DD2Event.Ongoing)
            // {
            // this.itemTime = item.useTime;
            // SoundEngine.PlaySound(SoundID.Roar, this.Center);
            // if (Main.netMode != NetmodeID.MultiplayerClient)
            // {
            // Main.NewText(Lang.misc[34], 50, 255, 130, false);
            // Main.startSnowMoon();
            // }
            // else
            // {
            // NetMessage.SendData(61, -1, -1, "", this.whoAmI, -5f, 0f, 0f, 0, 0, 0);
            // }
            // }

            #endregion
        }
        public override void PreUpdate()
        {
            if (!FargoSoulsWorld.EternityMode)
            {
                return;
            }

            FargoSoulsPlayer fargoSoulsPlayer = Player.GetModPlayer <FargoSoulsPlayer>();

            if (Player.active && !Player.dead && !Player.ghost)
            {
                //falling gives you dazed. wings save you

                /*if (Player.velocity.Y == 0f && Player.wingsLogic == 0 && !Player.noFallDmg && !Player.ghost && !Player.dead)
                 * {
                 *  int num21 = 25;
                 *  num21 += Player.extraFall;
                 *  int num22 = (int)(Player.position.Y / 16f) - Player.fallStart;
                 *  if (Player.mount.CanFly)
                 *  {
                 *      num22 = 0;
                 *  }
                 *  if (Player.mount.Cart && Minecart.OnTrack(Player.position, Player.width, Player.height))
                 *  {
                 *      num22 = 0;
                 *  }
                 *  if (Player.mount.Type == 1)
                 *  {
                 *      num22 = 0;
                 *  }
                 *  Player.mount.FatigueRecovery();
                 *
                 *  if (((Player.gravDir == 1f && num22 > num21) || (Player.gravDir == -1f && num22 < -num21)))
                 *  {
                 *      Player.immune = false;
                 *      int dmg = (int)(num22 * Player.gravDir - num21) * 10;
                 *      if (Player.mount.Active)
                 *          dmg = (int)(dmg * Player.mount.FallDamage);
                 *
                 *      Player.Hurt(PlayerDeathReason.ByOther(0), dmg, 0);
                 *      Player.AddBuff(BuffID.Dazed, 120);
                 *  }
                 *  Player.fallStart = (int)(Player.position.Y / 16f);
                 * }*/

                if (!NPC.downedBoss3 && Player.ZoneDungeon && !NPC.AnyNPCs(NPCID.DungeonGuardian))
                {
                    NPC.SpawnOnPlayer(Player.whoAmI, NPCID.DungeonGuardian);
                }


                if (Player.ZoneUnderworldHeight)
                {
                    if (!(Player.fireWalk || fargoSoulsPlayer.PureHeart || Player.lavaMax > 0))
                    {
                        FargoSoulsUtil.AddDebuffFixedDuration(Player, BuffID.OnFire, 2);
                    }
                }

                if (Player.ZoneJungle)
                {
                    if (Player.wet && !Player.lavaWet && !Player.honeyWet && !fargoSoulsPlayer.MutantAntibodies)
                    {
                        FargoSoulsUtil.AddDebuffFixedDuration(Player, BuffID.Poisoned, 2);
                    }
                }

                if (Player.ZoneSnow)
                {
                    //if (!fargoSoulsPlayer.PureHeart && !Main.dayTime && Framing.GetTileSafely(Player.Center).WallType == WallID.None)
                    //    Player.AddBuff(BuffID.Chilled, Main.expertMode && Main.expertDebuffTime > 1 ? 1 : 2);

                    if (Player.wet && !Player.lavaWet && !Player.honeyWet && !fargoSoulsPlayer.MutantAntibodies)
                    {
                        //Player.AddBuff(BuffID.Frostburn, Main.expertMode && Main.expertDebuffTime > 1 ? 1 : 2);
                        MasomodeFreezeTimer++;
                        if (MasomodeFreezeTimer >= 600)
                        {
                            FargoSoulsUtil.AddDebuffFixedDuration(Player, BuffID.Frozen, 120);
                            MasomodeFreezeTimer = -300;
                        }
                    }
                    else
                    {
                        MasomodeFreezeTimer = 0;
                    }
                }
                else
                {
                    MasomodeFreezeTimer = 0;
                }

                /*if (Player.wet && !fargoSoulsPlayer.MutantAntibodies)
                 * {
                 *  if (Player.ZoneDesert)
                 *      FargoSoulsUtil.AddDebuffFixedDuration(Player, BuffID.Slow, 2);
                 *  if (Player.ZoneDungeon)
                 *      FargoSoulsUtil.AddDebuffFixedDuration(Player, BuffID.Cursed, 2);
                 *  Tile currentTile = Framing.GetTileSafely(Player.Center);
                 *  if (currentTile.WallType == WallID.GraniteUnsafe)
                 *      FargoSoulsUtil.AddDebuffFixedDuration(Player, BuffID.Weak, 2);
                 *  if (currentTile.WallType == WallID.MarbleUnsafe)
                 *      FargoSoulsUtil.AddDebuffFixedDuration(Player, BuffID.BrokenArmor, 2);
                 * }*/

                if (Player.ZoneCorrupt)
                {
                    if (!fargoSoulsPlayer.PureHeart)
                    {
                        FargoSoulsUtil.AddDebuffFixedDuration(Player, BuffID.Darkness, 2);
                    }
                    if (Player.wet && !Player.lavaWet && !Player.honeyWet && !fargoSoulsPlayer.MutantAntibodies)
                    {
                        FargoSoulsUtil.AddDebuffFixedDuration(Player, BuffID.CursedInferno, 2);
                    }
                }

                if (Player.ZoneCrimson)
                {
                    if (!fargoSoulsPlayer.PureHeart)
                    {
                        FargoSoulsUtil.AddDebuffFixedDuration(Player, BuffID.Bleeding, 2);
                    }
                    if (Player.wet && !Player.lavaWet && !Player.honeyWet && !fargoSoulsPlayer.MutantAntibodies)
                    {
                        FargoSoulsUtil.AddDebuffFixedDuration(Player, BuffID.Ichor, 2);
                    }
                }

                if (Player.ZoneHallow)
                {
                    if (Player.ZoneRockLayerHeight && !fargoSoulsPlayer.PureHeart)
                    {
                        if (++HallowFlipCheckTimer > 6) //reduce computation
                        {
                            HallowFlipCheckTimer = 0;

                            float playerAbove = Player.Center.Y - 16 * 50;
                            float playerBelow = Player.Center.Y + 16 * 50;
                            if (playerAbove / 16 < Main.maxTilesY && playerBelow / 16 < Main.maxTilesY &&
                                !Collision.CanHitLine(new Vector2(Player.Left.X, playerAbove), 0, 0, new Vector2(Player.Left.X, playerBelow), 0, 0) &&
                                !Collision.CanHitLine(new Vector2(Player.Right.X, playerAbove), 0, 0, new Vector2(Player.Right.X, playerBelow), 0, 0))
                            {
                                if (!Main.wallHouse[Framing.GetTileSafely(Player.Center).WallType] &&
                                    !Main.wallHouse[Framing.GetTileSafely(Player.TopLeft).WallType] &&
                                    !Main.wallHouse[Framing.GetTileSafely(Player.TopRight).WallType] &&
                                    !Main.wallHouse[Framing.GetTileSafely(Player.BottomLeft).WallType] &&
                                    !Main.wallHouse[Framing.GetTileSafely(Player.BottomRight).WallType])
                                {
                                    Player.AddBuff(ModContent.BuffType <FlippedHallow>(), 90);
                                }
                            }
                        }
                    }

                    if (Player.wet && !Player.lavaWet && !Player.honeyWet && !fargoSoulsPlayer.MutantAntibodies)
                    {
                        Player.AddBuff(ModContent.BuffType <Smite>(), 2);
                    }
                }

                if (!fargoSoulsPlayer.PureHeart && Main.raining && (Player.ZoneOverworldHeight || Player.ZoneSkyHeight) && Player.HeldItem.type != ItemID.Umbrella)
                {
                    Tile currentTile = Framing.GetTileSafely(Player.Center);
                    if (currentTile.WallType == WallID.None)
                    {
                        if (Player.ZoneSnow)
                        {
                            Player.AddBuff(ModContent.BuffType <Hypothermia>(), 2);
                        }
                        else
                        {
                            Player.AddBuff(BuffID.Wet, 2);
                        }

                        /*if (Main.hardMode)
                         * {
                         *  lightningCounter++;
                         *
                         *  if (lightningCounter >= 600)
                         *  {
                         *      //tends to spawn in ceilings if the Player goes indoors/underground
                         *      Point tileCoordinates = Player.Top.ToTileCoordinates();
                         *
                         *      tileCoordinates.X += Main.rand.Next(-25, 25);
                         *      tileCoordinates.Y -= 15 + Main.rand.Next(-5, 5);
                         *
                         *      for (int index = 0; index < 10 && !WorldGen.SolidTile(tileCoordinates.X, tileCoordinates.Y) && tileCoordinates.Y > 10; ++index) tileCoordinates.Y -= 1;
                         *
                         *      Projectile.NewProjectile(tileCoordinates.X * 16 + 8, tileCoordinates.Y * 16 + 17, 0f, 0f, ProjectileID.VortexVortexLightning, 0, 2f, Main.myPlayer,
                         *          0f, 0);
                         *
                         *      lightningCounter = 0;
                         *  }
                         * }*/
                    }
                }

                if (Player.wet && !Player.lavaWet && !Player.honeyWet && !(Player.accFlipper || Player.gills || fargoSoulsPlayer.MutantAntibodies))
                {
                    Player.AddBuff(ModContent.BuffType <Lethargic>(), 2);
                }

                if (!fargoSoulsPlayer.PureHeart && !Player.buffImmune[BuffID.Suffocation] && Player.ZoneSkyHeight && Player.whoAmI == Main.myPlayer)
                {
                    bool inLiquid = Collision.DrownCollision(Player.position, Player.width, Player.height, Player.gravDir) || (!Player.armor[0].IsAir && (Player.armor[0].type == ItemID.FishBowl || Player.armor[0].type == ItemID.GoldGoldfishBowl));
                    if (!inLiquid)
                    {
                        Player.breath -= 3;
                        if (++MasomodeSpaceBreathTimer > 10)
                        {
                            MasomodeSpaceBreathTimer = 0;
                            Player.breath--;
                        }
                        if (Player.breath == 0)
                        {
                            SoundEngine.PlaySound(SoundID.Drown);
                        }
                        if (Player.breath <= 0)
                        {
                            Player.AddBuff(BuffID.Suffocation, 2);
                        }
                    }
                }

                if (!fargoSoulsPlayer.PureHeart && !Player.buffImmune[BuffID.Webbed] && Player.stickyBreak > 0)
                {
                    Vector2 tileCenter = Player.Center;
                    tileCenter.X /= 16;
                    tileCenter.Y /= 16;
                    Tile currentTile = Framing.GetTileSafely((int)tileCenter.X, (int)tileCenter.Y);
                    if (currentTile != null && currentTile.WallType == WallID.SpiderUnsafe)
                    {
                        Player.AddBuff(BuffID.Webbed, 30);
                        Player.AddBuff(BuffID.Slow, 90);
                        Player.stickyBreak = 0;

                        Vector2 vector = Collision.StickyTiles(Player.position, Player.velocity, Player.width, Player.height);
                        if (vector.X != -1 && vector.Y != -1)
                        {
                            int num3 = (int)vector.X;
                            int num4 = (int)vector.Y;
                            WorldGen.KillTile(num3, num4, false, false, false);
                            if (Main.netMode == NetmodeID.MultiplayerClient && !Main.tile[num3, num4].HasTile)
                            {
                                NetMessage.SendData(MessageID.TileManipulation, -1, -1, null, 0, num3, num4, 0f, 0, 0, 0);
                            }
                        }
                    }
                }

                if (!fargoSoulsPlayer.PureHeart && Main.bloodMoon)
                {
                    Player.AddBuff(BuffID.WaterCandle, 2);
                }

                //no more because cactus harder to break now

                /*if (!SandsofTime)
                 * {
                 *  Vector2 tileCenter = Player.Center;
                 *  tileCenter.X /= 16;
                 *  tileCenter.Y /= 16;
                 *  Tile currentTile = Framing.GetTileSafely((int)tileCenter.X, (int)tileCenter.Y);
                 *  if (currentTile != null && currentTile.type == TileID.Cactus && currentTile.nactive())
                 *  {
                 *      int damage = 10;
                 *      if (Player.ZoneCorrupt)
                 *      {
                 *          damage *= 2;
                 *          Player.AddBuff(BuffID.CursedInferno, Main.expertMode && Main.expertDebuffTime > 1 ? 150 : 300);
                 *      }
                 *      if (Player.ZoneCrimson)
                 *      {
                 *          damage *= 2;
                 *          Player.AddBuff(BuffID.Ichor, Main.expertMode && Main.expertDebuffTime > 1 ? 150 : 300);
                 *      }
                 *      if (Player.ZoneHoly)
                 *      {
                 *          damage *= 2;
                 *          Player.AddBuff(BuffID.Confused, Main.expertMode && Main.expertDebuffTime > 1 ? 150 : 300);
                 *      }
                 *
                 *      if (Main.hardMode)
                 *          damage *= 2;
                 *
                 *      if (Player.hurtCooldowns[0] <= 0) //same i-frames as spike tiles
                 *          Player.Hurt(PlayerDeathReason.ByCustomReason(Player.name + " was pricked by a Cactus."), damage, 0, false, false, false, 0);
                 *  }
                 * }*/
            }
        }