Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using Terraria;
- using TerrariaAPI;
- using TerrariaAPI.Hooks;
- namespace TerrariaPeaceMod
- {
- [APIVersion(1, 8)]
- public class TerrariaPeaceMod : TerrariaPlugin
- {
- public static DateTime LastUpdate;
- public override string Author
- {
- get { return "Deathmax"; }
- }
- public override string Description
- {
- get { return "Changes the game to be more peaceful"; }
- }
- public override string Name
- {
- get { return "PeaceMod"; }
- }
- public override Version Version
- {
- get { return new Version(1, 0, 0, 0); }
- }
- public TerrariaPeaceMod(Main game)
- : base(game)
- {
- }
- public override void Initialize()
- {
- GameHooks.Update += GameHooks_Update;
- LastUpdate = DateTime.UtcNow;
- }
- void GameHooks_Update(GameTime obj)
- {
- WorldGen.spawnEye = false;
- WorldGen.spawnMeteor = false;
- Main.time = 27000.0;
- if ((DateTime.UtcNow - LastUpdate).TotalSeconds >= 1)
- {
- LastUpdate = DateTime.UtcNow;
- Main.bloodMoon = false;
- Main.invasionSize = 0;
- Main.invasionDelay = 0;
- Main.invasionWarn = 0;
- Main.dayTime = true;
- NetMessage.SendData((int)PacketTypes.WorldInfo);
- for (int i = 0; i < Main.maxNPCs; i++)
- {
- if (Main.npc[i].active)
- if (Main.npc[i].friendly)
- continue;
- Main.npc[i].SetDefaults(46);
- }
- }
- }
- public override void DeInitialize()
- {
- GameHooks.Update -= GameHooks_Update;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment