public override void Initialize(ICoreAPI api, JsonObject properties) { base.Initialize(api, properties); if (api.Side == EnumAppSide.Client) { Blockentity.RegisterGameTickListener(onEverySecond, 1000); } if (largeGear != null) { if (largeGear.AngledGearNotAlreadyAdded(this.Position)) // during chunk loading it's random whether the angled gear or the large gear gets initialised first { this.tryConnect(this.orientation.Opposite); } } }
public override void Initialize(ICoreAPI api, JsonObject properties) { base.Initialize(api, properties); //this.Api = api; //Shape = GetShape(); //manager = Api.ModLoader.GetModSystem<MechanicalPowerMod>(); //if (Api.World.Side == EnumAppSide.Client) //{ // lightRbs = Api.World.BlockAccessor.GetLightRGBs(Blockentity.Pos); // if (NetworkId > 0) // { // network = manager.GetOrCreateNetwork(NetworkId); // JoinNetwork(network); // } //} //manager.AddDeviceForRender(this); //AxisSign = new int[3] { 0, 0, 1 }; //SetOrientations(); //if (api.Side == EnumAppSide.Server && OutFacingForNetworkDiscovery != null) //{ // CreateJoinAndDiscoverNetwork(OutFacingForNetworkDiscovery); //} if (api.Side == EnumAppSide.Client) { Blockentity.RegisterGameTickListener(onEverySecond, 1000); } if (largeGear != null) { if (largeGear.AngledGearNotAlreadyAdded(this.Position)) // during chunk loading it's random whether the angled gear or the large gear gets initialised first { this.tryConnect(this.orientation.Opposite); } } }