コード例 #1
0
        public ReadResults Parse(IStringReader reader, DispatcherResources resources, out Entity result)
        {
            result = default;
            ReadResults readResults = ResourceLocation.TryRead(reader, out ResourceLocation entity);

            if (!readResults.Successful)
            {
                return(readResults);
            }

            // Temporary
            if (UseBedrock)
            {
                result = new Entity(entity);
                return(ReadResults.Success());
            }

            if (!resources.Entities.Contains(entity))
            {
                return(ReadResults.Failure(CommandError.UnknownEntity(entity)));
            }
            result = new Entity(entity);
            return(ReadResults.Success());
        }