Exemple #1
0
        public override void Start(ICoreAPI api)
        {
            GameVersion.EnsureEqualVersionOrKillExecutable(api, System.Diagnostics.FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).FileVersion, GameVersion.OverallVersion, "VSSurvivalMod");

            this.api = api;
            api.Network.RegisterChannel("survivalCoreConfig").RegisterMessageType <SurvivalConfig>();

            RegisterDefaultBlocks();
            RegisterDefaultBlockBehaviors();
            RegisterDefaultBlockEntityBehaviors();

            RegisterDefaultCollectibleBehaviors();

            RegisterDefaultCropBehaviors();
            RegisterDefaultItems();
            RegisterDefaultEntities();
            RegisterDefaultEntityBehaviors();
            RegisterDefaultBlockEntities();

            api.RegisterMountable("bed", BlockBed.GetMountable);
            AiTaskRegistry.Register("throwatentity", typeof(AiTaskThrowAtEntity));

            metalsByCode = new Dictionary <string, MetalPropertyVariant>();

            MetalProperty metals = api.Assets.TryGet("worldproperties/block/metal.json").ToObject <MetalProperty>();

            for (int i = 0; i < metals.Variants.Length; i++)
            {
                // Metals currently don't have a domain
                metalsByCode[metals.Variants[i].Code.Path] = metals.Variants[i];
            }
        }
Exemple #2
0
        public override void Start(ICoreAPI api)
        {
            GameVersion.EnsureEqualVersionOrKillExecutable(api, System.Diagnostics.FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).FileVersion, GameVersion.OverallVersion, "VSCreativeMod");

            base.Start(api);

            api.RegisterItemClass("ItemMagicWand", typeof(ItemMagicWand));

            api.RegisterBlockClass("BlockCommand", typeof(BlockCommand));

            api.RegisterBlockEntityClass("BECommand", typeof(BlockEntityCommand));
        }
Exemple #3
0
 public override void StartPre(ICoreAPI api)
 {
     GameVersion.EnsureEqualVersionOrKillExecutable(api, System.Diagnostics.FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).FileVersion, GameVersion.OverallVersion, "VSEssentials");
 }