public override void Initialize(ICoreAPI api) { base.Initialize(api); bloomeryInv.LateInitialize("bloomery-1", api); RegisterGameTickListener(OnGameTick, 100); if (ambientSound == null && api.Side == EnumAppSide.Client) { ambientSound = ((IClientWorldAccessor)api.World).LoadSound(new SoundParams() { Location = new AssetLocation("sounds/environment/fire.ogg"), ShouldLoop = true, Position = Pos.ToVec3f().Add(0.5f, 0.25f, 0.5f), DisposeOnFinish = false, Volume = 0.3f, Range = 8 }); if (burning) { ambientSound.Start(); } } if (api.Side == EnumAppSide.Client) { ICoreClientAPI capi = (ICoreClientAPI)api; capi.Event.RegisterRenderer(renderer = new BloomeryContentsRenderer(Pos, capi), EnumRenderStage.Opaque, "bloomery"); UpdateRenderer(); } ownFacing = BlockFacing.FromCode(api.World.BlockAccessor.GetBlock(Pos).LastCodePart()); }
public override void Initialize(ICoreAPI api) { base.Initialize(api); inventory.LateInitialize(BlockCode + "-" + Pos.ToString(), api); inventory.ResolveBlocksOrItems(); }
public override void Initialize(ICoreAPI api) { base.Initialize(api); _inv.Api = api; _inv.LateInitialize("gravestone-" + Pos.X + "/" + Pos.Y + "/" + Pos.Z, api); _inv.ResolveBlocksOrItems(); }
public override void Initialize(ICoreAPI api) { base.Initialize(api); inv.LateInitialize("curdsbundle-" + Pos, api); if (api.Side == EnumAppSide.Client) { animUtil?.InitializeAnimator("curdbundle", null, (Block as BlockCheeseCurdsBundle).GetShape(EnumCurdsBundleState.BundledStick)); } }
public override void Initialize(ICoreAPI api) { base.Initialize(api); inventory.LateInitialize("toolrack-" + pos.ToString(), api); inventory.ResolveBlocksOrItems(); if (api is ICoreClientAPI) { loadToolMeshes(); } }
public override void Initialize(ICoreAPI api) { base.Initialize(api); if (energyStorage == null) { energyStorage = new FluxStorage(MyMiniLib.GetAttributeInt(Block, "storage", 10000), MyMiniLib.GetAttributeInt(Block, "input", 1000), MyMiniLib.GetAttributeInt(Block, "output", 1000)); } inventory.LateInitialize("charger-" + Pos.ToString(), api); inventory.ResolveBlocksOrItems(); if (api is ICoreClientAPI) { loadToolMeshes(); } else { RegisterGameTickListener(OnTick, 250); } }
public override void Initialize(ICoreAPI api) { base.Initialize(api); inv.LateInitialize("cheese-" + Pos, api); }