コード例 #1
0
ファイル: BlockForge.cs プロジェクト: curquhart/vssurvivalmod
        public override void OnTryIgniteBlockOver(EntityAgent byEntity, BlockPos pos, float secondsIgniting, ref EnumHandling handling)
        {
            if (secondsIgniting < 1.45f)
            {
                return;
            }

            handling = EnumHandling.PreventDefault;

            IPlayer byPlayer = null;

            if (byEntity is EntityPlayer)
            {
                byPlayer = byEntity.World.PlayerByUid(((EntityPlayer)byEntity).PlayerUID);
            }
            if (byPlayer == null)
            {
                return;
            }

            BlockEntityForge bea = byEntity.World.BlockAccessor.GetBlockEntity(pos) as BlockEntityForge;

            bea?.TryIgnite();
        }