コード例 #1
0
        internal void OnEntityCollide(Entity entity)
        {
            if (!FullyRepaired || !Activated || !canTeleport)
            {
                return;
            }

            TeleportingEntity tpe = null;

            if (!tpingEntities.TryGetValue(entity.EntityId, out tpe))
            {
                tpingEntities[entity.EntityId] = tpe = new TeleportingEntity()
                {
                    Entity = entity
                };
            }

            tpe.LastCollideMs = Api.World.ElapsedMilliseconds;


            if (Api.Side == EnumAppSide.Client)
            {
                if ((Api as ICoreClientAPI).World.Player.Entity == entity)
                {
                    lastCollideMsOwnPlayer = Api.World.ElapsedMilliseconds;
                    manager.lastTranslocateCollideMsOwnPlayer = lastCollideMsOwnPlayer;
                }
            }
        }
コード例 #2
0
        public virtual void OnEntityCollide(Entity entity)
        {
            TeleportingEntity tpe;

            if (!tpingEntities.TryGetValue(entity.EntityId, out tpe))
            {
                tpingEntities[entity.EntityId] = tpe = new TeleportingEntity()
                {
                    Entity = entity
                };
            }

            tpe.LastCollideMs = Api.World.ElapsedMilliseconds;


            if (Api.Side == EnumAppSide.Client)
            {
                lastEntityCollideMs = Api.World.ElapsedMilliseconds;

                if ((Api as ICoreClientAPI).World.Player.Entity == entity)
                {
                    lastOwnPlayerCollideMs = Api.World.ElapsedMilliseconds;
                }
            }
        }
コード例 #3
0
        internal void OnEntityCollide(Entity entity)
        {
            TeleportingEntity tpe = null;

            if (!tpingEntities.TryGetValue(entity.EntityId, out tpe))
            {
                tpingEntities[entity.EntityId] = tpe = new TeleportingEntity()
                {
                    Entity = entity
                };
            }

            tpe.LastCollideMs = api.World.ElapsedMilliseconds;


            if (api.Side == EnumAppSide.Client)
            {
                if ((api as ICoreClientAPI).World.Player.Entity == entity)
                {
                    lastCollideMsOwnPlayer             = api.World.ElapsedMilliseconds;
                    manager.lastTeleCollideMsOwnPlayer = lastCollideMsOwnPlayer;
                }
            }
        }